Files
claudeandClaude Opus 5.5 7d6eec8963 Harmony on eom.dev: Supabase + Harmony on Kubernetes, Dex sign-in, Catppuccin, LiveKit
Kubernetes port of Harmony 1.9.6's self-host compose stack (Supabase Postgres,
GoTrue, PostgREST, Realtime, storage-api, imgproxy, Kong; Harmony web,
federation server/worker, Redis, media cache, Caddy router; LiveKit) at
harmony.eom.dev, api.harmony.eom.dev and voice.harmony.eom.dev.

- Dex is the only sign-in (GoTrue custom OIDC provider custom:dex); e-mail
  login off; listed addresses become instance admins.
- Upstream bootstrap.sh runs unchanged in a Job through a docker shim.
- Catppuccin Mocha/Latte stylesheet injected into the stock web image.
- Secrets generated once and kept in Secret/harmony.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:31:50 -05:00

48 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: MIT-0
# Harmony web image hook (/docker-entrypoint.d/50-eom-theme.sh, after the
# image's own 40-harmony-config.sh): link the eom.dev Catppuccin stylesheet
# from index.html so it applies on first paint, and recolour the browser
# chrome meta tags to match.
#
# Idempotent: a tag left by an earlier start is replaced, so a changed
# stylesheet gets a new ?v= even when the container is restarted rather than
# recreated. The query string is the cache buster: nginx serves /eom/* with
# max-age=86400, and Harmony's service worker (public/service-worker.js) keeps
# same-origin .css stale-while-revalidate keyed by the full URL. The worker
# lets navigations through to the network and nginx sends index.html no-cache,
# so the edited page itself needs no service-worker revision bump (unlike
# Funkwhale's precache manifest).
set -eu
html=/usr/share/nginx/html
index=$html/index.html
css=$html/eom/catppuccin.css
js=$html/eom/theme.js
if [ ! -f "$css" ]; then
echo "eom.dev: $css not found; theme not linked" >&2
exit 0
fi
tags="<link rel=\"stylesheet\" href=\"/eom/catppuccin.css?v=$(md5sum "$css" | cut -c1-12)\">"
# Optional: a blocking script, should one ever be needed before first paint.
if [ -f "$js" ]; then
tags="<script src=\"/eom/theme.js?v=$(md5sum "$js" | cut -c1-12)\"></script>$tags"
fi
sed -i \
-e 's|<script src="/eom/theme\.js?v=[0-9a-f]*"></script>||g' \
-e 's|<link rel="stylesheet" href="/eom/catppuccin\.css?v=[0-9a-f]*">||g' \
-e "s|</head>|$tags</head>|" \
-e 's|media="(prefers-color-scheme: dark)" content="#1e1f22"|media="(prefers-color-scheme: dark)" content="#11111b"|' \
-e 's|media="(prefers-color-scheme: light)" content="#ffffff"|media="(prefers-color-scheme: light)" content="#dce0e8"|' \
-e 's|name="msapplication-TileColor" content="#1e1f22"|name="msapplication-TileColor" content="#11111b"|' \
-e 's|name="msapplication-navbutton-color" content="#0EA5E9"|name="msapplication-navbutton-color" content="#cba6f7"|' \
"$index"
if grep -q '/eom/catppuccin.css?v=' "$index"; then
echo "eom.dev: Catppuccin stylesheet linked from $index"
else
echo "eom.dev: no </head> in $index; theme not linked" >&2
fi