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>
54 lines
1.5 KiB
Bash
54 lines
1.5 KiB
Bash
#!/bin/bash
|
|
# SPDX-License-Identifier: MIT-0
|
|
# Stand-in for the `docker` CLI so Harmony's own self-host/bootstrap.sh runs
|
|
# unchanged in the bootstrap Job. bootstrap.sh talks to the database container
|
|
# with `docker exec <db> psql ...` and `docker cp`; here the Job's own psql
|
|
# reaches Postgres over the network at $DB_HOST instead.
|
|
#
|
|
# docker exec [-e K=V]... [-i] <container> CMD... -> CMD with K=V, PGHOST=$DB_HOST;
|
|
# "-h 127.0.0.1"/"localhost" -> $DB_HOST
|
|
# docker cp SRC <container>:DST -> cp -r SRC DST
|
|
# docker inspect -f '{{.State.Running}}' ... -> true (the Job waits on the db Service)
|
|
# docker inspect / ps / compose (anything else) -> nothing: no compose project, so
|
|
# bootstrap.sh polls the schemas itself
|
|
set -euo pipefail
|
|
: "${DB_HOST:?DB_HOST must name the Postgres service}"
|
|
|
|
cmd="${1:-}"
|
|
shift || true
|
|
case "$cmd" in
|
|
exec)
|
|
envs=()
|
|
while [[ $# -gt 0 && "$1" == -* ]]; do
|
|
case "$1" in
|
|
-e) envs+=("$2"); shift 2 ;;
|
|
*) shift ;;
|
|
esac
|
|
done
|
|
shift # the container name
|
|
args=()
|
|
for a in "$@"; do
|
|
case "$a" in
|
|
127.0.0.1|localhost) args+=("$DB_HOST") ;;
|
|
*) args+=("$a") ;;
|
|
esac
|
|
done
|
|
exec env PGHOST="$DB_HOST" ${envs[@]+"${envs[@]}"} "${args[@]}"
|
|
;;
|
|
cp)
|
|
src="$1"
|
|
dst="${2#*:}"
|
|
rm -rf "$dst"
|
|
cp -r "$src" "$dst"
|
|
;;
|
|
inspect)
|
|
case "$*" in
|
|
*State.Running*) echo true ;;
|
|
*) echo "" ;;
|
|
esac
|
|
;;
|
|
*)
|
|
exit 0
|
|
;;
|
|
esac
|