diff --git a/config b/config new file mode 100644 index 0000000..a337a68 --- /dev/null +++ b/config @@ -0,0 +1 @@ +StrictHostKeyChecking accept-new diff --git a/docker-compose.yml b/docker-compose.yml index 56d4a57..ce88ccc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,3 +8,7 @@ services: network_mode: "host" volumes: - ./crontab.yaml:/root/crontab.yaml:Z + - ./id_rsa:/root/.ssh/id_rsa:Z + - ./id_rsa.pub:/root/.ssh/id_rsa.pub:Z + - ./config:/root/.ssh/config:Z + - ./scripts:/root/scripts:Z diff --git a/start_or_update.sh b/start_or_update.sh index be128b3..00ab87e 100755 --- a/start_or_update.sh +++ b/start_or_update.sh @@ -11,10 +11,14 @@ then exit 1 fi fi -openssl enc -aes-256-cbc -d -in ~/secrets.tar.gz.enc | sudo tar -zxv --strip 2 secrets/docker-cron-global-stack${HOST}${INSTANCE}/crontab.yaml \ +openssl enc -aes-256-cbc -d -in ~/secrets.tar.gz.enc \ + | sudo tar -zxv --strip 2 secrets/docker-cron-global-stack${HOST}${INSTANCE}/crontab.yaml \ + secrets/docker-cron-global-stack${HOST}${INSTANCE}/scripts \ + secrets/bootstrap/id_rsa secrets/bootstrap/id_rsa.pub \ || { echo "Could not extract from secrets archive, exiting."; rm -f ~/secrets.tar.gz.enc; exit 1; } -sudo chown root. crontab.yaml +sudo chown root. crontab.yaml id_rsa id_rsa.pub config scripts sudo chmod 644 crontab.yaml +sudo chmod 400 id_rsa id_rsa.pub config unset VERSION_CRON export VERSION_CRON=$(git ls-remote https://git.scimetis.net/yohan/docker-cron.git| head -1 | cut -f 1|cut -c -10)