Skip to content

feat(config): allow server settings via config file with env precedence#1554

Open
akagifreeez wants to merge 1 commit into
finos:mainfrom
akagifreeez:feat/server-settings-config
Open

feat(config): allow server settings via config file with env precedence#1554
akagifreeez wants to merge 1 commit into
finos:mainfrom
akagifreeez:feat/server-settings-config

Conversation

@akagifreeez
Copy link
Copy Markdown

@akagifreeez akagifreeez commented Jun 2, 2026

Description

The server port, HTTPS server port, UI host, UI port and HTTPS UI port were only
configurable via environment variables, with defaults hard-coded in src/config/env.ts
unlike every other setting, which lives in the config schema/file. This legacy split adds
needless complexity for operators.

This moves the five settings into the config schema (config.schema.json /
proxy.config.json), mirroring how GIT_PROXY_COOKIE_SECRET already works:

  • Precedence: environment variable (when set) → config file → built-in default.
  • src/config/env.ts now exposes the raw environment values (undefined when unset) so the
    config file can supply the default.
  • New getters getServerPort / getHttpsServerPort / getUIHost / getHttpsUIPort (and
    getUIPort now reads the merged config); the proxy, service, URL helpers and the OIDC auth
    route read these lazily instead of at module load.
  • Also fixes the OIDC callback redirect, which previously fell back to UI port 3000 instead
    of the configured UI port.

Config-file properties added: serverPort, httpsServerPort, uiHost, uiPort, httpsUiPort.

Related Issue

Resolves #1553

Checklist

General

Documentation

  • Documentation has been added/updated (config overview note + regenerated schema reference)

Configuration

  • If configuration schema (config.schema.json) was modified:
    • TypeScript types regenerated (npm run generate-config-types)
    • Schema reference docs regenerated (npm run gen-schema-doc)

Tests

  • Tests have been added/updated for new functionality (default / config-file / env-precedence for the new settings)
  • Unit tests pass (npm test) — 808 passed
  • Linting and formatting pass (npm run lint and npm run format:check)
  • Type checks pass (npm run check-types)

The server port, HTTPS server port, UI host, UI port and HTTPS UI port
could only be set via environment variables, with defaults hard-coded in
src/config/env.ts - unlike every other setting, which lives in the config
schema/file. This legacy split is confusing for operators (finos#1553).

Move these five settings into the config schema and proxy.config.json
defaults, mirroring GIT_PROXY_COOKIE_SECRET: the environment variable
(when set) takes precedence over the config file, which takes precedence
over the built-in default. env.ts now exposes the raw environment values
(undefined when unset) so the config file can supply the default.

- Add serverPort, httpsServerPort, uiHost, uiPort and httpsUiPort to
  config.schema.json and proxy.config.json; regenerate config types and
  schema reference docs.
- Resolve them with environment precedence in mergeConfigurations and add
  getServerPort/getHttpsServerPort/getUIHost/getHttpsUIPort getters;
  getUIPort now reads the merged config.
- Switch the proxy, service, urls and auth-route call sites to the getters,
  reading lazily instead of at module load. This also fixes the OIDC auth
  redirect, which fell back to UI port 3000 instead of the configured port.
@akagifreeez akagifreeez requested a review from a team as a code owner June 2, 2026 13:48
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

Deploy Preview for endearing-brigadeiros-63f9d0 ready!

Name Link
🔨 Latest commit d2f38dc
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6a1edf25a58959000848957d
😎 Deploy Preview https://deploy-preview-1554.git-proxy.preview.finos.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 2, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: akagifreeez / name: akagifreeez (d2f38dc)

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.

Allow server details to be set through configuration in addition to environment variables

1 participant