feedhook

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: MIT

README

feedhook

A service for forwarding RSS and Atom feeds to Discord webhooks.

GitHub Release CI/CD GitHub License

Content

Key Features

  • Forward RSS and Atom feeds to webhooks on Discord
  • Respects Discord rate limits
  • Build for high throughput
  • Easy configuration
  • Single executable file
  • Restartable without data loss
  • Live statistics

Example

Here is how a forwarded RSS item looks on Discord:

example

Installation

This section explains how to install feedhook as a service on a Unix-like server.

[!NOTE] This guide uses supervisor for running feedhook as a service. Please make sure it is installed on your system before continuing.

Create a "service" user with disabled login:

sudo adduser --disabled-login feedhook

Switch to the service user and move to the home directory:

sudo su feedhook
cd ~

Download and decompress the latest release from the releases page:

wget https://github.com/ErikKalkoken/feedhook/releases/download/vX.Y.Z/feedhook-X.Y.Z-linux-amd64.tar.gz
tar -xvzf feedhook-X.Y.Z-linux-amd64.tar.gz

[!TIP] Please make sure update the URL and filename to the latest version.

Download configuration files:

wget https://raw.githubusercontent.com/ErikKalkoken/feedhook/main/config/supervisor.conf
wget https://raw.githubusercontent.com/ErikKalkoken/feedhook/main/config/config.toml

Setup and configure:

chmod +x feedhook
touch feedhook.log

Setup your initial feeds and webhooks by adding them to config.toml.

Then check your config is valid before continuing:

./feedhookcli check-config

We also recommend running a test ping to ensure the webhooks are setup correctly:

./feedhookcli ping WEBHOOK

Add feedhook to supervisor:

sudo ln -s /home/feedhook/supervisor.conf /etc/supervisor/conf.d/feedhook.conf
sudo systemctl restart supervisor

Restart feedhook to start feedhook.

sudo supervisorctl restart feedhook

[!TIP] You can monitor your service with the feedhookcli tool. For example to get the current statistics you can run: ./feedhookcli stats

[!NOTE] Whenever you make changes to the configuration you need to restart the service to activate them.

Update

Stop the feedhook service.

sudo supervisorctl stop feedhook

Login as your service user and move to the home directory:

sudo su feedhook
cd ~

Download the latest release and overwrite the outdated executables:

wget https://github.com/ErikKalkoken/feedhook/releases/download/vX.Y.Z/feedhook-X.Y.Z-linux-amd64.tar.gz
tar -xvzf feedhook-X.Y.Z-linux-amd64.tar.gz

Switch back to your sudo user and start the feedhook service again.

exit
sudo supervisorctl start feedhook

CLI tool

Feedhook comes with a CLI tool for interacting with the running service. With it you can:

  • Check if the configuration is valid
  • See live statistics (e.g. how many items have been received from reach feed)
  • Make pings to configured webhooks (useful for testing)
  • Force a re-send of the latest feed item (useful for testing)
  • Restart the service (e.g. for reloading the config)

To see all commands please run the tool with the help flag: feedhookcli -h.

You can also get help for a specific command with the help flag: feedhookcli COMMAND -h.

Attributions

Directories

Path Synopsis
cmd
feedhookcli
Feedhookcli is a CLI tool for interacting with a running service.
Feedhookcli is a CLI tool for interacting with a running service.
feedhooksrv
Feedhooksrv is a service for forwarding RSS and Atom feeds to Discord webhooks.
Feedhooksrv is a service for forwarding RSS and Atom feeds to Discord webhooks.
internal
app
app/dispatcher
Package dispatcher contains the dispatcher service.
Package dispatcher contains the dispatcher service.
app/remote
Package remoteservice contains the logic for communicating between cli and server process
Package remoteservice contains the logic for communicating between cli and server process
dhooks
Package dhooks provides types and functions for sending messages to Discord webhooks.
Package dhooks provides types and functions for sending messages to Discord webhooks.
pqueue
Package pqueue implements persistent queues.
Package pqueue implements persistent queues.
rate
Package rate provides types for dealing with rate limits.
Package rate provides types for dealing with rate limits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL