Skip to content

Commit cc075b1

Browse files
committed
docs: document codex-lb secret-backed database wiring
1 parent bfc43bc commit cc075b1

3 files changed

Lines changed: 52 additions & 1 deletion

File tree

charts/codex-lb/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ persistence:
5353
enabled: false # no SQLite file needed
5454
```
5555
56+
For secret-backed deployments, avoid putting the URL in `config.databaseUrl`, because that renders it into the Deployment manifest. Instead inject `CODEX_LB_DATABASE_URL` from a Secret:
57+
58+
```yaml
59+
envFrom:
60+
- secretRef:
61+
name: codex-lb-env
62+
63+
persistence:
64+
enabled: false
65+
```
66+
67+
## Database Migrations
68+
69+
By default Codex LB runs Alembic migrations on startup (`config.databaseMigrateOnStartup: true`). On app startup it converts async URLs to a sync driver for Alembic, applies pending revisions, and fails startup if migrations fail.
70+
71+
For single-replica installs this is usually the simplest option. If you need an external migration workflow, disable it explicitly:
72+
73+
```yaml
74+
config:
75+
databaseMigrateOnStartup: false
76+
```
77+
5678
## OAuth Callback via Ingress
5779

5880
To expose the OAuth callback through your ingress controller, enable both the OAuth Service and OAuth Ingress:
@@ -123,6 +145,9 @@ spec:
123145
name: icoretech
124146
namespace: flux-system
125147
values:
148+
envFrom:
149+
- secretRef:
150+
name: codex-lb-env
126151
encryptionKey:
127152
existingSecret:
128153
name: codex-lb-encryption
@@ -140,7 +165,7 @@ spec:
140165
| config.authBaseUrl | string | `"https://auth.openai.com"` | OpenAI OAuth base URL. |
141166
| config.databaseMigrateOnStartup | bool | `true` | Run Alembic migrations on startup. |
142167
| config.databasePoolSize | int | `15` | Database connection pool size. |
143-
| config.databaseUrl | string | `""` | Database URL. Use sqlite (default) or postgresql+asyncpg:// for PostgreSQL. |
168+
| config.databaseUrl | string | `""` | For secret-backed deployments, prefer envFrom/extraEnv with CODEX_LB_DATABASE_URL instead of setting this literal value. |
144169
| config.firewallTrustProxyHeaders | bool | `false` | Trust X-Forwarded-For headers (set true when behind ingress/proxy). |
145170
| config.firewallTrustedProxyCidrs | string | `"127.0.0.1/32,::1/128"` | Trusted proxy CIDRs (comma-separated). |
146171
| config.imageInlineFetchEnabled | bool | `true` | Enable inline image fetching. |

charts/codex-lb/README.md.gotmpl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ persistence:
5353
enabled: false # no SQLite file needed
5454
```
5555

56+
For secret-backed deployments, avoid putting the URL in `config.databaseUrl`, because that renders it into the Deployment manifest. Instead inject `CODEX_LB_DATABASE_URL` from a Secret:
57+
58+
```yaml
59+
envFrom:
60+
- secretRef:
61+
name: codex-lb-env
62+
63+
persistence:
64+
enabled: false
65+
```
66+
67+
## Database Migrations
68+
69+
By default Codex LB runs Alembic migrations on startup (`config.databaseMigrateOnStartup: true`). On app startup it converts async URLs to a sync driver for Alembic, applies pending revisions, and fails startup if migrations fail.
70+
71+
For single-replica installs this is usually the simplest option. If you need an external migration workflow, disable it explicitly:
72+
73+
```yaml
74+
config:
75+
databaseMigrateOnStartup: false
76+
```
77+
5678
## OAuth Callback via Ingress
5779

5880
To expose the OAuth callback through your ingress controller, enable both the OAuth Service and OAuth Ingress:
@@ -123,6 +145,9 @@ spec:
123145
name: icoretech
124146
namespace: flux-system
125147
values:
148+
envFrom:
149+
- secretRef:
150+
name: codex-lb-env
126151
encryptionKey:
127152
existingSecret:
128153
name: codex-lb-encryption

charts/codex-lb/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ persistence:
213213
# -- codex-lb application configuration mapped to CODEX_LB_* environment variables.
214214
config:
215215
# -- Database URL. Use sqlite (default) or postgresql+asyncpg:// for PostgreSQL.
216+
# -- For secret-backed deployments, prefer envFrom/extraEnv with CODEX_LB_DATABASE_URL instead of setting this literal value.
216217
databaseUrl: ""
217218

218219
# -- Database connection pool size.

0 commit comments

Comments
 (0)