Skip to content
mofcloud

Environment variables (ENV)

Last updated:

Set only what you need to change. Leave defaults out of your deployment file.

Where to set ENV

Compose: environment under the named service. Kubernetes: env / envFrom on the named container. Recreate or restart the workload after changes.

RK_* names map to boot.yaml; numbers are array indexes. In Compose, quote booleans and escape a literal $ as $$. RK also parses commas and backslashes; use a long random hexadecimal password for new databases. Keep existing passwords when upgrading.

This page lists the common ones. Any boot.yaml value can be overridden the same way; see rk-boot: Override boot ↗.

Terminal · Compose
docker compose up -d
Terminal · Kubernetes
kubectl -n mof rollout restart deployment/mof

Database

VariableDefaultDescription
RK_POSTGRES_0_ADDRlocalhost:5432PostgreSQL address:port.
RK_POSTGRES_0_USERpostgresDatabase role with login and CREATEDB permissions.
RK_POSTGRES_0_PASSpasswordUse your existing database password.
RK_POSTGRES_0_DATABASE_0_MAXOPENCONN30Maximum database connections per MOF process. With several processes, keep the total under the database limit.

All options in the rk-boot docs ↗

Empty database Params use sslmode=disable and TimeZone=Asia/Shanghai. MOF does not apply TLS to provider databases; TLS-only PostgreSQL is not supported.

Server and Admin

VariableDefaultDescription
MOF_ADMIN_PASSWORD—Optional Admin password override; otherwise generated on first setup.
RK_CONFIG_0_CONTENT_MODE_WEBfalseWeb-only mode. Leave both mode flags unset for all-in-one.
RK_CONFIG_0_CONTENT_MODE_WORKERfalseWorker-only mode; do not enable together with Web-only mode.
RK_CONFIG_0_CONTENT_JOBS_SYNCWORKERS2Sync jobs (bills, resources, exports) run at the same time in one process.
RK_CONFIG_0_CONTENT_JOBS_OPSWORKERS2Ops jobs (delete an account, purge bills, apply a virtual tag) run at the same time in one process.
MOF_JWT_SECRET—Optional sign-in signing key, at least 32 characters. Unset: generated on first start and stored in the database. If set, use the same value on every MOF process.

CORS

VariableDefaultDescription
RK_GIN_0_MIDDLEWARE_CORS_ALLOWORIGINS_0*Allowed browser origin, including scheme and port; no path.
RK_GIN_0_MIDDLEWARE_CORS_ALLOWCREDENTIALSfalseFor cross-origin credentials, use explicit origins instead of *.

All options in the rk-boot docs ↗

Example: cross-origin credentials
Compose · mof.environment
RK_GIN_0_MIDDLEWARE_CORS_ALLOWORIGINS_0: "https://mof.example.com"
RK_GIN_0_MIDDLEWARE_CORS_ALLOWCREDENTIALS: "true"

Add origins using _1, _2, etc. Replace the default * when credentials are enabled.

Logs

VariableDefaultDescription
RK_LOGGER_0_ZAP_LEVELinfoApplication log level: debug, info, warn, error.
RK_LOGGER_0_ZAP_ENCODINGconsoleApplication log format: console or json (for log collectors).
RK_GIN_0_MIDDLEWARE_LOGGING_ENABLEDtrueHTTP request logging; independent of application logs.
RK_POSTGRES_0_LOGGER_LEVELwarnSQL logging: info, warn, error, silent.

All options in the rk-boot docs ↗

MCP and OAuth

VariableDefaultDescription
MOF_MCP_INTERNAL_URLhttp://mof-mcp:8001Internal MCP address: the compose service / Kubernetes Service name. Leave unset.
MOF_PUBLIC_URL—OAuth public HTTPS origin shared by Dash and MOF, without a path.
MOF_MCP_OAUTH_SECRET—OAuth secret, at least 32 characters; shared across MOF nodes.
Example: OAuth
Compose · mof.environment
MOF_PUBLIC_URL: "https://mof.example.com"
MOF_MCP_OAUTH_SECRET: "REPLACE_WITH_A_RANDOM_SECRET_AT_LEAST_32_CHARACTERS"

Personal tokens do not need OAuth. Enable MCP access in Admin → Settings → MCP. OAuth configuration status does not prove public callback connectivity.

Dash upstream

VariableDefaultDescription
MOF_UPSTREAMhttp://mof:8080MOF address: the compose service / Kubernetes Service name. Set it only when MOF runs under another name.

Outbound proxy

VariableDefaultDescription
HTTP_PROXY—Optional outbound HTTP proxy.
HTTPS_PROXY—Optional outbound HTTPS proxy.
NO_PROXY—Exclude internal hosts and database addresses. SDK support varies.

— means unset. License and user management belong in Admin.