Skip to content
edsuwarnaPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

25 Commits

Folders and files

Repository files navigation

Jagad

Backup Manager β€” Web UI untuk PostgreSQL, MySQL, dan MariaDB backup dengan S3-compatible object storage.

Build Version License Go


Overview

Jagad adalah self-hosted database backup manager dengan Web UI yang memungkinkan kamu mengelola backup database dari satu dashboard. Support full backup, scheduled backup dengan retention policy, dan S3-compatible object storage (AWS S3, Cloudflare R2, MinIO, Backblaze B2).

Key Features

  • πŸ›’οΈ Multi-DB β€” PostgreSQL, MySQL, MariaDB
  • ⏰ Scheduled Backups β€” Cron-based dengan retention policy auto-cleanup
  • ☁️ S3-Compatible β€” AWS S3, Cloudflare R2, MinIO, Backblaze B2
  • πŸ” Encryption at Rest β€” AES-256-GCM client-side encryption sebelum upload
  • βœ… Backup Verification β€” SHA-256 checksum verification
  • ⬇️ Download & Restore β€” One-click restore atau download backup file
  • πŸ“Š Web UI β€” Dashboard, backup history, schedule management
  • πŸŒ“ Dark/Light Mode β€” Theme toggle
  • πŸ“± Responsive β€” Mobile-friendly dengan sidebar slide-in

Quick Start

Prerequisites

  • Docker & Docker Compose
  • PostgreSQL / MySQL / MariaDB server (yang mau di-backup)

1. Clone & Run

git clone https://github.com/edsuwarna/jagad.git
cd jagad
docker compose up -d

2. Access UI

http://localhost:8085

Default credentials:

  • Username: admin
  • Password: admin123

3. Add Connection

  1. Go to Connections β†’ Add Connection
  2. Choose DB type (PostgreSQL, MySQL, MariaDB)
  3. Fill connection details (host, port, user, password)
  4. Test connection β†’ Save
  5. Backend auto-discovers databases on the server

4. Add Storage Provider

  1. Go to Storage β†’ Add Storage
  2. Choose type (AWS S3, Cloudflare R2, MinIO, Backblaze B2)
  3. Fill endpoint, bucket, credentials
  4. Test β†’ Save

5. Run Backup

  • Manual: Click "Run Backup Now" on Dashboard
  • Scheduled: Go to Schedules β†’ Create Schedule β†’ Set cron + retention

Architecture

Jagad supports two database backends:

Backend Use Case
SQLite (default) Single-server, zero-config β€” no external dependencies
PostgreSQL + TimescaleDB Production, monitoring, multi-server β€” enables DB health metrics

When JAGAD_DATABASE_URL is set, Jagad uses PostgreSQL with TimescaleDB for both config data AND monitoring hypertables. When unset, it falls back to SQLite.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Docker Compose                        β”‚
β”‚                                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚  β”‚  Nginx (UI)  │────▢│  Go Backend    β”‚              β”‚
β”‚  β”‚  :8085       β”‚     β”‚  :8080         β”‚              β”‚
β”‚  β”‚  web/ static β”‚     β”‚  REST API      β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  + Scheduler   β”‚              β”‚
β”‚                       β”‚  + Backup Exec β”‚              β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                              β”‚                        β”‚
β”‚                       β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚                       β”‚  PostgreSQL  β”‚               β”‚
β”‚                       β”‚  +TimescaleDBβ”‚               β”‚
β”‚                       β”‚  (or SQLite) β”‚               β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                      β”‚                       β”‚
   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”
   β”‚  S3     β”‚          β”‚  R2 / B2  β”‚          β”‚  MinIO   β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology
Backend Go 1.25
Database SQLite (default) or PostgreSQL + TimescaleDB
Monitoring TimescaleDB hypertables (health_checks, db_metrics, perf_metrics)
Frontend Vanilla JS SPA + Lucide Icons
Scheduler robfig/cron
Storage SDK MinIO (S3-compatible)
Encryption AES-256-GCM + Argon2id KDF
Container Docker / Docker Compose

API Endpoints

Method Path Description
GET /api/health Health check
POST /api/auth/login Login
GET /api/auth/check Check auth status
GET /api/connections List connections
POST /api/connections Add connection
PUT /api/connections/{id} Update connection
DELETE /api/connections/{id} Delete connection
POST /api/connections/{id}/test Test connection
GET /api/connections/{id}/databases List discovered DBs
POST /api/connections/{id}/discover Re-discover databases
PUT /api/connections/databases/{id} Update DB selection
GET /api/backups List backups
POST /api/backups Start backup
GET /api/backups/{id} Backup detail
DELETE /api/backups/{id} Delete backup
GET /api/backups/{id}/logs Backup logs
GET /api/backups/{id}/download Download backup
POST /api/backups/{id}/verify Verify backup
GET /api/backups/stats Backup statistics
GET /api/schedules List schedules
POST /api/schedules Create schedule
PUT /api/schedules/{id} Update schedule
DELETE /api/schedules/{id} Delete schedule
POST /api/schedules/{id}/run Run schedule now
GET /api/restores List restores
POST /api/backups/{id}/restore Restore from backup
GET /api/restores/{id} Restore detail
GET /api/storage-providers List storage providers
POST /api/storage-providers Add storage provider
PUT /api/storage-providers/{id} Update storage
DELETE /api/storage-providers/{id} Delete storage
POST /api/storage-providers/{id}/test Test storage
POST /api/storage-providers/{id}/set-default Set default
GET /api/monitoring/health Health check history (PG only)
GET /api/monitoring/metrics Database metrics (PG only)
GET /api/monitoring/performance Performance metrics (PG only)

Configuration

Environment variables:

Variable Default Description
JAGAD_PORT 8080 API server port
JAGAD_DATA_DIR /data SQLite + temp data directory
JAGAD_DATABASE_URL (none) PostgreSQL DSN (set to use PG+TimescaleDB instead of SQLite)
JAGAD_ADMIN_USER admin Admin username
JAGAD_ADMIN_PASS admin123 Admin password
JAGAD_SECRET_KEY (auto) Session secret key
JAGAD_ENCRYPTION_KEY (none) Master key for AES-256-GCM

Migration from SQLite to PostgreSQL

To migrate existing data from SQLite to PostgreSQL:

# 1. Start TimescaleDB + migrate data
docker compose up -d timescaledb
go run cmd/migrate-sqlite/main.go \
  -dsn "postgres://postgres:jagad_secret@localhost:5432/jagad?sslmode=disable" \
  -data-dir /path/to/your/data

# 2. Dry-run first to see what will be migrated
go run cmd/migrate-sqlite/main.go \
  -dsn "postgres://postgres:jagad_secret@localhost:5432/jagad?sslmode=disable" \
  -data-dir /path/to/your/data \
  -dry-run

# 3. Set env and restart
export JAGAD_DATABASE_URL="postgres://postgres:jagad_secret@localhost:5432/jagad?sslmode=disable"
docker compose up -d

Development

# Run locally
make run

# Run tests
make test

# Build
make build

# Docker
make docker-run

Project Structure

jagad/
β”œβ”€β”€ cmd/jagad/            # Main entrypoint
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/             # HTTP router + response helpers
β”‚   β”œβ”€β”€ auth/            # Authentication
β”‚   β”œβ”€β”€ backup/          # Backup engine + handler
β”‚   β”œβ”€β”€ config/          # Configuration
β”‚   β”œβ”€β”€ connection/      # DB connection management
β”‚   β”œβ”€β”€ encryption/      # AES-256-GCM encryption
β”‚   β”œβ”€β”€ repository/      # SQLite data access
β”‚   β”œβ”€β”€ restore/         # Restore engine
β”‚   β”œβ”€β”€ schedule/        # Cron scheduler
β”‚   └── storage/         # S3-compatible storage
β”œβ”€β”€ web/                 # Frontend (Vanilla JS SPA)
β”‚   β”œβ”€β”€ css/style.css
β”‚   β”œβ”€β”€ js/app.js
β”‚   └── index.html
β”œβ”€β”€ prd/                 # Product requirements
β”œβ”€β”€ sketches/            # UI mockups
β”œβ”€β”€ Dockerfile           # Go backend
β”œβ”€β”€ Dockerfile.frontend  # Nginx frontend
β”œβ”€β”€ docker-compose.yml
└── Makefile

Roadmap

  • Phase 1: Foundation (Go, SQLite, Auth, Docker)
  • Phase 2: Backup Engine (Full backup, S3 storage, encryption)
  • Phase 3: Scheduling & Restore (Cron, retention, restore)
  • Phase 4: UI MVP (Dashboard, connections, schedules, dark/light)
  • Phase 5: PostgreSQL + TimescaleDB (Config & monitoring in single DB)
  • Phase 6: Monitoring API (Health checks, DB metrics, performance)
  • v1.1: Incremental backup engine (pgBackRest, XtraBackup, Mariabackup)
  • v1.2: Notifications (Email, Telegram, Slack)
  • v2.0: Multi-user, schedule templates, compression settings

License

Apache 2.0 Β© 2026 Endang Suwarna

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages