Login

Discord Updater Bot

Updater is a lightweight Go-based notification tool that monitors updates from multiple platforms and sends alerts to Discord via webhooks. It uses a local cache to ensure each update is only notified once.

Features

  • Wiki.js Support: Tracks the most recent activity on your Wiki.js instance.
  • Redmine Support: Monitors recent issues and updates from Redmine.
  • Gitea Support: Tracks recent activities (commits, issues, PRs) in specified repositories.
  • Discord Integration: Sends notifications to different Discord channels (webhooks) based on the source of the update.
  • Caching: Remembers the last notified update for each service to prevent duplicate notifications.
  • Configurable: Fully controlled via environment variables.

How It Works

  1. Fetch: The program periodically polls the configured APIs (Wiki.js, Redmine, Gitea) for the latest activity.
  2. Compare: It compares the latest activity ID or timestamp against a local cache.json file.
  3. Notify: If new activity is detected, it formats a message and sends it to the designated Discord webhook.
  4. Update Cache: The cache.json is updated with the latest activity to avoid re-sending the same notification in the next run.

Configuration

The program is configured using environment variables. You can create a .env file based on the provided env-example.

General Settings

Variable Description Default
INTERVAL_MINUTES Frequency of update checks (in minutes). 5
DISCORD_WEBHOOK Default Discord webhook URL if a service-specific one isn't provided. -
DISCORD_FAKE If set to true, messages are logged to console instead of being sent to Discord. false

Wiki.js Settings

Variable Description
WIKI_BASE_URL Base URL of your Wiki.js instance (e.g., https://wiki.example.com).
WIKI_TOKEN API Token for Wiki.js.
WIKI_DISCORD_WEBHOOK Discord webhook URL for Wiki.js notifications.
WIKI_CONTENT_LIMIT Number of recent items to check.

Redmine Settings

Variable Description
REDMINE_BASE_URL Base URL of your Redmine instance.
REDMINE_KEY API Key for Redmine.
REDMINE_DISCORD_WEBHOOK Discord webhook URL for Redmine notifications.
REDMINE_CONTENT_LIMIT Number of recent items to check.

Gitea Settings

Variable Description
GITEA_BASE_URL Base URL of your Gitea instance.
GITEA_TOKEN API Token for Gitea.
GITEA_REPOS Comma-separated list of repositories to watch (e.g., org/repo1,user/repo2).
GITEA_DISCORD_WEBHOOK Discord webhook URL for Gitea notifications.
GITEA_CONTENT_LIMIT Number of recent items to check.

Installation & Running

Using Go

  1. Clone the repository.
  2. Create and configure your .env file.
  3. Run the application:
    BASH
    go run main.go
    

Using Docker

You can use the provided Dockerfile and docker-compose.yml to run the updater in a containerized environment.

  1. Configure your .env file.
  2. Build and start:
    BASH
    docker-compose up -d
    

Files

  • main.go: Application entry point.
  • lib/: Core logic including fetchers, senders, and cache management.
  • cache.json: Local storage for the last processed update (automatically created).
  • env-example: Template for configuration.

Repository

https://git.teletype.hu/tools/updater