Skip to content

Commit b6295a3

Browse files
author
super
committed
Refactor env_sample configuration: reorganize sections for clarity and maintainability
1 parent 765a931 commit b6295a3

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

env_sample

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@
55
# Choose backup mode: sql (pg_dump backups) or wal (wal-g incremental backups)
66
BACKUP_MODE=sql
77

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
1611

17-
# --- PostgreSQL Credentials ---
1812
# Default superuser and password. CHANGE THE PASSWORD!
1913
POSTGRES_USER=postgres
2014
POSTGRES_PASSWORD=your_very_strong_superuser_password
2115

22-
# --- SQL Mode Backup Configuration (legacy) ---
16+
# --- Docker Configuration Based on Mode ---
17+
# For SQL mode (default):
2318
# These are used when BACKUP_MODE=sql
19+
2420
# Base64 encoded content of your rclone.conf file
2521
# Run: cat ~/.config/rclone/rclone.conf | base64 -w0
2622
RCLONE_CONFIG_BASE64=PASTE_YOUR_BASE64_ENCODED_RCLONE_CONFIG_HERE
2723

28-
# Your AGE public key for encryption
29-
AGE_PUBLIC_KEY=PASTE_YOUR_AGE_PUBLIC_KEY_HERE
30-
3124
# Rclone remote path (e.g., mydrive:database_backups/postgres)
3225
REMOTE_PATH=your_rclone_remote:path/to/all_db_backups
3326

27+
# Your AGE public key for encryption
28+
AGE_PUBLIC_KEY=PASTE_YOUR_AGE_PUBLIC_KEY_HERE
29+
3430
# How many days to keep the SQL dumps on the rclone remote
3531
SQL_BACKUP_RETAIN_DAYS=30
3632

33+
# Script will be executed every day at 2:00 AM
34+
BACKUP_CRON_SCHEDULE="0 2 * * *"
35+
36+
# For WAL mode:
3737
# --- WAL Mode Configuration (wal-g over SSH) ---
3838
# These are used when BACKUP_MODE=wal
3939
# 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
8585
# When using local SSH server, this replaces WALG_SSH_PREFIX (port provided via WALG_SSH_PORT)
8686
WALG_SSH_PREFIX_LOCAL=ssh://walg@ssh-server/backups
8787

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-
10188
# --- pgAdmin Settings ---
10289
# pgAdmin (database administration tool) runs on port 8080
10390
# Admin credentials for initial setup (change these for security!)
10491
10592
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

Comments
 (0)