GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ORISO-UserService/docs/required-environment.md at dev · OpenResilienceInitiative/ORISO-UserService

Expand file tree

/

required-environment.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
144 lines (113 loc) · 7.2 KB
/

required-environment.md

Copy path

File metadata and controls

144 lines (113 loc) · 7.2 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Required environment

The variables UserService refuses to start without, and why each one is guarded. config.env.example carries all of them; this page is the reasoning behind it.

Answers issue #1099.

Getting a local service running

cp config.env.example config.env      # then fill every CHANGE_ME
cp run-local-remote-db.sh.example run-local-remote-db.sh
chmod +x run-local-remote-db.sh
./run-local-remote-db.sh

Full walkthrough, including the frontend pairing and the dev CA truststore: documentation/local-development.md.

The startup guards

Each of these aborts the Spring context in @PostConstruct, before a single request is served. They fail one at a time, so a missing set is met one restart at a time.

Variable Guard Without it
STATISTICS_MESSAGE_COUNT_HMAC_SECRET ConsultantIdentityHasher IllegalStateException naming the variable
MATRIXRTC_CALL_POLICY_HMAC_SECRET MatrixRtcCorrelationIdHasher IllegalStateException naming the variable
SPRING_LIQUIBASE_ENABLED / ORISO_MIGRATIONS_EXTERNALLY_MANAGED SchemaMigrationGuard IllegalStateException: changesets in the image would never be applied
SPRING_JPA_HIBERNATE_DDL_AUTO SchemaMigrationGuard IllegalStateException unless the value is validate

Public mail-link origins

PublicUrlStartupValidator checks these before any bean is created and reports every problem in one message, so a missing set costs one restart, not six. Each must be an absolute http(s) origin with a host, no user info, and no query or fragment. Outside the local and testing profiles, template hosts (your-domain…, example.com/.org/.net) are refused as well (ORISO-Helm#368).

Variable Used for
APP_BASE_URL enquiry/welcome/inactivity mails, tenant links, OTP URL derivation
SYSTEM_NOTIFICATION_FRONTEND_BASE_URL supervisor-added notice, SMTP test mail
DPA_SIGN_FRONTEND_BASE_URL DPA signing link (forwarded to a Träger)
MAGIC_LINK_FRONTEND_BASE_URL magic-link login mail
ACCOUNT_INVITE_APP_FRONTEND_BASE_URL app-level invite accept link
ACCOUNT_INVITE_ADMIN_FRONTEND_BASE_URL tenant-admin and counsellor onboarding links, Admin panel links

PASSWORD_RESET_FRONTEND_BASE_URL and PASSWORD_RESET_ADMIN_FRONTEND_BASE_URL stay optional: blank keeps self-service password reset switched off. A value that is set must still pass the same shape check.

None of them falls back to another. An environment where App and Admin share one host sets the same origin in each variable.

SPRING_DATASOURCE_URL is required too, but the local path gets it from run-local-remote-db.sh, not from config.env. A value in config.env overrides it, because the script sources that file after its own exports.

The two HMAC secrets

Both pseudonymize an identifier that would otherwise be readable by anyone with database or log access: a consultant id in message-count statistics, and a room/user pair in MatrixRTC call-policy denial logs. Both reject a blank value rather than falling back to a default, because a shared or empty key would make the pseudonymization decorative.

Locally any random value works — openssl rand -hex 32. Keep them distinct from each other and from service.encryption.appkey; that independence is what stops one leaked secret from unmasking the other purpose. In a real deployment MATRIXRTC_CALL_POLICY_HMAC_SECRET must match the platform-wide MatrixRTC secret, or correlation ids stop lining up between the services that log them.

The migration settings

SchemaMigrationGuard refuses a deployment that would run against a schema nobody migrates or verifies. The reasoning, the escape hatch and how to audit an environment are in schema-migrations.md.

For local work the shipped example sets SPRING_LIQUIBASE_ENABLED=false with ORISO_MIGRATIONS_EXTERNALLY_MANAGED=true, because the documented local setup talks to the remote dev database, which the deployed dev UserService migrates. A laptop running Liquibase against it would apply changesets — and in time the seed/demo changesets — to a database the whole team shares, and an interrupted run would leave DATABASECHANGELOGLOCK held against the real deployment. Against a database only you use, set SPRING_LIQUIBASE_ENABLED=true and drop the escape hatch.

SPRING_JPA_HIBERNATE_DDL_AUTO must stay validate either way. That check is the one that catches an entity change nobody wrote a changeset for, so the guard accepts no other value — update and create let Hibernate alter the schema behind Liquibase's back, and none skips the comparison entirely.

Adding the next required variable

All three variables in #1099 slipped through because nothing tied a new startup guard to the example file. ConfigEnvExampleContractTest now does: it fails the build when a guard in src/main/java names an environment variable that config.env.example does not declare.

It finds them by convention — the message ends must be set (THE_ENV_VAR), as in:

throw new IllegalStateException(
    "statistics.message-count.hmac-secret must be set (STATISTICS_MESSAGE_COUNT_HMAC_SECRET)");

So a new guard needs three things: that message shape, a placeholder line in config.env.example, and a row in the table above. The cluster side is separate — see ORISO-Helm#272.

Dedicated backend identities

Backend calls use two separate confidential clients. Human password and OTP login keeps the existing app client. A missing backend secret, reuse of a backend client for the app, or reuse of the same secret for both backends stops startup. There is no fallback to the old technical or admin passwords.

For developers — source configuration and rollout dependencies:

IDENTITY_TECHNICAL_CLIENT_ID=backend-technical
KEYCLOAK_BACKEND_TECHNICAL_CLIENT_SECRET=<separately provisioned technical client secret>
KEYCLOAK_CONFIG_ADMIN_CLIENTID=backend-admin
KEYCLOAK_BACKEND_ADMIN_CLIENT_SECRET=<different separately provisioned admin client secret>
KEYCLOAK_BACKEND_ADMIN_SERVICE_SUBJECT=<actual backend-admin service-account UUID>

Technical calls: IdentityAuthentication.loginService(clientId, clientSecret).
Admin REST: client_credentials using backend-admin; no admin username/password.
Trusted user exchange: administrative token acquired via backend-admin and pinned
to its subject, azp, expiry and otp-config-admin realm role; tokens with technical
or realm-admin are rejected. Original app client and requested_subject exchange
contract retained.

Deploy reviewed matching Keycloak client/role and Helm configuration first.
Read actual service-account subjects in each existing realm and keep incoming
helper subject/client/role checks pinned to those actual values. Fresh import
UUIDs do not prove an existing realm uses the same subjects. Provision secrets
outside source; do not commit or log them. Verify all consumers before disabling
legacy technical/admin accounts. No shared deployment is implied by this patch.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.