Skip to content

Commit

Permalink
Remove Docker completely and unnecessary env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
pdcp1 committed Aug 20, 2024
1 parent 2bba1d4 commit d9e7368
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 74 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/db-backup-private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ jobs:
-e CLOUDFLARE_R2_WRITE_ACCESS_KEY_ID="${{ secrets.CLOUDFLARE_R2_WRITE_ACCESS_KEY_ID }}" \
-e CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY="${{ secrets.CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY }}" \
-e CLOUDFLARE_R2_BUCKET_NAME="${{ vars.CLOUDFLARE_R2_BUCKET_NAME }}" \
-e BACKUPFILE_PREFIX="backup" \
-e MONGODB_URI="${{ secrets.MONGODB_CONNECTION_STRING }}" \
-e MONGODB_DBNAME="aiidprod" \
-e MONGODB_DBNAME_TRANSLATIONS="translations" \
-v ~:/mab \
aiid-docker-backup:latest
5 changes: 2 additions & 3 deletions .github/workflows/db-backup-public-wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ jobs:
- name: Generate public backup
run: |
./bin/backup.sh
./bin/prune.sh
./bin/list.sh
working-directory: db-backup
env:
IS_PUBLIC_BACKUP: true
CLOUDFLARE_R2_ACCOUNT_ID: ${{ vars.CLOUDFLARE_R2_ACCOUNT_ID }}
CLOUDFLARE_R2_WRITE_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_WRITE_ACCESS_KEY_ID }}
CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY }}
CLOUDFLARE_R2_BUCKET_NAME: ${{ vars.CLOUDFLARE_R2_BUCKET_NAME }}
BACKUPFILE_PREFIX: backup
MONGODB_URI: ${{ secrets.MONGODB_CONNECTION_STRING }}
MONGODB_DBNAME: aiidprod
MONGODB_DBNAME_TRANSLATIONS: translations
1 change: 0 additions & 1 deletion .github/workflows/db-backup-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
-e CLOUDFLARE_R2_WRITE_ACCESS_KEY_ID="${{ secrets.CLOUDFLARE_R2_WRITE_ACCESS_KEY_ID }}" \
-e CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY="${{ secrets.CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY }}" \
-e CLOUDFLARE_R2_BUCKET_NAME="${{ vars.CLOUDFLARE_R2_BUCKET_NAME }}" \
-e BACKUPFILE_PREFIX="backup" \
-e MONGODB_URI="${{ secrets.MONGODB_CONNECTION_STRING }}" \
-e MONGODB_DBNAME="aiidprod" \
-e MONGODB_DBNAME_TRANSLATIONS="translations" \
Expand Down
25 changes: 0 additions & 25 deletions db-backup/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions db-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ This is a quick port of the forked project to support JSON and CSV backups of th

The complete state of the database will be backed up on a weekly basis in both JSON and CSV form. The backups can be downloaded from [here](https://incidentdatabase.ai/research/snapshots/).

What is mongodb-awesome-backup?
-------------------------------

mongodb-awesome-backup is the collection of scripts which backup MongoDB databases to Amazon S3.
You can set a custom S3 endpoint to use S3 based services like DigitalOcean Spaces instead of Amazon S3.


Requirements
------------

Expand All @@ -25,9 +18,7 @@ docker run --rm \
-e CLOUDFLARE_R2_WRITE_SECRET_ACCESS_KEY=<Cloudflare R2 Access Secret Key with write permission> \
-e CLOUDFLARE_R2_PUBLIC_BUCKET=<Cloudflare R2 public bucket name (ie: "aiid-public")> \
-e CLOUDFLARE_R2_BUCKET_NAME=<Cloudflare R2 bucket name (ie: "aiid-public")> \
[ -e BACKUPFILE_PREFIX=<Prefix of Backup Filename (default: "backup") \ ]
[ -e MONGODB_URI=<Target MongoDB URI> \ ]
[ -e MONGODB_DBNAME=<Target DB name> \ ]
[ -v ~:/mab \ ]
weseek/mongodb-awesome-backup
```
Expand All @@ -54,8 +45,6 @@ Environment variables

| Variable | Description | Default |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| BACKUPFILE_PREFIX | Prefix of Backup Filename | "backup" |
| MONGODB_URI | Target MongoDB URI (ex. `mongodb://mongodb?replicaSet=rs0`). If set, the other `MONGODB_*` variables will be ignored. | - |
| MONGODB_DBNAME | Target DB name | - |
| CRONMODE | If set "true", this container is executed in cron mode. In cron mode, the script will be executed with the specified arguments and at the time specified by CRON_EXPRESSION. | "false" |
| CRON_EXPRESSION | Cron expression (ex. "CRON_EXPRESSION=0 4 * * *" if you want to run at 4:00 every day) | - |
4 changes: 3 additions & 1 deletion db-backup/bin/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ echo "Starting backup.sh script execution..."

# settings
IS_PUBLIC_BACKUP=${IS_PUBLIC_BACKUP:-false}
BACKUPFILE_PREFIX=${BACKUPFILE_PREFIX:-backup}
BACKUPFILE_PREFIX="backup"
CRONMODE=${CRONMODE:-false}
CLOUDFLARE_R2_ACCOUNT_ID=${CLOUDFLARE_R2_ACCOUNT_ID}
MONGODB_DBNAME="aiidprod"
MONGODB_DBNAME_TRANSLATIONS="translations"

# start script
CWD=`/usr/bin/dirname $0`
Expand Down
10 changes: 0 additions & 10 deletions db-backup/bin/command_exec.sh

This file was deleted.

19 changes: 0 additions & 19 deletions db-backup/bin/entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion db-backup/bin/prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Starting prune.sh execution..."

# settings
BACKUPFILE_PREFIX=${BACKUPFILE_PREFIX:-backup}
BACKUPFILE_PREFIX="backup"
DELETE_DEVIDE=${DELETE_DEVIDE:-3}
DELETE_TARGET_DAYS_LEFT=${DELETE_TARGET_DAYS_LEFT:-4}

Expand Down

0 comments on commit d9e7368

Please sign in to comment.