Skip to content

Self-hosted Git repository monitoring & backup solution w/ WebUI

License

Notifications You must be signed in to change notification settings

zmh-program/backup-sentinel

Repository files navigation

Backup Sentinel

A self-hosted Git repository monitoring and backup solution with a modern web dashboard.

Preview

✨ What It Does

Backup Sentinel continuously monitors your Git repositories across multiple providers and maintains local mirror backups. It alerts you when backups become stale or when sync operations fail.

Supported Providers:

  • 🐙 GitHub (users and organizations)
  • 🦊 GitLab (users and groups, including self-hosted)
  • 🪣 Bitbucket (workspaces)
  • 📝 Custom repository lists

🚀 Quick Start

git clone https://github.com/user/backup-sentinel.git
cd backup-sentinel
pnpm install
pnpm dev

Open http://localhost:3000 to access the dashboard.

⚙️ Configuration

Copy .env.example to .env and configure:

cp .env.example .env
Variable Description Default
PORT Web server port 3000
APP_PASSWORD Password protection (empty = no auth)

📱 Web UI

Repos

Browse all tracked repositories with detailed information:

Column Description
Repo Repository name with archived/fork/private badges
Default Default branch name
Branches Total branch count
Tags Total tag count
Last commit Time since last commit
Size Repository size (from provider API)
Status ok / warn / fail / unknown
Last check Timestamp of last sync check

Actions:

  • Fetch — Manually fetch updates for a single repo
  • Delete — Remove from tracking (optionally delete local mirror)

Sources

Configure where repositories are discovered from.

Type Description
GitHub All repos from a user or organization
GitLab All projects from a user or group (supports self-hosted)
Bitbucket All repos from a workspace
Custom Manual list of repo URLs

Fields:

  • Owner — Username, org name, or workspace
  • Owner Type — User or Organization/Group
  • Token — API token for private repo discovery (optional)
  • Note — Your own label/description

⚠️ Tokens are used for API discovery only. Git clone/fetch requires SSH keys or credential helper configured on the server.

Storage

Configure backup destinations using local git mirrors (git clone --mirror).

Setting Description
Backup Root Directory path for mirrors (e.g., /data/mirrors)
Auto Fetch Automatically git fetch during checks
Auto Clone Clone missing repos automatically
Max Age Staleness threshold in minutes (default: 720 = 12h)

Mirrors are stored as: <backupRoot>/<owner>/<repo>.git

Schedule

Set check frequency using presets or custom cron:

Preset Cron
15 min */15 * * * *
30 min */30 * * * *
1 hour 0 */1 * * *
6 hours 0 */6 * * *
Daily 0 0 * * *

Webhook

Send alerts when checks complete. Supports multiple providers:

Provider Format
Telegram Markdown
Discord Markdown
Custom REST API (JSON)

Activity Levels:

  • ok — Send on successful checks
  • warn — Send on warnings (e.g., fetch failures)
  • fail — Send on failures (e.g., stale mirrors)

Logs

Full log viewer with color-coded entries, timestamps, and pagination.

🏭 Production Deployment

pnpm build
pnpm start

With PM2 (reads PORT from .env):

pm2 start ecosystem.config.js
pm2 logs backup-sentinel

Or with explicit port:

pm2 start node_modules/next/dist/bin/next --name backup-sentinel -- start --port 9100

📚 Documentation

📋 Requirements

  • Node.js 18+
  • Git
  • SSH keys or credential helper (for private repos)

About

Self-hosted Git repository monitoring & backup solution w/ WebUI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages