1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-06-27 23:08:14 +03:00
jmqm 02c9d71114
Overhaul (#4)
**README**
- Overhaul; changed docs to be better aligned to the new `backup.sh`.
- Add example `docker-compose`.

**Dockerfile**
- Install `zip`.
- Remove installation of `sqlite`.
- Remove unnecessary variables.

**backup.sh**
- Overhaul; now zips all required and recommended files and directories stated at [vaultwarden docs](https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault).
- Removed deleting old backups; will be added later on in a separate script.

**entrypoint.sh**
- Removed creating folders.
2021-05-25 20:34:39 -05:00
2021-05-25 20:34:39 -05:00
2021-05-25 20:34:39 -05:00
2021-05-25 20:34:39 -05:00
2021-05-25 20:34:39 -05:00

Backs up vaultwarden files using cron daemon. Can be set to run automatically.

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
    container_name: vaultwarden_backup
    volumes:
      - "/vaultwarden_data_directory:/data:ro"
      - "/backup_directory:/backups"

      - "/etc/localtime:/etc/localtime:ro" # Container uses date from host.
    environment:
      - DELETE_AFTER=30 #optional
      - CRON_TIME=* */4 * * *
      - UID=1024
      - GID=100

Environment Variables

Variable Description
UID User ID to run the cron job as.
GID Group ID to run the cron job as.
CRON_TIME 👍 When to run. Info here and generator here
DELETE_AFTER 👍 Delete backups X days old. (unsupported at the moment)

Optional

Variable Description
TZ ¹ Timezone inside the container. Can mount /etc/localtime instead as well (recommended).
LOGFILE Log file path relative to inside the container.
CRONFILE Cron file path relative to inside the container.

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

Errors

Wrong permissions

Error: unable to open database file is most likely caused by permission errors. Note that sqlite3 creates a lock file in the source directory while running the backup. So source AND destination have to be +rw for the user. You can set the user and group ID via the UID and GID environment variables like described above.

Date Time issues / Wrong timestamp

If you need timestamps in your local timezone you should mount /etc/timezone:/etc/timezone:ro and /etc/localtime:/etc/localtime:ro like it's done in the docker-compose.yml. An other possible solution is to set the environment variable accordingly (like TZ=Europe/Berlin) (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for more information).

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