Sign inSign up

waazaafr/syncthing-inactivity-notification

By waazaafr

â€ĸUpdated 4 months ago

Notification when syncthing shares are inactives.

Image
Monitoring & observability
0

2.3K

waazaafr/syncthing-inactivity-notification repository overview

⁠Syncthing Inactivity Notification

Get notified when a Syncthing⁠ folder stops receiving changes.

Ideal to make sure your backups, phone photo uploads or shared folders are still syncing: if a folder has not changed for too long, you get an alert by email, Gotify or Discord. Everything is configured from a web UI.


⁠Features

  • 👀 Monitors the activity of each Syncthing folder through the Syncthing REST API
  • âąī¸ Per-folder inactivity threshold and notification time
  • 🔔 Notifications by email (SMTP, STARTTLS or SSL), Gotify⁠ or Discord webhook, with optional reminders
  • 🔄 Syncthing folders are imported automatically
  • 📜 Dashboard and alert history
  • 🌐 Web UI in 8 languages (English, French, German, Spanish, Italian, Portuguese, Chinese, Japanese)
  • đŸ–Ĩī¸ Multi-arch: linux/amd64 and linux/arm64

⁠How it works

  1. Every 15 minutes (configurable), the app asks Syncthing for the last modification time of each monitored folder.
  2. A folder that has not changed for longer than its inactivity threshold is marked as inactive.
  3. An alert is sent once a day, at the folder's notification time, to the channels assigned to it.
  4. If repeat is enabled on a channel, a reminder is sent at a regular interval as long as the folder stays inactive.

⁠Quick start

⁠Docker Compose
services:
  syncthing-monitor:
    image: waazaafr/syncthing-inactivity-notification:latest
    container_name: syncthing-inactivity-notification
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./data:/data
    environment:
      SECRET_KEY: "changeme_secret_key_very_long_and_random"
      PUID: 99
      PGID: 100
⁠Docker run
docker run -d \
  --name syncthing-inactivity-notification \
  --restart unless-stopped \
  -p 8080:8080 \
  -v ./data:/data \
  -e SECRET_KEY="changeme_secret_key_very_long_and_random" \
  -e PUID=99 \
  -e PGID=100 \
  waazaafr/syncthing-inactivity-notification:latest

Then open http://localhost:8080⁠.

💡 To generate a SECRET_KEY: openssl rand -hex 32

âš ī¸ No password is set at first start, and the web UI is open to anyone who can reach it. Set a password in Settings right away: the login page (user admin) is enabled as soon as a password exists.


⁠Setup

⁠1. Connect to Syncthing
  1. In Syncthing, copy your API key from Actions → Settings → General.
  2. In the web UI, go to Settings and enter your Syncthing URL (e.g. http://192.168.1.10:8384) and API key.
  3. Click Test connection.

Your Syncthing folders are then imported automatically, and refreshed every hour. The polling interval, the language and the password are also set in Settings.

⁠2. Create notification channels

In Channels, create one or more channels, and use the test button to check them:

ChannelWhat you need
EmailYour SMTP server, port, credentials and security mode (STARTTLS or SSL)
GotifyYour Gotify server URL and an application token
DiscordA webhook URL: Server Settings → Integrations → Webhooks
⁠3. Configure your folders

In Folders, choose the folders to monitor and set for each one:

SettingDefaultDescription
Inactivity threshold1440 min (24 h)How long without changes before the folder is considered inactive
Notification time8 (08:00 UTC)Hour of the day when the alert is sent
Channels—Where the alert is sent
Repeat (per channel)off, every 1440 minSend reminders while the folder stays inactive

⁠Configuration

⁠Environment variables
VariableDefaultRequiredDescription
SECRET_KEY—✅Secret used to sign login sessions. Use a long, random value.
PUID99User ID the app runs as (owner of /data)
PGID100Group ID the app runs as
DB_PATH/data/syncthing_monitor.dbPath of the SQLite database
SYNCTHING_URL—Syncthing URL, e.g. http://192.168.1.10:8384
SYNCTHING_APIKEY—Syncthing API key

â„šī¸ SYNCTHING_URL and SYNCTHING_APIKEY are handy for a first setup, but they override the values saved in the web UI at every start. If you want to manage the connection from the web UI, don't set them.

⁠Volume
PathContent
/dataSQLite database: settings, channels, folders and alert history. Mount it to keep your configuration.

At startup, /data is owned by PUID:PGID.

⁠Port
PortService
8080Web UI

A Docker healthcheck is built into the image.


Tag summary

Content type

Image

Digest

sha256:85b594804â€Ļ

Size

54.4 MB

Last updated

4 months ago

docker pull waazaafr/syncthing-inactivity-notification