No description
- Go 93.8%
- Makefile 4.9%
- Dockerfile 1.3%
* chore(deps): bump actions/setup-go to v7 Self-hosted CI workflows. * ci: setup-go v7 + cache false |
||
|---|---|---|
| .github | ||
| cmd/module | ||
| deploy | ||
| internal | ||
| muxcore/backup/v1 | ||
| proto/muxcore/backup/v1 | ||
| test | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .golangci.yml | ||
| CHANGELOG.md | ||
| COMPATIBILITY.md | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| muxcore.json | ||
| README.md | ||
| SECURITY.md | ||
Backup Local
Local filesystem backup/restore provider.
A MuxCore sidecar module that stores .tar.gz backups on the local filesystem and exposes create / restore / list / delete over gRPC (BackupService). Provides the backup / backup.local capabilities.
How It Works
CreateBackup ──→ collect source dirs + Backupable ExportState ──→ backups/<id>.tar.gz + index.json
RestoreBackup ──→ verify checksum ──→ safe untar into target_path ──→ optional ImportState
CreateBackup builds a real gzip-compressed tar. Contents come from:
- Configured source directories (
BACKUP_SOURCE_DIRS) and/or per-requestsource_paths - Registered
Backupablepeers (modules/<id>/state.binviaExportState)
Empty archives are rejected (FailedPrecondition). Each backup records size and SHA-256 in index.json.
RestoreBackup requires target_path. It refuses missing archives, checksum mismatches, and path-traversal entries (../). After a safe extract, registered peers whose state is present in the archive receive ImportState.
Archive layout:
data/<source-name>/… # filesystem sources
modules/<id>/state.bin # Backupable exports
Configuration
| Variable | Default | Description |
|---|---|---|
BACKUP_DIR |
backups |
Directory for archives and index.json |
BACKUP_SOURCE_DIRS |
(empty) | Comma-separated directories included in every create |
| gRPC listen | :9302 |
BackupService address |
| HTTP listen | :9303 |
/health |
Quick Start
make build
export MUXCORE_INSECURE_DISABLE_TLS=true
export BACKUP_SOURCE_DIRS=/var/lib/muxcore/data
./backup-local --muxcore-mesh-addr localhost:9090
gRPC surface
| RPC | Behavior |
|---|---|
CreateBackup |
Write .tar.gz; return id, size, checksum, module ids |
RestoreBackup |
Untar into target_path; error if archive missing |
ListBackups |
Index entries, newest first |
DeleteBackup |
Remove archive + index entry |
Proto: proto/muxcore/backup/v1/backup.proto.
Capability
backup / backup.local — Local filesystem backup/restore
License
GPL-3.0