1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-06-27 23:48:15 +03:00
jmqm 479d78b9e3
Combine scripts, refactor, minor README improvements (#26)
- Combined backup and delete scripts.
  - Consequently, deleted `backup.sh` and `delete.sh`.
  - Changed Dockerfile and `entrypoint.sh`.
- Refactored script.
- Docker compose example in README now includes network property _(is it called a property?)_.
- README volume permission requirements are placed at better locations.
2022-01-02 19:37:08 -06:00
2021-08-30 11:34:54 -05:00

Backs up vaultwarden files and directories to tar.xz archives automatically. tar.xz archives can be opened using data compression programs like 7-Zip and WinRAR.

Files and directories that are backed up:

  • db.sqlite3
  • config.json
  • rsa_key.der
  • rsa_key.pem
  • rsa_key.pub.der
  • /attachments
  • /sends

Usage

Automatic Backups

Refer to the docker-compose section below. By default, backing up is automatic.

Manual Backups

Pass manual to docker run or docker-compose as a command.

docker-compose

services:
  vaultwarden:
    # Vaultwarden configuration here.
  backup:
    image: jmqm/vaultwarden_backup:latest
    container_name: vaultwarden_backup
    network_mode: none
    volumes:
      - /vaultwarden_data_directory:/data:ro # Read-only
      - /backup_directory:/backups

      - /etc/localtime:/etc/localtime:ro # Container uses date from host.
    environment:
      - DELETE_AFTER=30
      - CRON_TIME=* */24 * * * # Runs at 12:00 AM.
      - UID=1024
      - GID=100

Volumes (permissions required)

/data (read)- Vaultwarden's /data directory. Recommend setting mount as read-only.

/backups (write) - Where to store backups to.

Environment Variables

Environment Variable Info
UID User ID to run the cron job as.
GID Group ID to run the cron job as.
CRON_TIME 👍 When to run (default is every 12 hours). Info here and editor here.
DELETE_AFTER 👍 (exclusive to automatic mode) Delete backups X days old. Requires read and write permissions.

Optional

Environment Variable Info
TZ ¹ Timezone inside the container. Can mount /etc/localtime instead as well (recommended).

¹ See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for more information

Errors

Unexpected timestamp

Mount /etc/localtime (recommend mounting as read-only) or set TZ environment variable.

Description
A Docker-based backup solution for Vaultwarden with encryption and Telegram integration.
Readme 520 KiB
Languages
Shell 94.9%
Dockerfile 5.1%