Site icon Efficient Coder

WebHook Notifier: Automate Git & RSS Alerts with Zero Manual Checks

WebHook Notifier: Your Guide to Automated Git and RSS Notifications

In a world where staying updated is key, tools that simplify notifications can make a big difference. Whether you’re a developer tracking code changes or someone who loves following blog updates, WebHook Notifier offers a practical solution. This self-hosted tool listens for Git push events and RSS feed updates, then sends clear, concise messages to platforms like Telegram, email, or QQ.

This guide walks you through everything you need to know about WebHook Notifier—what it does, how to set it up, and how to use it effectively. Built from a technical Chinese document, this post translates and adapts that content into natural English, keeping all details accurate and accessible. Let’s dive into how this tool can streamline your workflow.


What is WebHook Notifier?

WebHook Notifier is a lightweight, customizable service that keeps you informed about changes in your Git repositories and RSS feeds. Imagine it as a personal assistant: it watches for specific events—like a new code push or a blog post—and delivers notifications to the tools you already use. Because it’s self-hosted, you run it on your own server, giving you control over your data and setup.

The tool supports popular Git platforms like GitHub, GitLab, and Gitea, as well as RSS feeds for content updates. It’s designed to be flexible, letting you choose how and where you receive alerts. Whether you’re managing a team project or just keeping up with your favorite sites, WebHook Notifier saves you from constantly checking for updates manually.


Core Features: What Makes It Stand Out

WebHook Notifier comes with a set of features that make it both powerful and easy to use. Here’s what it offers:

1. Git Platform Integration

It connects with major Git services:

  • GitHub: Tracks push events and verifies them with secure signatures.
  • GitLab: Supports token-based authentication for added security.
  • Gitea: Works with this lightweight Git platform using signature checks.

Whenever someone pushes code to your repository, you’ll know right away.

2. RSS Feed Monitoring

Stay updated on blogs, news, or any RSS source in two ways:

  • Scheduled Checks: Automatically scans feeds at set intervals, like every 30 minutes.
  • WebHook Updates: Uses a special endpoint for real-time notifications from RSS services.

3. Notification Options

Choose where your updates go:

  • Telegram: Sends messages through a bot to your chats or groups.
  • Email: Delivers alerts via SMTP to your inbox.
  • QQ: Uses Napcat to notify you on this popular messaging app.

4. Security Built In

Your notifications stay safe with:

  • Signature Verification: Ensures Git events come from trusted sources.
  • Token Checks: Validates requests, especially for GitLab.
  • Deduplication: Avoids sending the same RSS update twice.

5. Easy Customization

A single configuration file lets you tweak everything—delays, proxies, and platform settings—to match your needs.

These features work together to create a reliable, no-fuss notification system.


How It Works: A Simple Process

WebHook Notifier follows a clear, logical flow to get updates to you:

  1. Listens for Events: It waits for Git pushes or RSS changes, either through WebHooks or scheduled checks.
  2. Processes Data: Verifies the source and formats the message with key details.
  3. Adds a Delay (Optional): Waits a set time if you’ve configured it, giving you control over timing.
  4. Sends the Alert: Delivers the message to your chosen platform—Telegram, email, or QQ.

This streamlined approach ensures you get the right information at the right time without extra steps.


Installation and Setup: Get Running Fast

Setting up WebHook Notifier is straightforward, even if you’re new to server tools. You’ll need a basic server or computer with Python installed. Here’s how to do it:

Step 1: Download the Code

Start by grabbing the source files from GitHub. Open your terminal and type:

git clone https://github.com/hxsyzl/WebHook-Notifier.git
cd WebHook-Notifier

This creates a folder with all the necessary files.

Step 2: Set Up Python

WebHook Notifier runs on Python, so you’ll need to install a few libraries. To keep things clean, use a virtual environment.

Create the Environment

In the folder, run:

On Windows:

python -m venv venv
.\venv\Scripts\activate

On macOS or Linux:

python3 -m venv venv
source venv/bin/activate

Your terminal will show (venv) when it’s active.

Install Libraries

Next, install the tools WebHook Notifier needs:

pip install -r requirements.txt

This command adds libraries like FastAPI (for the web service), Uvicorn (the server), and others for handling YAML, HTTP requests, and RSS feeds.

Step 3: Configure the Tool

The config.yaml file controls how WebHook Notifier behaves. Open it with a text editor:

nano config.yaml

You’ll adjust this file later—details are in the next section.

Step 4: Start the Service

Run the tool with this command:

uvicorn main:app --host 0.0.0.0 --port 8000 --reload
  • --reload restarts the server if you change the code (great for testing).
  • For a permanent setup, skip --reload:
uvicorn main:app --host 0.0.0.0 --port 8000

Open a browser and go to http://<your-server-ip>:8000. If you see a welcome message, it’s working!


Configuration: Customize Your Experience

The config.yaml file is where you shape WebHook Notifier to fit your setup. It’s split into sections for global options, Git platforms, RSS feeds, and notification channels. Let’s break it down:

Global Settings

  • Notification Delay: Set notification_delay_seconds to wait before sending alerts (e.g., 5 for 5 seconds, or 0 for instant delivery).
  • Proxy: If your server needs a proxy to reach the internet, turn it on and add the proxy address here.

Git Platforms

Each platform has its own settings:

  • GitHub: Add a secret matching the one in your GitHub WebHook setup.
  • GitLab: Use secret for its token-based security.
  • Gitea: Set a secret for signature verification.

These secrets keep your notifications secure by confirming the source.

RSS Feeds

  • Enable It: Set enabled to true to start monitoring.
  • Check Frequency: Use check_interval_minutes to decide how often it looks for updates (e.g., 30 for every half hour).
  • WebHook Security: Add a webhook.secret if you use the RSS WebHook endpoint.
  • Feed List: Under feeds, list each RSS source with a name (like “Tech Blog”) and url (the feed’s address).

Notification Channels

Telegram

  • Enable: Set enabled to true.
  • Bot Token: Get this from Telegram’s BotFather and add it to bot_token.
  • Chat ID: Enter the chat or group ID where messages should go.

Email

  • Enable: Set enabled to true.
  • SMTP Details: Add your email server’s smtp_server (e.g., smtp.gmail.com), smtp_port (like 587), smtp_username, and smtp_password.
  • Sender: Set sender_email to the address sending notifications.
  • Recipients: List emails under recipient_emails.
  • Security: Use use_ssl or use_tls based on your server’s needs.

QQ (Napcat)

  • Enable: Set enabled to true.
  • API URL: Add your Napcat server’s base_url.
  • Mode: Pick private, group, or all for where messages go.
  • Targets: Set user_id or group_id for specific recipients.

Save the file after editing, and WebHook Notifier will apply your settings.


Usage: Connect Your Services

Now that it’s running, link WebHook Notifier to your Git repositories and RSS feeds.

Setting Up Git WebHooks

Here’s how to connect a Git platform (using GitHub as an example):

  1. Go to your repository’s settings on GitHub.
  2. Click “WebHooks” and then “Add WebHook.”
  3. For Payload URL, enter http://<your-server-ip>:8000/webhook/git.
  4. Set Content type to application/json.
  5. Add the Secret you put in config.yaml for GitHub.
  6. Check “Push events” under triggers.
  7. Save it.

Do the same for GitLab and Gitea, adjusting for their layouts.

Adding RSS Feeds

Option 1: Automatic Checks

Edit config.yaml, add your feeds under rss.feeds, and save. Example:

feeds:
  - name: "Tech News"
    url: "https://example.com/feed"

The tool will check them based on your interval.

Option 2: Real-Time Updates

Use an RSS-to-WebHook service:

  1. Set it up to watch your feed.
  2. Point its WebHook to http://<your-server-ip>:8000/webhook/rss.
  3. Add a secret if your config uses one.

API Endpoints: A Quick Look

WebHook Notifier offers a few simple endpoints:

  • GET /: Shows the service’s status and version.
  • POST /webhook/git: Handles Git push events.
  • POST /webhook/rss: Takes RSS updates from WebHook services.

These are easy to test or integrate if you’re technical.


Avoiding Duplicates: Smart Data Tracking

For RSS, WebHook Notifier saves article IDs in a file called rss_last_check.json. This stops it from sending the same update twice. Make sure the file is writable by the service, and it’ll handle the rest.


Why It Matters: Real-Life Benefits

Picture this: You push code to GitHub, and your team gets a Telegram alert with the details—no delay, no fuss. Or a blog you follow posts something new, and your email pings with the update. WebHook Notifier makes these moments effortless, keeping you connected to what matters.

It’s not just about convenience—it’s about staying in the loop without extra work. Developers can focus on coding, and readers can enjoy content without refreshing pages.


Conclusion: Start Simplifying Today

WebHook Notifier brings automation to your notifications, blending Git and RSS updates into one tool. With its easy setup, flexible options, and secure design, it’s a practical choice for anyone who values efficiency. This guide has covered the essentials—installation, configuration, and usage—so you’re ready to put it to work.

Give it a try on your server, tweak it to your liking, and see how it transforms your daily updates. It’s a small tool with a big impact, built to keep you informed without the clutter.

Exit mobile version