Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bit Boilerplate has no backup or restore for the server its CD deploys

Aperta
#14,442 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, docker-compose, mysql, postgresql, redis, sqlite

Direzione di ricerca

Start with the R&D notes and verify the listed tool capabilities against their sources, then resolve the open choices for supported database options and restore testing. Trace how the app host adds publish-mode containers and how the deploy skill configures deployment; done means a design that covers the stated backup, restore, retention, and restore-test requirements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area / infra

The deploy skill and the CD that came with #14382 put a project's server on the team's own Linux VM, as a Docker Compose project that .NET Aspire publishes from the app host. Nothing backs that server up yet, and nothing restores it.

We'll build our own backup and restore tool for this. It may use some of the existing tools below inside, but it's ours, and the template sets it up with the rest of the deployment.

What it has to do

  • Back up what a deployed project keeps on its server:
    • its database: PostgreSQL, SQL Server, MySQL or SQLite, depending on the project's options;
    • redis-persistent, which holds Hangfire's jobs and the distributed lock (redis-cache needs no backup);
    • the uploaded files, when they stay in the api's local volume, and a copy of them when they live on S3-compatible storage;
    • the small volumes: the Aspire dashboard's telemetry and DbGate's settings.
  • Write the backups, encrypted, to the project's own S3-compatible storage (the template recommends Cloudflare R2), on a schedule and with retention.
  • Restore to the latest backup, and to a point in time where the engine allows it.
  • Test its restores by itself, regularly, and fail loudly when one doesn't work.
  • Stay free, and work on a server that has no inbound port: the runner pulls its jobs and cloudflared dials out.
  • Fit the template: the app host adds it in publish mode, and the deploy skill sets it up with the rest.

R&D (2026-10-30)

Release dates were read from the GitHub API on 2026-10-30. Everything listed is free unless marked paid. These notes are input for the design, so check each claim against its source before relying on it.

Database-native tools
Tool Covers S3 / R2 Schedule and retention Encryption Point in time Restore License, latest
WAL-G (release binaries, no official image) PostgreSQL, MySQL, Redis S3; R2 reported working in wal-g#2550 cron; delete retain FULL n libsodium or PGP PostgreSQL through WAL, MySQL through binlogs backup-fetch, then restore_command='wal-g wal-fetch %f %p' and recovery_target_time Apache-2.0, 3.0.9 (Aug 2026)
pgBackRest (no official image) PostgreSQL S3; R2 works, with retries added for its 429s (#2661) external cron; full/diff kept by count or time AES-256 yes restore --type=time --target=… MIT, 2.60.0 (Oct 2026)
barman-cloud PostgreSQL --endpoint-url; R2 not documented cron; recovery window S3 server-side yes barman-cloud-restore and barman-cloud-wal-restore GPL-3.0, 3.20.1 (Sep 2026)
itbm/postgres-backup-s3 PostgreSQL, pg_dump S3_ENDPOINT SCHEDULE; DELETE_OLDER_THAN AES-256 no the same image with BACKUP_FILE=latest MIT, active
SQL Server BACKUP TO URL SQL Server 2022 and later, Linux included s3://; R2 reported working external built in log backups and STOPAT RESTORE … FROM URL built in, not in Express
MySQL Shell (ships in mysql:9.7) MySQL s3EndpointOverride; R2 untested external none found by GTID, from util.dumpBinlogs util.loadDump, then util.loadBinlogs({stopBefore}) GPLv2, 9.7.1
nfrastack/db-backup dumps of PostgreSQL, MySQL, SQL Server, Redis, SQLite S3 cron; last N or by age age no CLI or guided AGPL core, paid tier ($129/yr), 5.0.6 (Oct 2026)
Litestream SQLite R2 detected automatically continuous; snapshot.retention (default 24h) SSE-C only yes, within retention litestream restore -timestamp … -o … Apache-2.0, 0.5.17 (Aug 2026)
Volume and file tools

None of these has point-in-time restore; a restore goes back to a snapshot.

Tool S3 / R2 Schedule and retention Encryption Stops or quiesces containers Restore License, latest
offen/docker-volume-backup S3; R2 works BACKUP_CRON_EXPRESSION, BACKUP_RETENTION_DAYS GPG or age yes: a stop-during-backup label and archive-pre exec hooks, through the Docker socket untar into the volume from a throwaway container MPL-2.0, 2.50.0 (Oct 2026)
restic (Backrest adds a UI) generic S3 cron or Backrest; forget --keep-* always on no; database dumps through --stdin-from-command restic restore or dump BSD-2, 0.19.1 (Jul 2026)
Kopia generic S3 policies, run by kopia server; GFS always on opt-in actions snapshot restore or mount Apache-2.0, 0.23.1 (Jun 2026)
Borg with borgmatic S3 only in Borg 2, still beta (2.0.0b25) borgmatic; GFS optional dump hooks for PostgreSQL, MySQL and SQLite, none for SQL Server borgmatic restore BSD-3 and GPL-3.0; Borg 1.4.5, borgmatic 2.2.0
Duplicati S3 built in AES or GPG pre/post scripts from its UI, or straight from the backup files MIT, 2.4.1 (Oct 2026); its console is paid and optional
rclone a Cloudflare R2 provider external; dated --backup-dir a crypt remote no copy back MIT, 1.75.2 (Oct 2026)
Notes
  • Consistency. A plain VM has no filesystem snapshots, so a file-level tool that reads a live database volume gets a copy that isn't even crash-consistent. Dump first, stop the container, or use a database-native tool.
  • WAL-G
    • backup-push can stream over the replication protocol (docs), so a sidecar needs no access to PGDATA. That mode has no delta backups and uses a single stream.
    • WAL archiving needs wal-push inside the database image. The alternative is wal-receive in a sidecar, which holds a replication slot.
    • wal-g#2550 reports that the official postgres:18 image (and so pgvector/pgvector:pg18) has no CA certificates, and that WAL-G then retries the TLS error to R2 without logging it, which looks like a hang.
  • pgBackRest and barman-cloud need their binary next to PGDATA: a custom database image, with backups run through docker exec or from a sidecar that shares PGDATA.
  • eeshugerman/postgres-backup-s3 has been archived since Aug 2024. The MySQL counterpart of the dump images is databacker/mysql-backup (MIT, 1.5.0).
  • SQL Server
    • Backup to S3-compatible storage isn't supported in Express, the only free production edition; the container image defaults to Developer. On Linux, the S3 endpoint's CA has to be in /var/opt/mssql/security/ca-certificates before SQL Server starts.
    • The free route is a scheduled sqlcmd running BACKUP DATABASE and BACKUP LOG … TO DISK (Express has no SQL Agent), into a volume shared with whatever uploads the files, since sqlservr writes them.
    • On a paid edition, the R2 write-up above found the REGION option failing. R2 also wants equal-size multipart parts, while SQL Server's part sizes vary between 5 and 20 MB, so it needs a test at real database size.
    • WAL-G's SQL Server mode targets Windows, and its docs cover full backups only.
  • MySQL 9.7. Percona XtraBackup 9.7 is still a release candidate (Jul 2026), so WAL-G would use mysqldump and binlog-push, reading the binlogs from the data volume.
  • Litestream
    • A sidecar on the same named volume is supported, on local disks (not NFS or SMB).
    • Microsoft.Data.Sqlite retries busy errors until its command timeout, and the app's own checkpoints make Litestream take extra snapshots.
    • Version 0.5 removed client-side encryption.
  • Redis
    • Redis 8 has the BACKUP START/SEAL/LIST/CLEANUP commands, which take a consistent online copy of the multi-part AOF, restored with preload-file aof:…/appendonly.aof.manifest.
    • The older route: set auto-aof-rewrite-percentage 0, wait for aof_rewrite_in_progress:0, copy appendonlydir, then turn it back on.
    • A dump.rdb copied into /data is ignored while AOF is on; preload-file rdb: loads it.
    • WAL-G (redis backup-push --type aof), nfrastack and offen's stop label also work.
    • Restoring an old Hangfire state can run jobs again or drop them.
  • Aspire. Neither Aspire nor CommunityToolkit/Aspire has an integration for any of these. Each would be a container the app host adds in publish mode only (AddContainer or AddDockerfile), sharing the named volumes it backs up through WithVolume(sameName, path, isReadOnly: true) and getting labels through PublishAsDockerComposeService.
  • Cloudflare R2
    • The free tier covers 10 GB-month, then $0.015 per GB.
    • R2 has no S3 versioning or Object Lock. Its bucket locks also block overwrites, so they fit only prefixes a tool never rewrites.
    • Backups want a bucket of their own, with a token scoped to it.
What the research would use if we only combined existing tools
  • PostgreSQL: WAL-G. A thin image FROM pgvector/pgvector:pg18 that adds wal-g and ca-certificates, with archive_command='wal-g wal-push %p' and archive_timeout=60; a cron sidecar runs backup-push nightly and delete retain FULL 7, with a libsodium key. pgBackRest for large databases.
  • SQL Server Express: a nightly full backup and a log backup every 15 minutes (FULL recovery model) with sqlcmd, into a backup volume that restic pushes to R2.
  • MySQL: MySQL Shell in a mysql:9.7 sidecar, dumpInstance nightly and dumpBinlogs every 15 minutes, once proven against R2; WAL-G otherwise.
  • SQLite: a Litestream sidecar with snapshot.retention: 168h.
  • Redis: a nightly job running BACKUP START, SEAL, the copy, then CLEANUP; offen's stop label is simpler when a few seconds of downtime are fine.
  • Files: on R2, rclone sync to the backup bucket with a dated --backup-dir and a lifecycle rule; in a local volume, restic.
  • Small volumes (dashboard, DbGate): offen nightly, with stop labels, age encryption and 14 days' retention.
  • Restore testing: a weekly scheduled workflow on the self-hosted runner that restores everything into throwaway containers on an isolated network, PostgreSQL to "now minus one hour", then checks it: pg_amcheck and the latest __EFMigrationsHistory row, DBCC CHECKDB, PRAGMA integrity_check, Redis DBSIZE, and restic check --read-data-subset=10%. A failed run is the alert. GitHub turns scheduled workflows off after 60 days without activity in a public repository.
Still open
  • Whether MySQL Shell and SQL Server's native backup work against R2 at real database sizes.
  • Whether wal-receive uploads partial WAL segments.
  • How Kopia schedules snapshots without its server running.
Lingua principale
C#
Stelle
1.4k
Fork
264
Merge medio
10h 48m
PR unite (30g)
425

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bitfoundation/bitplatform

Tutte le issue di bitfoundation/bitplatform

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.