kino in the stack: the vel's chat beside the 1.0 site
The chat left with NATS at the move to 1.0. uhhm/kino 0.1.2 has an image now, so it comes back as a service under the profile `chat`: it shares the site's network namespace like gdo and kron, dials the site over dhd/1, signs people in at Rauthy as the client `chat`, listens on 3070 (the host Caddy's samtaler.tomtervel.no block already points there) and keeps its history in kino_data. The deploy takes CHAT_HOST, KINO_RELEASE and the secret CHAT_OAUTH2_CLIENT_SECRET, refuses the profile without them, and writes kino.env; deploy-tomtervel puts that file in place. README.md, "The chat", has the four steps, the last being kino's key into DHD_KEYS. Nothing changes until COMPOSE_PROFILES has `chat`: the profile keeps the service out, and the new published port (3070) has nothing behind it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5fbDjRr9xfrtcDzcdJNr2
This commit is contained in:
4 files changed
+97
-7
No files matched your search
@@ -39,6 +39,12 @@ jobs:
|
||||
PORTAL_RELEASE: ${{ vars.PORTAL_RELEASE }}
|
||||
GDO_RELEASE: ${{ vars.GDO_RELEASE }}
|
||||
KRON_RELEASE: ${{ vars.KRON_RELEASE }}
|
||||
# The chat (README.md, "The chat"): where it answers, which kino,
|
||||
# and the secret of the Rauthy client `chat`. With the profile
|
||||
# `chat` all three must be set.
|
||||
CHAT_HOST: ${{ vars.CHAT_HOST }}
|
||||
KINO_RELEASE: ${{ vars.KINO_RELEASE }}
|
||||
CHAT_OAUTH2_CLIENT_SECRET: ${{ secrets.CHAT_OAUTH2_CLIENT_SECRET }}
|
||||
COMPOSE_PROFILES: ${{ vars.COMPOSE_PROFILES }}
|
||||
CONTENT_REPO: ${{ vars.CONTENT_REPO }}
|
||||
CONTENT_BRANCH: ${{ vars.CONTENT_BRANCH }}
|
||||
@@ -126,6 +132,15 @@ jobs:
|
||||
[ -z "$missing" ] || { echo "COMPOSE_PROFILES has pay, but not set:$missing"; exit 1; }
|
||||
fi
|
||||
|
||||
chat=
|
||||
case ",$COMPOSE_PROFILES," in *,chat,*) chat=1;; esac
|
||||
if [ -n "$chat" ]; then
|
||||
for v in CHAT_HOST KINO_RELEASE CHAT_OAUTH2_CLIENT_SECRET; do
|
||||
[ -n "${!v}" ] || missing="$missing $v"
|
||||
done
|
||||
[ -z "$missing" ] || { echo "COMPOSE_PROFILES has chat, but not set:$missing"; exit 1; }
|
||||
fi
|
||||
|
||||
umask 077
|
||||
mkdir -p "$STAGE"
|
||||
# Interpolated by compose: hosts, versions, profiles. No secret.
|
||||
@@ -137,6 +152,8 @@ jobs:
|
||||
PORTAL_DHD=$PORTAL_DHD
|
||||
COMPOSE_PROFILES=$COMPOSE_PROFILES
|
||||
PAY_HOST=$PAY_HOST
|
||||
CHAT_HOST=$CHAT_HOST
|
||||
KINO_RELEASE=$KINO_RELEASE
|
||||
RAUTHY_HOST=$RAUTHY_HOST
|
||||
OIDC_ISSUER=$OIDC_ISSUER
|
||||
EOF
|
||||
@@ -186,6 +203,12 @@ jobs:
|
||||
if [ -n "${!name}" ]; then echo "$name=${!name}"; fi
|
||||
done
|
||||
} > "$STAGE/kron.env"
|
||||
# kino: the secret it signs people in with. Only with the
|
||||
# profile, so a stack without the chat gets no file.
|
||||
if [ -n "$chat" ]; then
|
||||
echo "OAUTH2_CLIENT_SECRET=$CHAT_OAUTH2_CLIENT_SECRET" > "$STAGE/kino.env"
|
||||
sed -i 's/\$/$$/g' "$STAGE/kino.env"
|
||||
fi
|
||||
# Rauthy's secrets. The first admin is the vel's first person.
|
||||
cat > "$STAGE/rauthy.env" <<EOF
|
||||
ENC_KEYS=$RAUTHY_ENC_KEY
|
||||
|
||||
Reference in new issue
Block a user