Sign inSign up

rcouto/fritzbox-backup-docker

By rcouto

•Updated about 2 years ago

Automate the backup of configurations from a FRITZ!Box router using 1Password for secrets

Image
Networking
Databases & storage
0

892

rcouto/fritzbox-backup-docker repository overview

⁠fritzbox-backup Docker Image

This Docker image, fritzbox-backup, is designed to automate the backup of configurations from a FRITZ!Box router. The image leverages 1Password to load necessary secrets and is built using Nix with a flake.nix configuration.

⁠Running the Docker Container

You can run the Docker container with the following command:

docker run --rm -ti -v ./token:/etc/token:ro -v ./backup/:/mnt/backup:rw rcouto/fritzbox-backup-docker
⁠Explanation of Command Line Options:
  • -v ./token:/etc/token:ro: Mounts the local ./token file containing your 1Password Service Account token to /etc/token inside the container as read-only.

  • -v ./backup/:/mnt/backup:rw: Mounts the local ./backup/ directory to /mnt/backup inside the container with read-write permissions. The backups from the FRITZ!Box will be saved here.

⁠Environment Variables

The Docker image may use environment variables to configure various aspects of the backup process. You can customize these by passing them to the docker run command using the -e flag.

  • FRITZ_BASE_URL: Base URL of the FRITZ!Box router (default https://fritz.box)
  • OP_TOKEN_FILE: Path to the token file inside the container (default /etc/token)
  • OP_BKP_USR_URL: Secret reference for FRITZ!Box user (default "op://homelab-scripts/Fritzbox - backup/username")
  • OP_BKP_PWD_URL: Secret reference for FRITZ!Box password (default "op://homelab-scripts/Fritzbox - backup/password")
  • OP_BKP_FIL_URL: Secret reference for FRITZ!Box backup file password (default "op://homelab-scripts/Fritzbox - backup/backup-file-password")
  • OP_BKP_OTP_URL: Secret reference for FRITZ!Box OTP (default "op://homelab-scripts/Fritzbox - backup/one-time password?attribute=otp")
  • BACKUP_DIR: Path to the directory inside the container where backups will be saved (default /mnt/backup)

⁠Additional Notes

  • Make sure your FRITZ!Box is configured for two-factor authentication, otherwise it will require physical presence to the router to click the front buttons.
  • Backups will be created with the following file name fritzbox-bkp-$(date +"%Y%m%d%H%M%S").export (e.g. fritzbox-bkp-20240817101506.export)
  • The container will automatically perform the backup based on the provided environment variables and mounted secrets.

Tag summary

Content type

Image

Digest

sha256:8864fefc1…

Size

31.5 MB

Last updated

about 2 years ago

docker pull rcouto/fritzbox-backup-docker