Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5772a70
[Server] Read server settings from UC_ environment variables
shba24 Nov 3, 2026
85fb47b
[CLI] Drop a comment that restates the code
shba24 Nov 3, 2026
1943aef
[Server] Point the client secret warning at bin/uc auth login
shba24 Nov 4, 2026
476239b
[CLI] Test reading the client secret from the environment
shba24 Nov 4, 2026
db8c642
[Server] Read the database password from an environment variable
shba24 Nov 3, 2026
67b25ea
[Docs] Leave the database password out of AGENTS.md
shba24 Nov 3, 2026
a733445
[Server] Drop a comment that restates getOverride
shba24 Nov 3, 2026
7376e27
Merge main into stack/ep31-config-secrets-env
shba24 Nov 5, 2026
d668515
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 5, 2026
e34f160
[Helm] Keep the old secret variables for custom server.properties tem…
shba24 Nov 5, 2026
c1e476c
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 5, 2026
f437c79
[Docs] Fix wording from the AI review
shba24 Nov 5, 2026
b81663d
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 5, 2026
b7c2155
[Server] Rewrap a Javadoc line over 100 characters
shba24 Nov 5, 2026
a1f926c
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 5, 2026
ccf1dc3
Merge main into stack/ep31-config-secrets-env
shba24 Nov 6, 2026
50c79b9
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 6, 2026
45908d7
Skip the env log line for the client secret; note auth.enabled in the…
shba24 Nov 6, 2026
bce4fd4
Rewrap the Helm upgrading note
shba24 Nov 6, 2026
ae24f11
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 6, 2026
c04f82f
Test the secrets-in-file warnings and the Helm secret wiring
shba24 Nov 6, 2026
52a6c8d
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 6, 2026
c6d1143
Pass whole storage credentials to the server; precompile env patterns
shba24 Nov 6, 2026
c24eb54
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 6, 2026
03c0541
Keep storage credentials out of the generated server.properties
shba24 Nov 6, 2026
39433fe
Rewrap the Helm upgrading note
shba24 Nov 6, 2026
86957eb
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 6, 2026
b63005a
Drop the precompiled env patterns
shba24 Nov 6, 2026
765315f
Test the secrets-in-file warnings through the log
shba24 Nov 6, 2026
c556936
Drop the docs note on exact-name variables
shba24 Nov 6, 2026
b39674e
Drop the rotation rationale from the docs
shba24 Nov 6, 2026
68c80c7
Shorten the secretEnv comment
shba24 Nov 6, 2026
0a43917
Restore the secrets fixture comment
shba24 Nov 6, 2026
6af48d7
Say that the UC_ variables take precedence over a custom template
shba24 Nov 6, 2026
52be2ac
Merge stack/ep31-config-secrets-env into stack/ep31-db-password-env
shba24 Nov 6, 2026
1d74a69
Merge main into stack/ep31-db-password-env
shba24 Nov 6, 2026
9ade813
Warn about a DB password in server.properties unless the environment …
shba24 Nov 6, 2026
0ed1bdf
Check the DB password Secret in the Helm render step
shba24 Nov 6, 2026
f45629d
Say the secretEnv helper also covers the DB password
shba24 Nov 6, 2026
07a508b
Test the ignored DB password warning in server.properties
shba24 Nov 7, 2026
48c3827
Correct the DB_PASSWORD_KEY Javadoc and drop its alias
shba24 Nov 7, 2026
a81ad0b
Merge main into stack/ep31-db-password-env
shba24 Nov 7, 2026
814b02b
[Helm] Keep the database password when the MySQL driver env is added
shba24 Nov 7, 2026
0aba501
Check the ignored DB password next to the secrets loop
shba24 Nov 10, 2026
eed6b86
Merge main into stack/ep31-db-password-env
shba24 Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/helm-chart-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,15 @@ jobs:
# Every part of a credential, so a restart after a rotation reads one set.
for ref in UC_S3_ACCESSKEY_0:ci-s3-credentials:accessKey UC_S3_SECRETKEY_0:ci-s3-credentials:secretKey \
UC_ADLS_TENANTID_0:ci-adls-credentials:tenantId UC_ADLS_CLIENTID_0:ci-adls-credentials:clientId \
UC_ADLS_CLIENTSECRET_0:ci-adls-credentials:clientSecret; do
UC_ADLS_CLIENTSECRET_0:ci-adls-credentials:clientSecret \
UC_HIBERNATE_CONNECTION_PASSWORD:ci-db-password:password; do
IFS=: read -r name secret key <<<"$ref"
grep -A4 -- "- name: $name\$" <<<"$out" | tr -d '\n' | grep -qE "name: \"$secret\" +key: $key( |\$)"
grep -A4 -- "- name: $name\$" <<<"$out" | tr -d '\n' | grep -qE "name: \"$secret\" +key: \"?$key\"?( |\$)"
done
# None in the file, which the init container writes only at pod start.
! grep -qE 'server\.client-secret|s3\.(accessKey|secretKey)|adls\.(tenantId|clientId|clientSecret)' <<<"$out" || exit 1
! grep -qE 'server\.client-secret|s3\.(accessKey|secretKey)|adls\.(tenantId|clientId|clientSecret)|hibernate\.connection\.password' <<<"$out" || exit 1
# The rendered chart no longer has DB_PASSWORD.
! grep -qF 'DB_PASSWORD' <<<"$out" || exit 1
# The deprecated init container variables are there only for a custom template.
legacy='S3_ACCESS_KEY_0 S3_SECRET_KEY_0 ADLS_TENANT_ID_0 ADLS_CLIENT_ID_0 ADLS_CLIENT_SECRET_0 OAUTH_CLIENT_SECRET'
! grep -qE -- "- name: (${legacy// /|})\$" <<<"$out" || exit 1
Expand Down
7 changes: 4 additions & 3 deletions docs/docker_compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ The UC server can be configured by editing the configuration files on the host,
and the mount will reflect the changes in the container.

Set secrets as environment variables of the `server` service, not in the mounted
`server.properties`, where they are deprecated (see
`server.properties` or `hibernate.properties`, where they are deprecated (see
[Secrets](./server/configuration.md#secrets)). For example, in `compose.yaml`:

```yaml
services:
server:
environment:
UC_S3_SECRETKEY_0: ${UC_S3_SECRETKEY_0}
UC_HIBERNATE_CONNECTION_PASSWORD: ${UC_HIBERNATE_CONNECTION_PASSWORD}
```

Compose fills in `${UC_S3_SECRETKEY_0}` from your shell or a `.env` file, so the
secret stays out of `compose.yaml`.
Compose fills in each `${...}` from your shell or a `.env` file, so the secrets stay
out of `compose.yaml`.

The configuration will also create a persistent, named volume to store the
server's data. This will persist between restarts of the container. See the
Expand Down
45 changes: 28 additions & 17 deletions docs/server/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,48 +95,59 @@ The server config file is at the location `etc/conf/server.properties` (relative

Any setting can also come from an environment variable named `UC_`, then the key in upper case, with `_` for each
character that is not a letter or digit. For example, `s3.region.0` is `UC_S3_REGION_0`. Set secrets this way, not in
`server.properties`:
`server.properties` or `hibernate.properties` (from `hibernate.properties`, only the password can come from the
environment):

| Key in `server.properties` | Environment variable |
| Key | Environment variable |
| --- | --- |
| `server.client-secret` | `UC_SERVER_CLIENT_SECRET` |
| `aws.secretKey` | `UC_AWS_SECRETKEY` |
| `s3.secretKey.<n>`, `s3.sessionToken.<n>` | `UC_S3_SECRETKEY_<n>`, `UC_S3_SESSIONTOKEN_<n>` |
| `adls.clientSecret.<n>` | `UC_ADLS_CLIENTSECRET_<n>` |
| `hibernate.connection.password` (in `hibernate.properties`) | `UC_HIBERNATE_CONNECTION_PASSWORD` |

```sh
export UC_S3_SECRETKEY_0='<secret key>'
bin/start-uc-server
```

A variable takes precedence over the same key in `server.properties`, and a variable named exactly as the key comes
before the `UC_` one. An empty `UC_` variable is ignored, and line breaks at the end of its value are dropped, as a
Kubernetes Secret made from a file often ends with one. The prefix keeps variables that runtimes set for their own use,
such as `AWS_REGION`, from changing settings. The server logs the name of each environment variable it uses for a
setting, never its value. `server.client-secret` is read by `bin/uc auth login`, not by the server.
The Helm chart passes each S3 and ADLS credential to the server container from its Kubernetes Secret, in
`UC_S3_ACCESSKEY_<n>` and `UC_S3_SECRETKEY_<n>`, or `UC_ADLS_TENANTID_<n>`, `UC_ADLS_CLIENTID_<n>` and
`UC_ADLS_CLIENTSECRET_<n>`.

!!! warning "Deprecated: secrets in `server.properties`"
Secrets in `server.properties` still work, but this is deprecated. The server logs a warning at startup for each
secret set in the file that no environment variable or system property supplies, and always for
`server.client-secret`. Move them to environment variables.
A variable takes precedence over the same key in `server.properties`, and `UC_HIBERNATE_CONNECTION_PASSWORD` over
`hibernate.properties`. A variable named exactly as the key comes before the `UC_` one. An empty `UC_` variable is
ignored, and line breaks at the end of its value are dropped, as a Kubernetes Secret made from a file often ends with
one. The prefix keeps variables that runtimes set for their own use, such as `AWS_REGION`, from changing settings. The
server logs the name of each environment variable it uses for a setting, never its value. `server.client-secret` is
read by `bin/uc auth login`, not by the server. The Helm chart passes each S3 and ADLS credential to the server
container from its Kubernetes Secret, in `UC_S3_ACCESSKEY_<n>` and `UC_S3_SECRETKEY_<n>`, or `UC_ADLS_TENANTID_<n>`,
`UC_ADLS_CLIENTID_<n>` and `UC_ADLS_CLIENTSECRET_<n>`. With `server.db.type: postgresql` or `mysql`, it also passes
`UC_HIBERNATE_CONNECTION_PASSWORD` if that database's `passwordSecretName` is set.

!!! warning "Deprecated: secrets in properties files"
Secrets in `server.properties` and the password in `hibernate.properties` still work, but this is deprecated. The
server logs a warning at startup for each one set in a file that no environment variable or system property
supplies (for the database password, only `UC_HIBERNATE_CONNECTION_PASSWORD` counts), and always for
`server.client-secret`. Move them to environment variables. The server never reads `hibernate.connection.password`
from `server.properties`; unless `UC_HIBERNATE_CONNECTION_PASSWORD` is set, it logs a warning that the line is
ignored.

#### Upgrading

- A `UC_` variable that is already set in the server's environment now takes precedence over the same key in
`server.properties`.
`server.properties`, and `UC_HIBERNATE_CONNECTION_PASSWORD` over `hibernate.properties`.
- `bin/uc auth login` reads `UC_SERVER_CLIENT_SECRET` before `server.client-secret` in `etc/conf/server.properties`.
- Helm: use the server image from the chart's release, which is the default. An older server image doesn't read these
variables, so S3 and ADLS lose their secrets.
variables, so S3 and ADLS lose their secrets, and the server can't log in to a PostgreSQL or MySQL database that
needs a password (`passwordSecretName` set).
- Helm: the rendered `server.properties` no longer holds `server.client-secret` or the S3 and ADLS credentials
(`s3.accessKey.<n>`, `s3.secretKey.<n>`, `adls.tenantId.<n>`, `adls.clientId.<n>`, `adls.clientSecret.<n>`). The
init container has `S3_ACCESS_KEY_<n>`, `S3_SECRET_KEY_<n>`, `ADLS_TENANT_ID_<n>`, `ADLS_CLIENT_ID_<n>`,
`ADLS_CLIENT_SECRET_<n>` and, with `auth.enabled`, `OAUTH_CLIENT_SECRET` only when `server.config.override` or
`extraProperties` is set, so a template that uses them still gets them; that is deprecated. The server container's
`UC_` variables still take precedence over the template's values. A container added through `extraInitContainers`
or `extraContainers` that needs these secrets must read them from the Kubernetes Secret itself.
- Helm: the rendered `hibernate.properties` no longer holds the password, and the init container no longer has
`DB_PASSWORD`. A container added through `extraInitContainers` or `extraContainers` that needs the password must
read it from the Secret named by the database's `passwordSecretName`. In a `server.db.overrideConfig`
template, remove the line `hibernate.connection.password=${DB_PASSWORD}`.

## Local file system storage

Expand Down
23 changes: 20 additions & 3 deletions docs/server/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ To deploy on Kubernetes, see [Deploy with Helm](helm.md).
### Configuring the UC server

- The UC server can be configured by modifying the files in `etc/conf/`. This includes properties related to logging,
server environment and the s3 configuration.
server environment and the s3 configuration. Set secrets, including the database password, in environment
variables instead; keeping them in these files is deprecated (see [Secrets](./configuration.md#secrets)).
- Setting the server environment to `dev` will use properties located in `etc/conf/hibernate.properties` to configure
the backend database whereas `test` will spin up an in-memory database.
- The `etc/data/` directory contains the data files that are used by the UC server. This includes the tables and volumes
Expand Down Expand Up @@ -114,11 +115,19 @@ To deploy on Kubernetes, see [Deploy with Helm](helm.md).
hibernate.connection.driver_class=com.mysql.cj.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/ucdb
hibernate.connection.user=uc_default_user
hibernate.connection.password=uc_default_password
hibernate.hikari.maximumPoolSize=20
hibernate.hikari.minimumIdle=2
```

- Set the password in the `UC_HIBERNATE_CONNECTION_PASSWORD` environment variable before you start the server:

```sh
export UC_HIBERNATE_CONNECTION_PASSWORD=uc_default_password
```

Keeping `hibernate.connection.password` in `hibernate.properties` still works but is deprecated: the server logs a
warning at startup (see [Secrets](configuration.md#secrets)).

- Modify the `jars/classpath` file and add path to your JDBC driver.

### Example PostgreSQL Connection
Expand All @@ -143,11 +152,19 @@ To deploy on Kubernetes, see [Deploy with Helm](helm.md).
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc:postgresql://localhost:5432/ucdb
hibernate.connection.user=uc_default_user
hibernate.connection.password=uc_default_password
hibernate.hikari.maximumPoolSize=20
hibernate.hikari.minimumIdle=2
```

- Set the password in the `UC_HIBERNATE_CONNECTION_PASSWORD` environment variable before you start the server:

```sh
export UC_HIBERNATE_CONNECTION_PASSWORD=uc_default_password
```

Keeping `hibernate.connection.password` in `hibernate.properties` still works but is deprecated: the server logs a
warning at startup (see [Secrets](configuration.md#secrets)).

### Existing deployments and column type changes

The server uses `hibernate.hbm2ddl.auto=update`. Hibernate can create missing tables and
Expand Down
9 changes: 8 additions & 1 deletion helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,14 @@ root
not set
</pre>
</td>
<td>Override Hibernate configuration for the server</td>
<td>Override Hibernate configuration for the server

Do not put the password here: set `passwordSecretName` and `passwordSecretKey` of the
database's config; with `db.type: postgresql` or `mysql` the chart passes the password to the
server as an environment variable. A password in `hibernate.properties` is deprecated.
If the template sets `hibernate.connection.password=${DB_PASSWORD}`, remove that line: the
server reads the password from `UC_HIBERNATE_CONNECTION_PASSWORD`.
</td>
</tr>
<tr>
<td>server.db.postgresqlConfig.dbName</td>
Expand Down
8 changes: 8 additions & 0 deletions helm/ci/secrets-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ storage:
- storageAccountName: ciaccount
credentialsSecretName: ci-adls-credentials
server:
db:
type: postgresql
postgresqlConfig:
host: ci-postgres
dbName: ucdb
username: uc
passwordSecretName: ci-db-password
passwordSecretKey: password
config:
# A custom template still gets the deprecated init container variables.
extraProperties:
Expand Down
21 changes: 13 additions & 8 deletions helm/templates/server/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ hibernate.connection.url=jdbc:h2:file:./etc/db/h2db;DB_CLOSE_ON_EXIT=FALSE;DB_CL
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc:postgresql://{{ .Values.server.db.postgresqlConfig.host }}:{{ .Values.server.db.postgresqlConfig.port }}/{{ .Values.server.db.postgresqlConfig.dbName }}{{ $urlParams }}
hibernate.connection.user={{ .Values.server.db.postgresqlConfig.username }}
{{- if .Values.server.db.postgresqlConfig.passwordSecretName }}
hibernate.connection.password=${DB_PASSWORD}
{{- end }}
{{- else if eq .Values.server.db.type "mysql" -}}

{{- $urlParamsList := list }}
Expand All @@ -94,9 +91,6 @@ hibernate.connection.driver_class=com.mysql.cj.jdbc.Driver
{{- /* Connector/J form-decodes the whole URL, the database name too, so urlquery is the right escape for it. */}}
hibernate.connection.url=jdbc:mysql://{{ required "server.db.mysqlConfig.host is required" .Values.server.db.mysqlConfig.host }}:{{ .Values.server.db.mysqlConfig.port }}/{{ urlquery .Values.server.db.mysqlConfig.dbName }}{{ $urlParams }}
hibernate.connection.user={{ .Values.server.db.mysqlConfig.username }}
{{- if .Values.server.db.mysqlConfig.passwordSecretName }}
hibernate.connection.password=${DB_PASSWORD}
{{- end }}
{{- else }}
{{ fail "Unsupported database type. Supported types are: file, postgresql, mysql." }}
{{- end }}
Expand Down Expand Up @@ -157,10 +151,21 @@ rootLogger.appenderRef.console.ref=Console
{{- end }}

{{/*
Storage credentials for the server container (see "Secrets" in docs/server/configuration.md). Every
part comes from here, not from the generated server.properties, which is written only at pod start.
Secrets for the server container (see "Secrets" in docs/server/configuration.md): the database
password and every part of each storage credential come from here, not from the generated properties
files, which are written only at pod start.
*/}}
{{- define "unitycatalog.server.secretEnv" -}}
{{- $db := dict "postgresql" .Values.server.db.postgresqlConfig "mysql" .Values.server.db.mysqlConfig }}
{{- with get $db .Values.server.db.type }}
{{- if .passwordSecretName }}
- name: UC_HIBERNATE_CONNECTION_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .passwordSecretName | quote }}
key: {{ required "Password secret key is required" .passwordSecretKey | quote }}
{{- end }}
{{- end }}
{{- range $index, $config := .Values.storage.credentials.s3 }}
- name: UC_S3_ACCESSKEY_{{ $index }}
valueFrom:
Expand Down
35 changes: 12 additions & 23 deletions helm/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,6 @@ spec:
- name: jwt-key-volume
mountPath: /home/unitycatalog/etc/confJwtKey
env:
{{- if and (eq .Values.server.db.type "postgresql") .Values.server.db.postgresqlConfig.passwordSecretName }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.server.db.postgresqlConfig.passwordSecretName | quote }}
key: {{ required "Password secret key is required" .Values.server.db.postgresqlConfig.passwordSecretKey | quote }}
{{- end }}
{{- if and (eq .Values.server.db.type "mysql") .Values.server.db.mysqlConfig.passwordSecretName }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.server.db.mysqlConfig.passwordSecretName | quote }}
key: {{ required "Password secret key is required" .Values.server.db.mysqlConfig.passwordSecretKey | quote }}
{{- end }}
{{- if and (eq .Values.server.db.type "postgresql") .Values.server.db.postgresqlConfig.ssl.enabled }}
{{- if .Values.server.db.postgresqlConfig.ssl.rootCert }}
- name: DB_ROOT_CERT
Expand Down Expand Up @@ -206,11 +192,21 @@ spec:
- --obs-port
- {{ . | quote }}
{{- end }}
{{- with include "unitycatalog.server.secretEnv" . | trim }}
# Secrets reach the server as environment variables, not through server.properties.
{{- $secretEnv := include "unitycatalog.server.secretEnv" . | trim }}
{{- /* One env list: a second env key would replace this one, and the secrets with it. */}}
{{- if or $secretEnv (eq .Values.server.db.type "mysql") }}
env:
{{- with $secretEnv }}
# Secrets reach the server as environment variables, not through the properties files.
{{- . | nindent 12 }}
{{- end }}
{{- if eq .Values.server.db.type "mysql" }}
# The image does not include the MySQL JDBC driver. Its launcher lists the classpath jars in a file, so the
# driver jar mounted from the volume loads from the module path instead.
- name: JDK_JAVA_OPTIONS
value: "--module-path=/home/unitycatalog/jdbc-drivers/mysql-connector-j.jar --add-modules=ALL-MODULE-PATH"
{{- end }}
{{- end }}
ports:
- name: api
containerPort: {{ .Values.server.deployment.port }}
Expand All @@ -220,13 +216,6 @@ spec:
containerPort: {{ . }}
protocol: TCP
{{- end }}
{{- if eq .Values.server.db.type "mysql" }}
env:
# The image does not include the MySQL JDBC driver. Its launcher lists the classpath jars in a file, so the
# driver jar mounted from the volume loads from the module path instead.
- name: JDK_JAVA_OPTIONS
value: "--module-path=/home/unitycatalog/jdbc-drivers/mysql-connector-j.jar --add-modules=ALL-MODULE-PATH"
{{- end }}

{{- if .Values.server.deployment.enableLivenessProbe }}
{{- with .Values.server.deployment.livenessProbe }}
Expand Down
8 changes: 8 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ server:

# -- (string) Override Hibernate configuration for the server
# @default -- not set
# @raw
#
# Do not put the password here: set `passwordSecretName` and `passwordSecretKey` of the
# database's config; with `db.type: postgresql` or `mysql` the chart passes the password to the
# server as an environment variable. A password in `hibernate.properties` is deprecated.
# If the template sets `hibernate.connection.password=${DB_PASSWORD}`, remove that line: the
# server reads the password from `UC_HIBERNATE_CONNECTION_PASSWORD`.
#
overrideConfig:

config:
Expand Down
Loading
Loading