mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:48:24 +01:00
brand.ts documents scripts/_brand.sh as the shell-side mirror of APP_NAME / APP_SLUG / APP_DOMAIN — the rebrand lever for shell consumers — but the file never existed. Shell scripts had no SSOT to read from, so a future rename had no lever on the shell side despite the docs claiming one (Ground Truth #2). - Create scripts/_brand.sh: the four canonical values + derived URLs, sourcing guard, and a note on why APP_SLUG (infra id: DB, systemd unit, paths) stays stable on a display rebrand. - Wire its one genuine consumer — scripts/hetzner/verify.sh now sources it for the FleetCrown health check + bridge domain (other products keep their own identifiers). Not a mass rewrite; slug-tied infra is intentionally untouched. - Add scripts/test/brand-sync.ts (test:brand-sync) enforcing that the shell mirror never drifts from brand.ts, wired into the pre-push hook. Turns "keep in sync" from a comment into a guarantee. tsc clean, eslint clean, 6/6 brand-sync assertions, drift case verified to fail.
29 lines
1.3 KiB
Bash
29 lines
1.3 KiB
Bash
# shellcheck shell=bash
|
|
# Shell-side mirror of the product brand. The canonical SSOT is
|
|
# src/config/brand.ts — this file exists so shell scripts have the same
|
|
# rebrand lever the TypeScript side does. Keep the four values below in sync
|
|
# with brand.ts (APP_NAME / APP_SLUG / APP_DOMAIN / BRIDGE_DOMAIN); nothing
|
|
# else here may redefine the brand.
|
|
#
|
|
# Usage: source "$(dirname "${BASH_SOURCE[0]}")/_brand.sh" # adjust path
|
|
#
|
|
# Note on slug vs. display name: APP_SLUG is also the infra identifier baked
|
|
# into the `fleetcrown` database, the `fleetcrown-app` systemd unit, and the
|
|
# repo path. Those intentionally do NOT change on a display rebrand — only
|
|
# APP_NAME (and possibly APP_DOMAIN) do. That is why a rename is "Tier A"
|
|
# (display + copy) and leaves the slug-tied infrastructure untouched.
|
|
|
|
# Guard against double-sourcing.
|
|
[ -n "${_FLEETCROWN_BRAND_SOURCED:-}" ] && return 0
|
|
_FLEETCROWN_BRAND_SOURCED=1
|
|
|
|
APP_NAME="FleetCrown" # display string
|
|
APP_SLUG="fleetcrown" # lowercase kebab; URLs, paths, infra ids
|
|
APP_DOMAIN="fleetcrown.orangecat.ch" # canonical hostname (no scheme)
|
|
BRIDGE_DOMAIN="bridge.orangecat.ch" # shared SSE fan-out host
|
|
|
|
APP_URL="https://${APP_DOMAIN}"
|
|
BRIDGE_URL="https://${BRIDGE_DOMAIN}/sse"
|
|
|
|
export APP_NAME APP_SLUG APP_DOMAIN BRIDGE_DOMAIN APP_URL BRIDGE_URL
|