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>
8.1 KiB
eom.dev Catppuccin theme for Harmony
catppuccin.css turns Harmony's stock Dark preset into Catppuccin
Mocha and its stock Light preset into Catppuccin Latte, with mauve
as primary/accent and lavender for secondary and hover. The sign-in pages
(AuthShell.vue) are also recoloured. Fonts are left alone, so the Appearance
font picker (Figtree or pixel) still works. Written against Harmony 1.9.6.
theme.sh is the web container's entrypoint hook. Mount it as
/docker-entrypoint.d/50-eom-theme.sh with mode 0755, so it runs after the
image's 40-harmony-config.sh. It mounts with catppuccin.css at
/usr/share/nginx/html/eom/. The hook does three things:
- adds
<link rel="stylesheet" href="/eom/catppuccin.css?v=<md5>">before</head>; - recolours the
theme-color,msapplication-TileColorandmsapplication-navbutton-colormeta tags; - if
/usr/share/nginx/html/eom/theme.jsexists, adds a blocking<script src="/eom/theme.js?v=<md5>">in front of the link. No theme.js ships today.
It is idempotent. Each run removes the tags the previous run added and adds
fresh ones, so a changed stylesheet gets a new ?v= even after a plain
restart.
How it works, and why CSS-only
Harmony keeps no theme in its stylesheets. applyPresetTheme() in
src/composables/useVisualTheme.ts writes the preset colours inline on
<html> with style.setProperty, and then sets data-theme /
data-theme-type. Custom themes do the same through applyThemePalette() in
src/utils/colorUtils.ts, which sets data-theme="custom". Skins set
data-skin="<id>".
The stylesheet is therefore scoped to
:root[data-theme="dark"|"light"]:not([data-skin]). The variables Harmony
writes inline carry !important, because a stylesheet !important beats an
inline declaration that has none. Variables that only exist in
design-system.css carry no !important.
Before the bundle sets data-theme, :root:not([data-theme]) follows
prefers-color-scheme. That is Harmony's own signed-out behaviour, so the
first paint already matches.
The alternative was a theme.js that seeds a custom theme into users'
appearance settings. I rejected it:
- a seeded custom theme becomes the user's stored choice and syncs to their profile;
- it can only produce an OKLCH-generated approximation, not exact Catppuccin;
- it can't apply to signed-out pages, because those follow the system scheme and persist nothing;
- settings are user- and instance-scoped in localStorage
(
harmony_i_<instance>_user_<id>_visual-theme).
Hooking setProperty from JS would be fragile. Because the CSS uses
!important, getComputedStyle also returns the Catppuccin values, so
Harmony's JS that reads them gets mauve:
applyContrastFillsin high-contrast mode;- the Theme Customizer's starting values.
Tradeoff: on the stock Dark and Light presets, the Appearance "CSS variable overrides" editor can't change the variables listed under "!important" below; the stylesheet wins. Overrides of every other variable still work. Anyone who wants to tweak those colours can pick a custom theme (the customizer starts from the current Catppuccin values) or Midnight.
User choice is unaffected:
- Midnight, every custom theme and community preset, and every skin render exactly as upstream;
- switching back to Dark or Light brings Catppuccin back.
The "Powered by Harmony" attribution (src/components/auth/AuthShell.vue,
a.powered-by; not AuthComponent.vue in 1.9.6) is not targeted. Its colours
come from the recoloured shell tokens, and it stays legible:
| Flavour | Text colour | Background | Contrast |
|---|---|---|---|
| Mocha | #a6adc8 |
#11111b |
8.4:1 |
| Latte | #5c5f77 |
#dce0e8 |
4.7:1 |
The "Harmony" name inside it is drawn in mauve. No Harmony logo or artwork is added or changed.
Service worker
public/service-worker.js (v3.9) does not touch navigations, and nginx
serves /index.html no-cache. The precached / is never served for a
navigation, so unlike Funkwhale no revision patch is needed. Same-origin
.css is served stale-while-revalidate, keyed by the full URL, so the ?v=
hash is what busts it. nginx also gives /eom/* max-age=86400.
Upstream things this depends on (re-check on upgrade)
-
DOM hooks.
useVisualTheme.tsandcolorUtils.tsstill setdata-themetodark,light,midnightorcustom, and setdata-skinwhen a skin is active. -
Variables written inline by the presets (
!importanthere). These are written byapplyPresetThemeandapplySurfaceSemanticTokens:--harmony-primary, plus its-hover,-light,-alpha,-alpha-lightand-alpha-strongvariants;- the same six for
--harmony-secondaryand--harmony-accent; --h-primary,--h-primary-light,--h-primary-dark,--h-brand;--background-primarythrough--background-senary;--background-{primary,secondary,tertiary,senary}-alpha;--text-primary,--text-secondary,--text-tertiary,--text-muted;--border-primary,--border-secondary,--border-hover,--border-focus,--border-color;--icon-primary,--icon-secondary,--icon-active;--nav-rail-button-bg,--nav-rail-button-icon,--channel-item-hover-bg,--channel-item-selected-bg.
If a new release writes more colour variables inline, add them here with
!important, or they will show stock values. -
Stylesheet-only variables (
src/assets/design-system.css, no!important).--text-on-primary,--text-inverse,--text-link,--text-danger,--text-success;--background-septenary,--background-floating;--icon-tertiary,--icon-muted;--success,--success-hover,--error,--error-hover,--error-fill,--error-fill-hover,--warning,--info;--status-online,--status-away,--status-busy,--status-offline;--color-primary-rgb,--h-brand-rgb,--color-success-rgb,--color-warning-rgb,--color-danger-rgb;--tooltip-bg,--tooltip-text,--tooltip-arrow;--mention-highlight.
The selectors here have specificity 0,3,0, which beats design-system's
:root[data-theme-type="light"]at 0,2,0. -
Glass effects off.
[data-disable-blur="true"]makes the*-alphasurfaces opaque, and is mirrored here. -
Sign-in pages.
AuthShell.vuekeeps its local tokens on.auth-wrapper(--page,--surface,--surface-light,--surface-hover,--border,--text,--text-muted,--text-dim,--autofill-bg). They are overridden with.auth-wrapper.auth-wrapperto outrank the scoped light-mode rule. -
index.html meta values. The hook's
sedreplaces the stock values#1e1f22,#ffffffand#0EA5E9. If upstream changes them, the replacement silently stops matching; the stylesheet link is unaffected. -
Not overridden. Hard-coded colours inside components, which are mostly
var(--harmony-primary, #0EA5E9)fallbacks that never apply; skins; the Midnight preset;manifest.json'stheme_color.
Verify
- In the running pod, run
grep -o '/eom/catppuccin.css?v=[0-9a-f]*' /usr/share/nginx/html/index.html. It should print one match, andcurl -I https://harmony.eom.dev/eom/catppuccin.cssshould return 200text/css. - Signed out, open https://harmony.eom.dev. With the OS dark, the page should be
crust (
#11111b), the card base (#1e1e2e) and the Log in button mauve (#cba6f7) with dark text. With the OS light, the page should be#dce0e8and the button#8839efwith white text. "Powered by Harmony" should be visible under the card. - In devtools, run
getComputedStyle(document.documentElement).getPropertyValue('--harmony-primary'). It should return#cba6f7on Dark and#8839efon Light. The inlinestyleattribute still shows Harmony's#0EA5E9; that is expected. - Signed in, go to Settings → Appearance:
- Dark and Light should look Catppuccin;
- Midnight, any community preset or custom theme, and any skin should look exactly like upstream;
- switching back should restore Catppuccin.
- After changing the CSS, restart the pod and check that the
?v=hash in index.html changed.