Generate restic configs from apps.config
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -15,10 +15,11 @@ terraform.tfstate.backup
|
||||
app
|
||||
|
||||
config/apps.config
|
||||
config/restic-env
|
||||
config/restic-password
|
||||
config/production.tfvars
|
||||
|
||||
restic-env
|
||||
restic-password
|
||||
|
||||
# generated files
|
||||
all-apps/lb/Caddyfile
|
||||
all-apps/nextcloud/nextcloud.env
|
||||
|
||||
10
Makefile
10
Makefile
@@ -34,6 +34,12 @@ all-apps/nextcloud/redis_password: $(apps_config)
|
||||
all-apps/nextcloud/nextcloud.env: $(apps_config) make-nextcloud-env.sh
|
||||
./make-nextcloud-env.sh $(apps_config)
|
||||
|
||||
# Backups / Restic / Backblaze
|
||||
restic-env: $(apps_config) make-restic-generated.sh
|
||||
./make-restic-generated.sh $(apps_config) > restic-env
|
||||
restic-password: $(apps_config) make-restic-password.sh
|
||||
./make-restic-password.sh $(apps_config) > restic-password
|
||||
|
||||
ignition.json: cl.yaml app/.dirstamp \
|
||||
all-apps/lb/Caddyfile \
|
||||
all-apps/nextcloud/nextcloud_admin_user \
|
||||
@@ -42,7 +48,9 @@ all-apps/nextcloud/postgres_db \
|
||||
all-apps/nextcloud/postgres_user \
|
||||
all-apps/nextcloud/postgres_password \
|
||||
all-apps/nextcloud/redis_password \
|
||||
all-apps/nextcloud/nextcloud.env
|
||||
all-apps/nextcloud/nextcloud.env \
|
||||
restic-env \
|
||||
restic-password
|
||||
cat cl.yaml | docker run --rm --volume /home/tjhintz/.ssh/id_rsa.pub:/pwd/ssh-keys --volume ${PWD}:/pwd --workdir /pwd -i quay.io/coreos/butane:latest -d /pwd > ignition.json
|
||||
|
||||
generated.tfvars: $(apps_config) make-generated.sh
|
||||
|
||||
4
cl.yaml
4
cl.yaml
@@ -88,10 +88,10 @@ storage:
|
||||
files:
|
||||
- path: /restic-password
|
||||
contents:
|
||||
local: config/restic-password
|
||||
local: restic-password
|
||||
- path: /restic-env
|
||||
contents:
|
||||
local: config/restic-env
|
||||
local: restic-env
|
||||
### docker-compose sysext
|
||||
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
||||
- path: /opt/extensions/docker-compose/docker-compose-2.34.0-x86-64.raw
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
AWS_ACCESS_KEY_ID=""
|
||||
AWS_SECRET_ACCESS_KEY=""
|
||||
8
make-restic-generated.sh
Executable file
8
make-restic-generated.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
. $1 # source the apps.config file with then env vars
|
||||
|
||||
echo "AWS_ACCESS_KEY_ID=\"$BACKBLAZE_KEY_ID\""
|
||||
echo "AWS_SECRET_ACCESS_KEY=\"$BACKBLAZE_APPLICATION_KEY\""
|
||||
7
make-restic-password.sh
Executable file
7
make-restic-password.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
. $1 # source the apps.config file with then env vars
|
||||
|
||||
echo "$RESTIC_PASSWORD"
|
||||
Reference in New Issue
Block a user