Sign inSign up

waazaafr/syncthing-inactivity-notification

By waazaafr

Updated 3 months ago

Notification when syncthing shares are inactives.

Image
Monitoring & observability
0

1.1K

waazaafr/syncthing-inactivity-notification repository overview

Syncthing Inactivity Notification

Monitors Syncthing folder activity and sends notifications when a folder has been inactive for too long. Runs as a Docker container and exposes a web UI for configuration.

How it works

The application polls the Syncthing REST API at regular intervals (default: every 15 minutes) to detect the last modification time of each monitored folder. If a folder has not been modified for longer than a configurable threshold, a notification is sent at the scheduled time.

Supported notification channels:

  • Email (SMTP with STARTTLS or SSL)
  • Gotify (self-hosted push notifications)
  • Discord (webhook)

Quick start

services:
  syncthing-monitor:
    image: waazaafr/syncthing-inactivity-notification
    container_name: syncthing-inactivity-notification
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./data:/data
    environment:
      # Secret key
      - SECRET_KEY=changeme_secret_key_very_long_and_random
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

The web UI is available at http://localhost:8080.

Configuration

Environment variables
VariableRequiredDescription
SECRET_KEYYesFlask session secret key. Use a long, random value.
DB_PATHNoPath to the SQLite database (default: /data/syncthing_monitor.db)
SYNCTHING_URLNoSyncthing instance URL, e.g. http://192.168.1.10:8384. Overrides the database value on every start.
SYNCTHING_APIKEYNoSyncthing API key. Overrides the database value on every start.

SYNCTHING_URL and SYNCTHING_APIKEY are convenient for initial setup but override the stored config on every restart. Use the web UI instead if you don't want this behaviour.

Data persistence

The /data volume holds the SQLite database. Mount it to preserve configuration across restarts.

volumes:
  - ./data:/data
Connecting to Syncthing
  1. Open the web UI and log in (default credentials: admin / no password).
  2. Go to Settings and enter your Syncthing instance URL and API key.
    • The API key can be found in Syncthing → Actions → Configuration.
  3. Click Test connection to verify.
  4. Syncthing folders are automatically imported every hour.
Notification channels

Create one or more channels in the Channels section, then assign them to each folder in Folders.

Discord: create a webhook in your Discord server settings (Server Settings → Integrations → Webhooks) and paste the URL into the form.

Inactivity thresholds

For each folder, configure:

  • Inactivity threshold (in minutes): how long without activity before triggering an alert.
  • Notification time (UTC): the hour at which the alert is sent once the threshold is exceeded.
  • Repeat: optionally repeat the notification at a regular interval while the folder remains inactive.

Tag summary

Content type

Image

Digest

sha256:85b594804

Size

54.4 MB

Last updated

3 months ago

docker pull waazaafr/syncthing-inactivity-notification