|
5 | 5 | # Choose backup mode: sql (pg_dump backups) or wal (wal-g incremental backups) |
6 | 6 | BACKUP_MODE=sql |
7 | 7 |
|
8 | | -# --- Docker Configuration Based on Mode --- |
9 | | -# For SQL mode (default): |
10 | | -POSTGRES_IMAGE=postgres:17 |
11 | | -# POSTGRES_DOCKERFILE= (leave empty/commented for SQL mode) |
12 | | - |
13 | | -# For WAL mode (uncomment and comment out POSTGRES_IMAGE above): |
14 | | -# POSTGRES_DOCKERFILE=Dockerfile.postgres-walg |
15 | | -# BACKUP_VOLUME_MODE=ro (optional: backup container only reads in WAL mode) |
| 8 | +# --- General Settings --- |
| 9 | +# Timezone for the container and cron job (e.g., Asia/Shanghai, UTC, America/New_York) |
| 10 | +TZ=Asia/Shanghai |
16 | 11 |
|
17 | | -# --- PostgreSQL Credentials --- |
18 | 12 | # Default superuser and password. CHANGE THE PASSWORD! |
19 | 13 | POSTGRES_USER=postgres |
20 | 14 | POSTGRES_PASSWORD=your_very_strong_superuser_password |
21 | 15 |
|
22 | | -# --- SQL Mode Backup Configuration (legacy) --- |
| 16 | +# --- Docker Configuration Based on Mode --- |
| 17 | +# For SQL mode (default): |
23 | 18 | # These are used when BACKUP_MODE=sql |
| 19 | + |
24 | 20 | # Base64 encoded content of your rclone.conf file |
25 | 21 | # Run: cat ~/.config/rclone/rclone.conf | base64 -w0 |
26 | 22 | RCLONE_CONFIG_BASE64=PASTE_YOUR_BASE64_ENCODED_RCLONE_CONFIG_HERE |
27 | 23 |
|
28 | | -# Your AGE public key for encryption |
29 | | -AGE_PUBLIC_KEY=PASTE_YOUR_AGE_PUBLIC_KEY_HERE |
30 | | - |
31 | 24 | # Rclone remote path (e.g., mydrive:database_backups/postgres) |
32 | 25 | REMOTE_PATH=your_rclone_remote:path/to/all_db_backups |
33 | 26 |
|
| 27 | +# Your AGE public key for encryption |
| 28 | +AGE_PUBLIC_KEY=PASTE_YOUR_AGE_PUBLIC_KEY_HERE |
| 29 | + |
34 | 30 | # How many days to keep the SQL dumps on the rclone remote |
35 | 31 | SQL_BACKUP_RETAIN_DAYS=30 |
36 | 32 |
|
| 33 | +# Script will be executed every day at 2:00 AM |
| 34 | +BACKUP_CRON_SCHEDULE="0 2 * * *" |
| 35 | + |
| 36 | +# For WAL mode: |
37 | 37 | # --- WAL Mode Configuration (wal-g over SSH) --- |
38 | 38 | # These are used when BACKUP_MODE=wal |
39 | 39 | # SSH remote path for wal-g (omit port; set WALG_SSH_PORT below to avoid double-port parsing issues) |
@@ -85,21 +85,13 @@ SSH_USER=walg |
85 | 85 | # When using local SSH server, this replaces WALG_SSH_PREFIX (port provided via WALG_SSH_PORT) |
86 | 86 | WALG_SSH_PREFIX_LOCAL=ssh://walg@ssh-server/backups |
87 | 87 |
|
88 | | -# --- Telegram Notifications (Optional) --- |
89 | | -TELEGRAM_BOT_TOKEN=PASTE_YOUR_TELEGRAM_BOT_TOKEN_HERE |
90 | | -TELEGRAM_CHAT_ID=PASTE_YOUR_TELEGRAM_CHAT_ID_HERE |
91 | | -TELEGRAM_MESSAGE_PREFIX=Database |
92 | | - |
93 | | -# --- General Settings --- |
94 | | -# Timezone for the container and cron job (e.g., Asia/Shanghai, UTC, America/New_York) |
95 | | -TZ=Asia/Shanghai |
96 | | - |
97 | | -# --- CRON Settings --- |
98 | | -# Script will be executed every day at 2:00 AM |
99 | | -BACKUP_CRON_SCHEDULE="0 2 * * *" |
100 | | - |
101 | 88 | # --- pgAdmin Settings --- |
102 | 89 | # pgAdmin (database administration tool) runs on port 8080 |
103 | 90 | # Admin credentials for initial setup (change these for security!) |
104 | 91 | |
105 | 92 | PGADMIN_DEFAULT_PASSWORD=admin |
| 93 | + |
| 94 | +# --- Telegram Notifications (Optional) --- |
| 95 | +TELEGRAM_BOT_TOKEN=PASTE_YOUR_TELEGRAM_BOT_TOKEN_HERE |
| 96 | +TELEGRAM_CHAT_ID=PASTE_YOUR_TELEGRAM_CHAT_ID_HERE |
| 97 | +TELEGRAM_MESSAGE_PREFIX=Database |
0 commit comments