src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
README.md | ||
rust-toolchain.toml | ||
shell.nix | ||
wrangler.toml |
Forgejo Notifier
A Cloudflare Worker written in Rust that notifies you about stale issues in your Gitea/Forgejo repository via ntfy.sh.
Overview
This project helps you keep track of your Gitea/Forgejo issues by sending notifications when issues haven't been updated for a specified period (default: 3 days). It's designed to be deployed as a Cloudflare Worker and runs on a schedule.
Features
- Connects to Gitea/Forgejo API to fetch open issues
- Identifies issues that haven't been updated in a configurable time period
- Sends notifications via ntfy.sh with direct links to stale issues
- Runs automatically on a schedule (default: daily at 10:00 UTC)
- Provides HTTP endpoints for manual checking and status verification
Setup
Prerequisites
- Rust
- wrangler
- A Cloudflare account
- A Gitea/Forgejo instance with API access
- A topic name for ntfy.sh notifications
Configuration
Edit the wrangler.toml
file to configure your Worker:
[vars]
GITEA_URL = "https://your-gitea-instance.com" # Your Gitea/Forgejo instance URL
GITEA_TOKEN = "your-gitea-api-token" # API token with repo access
GITEA_OWNER = "your-username" # Repository owner username
GITEA_REPO = "your-repository" # Repository name
NTFY_TOPIC = "your-ntfy-topic" # ntfy.sh topic for notifications
STALE_DAYS = "3" # Number of days before an issue is considered stale
For security, it's recommended to set sensitive values like GITEA_TOKEN
as secrets rather than in the wrangler.toml
file:
wrangler secret put GITEA_TOKEN
Schedule Configuration
The worker is configured to run daily at 10:00 UTC by default. You can change this by modifying the crons
setting in wrangler.toml
:
[triggers]
crons = ["0 10 * * *"] # Run daily at 10:00 UTC
Deployment
Build and deploy the worker to Cloudflare:
wrangler publish
Manual Testing
You can manually test the worker using the following endpoints:
- Root endpoint (
/
): Displays a simple status message confirming the worker is running - Check endpoint (
/check
): Manually triggers a check for stale issues and displays the results. This endpoint will also send notifications for any stale issues found.
Example:
# Check if the worker is running
curl https://forgejo-notifier.your-worker.workers.dev/
# Manually check for stale issues
curl https://forgejo-notifier.your-worker.workers.dev/check
Development
Local Development
For local testing:
wrangler dev
Building
wrangler build
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.