- dr-sync: mirror all repos (incl private via token) over LAN, fsck, source read-only guard - dr-bundle: weekly full bundles with GFS retention - dr-dump: gitea dump --skip-repository via docker exec, zero source residue - dr-verify: drift + HEAD-sync + bundle integrity checks - dr-restore: one-command recovery to a fresh Gitea - systemd timers; secrets/data gitignored, dr.conf.example provided
28 lines
882 B
Plaintext
28 lines
882 B
Plaintext
# dr.conf.example — 复制为 dr.conf 并填真实值(chmod 600, 含 token 勿入库)
|
|
# 路径
|
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
SOURCE_URL="http://192.168.1.11:3000" # 源 Gitea(建议局域网地址)
|
|
SOURCE_TOKEN="" # 只读 token(覆盖私有库; 公开库可留空)
|
|
MIRROR_DIR="$BASE_DIR/mirror"
|
|
BUNDLE_DIR="$BASE_DIR/bundles"
|
|
DUMP_DIR="$BASE_DIR/dumps"
|
|
|
|
# L3 异地(第三台机/外置盘; 留空=跳过)
|
|
OFFSITE_HOST=""
|
|
OFFSITE_SSH_KEY=""
|
|
OFFSITE_PATH="/home/tonycao/git-backup"
|
|
|
|
# 源站(主节点) SSH, Gitea 跑在 docker 容器内 → dump 用 docker exec
|
|
SOURCE_SSH="user@source-host"
|
|
GITEA_CONTAINER="gitea"
|
|
GITEA_CONF="/data/gitea/conf/app.ini"
|
|
|
|
# L2 快照保留(份数)
|
|
KEEP_DAILY=7
|
|
KEEP_WEEKLY=4
|
|
KEEP_MONTHLY=12
|
|
|
|
# 恢复目标(可选, dr-restore.sh 默认值)
|
|
RESTORE_TARGET_URL=""
|
|
RESTORE_TARGET_OWNER=""
|