Skip to content

Commit bcde4b0

Browse files
committed
Update variables
1 parent 5a6ebc0 commit bcde4b0

2 files changed

Lines changed: 52 additions & 14 deletions

File tree

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,17 @@ Below is the complete list of available options that can be used to customize yo
116116
| `ALLOW_ENCRYPTION` | Allow encrypted rooms and events | `true` | |
117117
| `ALLOW_ROOM_CREATION` | Allow standard users to create rooms | `true` | |
118118

119-
Any `CONTINUWUITY_*` environment variable is passed directly into the TOML config. Use `__` as a section separator. Examples:
119+
All configuration is generated from environment variables prefixed with `CONTINUWUITY_*`. Each variable maps directly to a TOML config key. Use `__` (double underscore) for section nesting.
120+
121+
Three ways to set any config value (listed in precedence order):
122+
123+
| Method | Example | Description |
124+
|--------|---------|-------------|
125+
| `CONTINUWUITY_*` | `CONTINUWUITY_OAUTH__OIDC__CLIENT_SECRET=xxx` | Full prefix — always takes priority |
126+
| Short section alias | `OAUTH__OIDC__CLIENT_SECRET=xxx` | Same as above, without the prefix. Any var containing `__` is auto-mapped |
127+
| Short name alias | `OIDC_CLIENT_SECRET=xxx` | Convenience alias for common vars (see table below) |
128+
129+
**TOML section mapping examples:**
120130

121131
| Example Variable | Generated TOML |
122132
|---|---|
@@ -126,14 +136,28 @@ Any `CONTINUWUITY_*` environment variable is passed directly into the TOML confi
126136

127137
The `well_known` and `proxy` sections are automatically mapped under `[global]`.
128138

139+
##### OIDC / Well-Known Short Name Aliases
140+
141+
| Short Name | Maps to TOML |
142+
|---|---|
143+
| `OIDC_CLIENT_SECRET` | `[oauth.oidc]``client_secret` |
144+
| `OIDC_DISCOVERY_URL` | `[oauth.oidc]``discovery_url` |
145+
| `OIDC_CLIENT_ID` | `[oauth.oidc]``client_id` |
146+
| `OIDC_ADDITIONAL_SCOPES` | `[oauth.oidc]``additional_scopes` |
147+
| `OIDC_PROMPT_FOR_LOCALPART` | `[oauth.oidc]``prompt_for_localpart` |
148+
| `OIDC_AUTOLOGIN` | `[oauth.oidc]``autologin` |
149+
| `OIDC_PREFERRED_USERNAME_CLAIM` | `[oauth.oidc]``preferred_username_claim` |
150+
| `WELL_KNOWN_CLIENT` | `[global.well_known]``client` |
151+
| `WELL_KNOWN_SERVER` | `[global.well_known]``server` |
152+
129153
#### Log Configuration
130154

131-
| Parameter | Description | Default | Advanced |
132-
| ----------- | ------------------------------------------------------------ | ----------------------- | -------- |
133-
| `LOG_TYPE` | Log output type `console` `file` `both` `none` | `both` | |
134-
| `LOG_LEVEL` | Log level (`trace`, `debug`, `info`, `warn`, `error`, `off`) | `info` | |
135-
| `LOG_PATH` | Logfiles path | `/logs/continuwuity/` | |
136-
| `LOG_FILE` | Logfile name | `continuwuity.log` | |
155+
| Parameter | Description | Default | Advanced | TOML Key |
156+
| ----------- | ------------------------------------------------------------ | ----------------------- | -------- | -------- |
157+
| `LOG_TYPE` | Log output type `console` `file` `both` `none` | `both` | ||
158+
| `LOG_LEVEL` | Log level (`trace`, `debug`, `info`, `warn`, `error`, `off`) | `info` | | `log` |
159+
| `LOG_PATH` | Logfiles path | `/logs/continuwuity/` | ||
160+
| `LOG_FILE` | Logfile name | `continuwuity.log` | ||
137161

138162
## Users and Groups
139163

rootfs/container/defaults/20-continuwuity

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
SETUP_TYPE=${SETUP_TYPE:-"AUTO"}
77

8+
9+
CONFIG_PATH=${CONFIG_PATH:-"/config/"}
10+
CONFIG_FILE=${CONFIG_FILE:-"conduwuit.toml"}
11+
LOG_TYPE=${LOG_TYPE:-"both"}
12+
LOG_PATH=${LOG_PATH:-"/logs/continuwuity/"}
13+
LOG_FILE=${LOG_FILE:-"continuwuity.log"}
14+
815
CONTINUWUITY_SERVER_NAME=${CONTINUWUITY_SERVER_NAME:-${SERVER_NAME:-}}
916
CONTINUWUITY_DATABASE_PATH=${CONTINUWUITY_DATABASE_PATH:-${DATA_PATH:-"/data/"}}
1017
CONTINUWUITY_PORT=${CONTINUWUITY_PORT:-${LISTEN_PORT:-"8008"}}
@@ -14,14 +21,21 @@ CONTINUWUITY_ALLOW_REGISTRATION=${CONTINUWUITY_ALLOW_REGISTRATION:-${ALLOW_REGIS
1421
CONTINUWUITY_ALLOW_FEDERATION=${CONTINUWUITY_ALLOW_FEDERATION:-${ALLOW_FEDERATION:-"true"}}
1522
CONTINUWUITY_ALLOW_ENCRYPTION=${CONTINUWUITY_ALLOW_ENCRYPTION:-${ALLOW_ENCRYPTION:-"true"}}
1623
CONTINUWUITY_ALLOW_ROOM_CREATION=${CONTINUWUITY_ALLOW_ROOM_CREATION:-${ALLOW_ROOM_CREATION:-"true"}}
24+
CONTINUWUITY_NEW_USER_DISPLAYNAME_SUFFIX=${CONTINUWUITY_NEW_USER_DISPLAYNAME_SUFFIX:-"${NEW_USER_DISPLAY_NAME_SUFFIX:-""}"}
25+
CONTINUWUITY_OAUTH__OIDC__CLIENT_SECRET=${CONTINUWUITY_OAUTH__OIDC__CLIENT_SECRET:-${OIDC_CLIENT_SECRET:-}}
26+
CONTINUWUITY_OAUTH__OIDC__DISCOVERY_URL=${CONTINUWUITY_OAUTH__OIDC__DISCOVERY_URL:-${OIDC_DISCOVERY_URL:-}}
27+
CONTINUWUITY_OAUTH__OIDC__CLIENT_ID=${CONTINUWUITY_OAUTH__OIDC__CLIENT_ID:-${OIDC_CLIENT_ID:-}}
28+
CONTINUWUITY_OAUTH__OIDC__ADDITIONAL_SCOPES=${CONTINUWUITY_OAUTH__OIDC__ADDITIONAL_SCOPES:-${OIDC_ADDITIONAL_SCOPES:-}}
29+
CONTINUWUITY_OAUTH__OIDC__PROMPT_FOR_LOCALPART=${CONTINUWUITY_OAUTH__OIDC__PROMPT_FOR_LOCALPART:-${OIDC_PROMPT_FOR_LOCALPART:-}}
30+
CONTINUWUITY_OAUTH__OIDC__AUTOLOGIN=${CONTINUWUITY_OAUTH__OIDC__AUTOLOGIN:-${OIDC_AUTOLOGIN:-}}
31+
CONTINUWUITY_OAUTH__OIDC__PREFERRED_USERNAME_CLAIM=${CONTINUWUITY_OAUTH__OIDC__PREFERRED_USERNAME_CLAIM:-${OIDC_PREFERRED_USERNAME_CLAIM:-}}
32+
CONTINUWUITY_WELL_KNOWN__CLIENT=${CONTINUWUITY_WELL_KNOWN__CLIENT:-${WELL_KNOWN_CLIENT:-}}
33+
CONTINUWUITY_WELL_KNOWN__SERVER=${CONTINUWUITY_WELL_KNOWN__SERVER:-${WELL_KNOWN_SERVER:-}}
1734

18-
# not mapped to CONTINUWUITY_* — used by scripts, not TOML
19-
CONFIG_PATH=${CONFIG_PATH:-"/config/"}
20-
CONFIG_FILE=${CONFIG_FILE:-"conduwuit.toml"}
21-
LOG_TYPE=${LOG_TYPE:-"both"}
22-
LOG_PATH=${LOG_PATH:-"/logs/continuwuity/"}
23-
LOG_FILE=${LOG_FILE:-"continuwuity.log"}
35+
# Auto-map vars with __ to TOML sections - OAUTH__OIDC__* directly
36+
for var in $(env | sed 's/=.*//' | grep '^[A-Z]' | grep -v '^CONTINUWUITY_' | grep -F '__'); do
37+
eval "CONTINUWUITY_${var}=\${CONTINUWUITY_${var}:-\${${var}}}"
38+
done
2439

25-
CONTINUWUITY_NEW_USER_DISPLAYNAME_SUFFIX=${CONTINUWUITY_NEW_USER_DISPLAYNAME_SUFFIX:-""}
2640

2741
get_defaults_advanced

0 commit comments

Comments
 (0)