aido-onyx/README.md
NaeemDosh b586639a70 docs: add 'Accessing the app' section to README
How to reach the app (http://localhost:3000), change the port (HOST_PORT),
auth behaviour, first-boot wait, health-check commands, and troubleshooting
the backend-unavailable banner.
2026-06-30 16:55:27 +05:00

236 lines
11 KiB
Markdown

# AIDO — Onyx Community Edition White-Label (Livtec AG)
A clean, upgrade-friendly white-label of [Onyx](https://github.com/onyx-dot-app/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](#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
```bash
# 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:
```bash
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):
```bash
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:
```bash
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:
```bash
# 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. Two 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.
---
## 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](#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.