Giter VIP home page Giter VIP logo

vvzvlad / html2rss-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from html2rss/html2rss-web

0.0 0.0 0.0 464 KB

๐Ÿ•ธ Generates and delivers RSS feeds via HTTP. Docker image available! Create your own feeds or get started quickly with the included configs.

Home Page: https://html2rss.github.io/components/html2rss-web

License: MIT License

Shell 0.85% JavaScript 0.76% Ruby 77.58% XSLT 8.42% CSS 3.49% HTML 4.97% Dockerfile 3.79% Procfile 0.14%

html2rss-web's Introduction

html2rss logo

html2rss-web mergify-status

This is a small web application to deliver RSS feeds built by html2rss via HTTP.

Features:

  • serves your own feeds: set up your feed configs in a YAML file. See html2rss' README for documentation.
  • comes with all html2rss-configs included.
  • handles caching and HTTP Cache-Headers.

This web application is distributed in a rolling release fashion from the master branch.

๐Ÿ’“ Depending on this application? Feel free to donate! Thank you!

Using the included html2rss-configs

Build the URL like this:

The feed config you'd like to use:
lib/html2rss/configs/domainname.tld/whatever.yml
โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ^^^^^^^^^^^^^^^^^^^^^^^^^^^

The corresponding URL:
http://localhost:3000/domainname.tld/whatever.rss
โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ โ€Œ ^^^^^^^^^^^^^^^^^^^^^^^^^^^

๐Ÿ‘‰ See file list of all html2rss-configs.

Deployment with Docker

Install Docker CE and docker run -d -p 3000:3000 gilcreator/html2rss-web.

To use your private feed configs, mount a feed.yml into the /app/config/ folder.

docker run -d --name html2rss-web \
  --mount type=bind,source="/path/to/your/config/folder,target=/app/config" \
  -p 3000:3000 \
  gilcreator/html2rss-web

Automatic updating

using containrrr/watchtower

The docker image containrrr/watchtower automatically pulls running docker images and checks for updates. If an update is available, it will start the updated image with the same configuration as the running one.

To start html2rss-web and let watchtower monitor it, save this as start script:

#!/bin/sh

docker run -d --name html2rss-web \
  --mount type=bind,source="/path/to/your/config/folder,target=/app/config" \
  -p 3000:3000 \
  gilcreator/html2rss-web

docker run -d \
  --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower \
  --cleanup \
  --interval=7200 \
  html2rss-web

Watchtower will pull in a 2h interval to check if there's a new image and cleanup (remove the stopped previous image).

via cronjob

A primitive way to automatically update your Docker instance is to set up this script as a cronjob. This has the disadvantage that it restarts the container without first checking whether an update is available or not.

#!/bin/bash
set -e
docker pull -q gilcreator/html2rss-web
(docker stop html2rss-web && docker rm html2rss-web) || :
docker run -d --name html2rss-web --restart=always -p 3000:3000  \
  --mount type=bind,source="/home/deploy/html2rss-web/config,target=/app/config" \
  gilcreator/html2rss-web

The cronjob for updating every 30 minutes could look like this:

*/30 *  * * * /home/deploy/html2rss-web/update > /dev/null 2>&1

Heroku one-click deployment

Deploy

Since this repository receives updates frequently, you'd need to update your instance yourself.

Run it locally

  1. Install Ruby >= 2.6.
  2. gem install bundler foreman
  3. bundle
  4. foreman start

html2rss-web now listens on port 5000 for requests.

Build and run with docker locally

This approach allows you to play around without installing Ruby on your machine. All you need to do is install and run the Docker daemon.

# Build image from Dockerfile and name/tag it as html2rss-web:
docker build -t html2rss-web -f Dockerfile .

# Run the image and name it html2rss-web-dev:
docker run \
  --detach \
  --mount type=bind,source=$(pwd)/config,target=/app/config \
  --name html2rss-web-dev \
  html2rss-web

# Open a interactive TTY with the shell `sh`:
docker exec -ti html2rss-web-dev sh

# Stop and cleanup container
docker stop html2rss-web-dev
docker rm html2rss-web-dev

# Remove the image
docker rmi html2rss-web

Feed configs runtime health checks

Websites often change their markup. To get notified when one of your own configs break, use the /health_check.txt endpoint.

It will respond with success if your feeds are generatable. Otherwise it will not print success, but states the broken config names.

Supported ENV variables

Name Description
PORT default: 3000
RACK_ENV default: 'development'
RACK_TIMEOUT_SERVICE_TIMEOUT default: 15
WEB_CONCURRENCY default: 2
WEB_MAX_THREADS default: 5

html2rss-web's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.