feat(base-path): subpath mounting via BASE_PATH env - #19
Merged
Conversation
Enables deploying indexer-ui under a subpath (e.g. /indexerui/) on the
same vhost as the OpenRag backend, removing the need for separate
hostnames and eliminating the cross-origin cookie problem.
Changes:
- svelte.config.js: kit.paths.base = process.env.BASE_PATH ?? ''
- Dockerfile: ARG BASE_PATH forwarded to the build stage
- Prefix every internal fetch/navigation with `base` from $app/paths:
- src/lib/api/index.ts — loadConfig()
- src/lib/components/indexer/Header.svelte — partition links
- src/lib/components/layout/NavBar.svelte — home/indexer/dashboard
- src/lib/components/dashboard/Header.svelte — dashboard link
- src/routes/(home)/+page.svelte — CTA links
- src/routes/+layout.svelte — goto fallback
- src/routes/indexer/+layout.svelte + indexer/+page.svelte +
indexer/partition/[partition]/+page.svelte — goto() and partition
file links
Leave BASE_PATH unset for root-level deployment (existing behaviour).
guimard
added a commit
to linagora/openrag
that referenced
this pull request
Apr 17, 2026
Lets operators mount indexer-ui under a subpath (e.g. `/indexerui/`) on the same vhost as the OpenRag backend, eliminating the cross-origin cookie problem when front and back were on different hosts. Changes: - docker-compose.yaml: forward INDEXERUI_BASE_PATH env as BASE_PATH build-arg to the indexer-ui Dockerfile. - .env.example: document INDEXERUI_BASE_PATH (commented, empty = root, rebuild required after change). - extern/indexer-ui: bump pointer to the merged main of openrag-admin-ui (c967017 — OIDC support). Pairs with linagora/openrag-admin-ui#19 (base-path support in the SvelteKit app). Merging that PR + a subsequent submodule pointer bump are required to actually deploy under a subpath. Without the PR merged, setting INDEXERUI_BASE_PATH has no effect (the build-arg is passed but the Dockerfile it reaches doesn't honor it yet).
3 tasks
EnjoyBacon7
pushed a commit
to linagora/openrag
that referenced
this pull request
Apr 20, 2026
Lets operators mount indexer-ui under a subpath (e.g. `/indexerui/`) on the same vhost as the OpenRag backend, eliminating the cross-origin cookie problem when front and back were on different hosts. Changes: - docker-compose.yaml: forward INDEXERUI_BASE_PATH env as BASE_PATH build-arg to the indexer-ui Dockerfile. - .env.example: document INDEXERUI_BASE_PATH (commented, empty = root, rebuild required after change). - extern/indexer-ui: bump pointer to the merged main of openrag-admin-ui (c967017 — OIDC support). Pairs with linagora/openrag-admin-ui#19 (base-path support in the SvelteKit app). Merging that PR + a subsequent submodule pointer bump are required to actually deploy under a subpath. Without the PR merged, setting INDEXERUI_BASE_PATH has no effect (the build-arg is passed but the Dockerfile it reaches doesn't honor it yet).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables deploying the indexer-ui under a subpath (e.g.
/indexerui/) on the same vhost as the OpenRag backend. This removes the need for separate hostnames and eliminates the cross-origin cookie problem when the browser hits both front and back under different origins.Changes
svelte.config.js:kit.paths.base = process.env.BASE_PATH ?? ''Dockerfile:ARG BASE_PATHforwarded to the build stage.basefrom$app/paths:src/lib/api/index.ts—loadConfig()src/lib/components/indexer/Header.sveltesrc/lib/components/layout/NavBar.sveltesrc/lib/components/dashboard/Header.sveltesrc/routes/(home)/+page.sveltesrc/routes/+layout.sveltesrc/routes/indexer/{+layout,+page}.sveltesrc/routes/indexer/partition/[partition]/+page.svelteBackward compatibility
BASE_PATHunset → empty base → root-level deployment exactly as today.Deploying under a subpath
docker build --build-arg BASE_PATH=/indexerui -t indexer-ui:subpath .Then the reverse proxy must forward
/indexerui/*to the container without stripping the prefix (SvelteKit withpaths.baseexpects to see the prefix). Example nginx:Test plan
npm run check— no new errors (8 pre-existing)npm run build— succeedsBASE_PATH=/indexerui) — logo, nav, partition links,loadConfig,goto("/")all resolve under the prefix