Compare commits
1
Commits
kino
..
access-log
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fc2966b89 |
No files matched your search
@@ -39,12 +39,6 @@ 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 }}
|
||||
@@ -132,15 +126,6 @@ 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.
|
||||
@@ -152,8 +137,6 @@ 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
|
||||
@@ -203,12 +186,6 @@ 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
|
||||
|
||||
@@ -19,8 +19,8 @@ Nothing about the vel's members or records depends on anyone else's
|
||||
host: the login and the site are the vel's own.
|
||||
|
||||
The site ran portal 0.19 on NATS until the move to 1.0, which
|
||||
`move-1.0/` is. The chat it had (cnats) spoke to portal over NATS and went
|
||||
with it; uhhm/kino, which dials a 1.0 site, takes its place ("The chat").
|
||||
`move-1.0/` is. The chat (cnats) spoke to portal over NATS and went
|
||||
with it; the one that dials a 1.0 site (uhhm/kino) has no image yet.
|
||||
|
||||
## First start
|
||||
|
||||
@@ -47,7 +47,6 @@ it, and `host-caddy/tomtervel.no` is its file for them
|
||||
|
||||
- portal → `127.0.0.1:3050`
|
||||
- kron → `127.0.0.1:3080`
|
||||
- kino → `127.0.0.1:3070`
|
||||
- rauthy → `127.0.0.1:8090`
|
||||
|
||||
## Accounts and groups
|
||||
@@ -151,8 +150,6 @@ Run workflow**. Set them with `gt` (`gt variable set NAME --body ...`,
|
||||
| `RAUTHY_BOOTSTRAP_API_KEY`, `RAUTHY_BOOTSTRAP_API_KEY_SECRET` | secret | repo | optional, Rauthy's first start only: a short-lived key (base64 of `{"name","exp","access"}`, secret 64+ alphanumerics) that makes the OIDC clients through the API; read into an empty database, ignored after |
|
||||
| `RAUTHY_API_KEY`, `RAUTHY_LANGUAGE` | secret, variable | repo | portal makes accounts in Rauthy (`<name>$<secret>`, made in Rauthy's admin), in `nb` |
|
||||
| `VIPPS_LOGIN_CLIENT_ID`, `VIPPS_LOGIN_CLIENT_SECRET` | variable, secret | repo | Vipps Login (the login sales unit's keys from portal.vippsmobilepay.no): the deploy keeps Vipps as a sign-in provider in Rauthy with them (`rauthy-providers.sh`) |
|
||||
| `CHAT_HOST`, `KINO_RELEASE` | variable | repo | the chat: where it answers (`samtaler.tomtervel.no`, DNS in `dns/`, a kasse Caddy block) and which kino image (`0.1.2`). Needed once `COMPOSE_PROFILES` has `chat` |
|
||||
| `CHAT_OAUTH2_CLIENT_SECRET` | secret | repo | the secret of the Rauthy client `chat` ("Rauthy" below), which kino signs people in with |
|
||||
| `PAY_HOST` | variable | repo | where the money service answers: `betaling.tomtervel.no` (DNS in `dns/`, a kasse Caddy block) |
|
||||
| `VIPPS_MSN` | variable | repo | the Medlemskap sales unit's merchant serial number, `1192072` |
|
||||
| `VIPPS_CLIENT_ID`, `VIPPS_CLIENT_SECRET`, `VIPPS_SUBSCRIPTION_KEY` | secret | repo | the Medlemskap sales unit's ePayment keys (For developers, API keys, production), read by kron alone. With all four set kron asks the site for nothing |
|
||||
@@ -220,36 +217,6 @@ Going live, in order:
|
||||
Nothing here touches the Vippsnummer (500396): people may keep paying
|
||||
there, and the treasurer marks those by hand as before.
|
||||
|
||||
## The chat
|
||||
|
||||
The vel's conversations are uhhm/kino at `samtaler.tomtervel.no`: every
|
||||
group the content names is a room, and the site decides who gets in.
|
||||
kino signs people in at Rauthy as the client `chat`, dials the site
|
||||
over dhd/1 beside gdo and kron, and keeps what is said in a file of its
|
||||
own (`kino_data`). What was said in the old chat did not come along.
|
||||
|
||||
To turn it on:
|
||||
|
||||
1. Set the variables `CHAT_HOST` (`samtaler.tomtervel.no`) and
|
||||
`KINO_RELEASE` (`0.1.2`), and the secret `CHAT_OAUTH2_CLIENT_SECRET`:
|
||||
the Rauthy client `chat` exists from the old chat, with the redirect
|
||||
`https://samtaler.tomtervel.no/auth/callback`; its secret is in
|
||||
Rauthy's admin, under the client.
|
||||
2. Install the `deploy-tomtervel` from this repo on kasse (its first
|
||||
lines say how): the one before this does not put `kino.env` in
|
||||
place.
|
||||
3. Add `chat` to `COMPOSE_PROFILES` (`pay,chat`) and run the deploy.
|
||||
kino starts and says its key in its log (`podman logs
|
||||
infrastructure_kino_1`). The site does not know that key yet, so
|
||||
kino has no rooms to show until the next step.
|
||||
4. Add that key to the variable `DHD_KEYS` as `<key>=rooms,watch,may`,
|
||||
beside gdo's and kron's, and run the deploy again. Portal starts with
|
||||
the new key, and kino's next dial is taken.
|
||||
|
||||
`https://samtaler.tomtervel.no/` then asks for a sign-in, and a member
|
||||
of a group finds its room. The host Caddy's block and the DNS record
|
||||
are the old chat's, on the same port.
|
||||
|
||||
## Rauthy
|
||||
|
||||
[Rauthy](https://github.com/sebadob/rauthy) at `RAUTHY_HOST`
|
||||
|
||||
+3
-37
@@ -111,8 +111,6 @@ services:
|
||||
- "127.0.0.1:3050:3000"
|
||||
# kron (betaling.tomtervel.no -> here).
|
||||
- "127.0.0.1:3080:3080"
|
||||
# kino (samtaler.tomtervel.no -> here).
|
||||
- "127.0.0.1:3070:3070"
|
||||
|
||||
portal:
|
||||
build:
|
||||
@@ -230,40 +228,9 @@ services:
|
||||
# content repo's reload reaches the site over HTTPS, so no in-compose
|
||||
# runner - and no docker.sock/podman.sock mount - is needed here.
|
||||
|
||||
# The vel's conversations (uhhm/kino): every group the content names is
|
||||
# a room, and the site decides who gets in. kino dials the site over
|
||||
# dhd/1 as gdo and kron do, and keeps its history in a file of its own
|
||||
# in kino_data; what was said in the old chat (cnats, on NATS) did not
|
||||
# come along. Reached by kasse's host Caddy on the published 3070
|
||||
# (samtaler.tomtervel.no). A profile, since it needs its sign-in
|
||||
# secret: COMPOSE_PROFILES has `chat` once CHAT_HOST, KINO_RELEASE and
|
||||
# CHAT_OAUTH2_CLIENT_SECRET are set.
|
||||
#
|
||||
# The site must name kino's key in DHD_KEYS as `<key>=rooms,watch,may`;
|
||||
# kino says its key as it starts (README.md, "The chat").
|
||||
kino:
|
||||
profiles: ["chat"]
|
||||
image: project.uhhm.no/uhhm/kino:${KINO_RELEASE:-no-tag-set}
|
||||
restart: unless-stopped
|
||||
network_mode: "service:net"
|
||||
env_file:
|
||||
- path: kino.env
|
||||
required: false
|
||||
environment:
|
||||
PORTAL_DHD: ${PORTAL_DHD:-}
|
||||
# Must be the portal's own: a room names its site.
|
||||
SITE_NAME: tomtervel
|
||||
# Rauthy, and the client it knows the chat as.
|
||||
OIDC_ISSUER: ${OIDC_ISSUER}
|
||||
OAUTH2_CLIENT_ID: chat
|
||||
PUBLIC_URL: https://${CHAT_HOST:-no-host-set}
|
||||
COOKIE_SECURE: "true"
|
||||
# 3070, not 3000: in the shared network 3000 is portal's.
|
||||
LEPTOS_SITE_ADDR: 0.0.0.0:3070
|
||||
volumes:
|
||||
- kino_data:/var/lib/kino
|
||||
depends_on:
|
||||
- portal
|
||||
# The vel's conversations are not in this stack for now: the chat that
|
||||
# ran here (cnats) spoke to portal over NATS, and the one that dials a
|
||||
# 1.0 site (uhhm/kino) is not published as an image yet.
|
||||
|
||||
# Where uploads go: the pictures and documents a desk attaches, and what
|
||||
# `portal import` brings in. One node on this host, reachable only inside
|
||||
@@ -282,7 +249,6 @@ volumes:
|
||||
portal_data:
|
||||
gdo_data:
|
||||
kron_data:
|
||||
kino_data:
|
||||
caddy_data:
|
||||
caddy_config:
|
||||
nats_data:
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ root=/srv/tomtervel/infrastructure
|
||||
stage=/var/lib/gitea-runner/tomtervel-env
|
||||
files=(.env portal.env)
|
||||
# Written only when the site runs what needs it (Rauthy, the money
|
||||
# service under the pay profile, the chat under the chat profile).
|
||||
optional=(rauthy.env kron.env kino.env)
|
||||
# service under the pay profile).
|
||||
optional=(rauthy.env kron.env)
|
||||
|
||||
[ -d "$root/.git" ] || { echo "no checkout at $root - bootstrap it first" >&2; exit 1; }
|
||||
for f in "${files[@]}"; do
|
||||
|
||||
@@ -6,6 +6,18 @@
|
||||
|
||||
tomtervel.no {
|
||||
reverse_proxy 127.0.0.1:3050
|
||||
# Every request, with how long it took and what it was answered:
|
||||
# what to read when the site was slow or a page said it could not
|
||||
# reach the server. Addresses and what was asked for are in it, so
|
||||
# it is kept two weeks and no longer. Caddy runs as `caddy`:
|
||||
# `sudo install -d -o caddy -g caddy /var/log/caddy` once.
|
||||
log {
|
||||
output file /var/log/caddy/tomtervel.no.log {
|
||||
roll_size 20MiB
|
||||
roll_keep 5
|
||||
roll_keep_for 336h
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
www.tomtervel.no {
|
||||
|
||||
Reference in new issue
Block a user