-
Notifications
You must be signed in to change notification settings - Fork 99
Refactor devportal configs #2794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3eaf78b
Update fast-uri to v3.1.4
Piumal1999 b18115a
Add developer_portal prefix to configs
Piumal1999 39ae51f
Remove baseurl config
Piumal1999 3cc85b8
Remove readonly mode
Piumal1999 bae289e
Update https configs
Piumal1999 078022a
Update logging configs
Piumal1999 0a81131
Update db related configs
Piumal1999 6d87b37
Refactor auth related configs
Piumal1999 dcf64cf
Update platform-api version in docker-compose
Piumal1999 24fc842
Fix config ordering and defaults
Piumal1999 ce6e93a
Refactor devportal local auth to read public key from a path
Piumal1999 f91541d
Fix minor issues
Piumal1999 c1a4e04
Improve validation
Piumal1999 bb60996
Update docker compose
Piumal1999 81d64ac
Add base_url config to devportal
Piumal1999 83ae5b5
Improve baseurl validation
Piumal1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,54 @@ | ||
| # Developer Portal configuration for the all-in-one (build-from-source) compose | ||
| # stack. Mounted at /app/configs/config.toml — replaces the image's shipped | ||
| # configs/config.toml, which fails closed at startup on the required security | ||
| # secrets and only wires the SQLite `file` key (this stack shares one Postgres | ||
| # secrets and only wires the SQLite `path` key (this stack shares one Postgres | ||
| # server with platform-api). | ||
| # | ||
| # There is NO automatic APIP_DP_* environment-variable override (see | ||
| # src/config/configLoader.js) — an env var set in docker-compose.yaml's | ||
| # `devportal.environment` block only takes effect where a key below explicitly | ||
| # references it via a {{ env "..." }} token. | ||
| # Every key lives under the single [developer_portal] table; configLoader.js | ||
| # unwraps it and IGNORES anything outside it, so a section at the top level is | ||
| # silently dropped and its defaults (src/config/configDefaults.js) win instead. | ||
| # | ||
| # There is NO automatic APIP_DP_* environment-variable override — an env var set | ||
| # in docker-compose.yaml's `devportal.environment` block only takes effect where | ||
| # a key below explicitly references it via a {{ env "..." }} token. | ||
|
|
||
| [server] | ||
| base_url = '{{ env "APIP_DP_SERVER_BASEURL" "http://localhost:3001" }}' | ||
| port = 3000 | ||
| [developer_portal.server] | ||
| port = '{{ env "APIP_DP_SERVER_PORT" "3000" }}' | ||
|
|
||
| [tls] | ||
| [developer_portal.server.https] | ||
| # Plain HTTP — nothing in this stack talks to devportal over TLS. | ||
| enabled = false | ||
| enabled = '{{ env "APIP_DP_SERVER_HTTPS_ENABLED" "false" }}' | ||
|
|
||
| [logging] | ||
| console_only = true | ||
| [developer_portal.logging] | ||
| console_only = '{{ env "APIP_DP_LOGGING_CONSOLE_ONLY" "true" }}' | ||
|
|
||
| [database] | ||
| type = '{{ env "APIP_DP_DATABASE_TYPE" "postgres" }}' | ||
| [developer_portal.database] | ||
| driver = '{{ env "APIP_DP_DATABASE_DRIVER" "postgres" }}' | ||
| host = '{{ env "APIP_DP_DATABASE_HOST" "postgres" }}' | ||
| port = '{{ env "APIP_DP_DATABASE_PORT" "5432" }}' | ||
| name = '{{ env "APIP_DP_DATABASE_NAME" "devportal" }}' | ||
| username = '{{ env "APIP_DP_DATABASE_USERNAME" "postgres" }}' | ||
| user = '{{ env "APIP_DP_DATABASE_USER" "postgres" }}' | ||
| password = '{{ env "APIP_DP_DATABASE_PASSWORD" "postgres" }}' | ||
|
|
||
| [organization] | ||
| default_name = '{{ env "APIP_DP_ORGANIZATION_DEFAULTNAME" "default" }}' | ||
| [developer_portal.organization] | ||
| default_name = '{{ env "APIP_DP_ORGANIZATION_DEFAULT_NAME" "default" }}' | ||
|
|
||
| [developer_portal.auth] | ||
| mode = "local" | ||
|
|
||
| [platform_api] | ||
| # platform-api signs admin JWTs with RS256 — there is no shared HMAC secret to | ||
| # set here. jwt_secret left empty makes the devportal decode the token payload | ||
| # without verifying its signature, trusting the direct HTTPS connection | ||
| # (insecure=true) instead — see extractPlatformJwtClaims in | ||
| # src/utils/platformJwt.js. platform-api's cert is self-signed (platform-api-certgen). | ||
| base_url = '{{ env "APIP_DP_PLATFORMAPI_BASEURL" "https://platform-api:9243" }}' | ||
| insecure = true | ||
| [developer_portal.auth.local] | ||
| # platform-api signs its tokens with RS256; the devportal verifies them against | ||
| # the public half of that keypair, bind-mounted read-only at /etc/devportal/keys. | ||
| # Only jwt_public.pem is exposed here (the private key stays with platform-api); | ||
| # the devportal reads it from that path. | ||
| platform_api_url = '{{ env "APIP_DP_AUTH_LOCAL_PLATFORM_API_URL" "https://platform-api:9243" }}' | ||
| public_key_path = '{{ env "APIP_DP_AUTH_LOCAL_PUBLIC_KEY_PATH" "/etc/devportal/keys/jwt_public.pem" }}' | ||
| # platform-api's cert is self-signed (platform-api-certgen). | ||
| tls_skip_verify = '{{ env "APIP_DP_AUTH_LOCAL_TLS_SKIP_VERIFY" "true" }}' | ||
|
|
||
| [security] | ||
| [developer_portal.security] | ||
| # Required — devportal fails closed at startup if either doesn't resolve to a | ||
| # 64-char hex string. Set APIP_DP_SECURITY_ENCRYPTIONKEY / APIP_DP_SECURITY_SESSIONSECRET | ||
| # 64-char hex string. Set APIP_DP_SECURITY_ENCRYPTION_KEY / APIP_DP_SECURITY_SESSION_SECRET | ||
| # in the environment before `docker compose up` (e.g. `openssl rand -hex 32` each). | ||
| encryption_key = '{{ env "APIP_DP_SECURITY_ENCRYPTIONKEY" }}' | ||
| session_secret = '{{ env "APIP_DP_SECURITY_SESSIONSECRET" }}' | ||
| encryption_key = '{{ env "APIP_DP_SECURITY_ENCRYPTION_KEY" }}' | ||
| session_secret = '{{ env "APIP_DP_SECURITY_SESSION_SECRET" }}' | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.