aido-onyx/README.md
NaeemDosh bbfbad2ca7 Fix upstream build: swap Docker Hardened Images (dhi.io) for public node bases
Onyx's web Dockerfile now bases on Docker Hardened Images (dhi.io/node:24-debian13*),
which require a paid DHI subscription + `docker login dhi.io` — so `make build` fails
with a registry-login error for anyone without DHI access.

The apply overlay now rewrites those two FROM lines to the equivalent PUBLIC Docker
Hub node images (24-trixie / 24-trixie-slim, Debian 13 / glibc to match the DHI variant
the Dockerfile targets) and sets the runtime to the non-root `node` user, matching
upstream's posture — no docker login needed.

- branding.config.json: new build.baseImageReplacements map (config-driven)
- apply-branding.mjs: step 1b swaps DHI FROM lines (digest-stripped) + adds USER node;
  idempotent, no-op with a warning if the DHI bases are absent (safe across upstream changes)
- README: upgrade note #3 documenting the swap

Verified end-to-end: full web image builds on the public bases (no login), serves 200,
and runs correctly as the non-root node user.
2026-07-04 02:40:05 +05:00

12 KiB

AIDO — Onyx Community Edition White-Label (Livtec AG)

A clean, upgrade-friendly white-label of Onyx Community Edition. The logo, product name (AIDO), favicon, documentation links and every user-visible "Onyx" reference are rebranded — while every backend and infrastructure service still runs the official Onyx Docker images.

Community Edition only. This rebrands at the open-source default level. It does not enable or depend on Onyx's Enterprise white-label feature (the enterprise-settings / ee code paths). No commercial features are used.


How it works (the approach)

Onyx bakes its branding into the web frontend build — the name is a hardcoded || "Onyx" fallback, the logo is an inline SVG React component, and ~180 UI strings are compiled into the JS bundle. Pure runtime injection (env vars / volume mounts) therefore can't fully rebrand it. So we use a thin-overlay model:

┌─────────────────────────────────────────────────────────────────────┐
│  branding/branding.config.json   ← single source of truth (you edit) │
│            │                                                          │
│            ▼  node branding/apply-branding.mjs                        │
│  ./web     ← branding baked in (logo, favicon, name, links)          │
│            │                                                          │
│            ▼  docker compose build web_server                         │
│  livtec/aido-web:local   ← the ONLY image we build                   │
└─────────────────────────────────────────────────────────────────────┘
   backend · model-server · code-interpreter · postgres · redis ·
   opensearch · minio · nginx   →  ALL pulled from official images

Because everything except the web image comes straight from upstream, taking a new Onyx release is a re-checkout + re-run, not a fork to maintain (see Upgrading Onyx).


Layout

Path Purpose
branding/branding.config.json Single source of truth — name, assets, links, emails, rename rules.
branding/apply-branding.mjs Applies the overlay into ./web (fetch assets, swap logos, repoint favicon, codemod strings).
branding/templates/ Logo React components (filled from the config at apply time).
branding/assets/ Offline fallback copies of the fetched brand images.
docker-compose.yml One self-contained stack. Branded web built from ./web; everything else (incl. minio) uses official Onyx images.
Makefile make setup / rebrand / apply / build / up / down / verify.
.env.example Deployment env template (Onyx's standard vars — not branding).
web/, data/ Upstream Onyx checkout (sparse: web + deployment/data/nginx), fetched by make setup. Git-ignored.

Quick start

# 0a. one-time: fetch the upstream Onyx sources (sparse checkout)
make setup

# 0b. one-time: copy the env template and set real secrets
cp .env.example .env
#   In .env, set at minimum:
#     USER_AUTH_SECRET   → REQUIRED, the API won't start blank:  openssl rand -hex 32
#     MINIO_ROOT_PASSWORD / S3_AWS_SECRET_ACCESS_KEY → strong values
#     AUTH_TYPE          → `disabled` for a quick local run, or oidc/basic for real auth
#     HOST_PORT          → optional, defaults to 3000

# 1. apply branding, build the branded web image, start the whole stack
make rebrand

# …or step by step:
make apply     # bake branding into ./web
make build     # build livtec/aido-web:local
make up        # start the full stack (one docker-compose.yml)

make logs      # follow the web container
make verify    # assert no stray "Onyx" remains in the shipping source
make down      # stop

Requires Docker + Docker Compose v2 and Node ≥ 18 (for the apply script).


Accessing the app

Once the stack is healthy, open:

http://localhost:3000

  • Port — defaults to 3000 (nginx → web). Change it by setting HOST_PORT in .env (e.g. HOST_PORT=8088) and make restart. In production the nginx Traefik labels route via your ${FQDN} instead.

  • Login — depends on AUTH_TYPE in .env: disabled drops you straight in (good for a quick local check); oidc / basic present a login screen. The first account to register becomes the admin.

  • First boot takes a few minutes. The model server downloads embedding models (a few GB) and api_server waits on OpenSearch + minio + Postgres, so it's the last to go green — nginx only starts serving once api_server is healthy. Watch progress with:

    make logs                 # follow the web container
    docker compose -f docker-compose.yml ps     # see every service's health
    
  • Health checks (handy for confirming it's actually up, not just the UI shell):

    curl -I http://localhost:3000/            # web UI            → 200
    curl    http://localhost:3000/api/health  # backend via proxy → {"success":true,"message":"ok",...}
    
  • Not loading? If the page shows a branded "backend is currently unavailable" banner, api_server isn't healthy yet — give it another minute, or check docker compose -f docker-compose.yml logs api_server. The most common causes are an empty USER_AUTH_SECRET or a port already in use on the host (HOST_PORT).


Updating the branding

Everything is driven by branding/branding.config.json — you never hand-edit files under onyx/.

To change… Edit in branding.config.json
Product name brand.name
Logo / wordmark / favicon assets.*.url (remote) — fetched on next apply. Or drop files in branding/assets/ and run with --no-fetch.
Documentation / help / legal links links.* and rename.literals
A specific phrase swap rename.literals (exact string)
The global name swap rename.word (whole-word, case-sensitive)

Then:

make apply && make build && make restart

The codemod is surgical: it replaces whole-word, capitalised Onyx only — it never touches code identifiers (OnyxDocument, SvgOnyxLogo, OnyxBot), lowercase package refs (@onyx/…, onyx.app, onyx.ico), tests or stories. make verify confirms the result.

Swapping assets without network access

The apply script fetches the asset URLs and also caches them into branding/assets/. If you're offline, run node branding/apply-branding.mjs --no-fetch and it uses those cached files. To use brand-new files, drop them into branding/assets/ (matching the dest basenames: mark.png, wordmark.png, favicon.png) and run --no-fetch.

The AIDO wordmark already contains the symbol, so the composed "logo + wordmark" component renders the wordmark only to avoid a duplicated mark. If you supply a text-less wordmark later, restore the upstream composition in branding/templates/onyx-logo-typed.tsx.


Upgrading Onyx

Because we don't fork, upgrading is mechanical:

# 1. check out the new upstream release into ./onyx
cd onyx
git fetch --all --tags
git checkout <new-tag-or-commit>      # e.g. a tagged release
cd ..

# 2. bump the pin in branding/branding.config.json → upstream.pinnedCommit
# 3. re-apply + rebuild
make apply && make build && make restart

# 4. sanity check
make verify

Pin IMAGE_TAG in .env to the same release so the official backend/model images match the web build you're compiling. Three things to watch after an upgrade:

  1. Logo component paths — if upstream moves the logo files, make apply prints a logo target missing warning. Update the paths in apply-branding.mjs → logoInstalls.
  2. New unbranded strings — if upstream adds new "Onyx" copy, the global word rule catches it automatically; review make verify output and the apply summary.
  3. Base image / Docker Hardened Images — Onyx's web Dockerfile bases on DHI (dhi.io/node:*), which needs a paid Docker subscription + docker login dhi.io, so make build fails with a registry-login error without it. make apply automatically rewrites those FROM lines to the equivalent public Docker Hub node images and sets the runtime to the non-root node user — no login required. If a future upstream change renames the base and make apply warns "no dhi.io base images ... nothing to swap", update branding.config.json → build.baseImageReplacements.

What gets rebranded (touchpoints)

  • Product name — the || "Onyx" resolution fallbacks (settings/hooks.ts, settings/lib.ts) → AIDO; this also drives the browser tab title.
  • All UI strings — ~180 user-visible "Onyx" references across ~96 files (chat, onboarding, admin panels, modals, auth screen, error pages…).
  • Logo — the in-app symbol + wordmark components (incl. the inline OnyxLogoTypeIcon used on the error/health pages) render the AIDO assets.
  • Favicon — public/onyx.ico replaced and DynamicMetadata repointed to /branding/favicon.png.
  • Documentation & community links — DOCS_BASE_URL / docs.onyx.app, the Onyx Discord URL, www.onyx.app links and support@onyx.app → Livtec destinations (see rename.literals).
  • Notification bell — its text is generated by the backend (the official image we don't rebuild), so it's rebranded at render time in the web image: any "Onyx" in a notification is rewritten to the brand name, and upstream/EE product notifications (permissions-migration announcement, license/trial warnings) are suppressed. See Notifications below.

Notifications

Driven by branding.config.json → notifications:

Key Effect
sanitize: true Rewrites "Onyx" → brand name in any notification title/description at render time.
suppressTypes: [...] Hides whole categories (feature_announcement, release_notes, license_expiry_warning, two_day_trial_ending). Empty the list to show everything (still sanitized).

Operational notifications (reindex, approvals, connector errors, scheduled tasks) are always kept. The apply script generates web/src/lib/branding-runtime.ts from these values and routes the notifications hook through it.

Minor note: suppression hides items from the panel; the bell's unread count comes from a separate backend summary endpoint, so a suppressed-but-unread item can still nudge the counter. If you'd rather keep perfect counts, set suppressTypes: [] — sanitization alone removes the "Onyx" wording with no count impact.

Known limitations / notes

  • Deep doc paths (e.g. /admins, /deployment/...) consolidate onto the single Livtec help URL you provided; sub-pages won't exist there unless you publish them.
  • Theme colors from the old Lobe config are not applied (they were outside the agreed logo/name/favicon/links scope and Onyx's theming differs). The AIDO logo already carries the brand colors. Color theming can be added as a follow-up.
  • Tests / stories intentionally keep the literal "Onyx" (they assert the upstream default). They are excluded from the production Docker build, so this is harmless.
  • Backend/API identifiers, cookies (onyx_tid) and internal names are unchanged — they are not user-visible and renaming them would risk breaking the official images.