Skip to content

Feat/base path and root path - #252

Merged
gzileni merged 2 commits into
mainfrom
feat/base-path-and-root-path
Aug 4, 2026
Merged

Feat/base path and root path#252
gzileni merged 2 commits into
mainfrom
feat/base-path-and-root-path

Conversation

@gzileni

@gzileni gzileni commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Explain what this PR changes and why.

Type of change

  • Documentation
  • Bug fix
  • New data source / connector
  • MCP server change
  • Frontend change
  • Backend/API change
  • Data quality / metadata change
  • Security hardening

Verification

Describe how you tested or manually verified the change.

Data/source grounding

If this PR changes data discovery, summarization, scoring or reports, list the public sources or examples used for verification.

Checklist

  • I kept the change focused.
  • I updated docs/examples where needed.
  • I added tests or explained why tests are not applicable.
  • I did not commit secrets, private data or large generated files.
  • AI-generated outputs remain grounded in real retrieved resources.

gzileni and others added 2 commits July 28, 2026 18:57
Both are opt-in and default to today's behaviour, so the GitHub Pages and
dedicated-host deploys are unchanged.

UI — NEXT_PUBLIC_BASE_PATH sets Next's `basePath` at build time (a static
export inlines every URL, so it cannot be a runtime setting). Note the
asymmetry that makes this alone insufficient: basePath rewrites the URLs
inside the HTML but still writes the files at the root of `out/`, so the
reverse proxy has to strip the prefix as well.

Next prefixes what it controls — <Link>, router.push, and every _next/*
asset — but not files served from `public/` and referenced by a literal
path, nor plain <a href> anchors. Those were silently broken under a prefix:
the favicon on every page, an illustration, and two internal links. They now
go through `withBasePath()`, a no-op when no prefix is configured.

API — ROOT_PATH sets FastAPI's `root_path`, so the /docs page advertises a
reachable /<prefix>/openapi.json instead of a root-relative one that would
land on whatever else is served at the site root. It does not change the
routes the app matches.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ale (#251)

llama-server e llama-swap parlano il formato OpenAI, quindi il branch
usa agent_framework.openai.OpenAIChatClient — gia' presente nel pacchetto
core agent-framework, nessuna dipendenza nuova.

Due trappole gestite esplicitamente nel client:

- l'SDK OpenAI tratta base_url come radice dell'API e ci appende
  "/chat/completions", quindi il /v1 deve farne parte. LLAMACPP_BASE_URL
  e' accettata con o senza, e normalizzata.
- senza api_key l'SDK ripiegherebbe su OPENAI_API_KEY dall'ambiente,
  spedendo i prompt a OpenAI invece che al server locale. Quando
  LLAMACPP_API_KEY non e' impostata si passa una chiave fittizia:
  llama-server senza --api-key ignora comunque l'header.

Introdotto is_self_hosted(provider) per llamacpp+ollama, che governa i
due comportamenti finora legati al solo "ollama": gate di accesso LLM
aperto (nessun costo per chiamata da tariffare) e report territorio in
modalita' sintetica (modelli locali compatti).

Cambio non retrocompatibile: il fallback di LLM_PROVIDER=auto senza
credenziali passa da ollama a llamacpp. Chi ci contava implicitamente
deve dichiarare LLM_PROVIDER=ollama.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gzileni
gzileni merged commit 158bde1 into main Aug 4, 2026
0 of 14 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1273ed17a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if settings.ollama_cloud_api_key:
return "ollama_cloud"
return "ollama"
return "llamacpp"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the default CPU stack on its bundled Ollama provider

With the documented make up flow, .env.local.example leaves LLM_PROVIDER=auto and Makefile routes up to up-cpu, which starts ollama-cpu but no llama.cpp server. This fallback therefore directs every LLM request to host.docker.internal:8080, where a fresh setup has nothing listening, while the bundled Ollama container is ignored. Either force LLM_PROVIDER=ollama in the CPU/GPU targets or include and validate the new inference server in the default stack.

Useful? React with 👍 / 👎.

Comment thread opendata-ai-ui/Dockerfile
Comment on lines +22 to +24
# Path prefix the app is served under, e.g. `/opendata` when it shares a
# hostname with other projects. Empty (the default) keeps the bundle rooted.
ARG NEXT_PUBLIC_BASE_PATH

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Forward the base-path argument from supported image builds

Declaring this build argument is insufficient for the repository's supported build paths: the opendata-ai-ui build args in docker-compose.yml and the build-args block in .github/workflows/docker-publish.yml forward the other NEXT_PUBLIC_* values but not NEXT_PUBLIC_BASE_PATH. Consequently, setting the new variable in the compose environment or GitHub repository variables still produces a root-based static bundle, so the advertised prefixed deployment fails unless someone bypasses both build paths and invokes Docker manually.

Useful? React with 👍 / 👎.

images: { unoptimized: true },
poweredByHeader: false,
trailingSlash: true,
...(basePath ? { basePath } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make OIDC redirects honor the configured base path

When a prefixed build also has OIDC enabled, authentication remains rooted at the host: lib/oidc.ts::redirectUri() returns ${window.location.origin}/, and logout uses the same root-relative destination. On the shared-host deployment this feature targets, the identity provider therefore returns the authorization code to another application at /, so this UI never processes the callback and protected pages cannot be used. The callback, post-logout, and local logout destinations need to include the configured base path.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant