What the stack is, in git: .env committed, the secrets on the host
.env is what `podman compose` reads as is: the hosts, the versions and where the content comes from, so moving to tomtervel.no or bumping portal is a commit that the deploy workflow brings up. Nothing in it is secret. The secrets stay on kasse in secrets.env (the old .env's NATS password, OAuth2 secret and first person), and what the scripts render from it. gdo and the chat get NATS_URL from nats.env instead of interpolating the password, and portal takes its URLs and content settings from .env over portal.env, so a new host name reaches it without re-running bootstrap.sh. The deploy script on kasse is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5fbDmSQSb6u27EiEuwzoM
This commit is contained in:
9 files changed
+125
-83
No files matched your search
+2
-1
@@ -12,6 +12,7 @@
|
||||
set -eu
|
||||
cd "$(dirname "$0")"
|
||||
. ./.env
|
||||
[ -f secrets.env ] && . ./secrets.env
|
||||
K="kanidm -D idm_admin -H https://$ID_HOST"
|
||||
C=$OAUTH2_CLIENT_ID
|
||||
SA=portal-onboarding
|
||||
@@ -167,7 +168,7 @@ fi
|
||||
# Kanidm, at creation; a rerun keeps the one portal.env already has.
|
||||
setenv() { if grep -q "^$1=" portal.env; then sed -i "s|^$1=.*|$1=$2|" portal.env; else printf '%s=%s\n' "$1" "$2" >> portal.env; fi; }
|
||||
secret=$($K system oauth2 show-basic-secret $C 2>/dev/null | tail -1)
|
||||
sed -i "s|^OAUTH2_CLIENT_SECRET=.*|OAUTH2_CLIENT_SECRET=$secret|" .env
|
||||
sed -i "s|^OAUTH2_CLIENT_SECRET=.*|OAUTH2_CLIENT_SECRET=$secret|" secrets.env
|
||||
setenv OAUTH2_CLIENT_SECRET "$secret"
|
||||
if ! grep -q '^KANIDM_API_TOKEN=.' portal.env 2>/dev/null; then
|
||||
token=$($K service-account api-token generate $SA "portal" --readwrite 2>/dev/null | tail -1)
|
||||
|
||||
Reference in new issue
Block a user