2022-11-13 01:10:26 +01:00
|
|
|
version: "3"
|
|
|
|
|
2024-01-03 17:47:01 +01:00
|
|
|
includes:
|
|
|
|
compose:
|
|
|
|
taskfile: ./compose.yml
|
|
|
|
internal: true
|
|
|
|
dir: ..
|
|
|
|
|
2022-12-11 23:24:48 +01:00
|
|
|
vars:
|
|
|
|
TMP_DIR: /tmp/container-server
|
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
tasks:
|
2023-09-24 22:47:56 +02:00
|
|
|
exec:
|
|
|
|
desc: Open shell in given container
|
|
|
|
cmds:
|
2023-10-29 20:22:54 +01:00
|
|
|
- docker exec -it {{.CLI_ARGS}} sh -c "ash || bash || sh"
|
2023-09-24 22:47:56 +02:00
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
mc-update:
|
|
|
|
desc: update minecraft mods
|
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker exec -it -u amp -w /home/amp/.ampdata/instances/Main/Minecraft minecraft bash update_all.sh"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
caddy-reload:
|
|
|
|
desc: Reload Caddy config
|
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker exec -w /etc/caddy proxy caddy reload"
|
|
|
|
|
|
|
|
mail-setup:
|
|
|
|
desc: Docker-Mailserver setup utility
|
|
|
|
cmds:
|
2023-09-13 22:33:47 +02:00
|
|
|
- "docker exec -i mail setup {{.CLI_ARGS}}"
|
|
|
|
|
|
|
|
occ:
|
|
|
|
desc: Nextcloud cli
|
|
|
|
cmds:
|
|
|
|
- "docker exec -u 33 nextcloud php ./occ {{.CLI_ARGS}}"
|
2022-12-11 23:24:48 +01:00
|
|
|
|
2023-09-21 13:47:22 +02:00
|
|
|
fail2ban:
|
|
|
|
desc: Fail2Ban client
|
|
|
|
cmds:
|
|
|
|
- docker exec fail2ban fail2ban-client {{.CLI_ARGS}}
|
|
|
|
|
2023-09-24 22:47:56 +02:00
|
|
|
watchtower:
|
|
|
|
desc: Trigger watchtower update
|
|
|
|
cmds:
|
2024-01-03 17:47:01 +01:00
|
|
|
- task: compose:run
|
|
|
|
vars:
|
|
|
|
CLI_ARGS: -d watchtower --run-once --no-startup-message
|
2023-09-24 22:47:56 +02:00
|
|
|
|
2022-12-11 23:24:48 +01:00
|
|
|
psql-dump:
|
|
|
|
desc: Dump postgres database for backup or update
|
|
|
|
cmds:
|
2023-10-18 19:54:47 +02:00
|
|
|
# - echo "{{.TMP_DIR}}/{{.CLI_ARGS}}.sql"
|
2022-12-11 23:24:48 +01:00
|
|
|
- mkdir -p {{.TMP_DIR}}
|
|
|
|
- docker exec pg-{{.CLI_ARGS}} pg_dumpall -U {{.CLI_ARGS}} > {{.TMP_DIR}}/{{.CLI_ARGS}}.sql
|
|
|
|
- ls -la {{.TMP_DIR}}/{{.CLI_ARGS}}.sql
|
|
|
|
|
2023-10-18 19:54:47 +02:00
|
|
|
psql-dump-all:
|
|
|
|
desc: Run 'psql-dump' task for each running postgres container
|
|
|
|
cmds:
|
|
|
|
- task compose:list | awk '/postgres/ { sub(/pg-/, "", $3) ; system("task srv:psql-dump -- "$3) }'
|
|
|
|
|
2022-12-11 23:24:48 +01:00
|
|
|
psql-restore:
|
|
|
|
desc: Load postgres database for restore
|
|
|
|
cmds:
|
2023-09-13 22:33:47 +02:00
|
|
|
- docker exec -i pg-{{.CLI_ARGS}} psql --echo-errors -U {{.CLI_ARGS}} < {{.TMP_DIR}}/{{.CLI_ARGS}}.sql
|
2022-12-11 23:24:48 +01:00
|
|
|
|
|
|
|
psql-clear-tmp:
|
|
|
|
desc: Clear temporary sql files created by psql-dump
|
|
|
|
cmds:
|
|
|
|
- rm -rv {{.TMP_DIR}}
|