diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d16436..cc1e5f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,6 +24,15 @@ build_master: only: - master +build_master_rpi3: + <<: *docker_build + script: + - *docker_login + - docker build --pull -t "$IMAGE_NAME:rpi3" . + - docker push "$IMAGE_NAME:rpi3" + tags: + - rpi3 + build: <<: *docker_build script: diff --git a/README.md b/README.md index 3a01d3c..00161a5 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,35 @@ # bitwarden_rs Backup ---- Docker Containers for bitwarden_rs Backup. ## Usage + +The default tag `latest` should be used for a x86-64 system. If you try to run the container on a raspberry pi 3 you should use the tag `rpi3`. Also make sure that your bitwarden_rs container is named `bitwarden` otherwise you have to replace the container name in the `--volumes-from` section of the `docker run` call. + +### Automatic Backups +A cron daemon is running inside the container and the container keeps running in background. + +Start backup container with default settings (automatic backup at 5 am) ```sh docker run -d --restart=always --name bitwarden_backup --volumes-from=bitwarden registry.gitlab.com/1o/bitwarden_rs-backup/bw_backup ``` Example for hourly backups +```sh +docker run -d --restart=always --name bitwarden_backup --volumes-from=bitwarden -e CRON_TIME="0 * * * *" registry.gitlab.com/1o/bitwarden_rs-backup/bw_backup ``` -docker run -d --restart=always --name bitwarden_backup --volumes-from=bitwarden -e CRON_TIME="0 * * * *" registry.gitlab.com/1o/bitwarden_rs-backup/bw_backup:latest + +### Manual Backups +You can use the crontab of your host to schedule the backup and the container will only be running during the backup process. + +Example using the integrated Backup script. You can use Environment variables for database and backup location +```sh +docker run --rm --volumes-from=bitwarden registry.gitlab.com/1o/bitwarden_rs-backup/bw_backup /bachkup.sh +``` + +If you want to run the sqlite commands manually you can use the following command +```sh +docker run --rm --volumes-from=bitwarden registry.gitlab.com/1o/bitwarden_rs-backup/bw_backup sqlite3 $DB_FILE ".backup $BACKUP_FILE" ``` ## Environment variables