Commit graph

56 commits

Author SHA1 Message Date
934dd8f286 Reusable .env update/migration script.
Reads a template file (default: .env.template) and merges it with an existing .env file (default: .env), then writes the result.
2026-11-20 22:29:19 +01:00
0c507ebfea Traefik Allowlist V2 2026-11-20 21:19:47 +01:00
7506695e7d Traefik IP Allowlist 2026-11-20 20:39:57 +01:00
64189e6140 Support a prebuilt web image (build once, pull on each instance)
Parameterize the web_server image + pull policy so an instance can pull a
centrally-built image from a private registry instead of running the
~16 GB `make build` locally:

  image:       ${AIDO_WEB_IMAGE:-livtec/aido-web:local}
  pull_policy: ${AIDO_WEB_PULL_POLICY:-never}

Defaults keep the current local-build behaviour, so build hosts and local
dev are unaffected. Add docs/PREBUILT-IMAGE.md with the build-once /
push-to-private-registry / pull-everywhere workflow.
2026-11-19 19:47:51 +01:00
0d7f51d26d Update .env.example 2026-11-12 20:14:04 +01:00
cfb3b7d418 fix(voice): route Onyx 5.0.3 STT/TTS to LocalAI Whisper endpoint
Replace the broken sed-based entrypoint from 4.8.2 with a runtime Python
patch script for Onyx 5.0.3 voice module compatibility.

Background
----------
Onyx 5.0.3 refactored the voice subsystem to use raw aiohttp instead of
the OpenAI Python SDK. The old /v1 suffix in our LocalAI base URL now
causes a double-prefix (https://.../v1/v1/audio/...) and 404s.
Additionally, line numbers and constants shifted, making the previous
sed patches fail silently.

Changes
-------
* api_server: override CMD with a startup sequence that runs
  patch_voice.py before uvicorn.
* Add backend/scripts/patch_voice.py that patches:
  - factory.py: fallback api_base, stt_model and api_key when no
    voice provider is configured in the Onyx admin UI.
  - providers/openai.py: DEFAULT_OPENAI_API_BASE (without /v1),
    realtime model constants, and optional chunked-STT language
    injection (WHISPER_LANGUAGE=de).
* Mount patch script read-only into /app/scripts/.
* Env: WHISPER_API_BASE now points to the origin only
  (https://aido-whisper-ch.livtec.cloud), leaving /v1 path assembly
  to Onyx code.
* Env: WHISPER_MODEL=whisper-1, WHISPER_LANGUAGE=de.

Migration
---------
The previous entrypoint sed block is removed. No admin UI voice
provider configuration is required; the patch is fully transparent.

Refs: aido-whisper-ch deployment, Onyx 5.0.3 upgrade
2026-11-12 20:10:14 +01:00
806d3b2160 Revert "fix(api_server): update voice STT patch for Onyx 5.0.3 image layout"
This reverts commit f51a35732c.
2026-11-12 20:04:19 +01:00
f51a35732c fix(api_server): update voice STT patch for Onyx 5.0.3 image layout
The previous Python-heredoc patch (written for 4.8.2) broke silently on
5.0.3 because:

- The Docker image installs the backend at a different path than
  /app/onyx/ (repo restructured to backend/onyx/ in 5.0.0). Hardcoded
  paths caused every patch to no-op.
- 5.0.3 switched from the OpenAI Python SDK (which expects /v1 in
  base_url) to raw aiohttp that appends /v1/audio/... to the base URL
  itself. The old /v1 suffix in the LocalAI URL produced a double
  prefix: /v1/v1/audio/transcriptions → 404.

Changes:
- Replace Python heredoc with shell sed + dynamic path resolution
  (python -c 'import ...' with prefix fallback loop).
- Remove /v1 from LocalAI base URL (https://aido-whisper-ch.livtec.cloud).
- Add set -e so real shell errors are not swallowed.
- Add inline grep verification after each patch block so docker logs
  shows exactly which patterns matched.
- Language injection now tries both aiohttp FormData (add_field) and
  dict-literal anchors instead of one fixed SDK-call string.
- Remove corruption-cleanup logic (repeated or "..." chains) that was
  only needed because the old sed ran non-idempotently on a persisted
  volume. The new approach is idempotent by design.
- Annotate VOICE_DISABLE_STREAMING_STT as inert in 5.0.3 (not
  referenced in the voice module source); kept for forward-compat.
2026-11-12 19:58:27 +01:00
bc3dd56e00 Hide LLM Gateway / Connectors / Usage tabs in user settings
Client manages these centrally, so end users should not see them. Filter
the settings tab list in app/app/settings/layout.tsx (patchFile, string-
anchored + idempotent). The routes still exist but are no longer linked.
Verified the anchors against the v5.0.3 source.
2026-11-11 18:39:18 +01:00
fa1f82767c Find/Replace
"Open-Source-KI-Plattform": "Powered by Livtec",
2026-11-10 19:31:25 +01:00
145725b6b1 Fix v5.0.3 build: type-safe notification gate + robust SMB overlay
Two issues from the client's make rebrand on v5.0.3:

1. TypeScript build failed (implicit-any in AccountPopover): the
   conditional-spread notification item lost contextual typing. Reworked
   to leave useSettingsItems untouched (compiles as upstream) and instead
   drop the "notifications" row in the component for non-admins:
   const items = isAdmin ? rawItems : rawItems.map(group =>
     filter out row.id === "notifications"). Uses only standard narrowing
   (item.kind, row.id), so no fragile typing. Still gates on isAdmin.

2. SMB UI patch did not apply: git-apply is brittle about context lines
   and re-runs (make rebrand does not re-clone). Converted the SMB
   overlay from a git-apply .patch to string-anchored patchFile edits
   (same mechanism as the other overlays) — idempotent and tolerant of
   context drift. Removed the now-unused branding/smb/smb-ui.patch.

Verified every anchor against the real v5.0.3 sources; v5's own SearchCard
already reads document.metadata, confirming the metadata access type-checks.
2026-11-10 16:34:42 +01:00
2c42e9fd03 Upgrade to Onyx v5.0.3; gate notifications on full-admin only
- Pin upstream to v5.0.3 (branding/branding.config.json).
- Notifications: gate on isAdmin (FULL_ADMIN_PANEL_ACCESS) instead of
  hasAdminAccess. hasAdminAccess also returns true for group/agent
  managers, so manage-agents users were still seeing the bell/panel. Now
  only full admins see notifications; everyone else gets nothing.
  Re-authored for v5's refactored AccountPopover (useSettingsItems hook +
  Dropdown views model): hide the notifications menu row and the account-
  button unread badge for non-admins.
- Re-sync the overlay onto v5.0.3:
  - smb-ui.patch regenerated (v5 moved the doc types and uses
    openExternalLink); still 2 files, keyed on metadata.smb_source,
    applies clean.
  - SettingsPage language limit re-synced to v5's LOCALE_OPTIONS spread
    (was SUPPORTED_LOCALES.map).
  - Verified against v5.0.3: all patch anchors match, icons regex matches,
    logo/favicon target paths exist.
2026-11-09 21:39:49 +01:00
8143cc123f fix(compose): repair STT after Onyx 5.0.3 upgrade and fix silent alembic skip
fix(compose): repair STT after Onyx 5.0.3 upgrade and fix silent alembic skip

- Replace fragile runtime `sed` patches with idempotent Python patching in
 api_server entrypoint. The old `sed` heuristics broke because Onyx 5.x
 refactored the voice provider to use the OpenAI SDK
 (`client.audio.transcriptions.create`) instead of raw HTTP payloads,
 causing the language parameter to never be injected and the model
 fallback to corrupt factory.py with chained `or` expressions.

- Add `WHISPER_MODEL` env override (defaults to `whisper-1`) so the
 transcription payload uses the exact model name exposed by the backend
 proxy. Fixes 404 "model not found" against self-hosted Whisper/LiteLLM.

- Fix critical Docker bug where `command` was passed as an argument to
 the custom `entrypoint` and silently ignored. `alembic upgrade head`
 now runs inside the entrypoint before Uvicorn starts.

- Merge upstream compose improvements:
 * Add json-file logging (50m/6 rotation) to web_server, relational_db,
   and code-interpreter
 * Add code-interpreter healthcheck
 * Include optional MCP server block (commented out)

- Preserve existing Livtec customizations:
 * Voice endpoint redirected to aido-whisper-ch.livtec.cloud
 * WHISPER_LANGUAGE=de injected into SDK transcribe() call
 * Custom livtec/aido-web:local branded image
 * Bind mounts for logs, caches, and file-system
2026-11-08 11:37:02 +01:00
9cedefa4fc Update .env.example 2026-11-05 12:33:30 +01:00
83fb8b299e Update docker-compose.yml 2026-10-01 23:50:05 +02:00
c3639fc4c7 Moved smb-connector to own repo aido-smb-connector 2026-10-01 23:33:55 +02:00
3e7309f588 fix(compose): merge upstream improvements and fix silent alembic skip
fix(compose): merge upstream improvements and fix silent alembic skip

- Fix critical Docker behavior bug where the separate `command` block on
  `api_server` was being passed as an argument to the custom `entrypoint`
  and silently ignored. `alembic upgrade head` is now executed inside
  the entrypoint before Uvicorn starts, ensuring DB migrations run.

- Add missing upstream logging blocks (json-file, 50m/6 rotation) to
  `web_server`, `relational_db`, and `code-interpreter`.

- Add upstream `healthcheck` to `code-interpreter` for accurate status.

- Include optional upstream `mcp_server` service block (commented out).
2026-10-01 23:26:34 +02:00
e6ab01f6e2 feat(voice): override OpenAI voice defaults for custom Whisper proxy
feat(voice): override OpenAI voice defaults for custom Whisper proxy

Replace api_server command with entrypoint that patches Onyx voice
provider files at runtime. Required because v4.8.x UI does not allow
setting api_base/stt_model for OpenAI Whisper.

- Force chunked HTTP STT via VOICE_DISABLE_STREAMING_STT=true
- Redirect all OpenAI voice constants to aido-whisper-ch.livtec.cloud
- Add WHISPER_LANGUAGE=de env var for transcription language
2026-10-01 22:33:30 +02:00
18eb30343e Delete litellm-config.yaml 2026-10-01 00:06:01 +02:00
9903f9dca7 refactor: extract LiteLLM into dedicated aido-litellm stack
LiteLLM proxy, database and Redis are no longer
managed by this repository. They have moved to aido-litellm.

- Remove litellm-proxy, litellm-db, litellm-redis services from
  docker-compose.yml
- Remove litellm-config.yaml (now maintained in aido-litellm)
- Prune LiteLLM-specific environment variables from .env.example
2026-09-30 23:59:26 +02:00
Naeem Dosh
01be9421df Upgrade to Onyx v4.8.2; drop dead badge fix; refresh connector docs
- Pin upstream to v4.8.2 (better official translations). Branding overlay
  re-verified: logos, favicon, Onyx->AIDO codemod (incl. the official
  next-intl catalogs, now 9 locales with Arabic), notification-hide, and
  de/en language limiting all apply clean and type-check.
- Re-sync smb-ui.patch onto v4.8.2 and remove the "Initial Indexing"
  badge hunk: connectors now ingest as the File source, which reports
  status correctly on its own, so the hunk was dead. The patch is now two
  files (chat citation + licensed Search), keyed on metadata.smb_source.
- Refresh the SMB connector docs to the current design: File-source
  ingestion (chat-searchable), the full extension set, the per-source
  index document and per-connector group access, and the UI overlay that
  copies the full path. Fix stale ingestion_api / v4.5.2 references and a
  trailing-whitespace nit in the connector payload.

DHI is a no-op on v4.8.2 (Dockerfile defaults to public node images).
2026-09-30 17:44:57 +05:00
9d5ee01217 fix(smb-ui): use metadata.smb_source instead of from_ingestion_api for SMB detection
The previous attempt added document.from_ingestion_api to the SMB UI patch
to distinguish API-ingested SMB files from normal File uploads after we
switched the connector source from ingestion_api to file.

This caused a TypeScript build error because from_ingestion_api is not
exposed on the frontend document types (OnyxDocument / SearchDocWithContent).

Fix: rely on document.metadata?.smb_source instead.
- The connector injects metadata.smb_source on every SMB document (files
  and index), so it is a reliable discriminator.
- Normal File uploads via the UI never carry this metadata key, so the
  preview-suppression and clipboard-copy behavior remains scoped to SMB
  docs only.

Updated in both locations of branding/smb/smb-ui.patch:
- SearchCard.tsx (licensed search view click handler)
- lib/search/utils.ts (chat citation openDocument helper)
2026-09-24 20:51:16 +02:00
d4cb8dcb99 fix(smb): ingest as File source so docs appear in default chat; update UI patch
The Ingestion API docs require creating a connector with source=file and
pushing documents with from_ingestion_api=true so they are indexed under a
recognizable DocumentSource that Onyx's chat UI can filter and search.

Previously we used source=ingestion_api / input_type=poll. Documents were
indexed (visible in the admin panel) but were not searchable in Onyx's
default chat because ingestion_api is absent from the chat filter UI.

Connector changes:
- onyx_client.py: create connector as source=file, input_type=load_state,
  connector_specific_config.file_locations=[] (avoids LocalFileConnector
  health-check errors since we push via API, not disk crawl)
- sync.py: set source=file and from_ingestion_api=true on every document
  and index payload so Onyx treats them as API-ingested File docs

UI overlay changes (branding/smb/smb-ui.patch):
- Replace document.source_type === ValidSources.IngestionApi with
  document.metadata?.smb_source
- This keeps the broken-preview suppression and logical-path clipboard
  copy working for SMB docs, while leaving normal File uploads untouched

Result: SMB documents now surface in default chat under the File filter,
the connector stays "Up to Date" without dummy-file errors, and the
Phase 2 click-to-copy behavior continues to work.
2026-09-24 20:34:31 +02:00
Naeem Dosh
26d3262cfb SMB connector: per-connector group access + standalone Docker mode
1. Optional Onyx group per connector. Set SMB_SOURCE_<N>_GROUPS (or
   "groups" in SMB_SOURCES JSON, or SMB_DEFAULT_GROUP_IDS as a fallback)
   to a list of Onyx user-group ids. The connector is then created
   PRIVATE and restricted to those groups; empty stays PUBLIC. Applied
   only at connector creation, as requested. Needs the Business licence.

2. Standalone deployment. New docker-compose.standalone.yml runs the
   connector as its own Compose project next to Onyx (no -f injection),
   joining Onyx's network (onyx_default, override via ONYX_NETWORK) to
   reach the API by service name. Suits Compose management tools that
   cannot handle multiple injected compose files. The legacy injected
   compose still works.

Verified: group-id parsing across all three source styles, the
private+groups vs public payload, standalone compose config, and the
full index/sync simulation (still green).
2026-09-24 14:20:39 +05:00
Naeem Dosh
9a886ac835 SMB UI overlay: copy full network path, not just the file name
Regression from the filename-label change: the clipboard copied the
label (semantic_identifier = file name) because the chat citation object
does not always carry `link`. Read the full path from
metadata.logical_path first (always present on SMB documents), then fall
back to link, then the file name. Applies to both the chat citation and
the licensed Search view.
2026-09-24 14:11:48 +05:00
8cc8fb3bec chore: update default file extensions in SMB connector config
Description: Updated the INCLUDE_EXTENSIONS variable in smb-connector\.env.example to align with the newly supported file types in extract.py. This ensures the connector's default configuration includes all recently added text-based IT formats.
2026-09-23 22:56:15 +02:00
4e5f379900 feat: migrate LiteLLM config to env vars and expand file handlers
Description: This commit introduces two main improvements to the SMB connector and LiteLLM configuration:

Configuration Security & Flexibility:
Refactored litellm-config.yaml to replace hardcoded API base URLs with the INFOMANIAK_BASE environment variable.
Updated .env.example to include the new INFOMANIAK_BASE variable, ensuring a consistent and secure configuration management strategy.
Added a new embedding model configuration (LivQwenEmbed) to the LiteLLM setup.
Enhanced File Type Support:
Extended the extract.py script to support a wider range of text-based IT file formats, including yaml, yml, json, xml, ini, conf, cfg, sh, bash, ps1, py, sql, log, dockerfile, properties, toml, rst, mjs, patch, and tsx.
2026-09-23 22:16:18 +02:00
Naeem Dosh
8c6c6c4016 SMB connector: per-source index document + filename citation labels
Two client-requested changes:

1. Table of contents per source. On each sync the connector writes one
   index document listing every file on the share, grouped by folder, so
   the assistant is aware of the full document set even when a search
   returns only some files. It re-upserts only when the file set changes,
   is excluded from the orphan-delete reconcile (shares the source prefix
   but is not a file), and is removed if SMB_WRITE_INDEX is turned off.

2. Shorter citation labels. semantic_identifier is now the file name, not
   the full path, so the chat/search citation shows "Angebot.pdf" instead
   of a long truncated Z:\... path. The full network path stays in `link`
   and metadata; the UI overlay copies it to the clipboard on click, in
   both the chat view and the licensed Search view. A DOC_FORMAT_VERSION
   bump re-upserts already-synced files once so existing docs get the new
   label without waiting for a content change.

Verified with a mock-client simulation: 17 checks covering filename
labels, full-path copy, index create/update/delete, reconcile whitelist,
add/remove sync, and the one-time format-version re-upsert.
2026-09-23 18:51:34 +05:00
Naeem Dosh
5c951c3742 SMB UI overlay: fix path-copy in the licensed Search view
The Phase 2 overlay patched the shared openDocument(), which the chat
view uses. The licensed (EE) Search view has its own click handler in
web/src/ee/sections/SearchCard.tsx that never calls openDocument, so
ingestion_api (SMB) documents still opened the broken preview pane.

Add the same ingestion_api branch to SearchCard.handleClick: copy the
logical network path to the clipboard instead of opening a dead preview.
Regenerate smb-ui.patch (now 3 files); applies clean to v4.7.2 and the
three files type-check clean.
2026-09-21 21:47:28 +05:00
Naeem Dosh
7297f18d15 Upgrade to Onyx v4.7.2; drop temporary i18n overlay
- Pin upstream to v4.7.2 and use its official next-intl i18n (German
  included); disable the temporary react-i18next backport.
- Extend the string codemod to rebrand Onyx->AIDO inside the official
  next-intl message catalogs (web/src/i18n/messages/*.json).
- Re-sync the SMB UI overlay patch onto v4.7.2 (path-copy for cited SMB
  documents + the ingestion_api "Initial Indexing" status fix).
- Re-add notification-hide-for-non-admins and de/en language limiting as
  string-based targeted patches in apply-branding.mjs, so they survive
  future version bumps (no more brittle patch files for these).
- DHI base-image swap is now a no-op: v4.7.2 defaults to public node
  images (DHI is a CI-only build-arg override).
2026-09-16 17:02:28 +05:00
Naeem Dosh
f3ab7f4cee SMB connector: fix stuck 'Initial Indexing', configurable name prefix + timeout
Four items from client feedback:

1. Stuck 'Initial Indexing' status. Root cause (by design in Onyx):
   docprocessing/utils.py never runs a classic index attempt for INGESTION_API
   connectors — documents are pushed via the API, not polled — so
   last_finished_status stays null and the badge is stuck even though the docs
   are indexed and searchable (also why it's safe: no risk of re-index deleting
   the pushed docs). Two-part fix:
   - Connector now sets each cc_pair ACTIVE after provisioning (set_cc_pair_active),
     which fixes the connector detail page + 'Active Connectors' count.
   - Frontend overlay (branding/smb/smb-ui.patch): the Ingestion table shows the
     real cc_pair_status for ingestion_api connectors instead of forcing
     'Initial Indexing'. Verified live: new cc_pair comes up ACTIVE.

2. Connector name now configurable: ONYX_CONNECTOR_NAME_PREFIX (default 'AIDO SMB').
3. HTTP timeout now configurable: ONYX_HTTP_TIMEOUT (default 60), for large embeds.
4. (Phase 2 already delivered in ab64692 — the preview/path overlay.)

Verified live against running Onyx: provisioning sets ACTIVE, custom prefix
'Livtec Docs - Sales' applied, timeout honoured, ä-filename still indexed. Full
overlay apply green, no conflict markers, connector modules parse.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 23:14:28 +05:00
Naeem Dosh
ee281da0e5 SMB connector: handle non-UTF-8 (Windows/Latin-1) filenames
Client hit a crash on every cycle: filenames with non-UTF-8 bytes (e.g. 0xE4 = ä)
arrive from os.walk surrogate-escaped ('\udce4'), and encoding them to UTF-8 for
the id hash / ingestion JSON / manifest raised UnicodeEncodeError.

Fix: normalise each relative path once via _fs_safe() — recover the real on-disk
bytes (os.fsencode reverses surrogateescape) and decode with the share's codepage
(SMB_FILENAME_ENCODING, default cp1252) — so the id hash, the ingestion payload
and the manifest are all UTF-8/JSON-safe and the filename displays correctly
(Angebot_März.txt, not a crash). New SMB_FILENAME_ENCODING env; the previously
added SMB_SOURCE_<N>_MOUNT_OPTS also lets you pass iocharset at mount time.

Verified E2E against live Onyx with a real 0xE4 filename: no crash, indexed
'Angebot_März.txt', logical path '\company\sales\Angebot_März.txt' stored
correctly, manifest persisted, restart → 0/0/all-unchanged (stable id).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 00:34:32 +05:00
Naeem Dosh
ab646927ed SMB Phase 2: suppress broken preview for SMB docs, copy logical path
Frontend overlay (folds into the white-label apply step). Documents synced from
SMB shares (source=ingestion_api) have no browsable file, so Onyx's preview click
was a dead end. openDocument now, for ingestion_api docs, copies the logical
network path (semantic_identifier, e.g. \\company\share\file) to the clipboard
with a toast instead of attempting a broken preview. Single change at the shared
click chokepoint, so it covers the document sidebar + citations.

- branding/smb/smb-ui.patch: the utils.ts change (applies clean to v4.5.2 and on
  top of the i18n patch; order-independent).
- apply-branding.mjs: new step 0b applies it (gated by smbUi.enabled, idempotent
  via a marker), before the codemod.
- branding.config.json: smbUi block.

Verified: full apply green (i18n + SMB + branding), idempotent re-apply, no
conflict markers. Compile build in progress.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 23:40:43 +05:00
Naeem Dosh
afac2c42ae SMB connector: mount CIFS shares inside the container (like Lobehub)
Client asked to mount the SMB share in Docker rather than on the host. Added an
opt-in in-container CIFS mount:
- entrypoint.sh mounts each source's share (mount -t cifs) from env
  (SMB_SOURCE_<N>_UNC or _SERVER+_SHARE, _USERNAME/_PASSWORD/_DOMAIN/_VERS),
  read-only, credentials via a 0600 file (never in the process list), then drops
  from root to the unprivileged app user via gosu and execs the sync app;
  unmounts cleanly on stop.
- Dockerfile installs cifs-utils + gosu, runs the mount entrypoint.
- docker-compose.smb.yml adds cap_add [SYS_ADMIN, DAC_READ_SEARCH] +
  apparmor:unconfined (privileged fallback noted).
- .env.example + README document in-container mode; legacy host-bind-mount mode
  still works (omit _UNC/_SERVER for that source).

Entrypoint logic validated (POSIX sh check + mocked dry-run: correct mount args,
guest fallback, creds file, privilege drop). Live CIFS round-trip to be run
against a real SMB server; the sync engine is already E2E-verified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-08 23:14:46 +05:00
NaeemDosh
909a541c6b SMB connector Phase 1: sync + self-provisioning + multi-source (E2E-verified)
Production SMB->Onyx sync sidecar (public ingestion + admin APIs only; no Onyx
source changes; upgrade-safe). Verified end-to-end against a live Onyx v4.5.2.

Core (app/sync.py): per-cycle reconcile — upsert new/changed (stable url-safe
document ids so updates replace in place), delete files removed from the share,
plus manifest-independent reconcile against Onyx's own doc list. Content-hash change
detection; per-source + per-file failure isolation.

Self-provisioning (app/onyx_client.py): create/cache API key (admin bootstrap) and
one connector/cc_pair per source via connector-with-mock-credential; idempotent
reuse via the grouped indexing-status lookup.

Multi-source (app/config.py): JSON SMB_SOURCES or indexed SMB_SOURCE_N_*; logical
path mapping (mount -> \\company\share) shown in citations.

Extraction (app/extract.py): pdf/docx/xlsx/csv/txt/md/html, light deps. State manifest
(atomic), entrypoint loop w/ graceful shutdown + retry/backoff. Dockerfile, compose
snippet, .env.example, README.

Bugs caught + fixed during live E2E (missed by code review + stub tests):
- Onyx URL-encodes document ids -> switched to url-safe ids + store Onyx's returned
  canonical id, so delete/reconcile match.
- connector listing endpoint + provision-response parsing corrected (indexing-status
  is grouped by source; StatusResponse.data = cc_pair_id).
- Documented: auto API-key creation needs LICENSE_ENFORCEMENT_ENABLED=false (the
  /admin/api-key endpoint is EE-tier-gated); ingestion + connector creation are not.

E2E results (live Onyx): ingest 2 docs w/ logical paths; change->update-in-place with
stable ids; remove->delete synced; auto-provision create + idempotent reuse; multi-
source config both styles.
2026-09-01 23:18:33 +05:00
dfbac553ff chore(branding): add B→SS and R→ss replacement mappings
Adds two additional string replacement rules to `branding/branding.config.json`:

- `"B": "SS"`
- `"R": "ss"`

These mappings supplement the existing Onyx → Livtec branding rules.
2026-08-20 11:14:21 +02:00
NaeemDosh
0050b0a285 i18n: system-prompt desc, search-filter/model/files labels, hide notif badge for users
- System prompt description ('Remove the base system prompt...') wrapped in BOTH
  places: AgentEditorPage (create) and AgentViewerModal (summary).
- Search filter (ActionsPopover/SwitchList): Enable All / Disable All now use the
  existing chat.actions keys (added useTranslation hook).
- Model selector: 'Search models...' placeholder -> model_selector.search_placeholder.
- File picker: 'Recent Files' / 'All Recent Files' -> files.* keys.
- Notification BADGE on the sidebar account button now also gated by
  canSeeNotifications — non-admins see no bell, no panel, and no count badge; admins
  keep the full unfiltered notification centre.

Patch 66 files, applies clean to v4.5.2; apply green; missing-hook + duplicate-hook
scans CLEAN. Build verification next.
2026-08-19 23:07:31 +05:00
NaeemDosh
6ea23b97e7 i18n: remove notification filter (admin=full), fix selected-tool + agent-filter labels, translate projects/agent-viewer/chat-header
Client feedback round:
- Notifications: removed the sanitize/suppress filter entirely. sanitize=false +
  empty suppressTypes => apply-branding.mjs now SKIPS patching useNotifications, so
  the (admin-only) notification centre renders pure upstream, unfiltered.
- Selected tool lost its translation: AppInputBar rendered tool.display_name for the
  selected pill; now getLocalizedToolLabel(tool, t) (matches the dropdown). Same fix
  applied to the agent 'More Agents' actions filter (AgentsFilters).
- Chat top-right: Share, Export As…, Move to Project, Plaintext/Markdown, Fit/Full width.
- Projects: CreateProjectModal (title/desc/name/placeholder/Cancel/Create) + project
  view (Recent Chats, Last message).
- Agent summary (AgentViewerModal): Featured, Knowledge, No Knowledge, Actions & Tools,
  No Actions, More Info, Instructions, Overwrite System Prompts.
- Agent editor: conversation-starter example placeholders (indexed keys).

Patch 64 files, applies clean to v4.5.2; apply green; full missing-hook + duplicate-hook
scan CLEAN; no conflict markers. Build verification in progress.
2026-08-19 16:56:40 +05:00
NaeemDosh
f11db110d4 i18n: fix type error — add useTranslation hook to MCPServerCard
Build failed type-check: AgentEditorPage.tsx MCPServerCard used t() without the
useTranslation() hook (Cannot find name 't'). Added the hook. Scanned every
function the patch touches for the same class; MCPServerCard was the only real one.
2026-08-19 08:52:37 +05:00
NaeemDosh
33c549bfca i18n: fix tool names, hide notifications for non-admins, full agent-creation German
Client feedback round:
- TOOLS bug: getLocalizedToolLabel calls t("tools.<x>") with no fallback and the
  tools.* keys were missing, so the UI showed raw keys (tools.web_search). Added
  tools.* to de/en (Websuche, Interne Suche, Bildgenerierung, ...).
- NOTIFICATIONS: hidden for non-admin end users (bell + panel) via AccountPopover
  canSeeNotifications gate (admin/curator/global_curator still see it, English).
  Client doesn't use it for users. Documented in branding.config.json.
- CREATE AGENT: wrapped the remaining strings across AgentEditorPage, AgentKnowledgePane,
  KnowledgeMainContent, InputDatePicker (Select Date), BackButton (Back). ~30 labels/
  descriptions/placeholders: Knowledge, Use Knowledge, instructions/starters/reminders
  descriptions, Share, Feature/private/unlisted notes, labels, Create/Edit Agent, Cancel.
  Added agent_editor.* + general.back/select_date German keys.

Patch regenerated (61 files, git add -A), applies cleanly to pristine v4.5.2; apply green;
only de/en; all keys resolve; no conflict markers. Image build verification in progress.
2026-08-19 01:14:56 +05:00
NaeemDosh
468cd93ea7 i18n: wrap sidebar, chat-search modal, and agent editor (v4.5.2 coverage)
Client-flagged English areas now translated (keys already in de.json, so German shows
immediately):
- Sidebar (AppSidebar): New Session, Search Chats, Recents, Agents, More Agents/Explore
  Agents, Projects, New Project.
- Chat-search command menu (ChatSearchCommandMenu): placeholder, Recent/Recent Sessions,
  Sessions/Projects filter chips, New Session, New Project, footer Select/Open/Show all.
  Added sidebar.search.* keys to de/en.
- Agent editor (AgentEditorPage, /app/agents/create): 13 section labels — Instructions,
  Conversation Starters, Agent Avatar, Advanced Options, Reminders, Share/Feature/Delete,
  Knowledge Cutoff, Overwrite System Prompt, User Files. Added agent_editor.* keys.

Patch regenerated with git add -A (prior manual regen had dropped untracked new files —
fixed). Applies cleanly to pristine v4.5.2; apply green; only de/en; all keys resolve;
no conflict markers. Image build verification in progress.
2026-08-18 08:03:44 +05:00
56b0e95790 feat: enhance LiteLLM proxy configuration and deployment setup
Configuration updates to the Aido deployment stack, focusing on LiteLLM proxy hardening, improved model configuration, and enhanced environment setup.
2026-08-14 23:18:57 +02:00
NaeemDosh
372c4827ab i18n: expand German coverage — wrap onboarding + app-shell components (v4.5.2)
Extends the v4.5.2 i18n patch to translate 8 more user components the initial re-sync
had left English (onboarding NameStep/LLMStep/NonAdminStep, AppChrome, AppPage, settings
layout, MultiModelSelector, opal sidebar). ~24 additional strings, using PR #12558's own
keys (already in de.json), so German resolves immediately.

Method: extracted the PR's exact string->key wrapping and re-applied it onto v4.5.2's
versions, injecting each useTranslation hook at the PR's own anchor (verified every t()
call is inside its hook's function scope). Patch applies clean to pristine v4.5.2 (55
files). Un-wrapped strings fall back to English, so no breakage.

Remaining un-wrapped (documented): components v4.5.2 restructured heavily (chat greeting
is a logic refactor, some sidebar/modal/model-selector text) — bespoke per-component work,
added incrementally.

Note: final image build to be run on a stable connection (local Docker build network-
blocked this session); patch + hook scoping verified statically.
2026-08-14 18:42:30 +05:00
NaeemDosh
ea2c56f9e0 i18n: client-editable German dictionary + limit UI languages to de/en
Two client requests on the v4.5.2 German build:

1. Editable/persistent translations. German dictionaries now live at
   branding/i18n/locales/{de,en}.json (the client edits these). apply-branding.mjs
   overlays them onto web/public/locales/<lang>/common.json AFTER the patch, so edits
   survive make setup (previously the dict was inside the patch and got overwritten).
   Added MISSING-de.md (the ~12 non-admin keys still English; dict is ~98% complete).

2. Limit the selector to German + English. New config i18n.languages=["de","en"];
   apply strips every other bundled language (es/fr/pt) from i18n.ts (imports +
   resources), the Settings selector, and public/locales. Config-driven + idempotent.

Note for coverage: dictionary edits only reach strings that are t()-wrapped. Components
kept at v4.5.2 during the re-sync (never-break-UI) render English regardless — those need
a component-wrapping pass (separate dev work), documented in README.

Verified in a built image: compiles (4.8min); de+en dictionaries served (200),
es/fr/pt removed (404); homepage 200.
2026-08-11 05:44:59 +05:00
NaeemDosh
01b9adfcd9 i18n: re-sync German UI overlay onto Onyx v4.5.2 + lock to release tag
Client is moving to release v4.5.2 (from the ~v4.3 the overlay was built on) and wants
the pin on a release NUMBER, not a raw commit.

- Re-synced end-user-i18n.patch: cherry-picked PR #12558 onto v4.5.2 and resolved the
  ~25 conflicts from upstream's own refactors. Strategy = never break the UI: kept
  v4.5.2's version for tangled components (they stay English) and hand-merged only the
  two that matter — AppProvider (i18n init + I18nextProvider) and SettingsPage (language
  selector). New i18n infra + all 5 locale dicts merged cleanly. 4 files upstream
  relocated were dropped (no dangling imports — verified).
- Pin to release tag: upstream.pinnedCommit + i18n.baseCommit = v4.5.2 (make setup
  checks out the tag). Regenerated patch applies to pristine v4.5.2 with zero conflicts.
- apply-branding.mjs: idempotent i18n step via a sentinel file (src/lib/i18n.ts), so
  re-running make apply no longer errors once branding has edited the patched files.
- DHI base-image swap now also triggers on v4.5.2 (its Dockerfile uses dhi.io/node).
- README: tag-pin model, coverage caveat, per-release re-sync guidance.

Verified: patch applies clean to v4.5.2; full make apply green (i18n + 201 code + 376
locale replacements); selector + init wired; no leaked conflict markers. Image build to
be run on a stable connection (local build blocked by network).
2026-08-07 13:38:15 +05:00
NaeemDosh
1f2d637263 feat(i18n): backport end-user German UI from Onyx PR #12558 as overlay
Temporary multi-language support until Onyx ships official i18n (ETA Q4'26/Q1'27).
Backports PR #12558 (react-i18next; end-user UI only, Admin stays English) as a
config-driven overlay so the official source stays intact and upgrades stay easy.

- branding/i18n/end-user-i18n.patch: the PR's 70-file change set, pinned to its exact
  base commit (727e096d) so it applies with zero conflicts.
- branding.config.json: pin upstream to 727e096d; add i18n block (enabled, patch,
  baseCommit, defaultLanguage=de, rebrandLocales).
- apply-branding.mjs: step 0 git-applies the patch BEFORE the string codemod; the
  codemod then rebrands Onyx->AIDO inside every locale dict (de/en/es/fr/pt).
  Idempotent; fails loudly if the checkout isn't at i18n.baseCommit.
- README: 'German UI / i18n (temporary)' section — how to edit translations, add
  languages, and retire the overlay when official i18n lands.

Verified: patch applies cleanly on a fresh pinned checkout; `make apply` runs green
(198 code + 376 locale replacements across 5 languages); i18n deps resolve. Fill/refine
German in web/public/locales/de/common.json (PR ships a full draft).
2026-08-02 15:04:55 +05:00
NaeemDosh
1e55297ce9 fix(compose): correct litellm-redis command indentation (broke whole file)
The litellm-redis `command:` was indented at service level (2 spaces) instead of
inside the service (4 spaces), so Docker Compose parsed it as a bogus top-level
service named `command` and rejected the entire file with:
  services.command must be a mapping
This made `docker compose <anything>` fail — the whole stack was unstartable.
Re-indented it under litellm-redis; `docker compose config` now validates.
2026-08-02 15:04:14 +05:00
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
livdebus
7a618d4a74 feat: production hardening with LiteLLM proxy integration and security updates
## Overview
Major production readiness update integrating LiteLLM proxy for AI model
management, security hardening, and infrastructure simplification.

## Changes

### 🔐 Security & Secrets Management
- Auto-generate secrets via `openssl rand -hex` for:
  - `USER_AUTH_SECRET`, `ENCRYPTION_KEY_SECRET`, `METRICS_AUTH_TOKEN`
  - `POSTGRES_PASSWORD`, `LITELLM_*` credentials
- Set `DISABLE_TELEMETRY=true` for data sovereignty compliance
- Changed `POSTGRES_USER` from `postgres` → `onyx-admin`
- Set `TRACK_EXTERNAL_IDP_EXPIRY=true`

### 🤖 LiteLLM Proxy Integration
- **New service**: `litellm-proxy` with dedicated Postgres + Redis
- **New config**: `litellm-config.yaml` with 3 Swiss-hosted models:
  - `LivQwen` (Qwen3.5-397B-A17B-FP8)
  - `LivKimi` (Kimi-K2.6)
  - `LivGemma` (NVIDIA Nemotron-3-Nano-30B-A3B-FP8)
- Model fallback routing: LivQwen ↔ LivKimi ↔ LivGemma
- Caching enabled via Redis with 3600s TTL
- Custom error message mappings for user-friendly responses

### 🏗️ Infrastructure Updates
- Switched from local builds → official Onyx Docker images
  - Removed `build.context` for api_server, background, inference/indexing servers
- Increased NGINX timeouts: 300s → 600s (for complex AI queries)
- Added PostgreSQL connection pooling & keepalive settings
- S3 credentials now fully environment-driven (no hardcoded values)
- Added `S3_REGION` variable
- Removed certbot service (SSL handled externally)

### ⚙️ Configuration
- `COMPOSE_PROFILES=s3-filestore` uncommented
- `DISABLE_LITELLM_STREAMING=false`
- `LLM_SOCKET_READ_TIMEOUT=600`
- `GENERATIVE_MODEL_ACCESS_CHECK_FREQ=300` (5 minutes)
2026-06-30 23:04:24 +02:00
livdebus
4216fd1c13 minio commented out
We use external S3 provider, therefore we dont need minio
2026-06-30 21:02:24 +02:00