From 8982fa741ad1ad469e4333af9d343529fd930edb Mon Sep 17 00:00:00 2001 From: kakious Date: Fri, 21 Jul 2023 09:17:36 -0700 Subject: [PATCH] Update boop-keys/setup-boop.sh --- boop-keys/setup-boop.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/boop-keys/setup-boop.sh b/boop-keys/setup-boop.sh index 8fd9dea..859d49b 100644 --- a/boop-keys/setup-boop.sh +++ b/boop-keys/setup-boop.sh @@ -15,6 +15,11 @@ echo "[BOOTSTRAP] DB Configured, setting up .env file..." # read /home/coder/.coder-env as they contain the workspace name and username +echo "[BOOTSTRAP] Generating Encryption Secret" + +# generate encryption secret +encryption_secret=$(openssl rand -base64 32) + WORKSPACE_ENV=$(cat /home/coder/.coder-env | grep WORKSPACE_ENV | cut -d '=' -f2) USERNAME_ENV=$(cat /home/coder/.coder-env | grep USERNAME_ENV | cut -d '=' -f2) @@ -26,5 +31,7 @@ sed -i "s/DATABASE_NAME=/DATABASE_NAME=oauth_provider/g" /home/coder/oauth-provi sed -i "s/REDIS_HOST=/REDIS_HOST=localhost/g" /home/coder/oauth-provider/.env sed -i "s/REDIS_PORT=/REDIS_PORT=6379/g" /home/coder/oauth-provider/.env sed -i "s/BASE_LOCAL_URL=/BASE_LOCAL_URL=https:\/\/3123--$WORKSPACE_ENV--$USERNAME_ENV.coder.kakio.us/g" /home/coder/oauth-provider/.env +echo "" >> /home/coder/oauth-provider/.env +echo "ENCRYPTION_SECRET=$encryption_secret" >> /home/coder/oauth-provider/.env -echo "[BOOTSTRAP] Script has finished running." \ No newline at end of file +echo "[BOOTSTRAP] Done!" \ No newline at end of file