Add .env backup system for Docker containers

- backup-env-files.sh: Main backup script with Gitea integration
- validate-env-backups.sh: Validation and integrity checking
- env-backup-integration.sh: Integration with existing backup system
- completions/env-backup-completion.bash: Tab completion support
- docs/env-backup-system.md: Documentation for the backup system

These scripts provide secure backup of .env files to private Gitea repository.
This commit is contained in:
Peter Wood
2025-05-29 06:51:22 -04:00
parent 30737a9c79
commit d711e66fc8
5 changed files with 1264 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
#!/bin/bash
# env-backup-completion.bash - Bash completion for environment backup scripts
# Source this file or copy to ~/.local/share/bash-completion/completions/
_backup_env_files() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --init --force --dry-run --restore --list --gitea-url --username"
case ${prev} in
--gitea-url|-g)
# Suggest common gitea URL patterns
COMPREPLY=( $(compgen -W "https://git. https://gitea. https://code." -- ${cur}) )
return 0
;;
--username|-u)
# No completion for username
return 0
;;
*)
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
_validate_env_backups() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --verbose --summary-only --missing-only --diff"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
# Register completion functions
complete -F _backup_env_files backup-env-files.sh
complete -F _validate_env_backups validate-env-backups.sh
# Also register for the full path versions
complete -F _backup_env_files ./backup-env-files.sh
complete -F _validate_env_backups ./validate-env-backups.sh