Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

docs(rexctl): document every environment variable (#3684)

Hampus01f8dd91315a
diff --git a/.github/workflows/env-reference.yaml b/.github/workflows/env-reference.yaml
new file mode 100644
index 000000000..067b36887
--- /dev/null
+++ b/.github/workflows/env-reference.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+name: env-reference
+
+on:
+ pull_request:
+ paths:
+ - fluxer_rexctl/**
+ - fluxer_admin/**
+ - fluxer_api/**
+ - fluxer_app_proxy/**
+ - fluxer_common/**
+ - fluxer_gateway/**
+ - fluxer_gifs/**
+ - fluxer_media_proxy/**
+ - fluxer_messages/**
+ - fluxer_push/**
+ - fluxer_snowflakes/**
+ - fluxer_static/**
+ - fluxer_svc/**
+ - fluxer_unfurl/**
+ - fluxer_users/**
+ - fluxer_*/Dockerfile
+ - packages/**
+ - fluxer_docs/scripts/**
+ - fluxer_docs/src/installer/**
+ - fluxer_docs/src/pages/**
+ - fluxer_docs/src/server/**
+ - fluxer_docs/src/content/docs/**
+ - deploy/helm/**
+ - .github/workflows/env-reference.yaml
+ push:
+ branches:
+ - main
+ paths:
+ - fluxer_rexctl/**
+ - fluxer_admin/**
+ - fluxer_api/**
+ - fluxer_app_proxy/**
+ - fluxer_common/**
+ - fluxer_gateway/**
+ - fluxer_gifs/**
+ - fluxer_media_proxy/**
+ - fluxer_messages/**
+ - fluxer_push/**
+ - fluxer_snowflakes/**
+ - fluxer_static/**
+ - fluxer_svc/**
+ - fluxer_unfurl/**
+ - fluxer_users/**
+ - fluxer_*/Dockerfile
+ - packages/**
+ - fluxer_docs/scripts/**
+ - fluxer_docs/src/installer/**
+ - fluxer_docs/src/pages/**
+ - fluxer_docs/src/server/**
+ - fluxer_docs/src/content/docs/**
+ - deploy/helm/**
+ - .github/workflows/env-reference.yaml
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+defaults:
+ run:
+ shell: bash
+ working-directory: fluxer_rexctl
+
+jobs:
+ env-reference:
+ name: environment variables are documented
+ runs-on: ubuntu-24.04
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
+ with:
+ persist-credentials: false
+
+ - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e
+ with:
+ go-version: "1.27.x"
+ check-latest: true
+ cache-dependency-path: fluxer_rexctl/go.sum
+
+ - name: every environment variable is documented
+ run: go test -count=1 ./internal/instance
diff --git a/.github/workflows/rexctl.yaml b/.github/workflows/rexctl.yaml
index 4fe5057f4..ffb757d3a 100644
--- a/.github/workflows/rexctl.yaml
+++ b/.github/workflows/rexctl.yaml
@@ -7,6 +7,7 @@ on:
- fluxer_rexctl/**
- fluxer_admin/openapi-admin.json
- fluxer_docs/src/content/docs/operator/rexctl.mdx
+ - fluxer_docs/src/content/docs/operator/environment.mdx
- .github/workflows/rexctl.yaml
push:
branches:
@@ -15,6 +16,7 @@ on:
- fluxer_rexctl/**
- fluxer_admin/openapi-admin.json
- fluxer_docs/src/content/docs/operator/rexctl.mdx
+ - fluxer_docs/src/content/docs/operator/environment.mdx
- .github/workflows/rexctl.yaml
permissions:
@@ -77,11 +79,11 @@ jobs:
go run ./internal/instance/shipped
git diff --exit-code -- internal/instance/shipped.json
- - name: command reference is current
- run: |
- set -euo pipefail
- go run . docs --out ../fluxer_docs/src/content/docs/operator/rexctl.mdx
- git diff --exit-code -- ../fluxer_docs/src/content/docs/operator/rexctl.mdx
+ - name: tests
+ run: go test -count=1 ./...
+
+ - name: command and environment references are current
+ run: scripts/check-references.sh
build:
runs-on: ubuntu-24.04
diff --git a/fluxer_docs/astro.config.ts b/fluxer_docs/astro.config.ts
index 78b863637..1f712e2af 100644
--- a/fluxer_docs/astro.config.ts
+++ b/fluxer_docs/astro.config.ts
@@ -168,6 +168,7 @@ export default defineConfig({
'operator/sign-in',
'operator/kubernetes',
'operator/docker-compose',
+ 'operator/environment',
'operator/rexctl',
],
},
diff --git a/fluxer_docs/src/content/docs/operator/docker-compose.mdx b/fluxer_docs/src/content/docs/operator/docker-compose.mdx
index 789636e3a..df6fd2319 100644
--- a/fluxer_docs/src/content/docs/operator/docker-compose.mdx
+++ b/fluxer_docs/src/content/docs/operator/docker-compose.mdx
@@ -31,7 +31,7 @@ for key in POSTGRES_PASSWORD MEILI_MASTER_KEY FLUXER_S3_SECRET_KEY FLUXER_SUDO_M
FLUXER_ADMIN_OAUTH_CLIENT_SECRET LIVEKIT_API_SECRET; do
sed -i "s|^$key=.*|$key=$(openssl rand -hex 32)|" .env
done
-sed -i "s|^FLUXER_SETUP_TOKEN=.*|FLUXER_SETUP_TOKEN=$(openssl rand -hex 16)|" .env
+sed -i "s|^FLUXER_SETUP_TOKEN=.*|FLUXER_SETUP_TOKEN=$(openssl rand -hex 32)|" .env
sed -i "s|^FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=.*|FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=$(openssl rand -base64 32)|" .env
sed -i "s|^FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64=.*|FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64=$(openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform DER | base64 | tr -d '\n')|" .env
openssl ecparam -name prime256v1 -genkey -noout -out vapid.pem
@@ -40,7 +40,9 @@ sed -i "s|^FLUXER_VAPID_PRIVATE_KEY=.*|FLUXER_VAPID_PRIVATE_KEY=$(openssl ec -in
rm vapid.pem
```
-Keep a copy of `.env` somewhere safe. The database, search, storage, voice and push keys can't change once Fluxer has started, because your data depends on them. If your platform asks for environment values instead of a `.env` file, paste the lines from `.env` there.
+You can put [every other setting](/operator/environment/) in `.env` too.
+
+Keep a copy of `.env` somewhere safe. The database, search and push keys can't change once Fluxer has started. Your data depends on them. If your platform has its own place for environment values, paste the lines from `.env` there.
## Start it
@@ -61,7 +63,7 @@ When every service is healthy, open your domain in a browser and enter the `FLUX
## Upgrade
-Download the new bundle into the same folder and unpack it, which replaces every file except `.env`. If the new `.env.example` has a key your `.env` doesn't have yet, add it, then run `docker compose up -d`.
+Download the new bundle into the same folder and unpack it, which replaces every file except `.env`. If the new `.env.example` has an uncommented line your `.env` doesn't have yet, add it, then run `docker compose up -d`.
Back up the Docker volumes yourself before you upgrade, because `rexctl backup` isn't available without rexctl.
diff --git a/fluxer_docs/src/content/docs/operator/environment.mdx b/fluxer_docs/src/content/docs/operator/environment.mdx
new file mode 100644
index 000000000..a83688813
--- /dev/null
+++ b/fluxer_docs/src/content/docs/operator/environment.mdx
@@ -0,0 +1,2733 @@
+---
+# SPDX-License-Identifier: AGPL-3.0-or-later
+title: Environment variables
+description: Every environment variable Fluxer and the Docker Compose bundle use.
+sidebar:
+ label: Environment variables
+---
+
+rexctl generates this page and the `.env.example` in the compose bundle of each release. Use the `.env.example` that came with your release. An entry for a setting rexctl manages ends with the `rexctl config set` command that changes it.
+
+## Required
+
+Fill these in before the first start.
+
+### `FLUXER_SETTINGS_LOADED`
+
+Leave it set to `true`. Docker Compose won't start without it.
+
+### `FLUXER_DOMAIN`
+
+The domain Fluxer runs on, such as `chat.example.com`. With rexctl, use `rexctl config set domain`.
+
+## First admin account
+
+### `FLUXER_SETUP_TOKEN`
+
+The token the setup wizard asks for before it creates the first admin account. Use 32 to 256 printable characters, such as the output of `openssl rand -hex 32`. When it's empty, the API generates one on its first start and writes it to its log once. With Docker Compose, `docker compose logs api` shows it. Keep it secret.
+
+## Secrets
+
+Fill these in before the first start, and keep a copy of `.env` somewhere safe. Only `FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64` may stay empty. rexctl generates these when it installs Fluxer. With Docker Compose, [these commands](/operator/docker-compose/#fill-in-env) fill them in.
+
+### `FLUXER_S3_ACCESS_KEY`
+
+The object store access key. Keep the default for the bundled object store, or set the access key of your own store. The default is `fluxer`. With rexctl, use `rexctl config set storage.access_key`.
+
+### `LIVEKIT_API_KEY`
+
+The LiveKit API key. Docker Compose passes it to the bundled LiveKit as its API key and webhook key, and to Fluxer as `FLUXER_LIVEKIT_API_KEY`. The value is `fluxer`.
+
+### `POSTGRES_PASSWORD`
+
+The Postgres password. Docker Compose passes it to Fluxer as `FLUXER_POSTGRES_PASSWORD` and to the bundled Postgres, which sets it only on its first start with an empty data directory. Set it once before the first start and never change it. Keep it secret.
+
+### `MEILI_MASTER_KEY`
+
+The Meilisearch master key. Docker Compose passes it to the bundled Meilisearch and to Fluxer as `FLUXER_SEARCH_API_KEY`. Set it once before the first start and never change it. Keep it secret.
+
+### `FLUXER_S3_SECRET_KEY`
+
+The object store secret key. For your own object store, set its secret key, and update it when you rotate the key at the store. With Docker Compose, a new value applies the next time it starts the services. Keep it secret. With rexctl, use `rexctl config set storage.secret_key`.
+
+### `LIVEKIT_API_SECRET`
+
+The LiveKit API secret that goes with `LIVEKIT_API_KEY`, at least 32 characters. Docker Compose passes it to the bundled LiveKit and to Fluxer as `FLUXER_LIVEKIT_API_SECRET`. With Docker Compose, a new value applies the next time it starts the services. Keep it secret.
+
+### `FLUXER_SUDO_MODE_SECRET`
+
+The key Fluxer signs sudo mode tokens with and derives a few other internal signing keys from. Changing it ends every active sudo mode session, voids codes already emailed and makes every remembered device count as new. Keep it secret.
+
+### `FLUXER_CONNECTION_INITIATION_SECRET`
+
+The key that signs connection initiation tokens, data export links and admin download links. Changing it breaks tokens not yet verified and download links already sent. Keep it secret.
+
+### `FLUXER_PROFILE_PSEUDONYM_SECRET`
+
+The key Fluxer uses to derive the placeholder name and tag that others see while an account's profile is hidden. The api, worker and users services must have the same value. Changing it gives every hidden profile a new placeholder. Keep it secret.
+
+### `FLUXER_GATEWAY_RPC_AUTH_TOKEN`
+
+The token the api, worker, gateway and push services use to authenticate internal calls to each other. Every service must have the same value. Keep it secret.
+
+### `FLUXER_ERLANG_COOKIE`
+
+The shared secret for Erlang distribution in the gateway. Anyone who can connect to the distribution port with this value can run code in the gateway. Keep the value secret and the port private.
+
+### `FLUXER_MEDIA_PROXY_SECRET_KEY`
+
+The key that signs media proxy URLs. The api, worker, media-proxy, gifs and unfurl services must have the same value. Keep it secret.
+
+### `FLUXER_ADMIN_SECRET_KEY_BASE`
+
+The key the admin panel signs its sessions, CSRF tokens and OAuth state with. Changing it signs everyone out of the admin panel. Keep it secret.
+
+### `FLUXER_ADMIN_OAUTH_CLIENT_SECRET`
+
+The OAuth2 client secret the admin panel uses to sign in through the API. The api and admin services must have the same value. Keep it secret.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64`
+
+The key that signs upload relay tokens, as standard base64 that decodes to at least 32 bytes. The api, worker and media-proxy services must have the same value. Keep it secret.
+
+### `FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64`
+
+The RSA private key the unfurl service signs ActivityPub requests with when it builds link previews for fediverse posts. Use base64 DER in PKCS#8 or PKCS#1 form. When it's empty, the unfurl service makes those requests unsigned. Keep it secret.
+
+### `FLUXER_VAPID_PUBLIC_KEY`
+
+The public half of the VAPID key pair for browser push notifications, as unpadded base64url of the 65-byte uncompressed P-256 point. The value is 87 characters long. Set the pair once before the first start and never change it.
+
+### `FLUXER_VAPID_PRIVATE_KEY`
+
+The private half of the VAPID key pair for browser push notifications, as unpadded base64url of the 32-byte P-256 private key. The value is 43 characters long. It must match `FLUXER_VAPID_PUBLIC_KEY`. Set the pair once before the first start and never change it. Keep it secret.
+
+## Compose files
+
+The optional compose files change how Fluxer runs. To use one, list it after `docker-compose.yml` in `COMPOSE_FILE`, such as `COMPOSE_FILE=docker-compose.yml:docker-compose.proxy.yml`.
+
+- `docker-compose.proxy.yml` for your own reverse proxy
+- `tunnel.compose.yml` for a tunnel
+- `external-object-store.compose.yml` for your own object store
+- `ipv6.compose.yml` for IPv6 on Fluxer's network
+
+### `COMPOSE_FILE`
+
+The compose files Docker Compose uses, with `docker-compose.yml` first. Separate them with colons, or with semicolons on Windows. rexctl takeover uses the value in your shell first and then the one in `.env`. Leave it commented out to use `docker-compose.yml` and, if there is one, `docker-compose.override.yml`. An empty value stops Docker Compose from finding any file.
+
+### `COMPOSE_PATH_SEPARATOR`
+
+The separator between the files in `COMPOSE_FILE`. When it's empty, Docker Compose and rexctl use a colon, or a semicolon on Windows.
+
+### `COMPOSE_PROJECT_NAME`
+
+The Docker Compose project name, which Docker Compose puts in front of every container and volume name. When it's empty, Docker Compose uses `fluxer` from `docker-compose.yml`. rexctl eject writes the project name rexctl ran the instance under. Keep that value, or Docker Compose starts new containers with new, empty volumes. rexctl takeover uses the value in your shell first and then the one in `.env`.
+
+## Public address
+
+Fluxer works out every address from `FLUXER_DOMAIN`. Set these only when a part of Fluxer runs on another address.
+
+### `FLUXER_PUBLIC_SCHEME`
+
+The scheme browsers use to open the instance. Use `https` or `http`. Fluxer builds public addresses from it and `FLUXER_DOMAIN` when `FLUXER_PUBLIC_ORIGIN` is empty. With `http`, also set `FLUXER_PUBLIC_PORT`, usually to `80`. Without rexctl, the edge also uses it for its default site address. The default is `https`. rexctl sets this from your domain and edge settings unless you set it. With rexctl, use `rexctl config set FLUXER_PUBLIC_SCHEME`.
+
+### `FLUXER_PUBLIC_ORIGIN`
+
+The origin browsers use to open the instance, as a scheme, host and optional port with no path or trailing slash, such as `https://chat.example.com:8443`. When it's set, the default public addresses of the api, worker and other services come from it. Keep `FLUXER_DOMAIN` set to the same host. The edge site address, the passkey relying party ID, the default sender and VAPID contact addresses and the gateway still use `FLUXER_DOMAIN`. rexctl sets this from your domain and edge settings unless you set it. With rexctl, use `rexctl config set FLUXER_PUBLIC_ORIGIN`.
+
+### `FLUXER_APP_ORIGIN_ALIASES`
+
+More web app origins, separated by commas, for an instance that serves the web app on more than one hostname. Each must be an http or https origin. The API allows each one through CORS and accepts it for sign-in handoff. For passkeys on these origins, list them and the web app origin in `FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS`. With rexctl, use `rexctl config set FLUXER_APP_ORIGIN_ALIASES`.
+
+### `FLUXER_API_ENDPOINT`
+
+The public base URL of the API. When it's empty, Fluxer uses the public origin followed by `/api`. With rexctl, use `rexctl config set FLUXER_API_ENDPOINT`.
+
+### `FLUXER_API_CLIENT_ENDPOINT`
+
+The API base URL Fluxer hands to clients. When it's empty, Fluxer uses the public origin followed by `/api`. With rexctl, use `rexctl config set FLUXER_API_CLIENT_ENDPOINT`.
+
+### `FLUXER_APP_ENDPOINT`
+
+The address of the web app, which Fluxer allows through CORS and uses in links. When it's empty, Fluxer uses the public origin. With rexctl, use `rexctl config set FLUXER_APP_ENDPOINT`.
+
+### `FLUXER_GATEWAY_ENDPOINT`
+
+The public WebSocket URL of the gateway, starting with `ws` or `wss`. When it's empty, Fluxer uses `wss` on the public host followed by `/gateway`, or `ws` when the public scheme is `http`. With rexctl, use `rexctl config set FLUXER_GATEWAY_ENDPOINT`.
+
+### `FLUXER_MEDIA_ENDPOINT`
+
+The public address of the media proxy. When it's empty, Fluxer uses the public origin followed by `/media`. With rexctl, use `rexctl config set FLUXER_MEDIA_ENDPOINT`.
+
+### `FLUXER_MEDIA_PROXY_PUBLIC_ENDPOINT`
+
+The public media proxy address that the gifs, unfurl and media-proxy services use when they build media links. When it's empty, they use `FLUXER_MEDIA_ENDPOINT`, or the public origin followed by `/media`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_PUBLIC_ENDPOINT`.
+
+### `FLUXER_STATIC_CDN_ENDPOINT`
+
+The origin Fluxer serves static assets such as the favicon and app icons from. When it's empty, the api and worker services derive it from `FLUXER_STATIC_CDN_DOMAIN` or the public origin, and the admin and gateway services use the public origin. The app-proxy service uses it only when it's set, and serves its own copies of the web app files otherwise. With rexctl, use `rexctl config set FLUXER_STATIC_CDN_ENDPOINT`.
+
+### `FLUXER_ADMIN_ENDPOINT`
+
+The public address of the admin panel. When it's empty, Fluxer uses the public origin followed by `FLUXER_ADMIN_BASE_PATH`. The admin sign-in redirect is this address followed by `/oauth2_callback`, and the admin panel uses secure cookies when the address starts with `https`. With rexctl, use `rexctl config set FLUXER_ADMIN_ENDPOINT`.
+
+### `FLUXER_MARKETING_ENDPOINT`
+
+The address of the marketing site, which Fluxer allows through CORS and uses in some links. When it's empty, Fluxer uses the public origin. With rexctl, use `rexctl config set FLUXER_MARKETING_ENDPOINT`.
+
+### `FLUXER_INVITE_ENDPOINT`
+
+The base URL of invite links. When it's empty, Fluxer uses `FLUXER_INVITE_DOMAIN` or the public host, followed by `/invite`. With rexctl, use `rexctl config set FLUXER_INVITE_ENDPOINT`.
+
+### `FLUXER_GIFT_ENDPOINT`
+
+The base URL of gift links. When it's empty, Fluxer uses `FLUXER_GIFT_DOMAIN` or the public host, followed by `/gift`. With rexctl, use `rexctl config set FLUXER_GIFT_ENDPOINT`.
+
+### `FLUXER_STATIC_CDN_DOMAIN`
+
+A separate hostname for static assets, with no scheme, port or path. When it's set, the default static address of the api and worker services is `https://` followed by this host. With rexctl, use `rexctl config set FLUXER_STATIC_CDN_DOMAIN`.
+
+### `FLUXER_INVITE_DOMAIN`
+
+A separate hostname for invite links, with no scheme, port or path. When it's set, the default invite address uses this host. With rexctl, use `rexctl config set FLUXER_INVITE_DOMAIN`.
+
+### `FLUXER_GIFT_DOMAIN`
+
+A separate hostname for gift links, with no scheme, port or path. When it's set, the default gift address uses this host. With rexctl, use `rexctl config set FLUXER_GIFT_DOMAIN`.
+
+## Edge and HTTPS
+
+By default Fluxer listens on ports 80 and 443 and gets its own HTTPS certificate for your domain.
+
+### `FLUXER_PUBLIC_PORT`
+
+The port people use in Fluxer's address, when it differs from the one Fluxer listens on. The default is `443`. rexctl sets this from your domain and edge settings unless you set it. With rexctl, use `rexctl config set edge.public_port`.
+
+### `FLUXER_HTTP_PORT`
+
+The port Fluxer listens on for HTTP. `docker-compose.proxy.yml` and `tunnel.compose.yml` ignore it and use `FLUXER_EDGE_BIND`. The default is `80`. With rexctl, use `rexctl config set edge.http_port`.
+
+### `FLUXER_HTTPS_PORT`
+
+The port Fluxer listens on for HTTPS. If people connect to this port directly, set `FLUXER_PUBLIC_PORT` to the same port. `docker-compose.proxy.yml` and `tunnel.compose.yml` ignore it and use `FLUXER_EDGE_BIND`. The default is `443`. With rexctl, use `rexctl config set edge.https_port`.
+
+### `FLUXER_EDGE_BIND`
+
+The address your reverse proxy or tunnel connects to. The default is `127.0.0.1:8080` with `docker-compose.proxy.yml`, or `127.0.0.1:80` with `tunnel.compose.yml`. With rexctl, use `rexctl config set edge.bind`.
+
+### `FLUXER_ADMIN_BASE_PATH`
+
+The path the admin panel is served under, with a leading slash and no trailing slash, such as `/panel`. The edge serves the admin panel under this path, the admin service builds its links with it, and the default `FLUXER_ADMIN_ENDPOINT` follows it. The default is `/admin`. With rexctl, use `rexctl config set FLUXER_ADMIN_BASE_PATH`.
+
+### `FLUXER_EDGE_SITE_ADDRESS`
+
+The site address the edge serves in its Caddyfile, including the scheme. When it's empty, Docker Compose uses `FLUXER_CADDY_SITE_ADDRESS`, or `FLUXER_PUBLIC_SCHEME` followed by `://` and `FLUXER_DOMAIN`. `docker-compose.proxy.yml` and `tunnel.compose.yml` set their own value. rexctl sets this from your domain and edge settings unless you set it. With rexctl, use `rexctl config set FLUXER_EDGE_SITE_ADDRESS`.
+
+### `FLUXER_CADDY_SITE_ADDRESS`
+
+The old name for `FLUXER_EDGE_SITE_ADDRESS`. Docker Compose uses it only without rexctl and when `FLUXER_EDGE_SITE_ADDRESS` is empty. rexctl takeover and rexctl upgrade move it to `FLUXER_EDGE_SITE_ADDRESS`.
+
+### `FLUXER_EDGE_TRUSTED_PROXIES`
+
+Proxies whose client address headers Fluxer trusts, separated by spaces. The default is `127.0.0.1/32`, or `private_ranges` with `docker-compose.proxy.yml` or `tunnel.compose.yml`. With rexctl, use `rexctl config set edge.trusted_proxies`.
+
+### `FLUXER_EDGE_ENCODE`
+
+The response compression the edge offers, written as the arguments of the Caddy encode directive, such as `gzip` alone. The default is `zstd gzip`. With rexctl, use `rexctl config set FLUXER_EDGE_ENCODE`.
+
+### `FLUXER_EDGE_PROTOCOLS`
+
+The HTTP versions the edge serves, as the arguments of the Caddy protocols option, such as `h1 h2` to turn off HTTP/3. The default is `h1 h2 h3`. On a machine with little memory, rexctl turns off HTTP/3 unless you set it. With rexctl, use `rexctl config set FLUXER_EDGE_PROTOCOLS`.
+
+### `FLUXER_EDGE_GLOBAL_OPTIONS`
+
+Extra Caddy global options on one line, added to the global block of the edge Caddyfile, such as `email [email protected]` for the certificate account. An empty value adds nothing. With rexctl, use `rexctl config set FLUXER_EDGE_GLOBAL_OPTIONS`.
+
+### `FLUXER_EDGE_TLS`
+
+The arguments of a Caddy tls directive for the edge, such as `internal` for a certificate from Caddy's own local CA, or a certificate and key path under `/certs`. When it's empty, the edge adds no tls line and Caddy gets certificates on its own. `docker-compose.proxy.yml` and `tunnel.compose.yml` ignore it. With rexctl, use `rexctl config set FLUXER_EDGE_TLS`.
+
+## Voice and video
+
+Calls connect directly to this machine on `FLUXER_LIVEKIT_TCP_PORT` and `FLUXER_LIVEKIT_UDP_PORT`, even when Fluxer is behind your own proxy.
+
+### `FLUXER_LIVEKIT_ENABLED`
+
+Whether voice and video calls are turned on. Use `true` or `false`. The default is `true`. With rexctl, use `rexctl config set FLUXER_LIVEKIT_ENABLED`.
+
+### `FLUXER_LIVEKIT_INTERNAL_URL`
+
+The URL the API uses for the LiveKit control API of the bundled LiveKit, the first server in the default voice region. Servers added in the admin panel use their own address. The default is `http://livekit:7880`. With rexctl, use `rexctl config set FLUXER_LIVEKIT_INTERNAL_URL`.
+
+### `FLUXER_LIVEKIT_DEFAULT_REGION`
+
+The voice region Fluxer creates when no voice regions exist yet, as a JSON object with `id`, `name`, `emoji`, `latitude` and `longitude`. The default is `{"id":"default","name":"Default","emoji":"🌍","latitude":0,"longitude":0}`. With rexctl, use `rexctl config set FLUXER_LIVEKIT_DEFAULT_REGION`.
+
+### `FLUXER_LIVEKIT_URL`
+
+The URL browsers and apps use for voice signalling. When it's empty, Fluxer uses the public origin, or `FLUXER_PUBLIC_SCHEME`, `FLUXER_DOMAIN` and `FLUXER_PUBLIC_PORT`, followed by `/livekit`. Set it only when LiveKit runs on another host. With rexctl, use `rexctl config set FLUXER_LIVEKIT_URL`.
+
+### `FLUXER_VOICE_P2P_STUN_URLS`
+
+STUN URLs for peer-to-peer calls, separated by commas, such as `stun:stun.example.com:3478`. When it's empty, peer-to-peer calls work only between devices with a direct route to each other, such as on one local network. With rexctl, use `rexctl config set FLUXER_VOICE_P2P_STUN_URLS`.
+
+### `FLUXER_LIVEKIT_TCP_PORT`
+
+The TCP port for voice and video. The default is `7881`. With rexctl, use `rexctl config set voice.tcp_port`.
+
+### `FLUXER_LIVEKIT_UDP_PORT`
+
+The UDP port for voice and video. The default is `7882`. With rexctl, use `rexctl config set voice.udp_port`.
+
+### `FLUXER_LIVEKIT_NODE_IP`
+
+The public IP address voice and video use, when Fluxer can't find it by itself. Set `FLUXER_LIVEKIT_USE_EXTERNAL_IP` to `false` with it. With rexctl, use `rexctl config set voice.public_ip`.
+
+### `FLUXER_LIVEKIT_USE_EXTERNAL_IP`
+
+Whether LiveKit finds its public IP address through STUN. Use `true` or `false`. Set it to `false` when you set `FLUXER_LIVEKIT_NODE_IP`. The default is `true`. With rexctl, use `rexctl config set voice.public_ip`.
+
+### `FLUXER_LIVEKIT_STUN_PRIMARY`
+
+The first STUN host LiveKit asks to find its public IP address, as `host:port`. Point it at another STUN host to avoid contacting Google. The default is `stun.l.google.com:19302`. With rexctl, use `rexctl config set FLUXER_LIVEKIT_STUN_PRIMARY`.
+
+### `FLUXER_LIVEKIT_STUN_SECONDARY`
+
+The second STUN host LiveKit asks to find its public IP address, as `host:port`. The default is `stun1.l.google.com:19302`. With rexctl, use `rexctl config set FLUXER_LIVEKIT_STUN_SECONDARY`.
+
+## Object storage
+
+By default Fluxer keeps files in the bundled object store. To use your own S3-compatible store, set its address and buckets, add `external-object-store.compose.yml` to `COMPOSE_FILE` and put its keys in `FLUXER_S3_ACCESS_KEY` and `FLUXER_S3_SECRET_KEY`.
+
+### `FLUXER_S3_ENDPOINT`
+
+The address of the S3-compatible object store. The default is `http://seaweedfs:8333`. With rexctl, use `rexctl config set storage.endpoint`.
+
+### `FLUXER_S3_PUBLIC_ENDPOINT`
+
+The object store address browsers use, when it differs from the one Fluxer uses. When it's empty, the api and worker use `FLUXER_S3_ENDPOINT`, and the web app doesn't let browsers upload to the object store. With rexctl, use `rexctl config set storage.public_endpoint`.
+
+### `FLUXER_S3_REGION`
+
+The object store region. The default is `us-east-1`. With rexctl, use `rexctl config set storage.region`.
+
+### `FLUXER_S3_FORCE_PATH_STYLE`
+
+Whether the object store needs path-style addresses. Use `true` or `false`. The default is `true`. With rexctl, use `rexctl config set storage.path_style`.
+
+### `FLUXER_S3_SESSION_TOKEN`
+
+A temporary S3 session token the media proxy sends with its object store requests. When it's empty, the media proxy sends none. Keep it secret. With rexctl, use `rexctl config set FLUXER_S3_SESSION_TOKEN`.
+
+### `FLUXER_S3_BUCKET_CDN`
+
+The bucket for processed media such as avatars and other served assets. The bundled object store creates it, and an outside store needs it to exist already. The default is `fluxer`. With rexctl, use `rexctl config set FLUXER_S3_BUCKET_CDN`.
+
+### `FLUXER_S3_BUCKET_UPLOADS`
+
+The bucket for raw uploads. The bundled object store creates it, and an outside store needs it to exist already. The default is `fluxer-uploads`. With rexctl, use `rexctl config set FLUXER_S3_BUCKET_UPLOADS`.
+
+### `FLUXER_S3_BUCKET_REPORTS`
+
+The bucket for abuse report evidence. The bundled object store creates it, and an outside store needs it to exist already. The default is `fluxer-reports`. With rexctl, use `rexctl config set FLUXER_S3_BUCKET_REPORTS`.
+
+### `FLUXER_S3_BUCKET_HARVESTS`
+
+The bucket for data export archives. The bundled object store creates it, and an outside store needs it to exist already. The default is `fluxer-harvests`. With rexctl, use `rexctl config set FLUXER_S3_BUCKET_HARVESTS`.
+
+### `FLUXER_S3_READ_ENDPOINT`
+
+A separate http or https address, with no credentials, that the media proxy fetches objects in `FLUXER_S3_READ_BUCKET` from. When it's empty, the media proxy fetches everything through `FLUXER_S3_ENDPOINT`. With rexctl, use `rexctl config set FLUXER_S3_READ_ENDPOINT`.
+
+### `FLUXER_S3_READ_BUCKET`
+
+The bucket the media proxy fetches through `FLUXER_S3_READ_ENDPOINT`. When it's empty, the media proxy uses `FLUXER_S3_BUCKET_CDN`. With rexctl, use `rexctl config set FLUXER_S3_READ_BUCKET`.
+
+### `FLUXER_S3_READ_BUCKET_STYLE`
+
+How the bucket appears in URLs to `FLUXER_S3_READ_ENDPOINT`. Use `path`, `virtual` or `root`. When it's empty, the media proxy uses `path` when `FLUXER_S3_FORCE_PATH_STYLE` is on and `virtual` when it's off. With rexctl, use `rexctl config set FLUXER_S3_READ_BUCKET_STYLE`.
+
+### `FLUXER_S3_READ_SIGNED`
+
+Whether the media proxy signs its requests to `FLUXER_S3_READ_ENDPOINT`. Use `true` or `false`. Use `false` only for a bucket that allows anonymous downloads. The default is `true`. With rexctl, use `rexctl config set FLUXER_S3_READ_SIGNED`.
+
+### `FLUXER_API_PRESIGNED_ATTACHMENT_UPLOADS_ENABLED`
+
+Whether the API hands clients upload URLs that let them upload attachments before they send the message. Use `true` or `false`. The default is `true`. With rexctl, use `rexctl config set FLUXER_API_PRESIGNED_ATTACHMENT_UPLOADS_ENABLED`.
+
+### `FLUXER_API_PRESIGNED_HARVEST_DOWNLOADS_ENABLED`
+
+Whether data export and admin download links are presigned URLs to the object store. Use `true` or `false`. With `false`, the API serves those downloads itself. Turn it on only once browsers can connect to `FLUXER_S3_PUBLIC_ENDPOINT`. The default is `false`. With rexctl, use `rexctl config set FLUXER_API_PRESIGNED_HARVEST_DOWNLOADS_ENABLED`.
+
+### `FLUXER_API_STORAGE_CHANGE_FEED_ENABLED`
+
+Whether the api and worker services publish a record of each object store write and delete they make to a NATS JetStream stream. Uploads written by the media proxy relay or sent straight to the store by clients are not in it. Use `true` or `false`. When it's empty, the feed is off. With rexctl, use `rexctl config set FLUXER_API_STORAGE_CHANGE_FEED_ENABLED`.
+
+### `FLUXER_API_STORAGE_CHANGE_FEED_STREAM`
+
+The JetStream stream the storage change feed publishes to, in letters, digits, underscores or hyphens. When it's empty, Fluxer uses `STORAGE_CHANGES`. With rexctl, use `rexctl config set FLUXER_API_STORAGE_CHANGE_FEED_STREAM`.
+
+### `FLUXER_API_STORAGE_CHANGE_FEED_SKIP_BUCKETS`
+
+Buckets the storage change feed leaves out, separated by commas, or `none` to leave out no bucket. When it's empty, the feed leaves out the uploads bucket. With rexctl, use `rexctl config set FLUXER_API_STORAGE_CHANGE_FEED_SKIP_BUCKETS`.
+
+### `FLUXER_SEAWEEDFS_INIT_ATTEMPTS`
+
+How many rounds, about two seconds apart, the bundled object store's setup job tries to create the buckets and set up access before it gives up. The default is `60`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_INIT_ATTEMPTS`.
+
+### `FLUXER_SEAWEEDFS_UPLOADS_TTL`
+
+How long the bundled object store keeps files in the uploads bucket before it deletes them, such as `1d` or `12h`. Use `off` to keep them. A new value applies to uploads written after the next start, and files already stored keep their old expiry. The default is `1d`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_UPLOADS_TTL`.
+
+## Database
+
+Leave these unset to use the bundled Postgres.
+
+### `FLUXER_POSTGRES_HOST`
+
+The hostname or address of the Postgres database. Set it when Postgres runs outside the stack. The default is `postgres`. With rexctl, use `rexctl config set FLUXER_POSTGRES_HOST`.
+
+### `FLUXER_POSTGRES_PORT`
+
+The Postgres port, from 1 to 65535. When it's empty, Fluxer uses `5432`. With rexctl, use `rexctl config set FLUXER_POSTGRES_PORT`.
+
+### `FLUXER_POSTGRES_DATABASE`
+
+The Postgres database name. When it's empty, Fluxer uses `fluxer`. The bundled Postgres creates this database only on its first start with an empty data directory. With rexctl, use `rexctl config set FLUXER_POSTGRES_DATABASE`.
+
+### `FLUXER_POSTGRES_USERNAME`
+
+The Postgres role Fluxer connects as. When it's empty, Fluxer uses `fluxer`. The bundled Postgres creates this role only on its first start with an empty data directory. With rexctl, use `rexctl config set FLUXER_POSTGRES_USERNAME`.
+
+### `FLUXER_POSTGRES_URL`
+
+A full Postgres connection URL, such as `postgres://fluxer:[email protected]:5432/fluxer`. When it's set, Fluxer connects with it and ignores the host, port, database, username and password settings. An `sslmode` in the URL can turn TLS on when `FLUXER_POSTGRES_SSL` isn't `true`. For the api and worker, it also wins over `FLUXER_POSTGRES_SSL`. Keep it secret. With rexctl, use `rexctl config set FLUXER_POSTGRES_URL`.
+
+### `FLUXER_POSTGRES_SSL`
+
+Whether Fluxer connects to Postgres over TLS. Use `true` or `false`. When it isn't `true` and `FLUXER_POSTGRES_URL` has no `sslmode`, the api and worker follow `PGSSLMODE` and the other services connect without TLS. With rexctl, use `rexctl config set FLUXER_POSTGRES_SSL`.
+
+### `FLUXER_POSTGRES_SSL_CA`
+
+A CA certificate in PEM form that Fluxer trusts for the Postgres TLS connection, with `\n` for line breaks. The Rust services use it whenever the connection uses TLS. The api and worker use it only when `FLUXER_POSTGRES_SSL` is `true` and `FLUXER_POSTGRES_URL` has no `sslmode`. With rexctl, use `rexctl config set FLUXER_POSTGRES_SSL_CA`.
+
+### `FLUXER_POSTGRES_PREPARED_STATEMENTS`
+
+Whether Fluxer uses Postgres prepared statements. Use `true` or `false`. When it's empty, Fluxer uses them. Set it to `false` behind a transaction-pooling pooler such as PgBouncer. With rexctl, use `rexctl config set FLUXER_POSTGRES_PREPARED_STATEMENTS`.
+
+### `FLUXER_POSTGRES_KV_TABLE`
+
+The Postgres table for Fluxer's key-value data, a plain identifier of letters, digits and underscores that starts with a letter or an underscore. When it's empty, Fluxer uses `fluxer_kv`. With rexctl, use `rexctl config set FLUXER_POSTGRES_KV_TABLE`.
+
+## Cache, queue and search
+
+Leave these unset to use the bundled Valkey, NATS and Meilisearch.
+
+### `FLUXER_KV_URL`
+
+The Valkey or Redis URL Fluxer uses for its cache, rate limits and other short-lived data. The default is `redis://valkey:6379/0`. With rexctl, use `rexctl config set FLUXER_KV_URL`.
+
+### `FLUXER_KV_MODE`
+
+How Fluxer connects to the key-value store. Use `standalone` for a single Valkey or Redis node or `cluster` for a Redis-compatible cluster. When it's empty, Fluxer uses `standalone`. With rexctl, use `rexctl config set FLUXER_KV_MODE`.
+
+### `FLUXER_NATS_URL`
+
+The core NATS address the api, worker and gateway services use, including for requests to the internal services and the push service. The internal services and JetStream follow it unless `FLUXER_SVC_NATS_URL` or `FLUXER_NATS_JETSTREAM_URL` is set. The default is `nats://nats:4222`. With rexctl, use `rexctl config set FLUXER_NATS_URL`.
+
+### `FLUXER_NATS_JETSTREAM_URL`
+
+The NATS address the api and worker services use for JetStream. When it's empty, they use `FLUXER_NATS_URL`. With rexctl, use `rexctl config set FLUXER_NATS_JETSTREAM_URL`.
+
+### `FLUXER_NATS_AUTH_TOKEN`
+
+The token every service sends when it connects to NATS. When it's empty, services connect without a token. The bundled NATS needs none. Keep it secret. With rexctl, use `rexctl config set FLUXER_NATS_AUTH_TOKEN`.
+
+### `FLUXER_SVC_NATS_URL`
+
+The NATS address the internal services and the push service listen on. When it's empty, they use `FLUXER_NATS_URL`. The api and worker send their requests to these services over `FLUXER_NATS_URL`, and both addresses must lead to the same NATS cluster. With rexctl, use `rexctl config set FLUXER_SVC_NATS_URL`.
+
+### `FLUXER_SVC_MAX_CONCURRENT_REQUESTS`
+
+How many requests each internal service handles at once before it turns new ones away. When it's empty, the messages service uses `192`, the snowflakes service `320` and the others `64`. One value you set applies to all of them. rexctl takeover and rexctl upgrade remove a value under `320`. With rexctl, use `rexctl config set FLUXER_SVC_MAX_CONCURRENT_REQUESTS`.
+
+### `FLUXER_SVC_CACHE_MAX_ENTRIES`
+
+The most entries each internal service process keeps in its cache. When it's empty, the internal services use `100000`. With rexctl, use `rexctl config set FLUXER_SVC_CACHE_MAX_ENTRIES`.
+
+### `FLUXER_SVC_CACHE_TTL_MS`
+
+How long the internal services keep cached entries, in milliseconds. When it's empty, they use `30000`. With rexctl, use `rexctl config set FLUXER_SVC_CACHE_TTL_MS`.
+
+### `FLUXER_GIF_SERVICE_NATS_CLIENT_NAME`
+
+The client name the API gives its NATS connection to the gifs service, which shows in NATS monitoring. When it's empty, the API uses `fluxer-api-gifs`. With rexctl, use `rexctl config set FLUXER_GIF_SERVICE_NATS_CLIENT_NAME`.
+
+### `FLUXER_GIF_SERVICE_TIMEOUT_MS`
+
+How long the API waits for gifs service requests such as searches, in milliseconds. When it's empty, the API uses `12000`. Recording a share uses `FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS`. With rexctl, use `rexctl config set FLUXER_GIF_SERVICE_TIMEOUT_MS`.
+
+### `FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS`
+
+How long the API waits for the gifs service to record that someone shared a GIF, in milliseconds. When it's empty, the API uses `3000`. With rexctl, use `rexctl config set FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS`.
+
+### `FLUXER_USERS_SERVICE_NATS_CLIENT_NAME`
+
+The client name the API gives its NATS connection to the users service, which shows in NATS monitoring. When it's empty, the API uses `fluxer-api-users`. With rexctl, use `rexctl config set FLUXER_USERS_SERVICE_NATS_CLIENT_NAME`.
+
+### `FLUXER_USERS_SERVICE_TIMEOUT_MS`
+
+How long the API waits for the users service, in milliseconds. When it's empty, the API uses `6000`. With rexctl, use `rexctl config set FLUXER_USERS_SERVICE_TIMEOUT_MS`.
+
+### `FLUXER_USERS_SERVICE_INFLIGHT_MAX_ENTRIES`
+
+How many user lookups the API tracks in flight, which lets requests for the same user share one call to the users service. Lookups past this limit go to the service on their own. When it's empty, the API uses `10000`. With rexctl, use `rexctl config set FLUXER_USERS_SERVICE_INFLIGHT_MAX_ENTRIES`.
+
+### `FLUXER_SNOWFLAKE_SERVICE_NATS_CLIENT_NAME`
+
+The client name the API gives its NATS connection to the snowflakes service, which shows in NATS monitoring. When it's empty, the API uses `fluxer-api-snowflakes`. With rexctl, use `rexctl config set FLUXER_SNOWFLAKE_SERVICE_NATS_CLIENT_NAME`.
+
+### `FLUXER_SNOWFLAKE_SERVICE_BATCH_SIZE`
+
+How many IDs the API fetches from the snowflakes service at a time, from 1 to 512. When it's empty, the API uses `128`. With rexctl, use `rexctl config set FLUXER_SNOWFLAKE_SERVICE_BATCH_SIZE`.
+
+### `FLUXER_SNOWFLAKE_SERVICE_LOW_WATERMARK`
+
+The number of unused IDs at which the API fetches a new batch, from 0 to one less than the batch size. When it's empty, the API uses `32`, or one less than the batch size if that's smaller. With rexctl, use `rexctl config set FLUXER_SNOWFLAKE_SERVICE_LOW_WATERMARK`.
+
+### `FLUXER_SNOWFLAKE_SERVICE_MAX_BUFFER_AGE_MS`
+
+How long the API keeps a fetched batch of IDs before it throws the rest away, in milliseconds from 1 to 60000. When it's empty, the API uses `5000`. With rexctl, use `rexctl config set FLUXER_SNOWFLAKE_SERVICE_MAX_BUFFER_AGE_MS`.
+
+### `FLUXER_SNOWFLAKE_SERVICE_REQUEST_TIMEOUT_MS`
+
+How long the API waits for the snowflakes service, in milliseconds from 1 to 60000. When it's empty, the API uses `6000`. With rexctl, use `rexctl config set FLUXER_SNOWFLAKE_SERVICE_REQUEST_TIMEOUT_MS`.
+
+### `FLUXER_SEARCH_ENGINE`
+
+Which search engine Fluxer uses. Use `meilisearch` or `elasticsearch`, or `none` to turn search off. With `elasticsearch`, set `MEILI_MASTER_KEY` to your Elasticsearch API key. Docker Compose passes it to Fluxer as `FLUXER_SEARCH_API_KEY`. The default is `meilisearch`. With rexctl, use `rexctl config set FLUXER_SEARCH_ENGINE`.
+
+### `FLUXER_SEARCH_URL`
+
+The address of the search engine. The default is `http://meilisearch:7700`. With rexctl, use `rexctl config set FLUXER_SEARCH_URL`.
+
+### `FLUXER_SEARCH_USERNAME`
+
+The basic auth username for Elasticsearch. Fluxer uses it only when `FLUXER_SEARCH_API_KEY` is empty. Docker Compose always sets that key from `MEILI_MASTER_KEY`. To use basic auth, set `FLUXER_SEARCH_API_KEY` to an empty value for the api and worker in a compose file of your own. With rexctl, use `rexctl config set FLUXER_SEARCH_USERNAME`.
+
+### `FLUXER_SEARCH_PASSWORD`
+
+The basic auth password for Elasticsearch. Fluxer uses it only when `FLUXER_SEARCH_API_KEY` is empty, the same as `FLUXER_SEARCH_USERNAME`. Keep it secret. With rexctl, use `rexctl config set FLUXER_SEARCH_PASSWORD`.
+
+### `FLUXER_SEARCH_TLS_REJECT_UNAUTHORIZED`
+
+Whether Fluxer checks the Elasticsearch TLS certificate. Use `true` or `false`. When it's empty, Fluxer checks it. Meilisearch connections don't use it. With rexctl, use `rexctl config set FLUXER_SEARCH_TLS_REJECT_UNAUTHORIZED`.
+
+## Outgoing proxy
+
+These settings are for Fluxer's services. rexctl and the Linux and macOS install script take `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY` from the shell you run them from.
+
+### `HTTP_PROXY`
+
+The proxy the Rust services other than the app-proxy use for outgoing HTTP requests. The api, worker and gateway don't use it. Docker Compose also sets `http_proxy` to this value for tools that only look up the lowercase name. With rexctl, use `rexctl config set network.http_proxy`.
+
+### `HTTPS_PROXY`
+
+The proxy the Rust services other than the app-proxy use for outgoing HTTPS requests. The api, worker and gateway don't use it. Docker Compose also sets `https_proxy` to this value for tools that only look up the lowercase name. With rexctl, use `rexctl config set network.https_proxy`.
+
+### `NO_PROXY`
+
+Hosts the Rust services other than the app-proxy connect to without the proxy, separated by commas. Docker Compose also sets `no_proxy` to this value for tools that only look up the lowercase name. With rexctl, use `rexctl config set network.no_proxy`.
+
+### `FLUXER_NODE_EXTRA_CA_CERTS`
+
+The path of a PEM file of CA certificates that the api and worker trust for outgoing TLS on top of Node's built-in ones. The path is inside their containers. A file you set replaces the system bundle. Add your CA to a copy of that bundle. The Rust services don't use it and take their CA certificates from `SSL_CERT_FILE`. The default is `/etc/ssl/certs/ca-certificates.crt`. With rexctl, use `rexctl config set FLUXER_NODE_EXTRA_CA_CERTS`.
+
+## Sign-in
+
+### `FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES`
+
+Whether single sign-on can use a provider on a private or local network address. Use `true` or `false`. When it's empty, Fluxer uses `false`. With rexctl, use `rexctl config set sso.allow_private_addresses`.
+
+### `FLUXER_PASSKEY_RP_ID`
+
+The relying party ID that passkeys are tied to, a domain such as `chat.example.com`. When it's empty, Fluxer uses `FLUXER_DOMAIN`. Changing it makes every passkey registered against the old value stop working. With rexctl, use `rexctl config set FLUXER_PASSKEY_RP_ID`.
+
+### `FLUXER_PASSKEY_RP_NAME`
+
+The title browsers show for Fluxer when someone creates or uses a passkey. When it's empty, browsers show `Fluxer`. With rexctl, use `rexctl config set FLUXER_PASSKEY_RP_NAME`.
+
+### `FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS`
+
+Every origin where passkeys work, separated by commas. When it's empty, Docker Compose uses `FLUXER_PUBLIC_ORIGIN`, or `FLUXER_PUBLIC_SCHEME` followed by `://` and `FLUXER_DOMAIN`. A list you set replaces it and must include the web app origin. Set a list when `FLUXER_APP_ENDPOINT` is on another origin. Each entry is an http or https origin or an Android app, written as `android:apk-key-hash:` followed by its signing certificate's SHA-256 hash in unpadded base64url. With rexctl, use `rexctl config set FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS`.
+
+## Email
+
+The admin panel can also save the delivery mode, the sender and the SMTP server. A value saved there is used first.
+
+### `FLUXER_EMAIL_ENABLED`
+
+The older way to turn email on. Use `FLUXER_EMAIL_DELIVERY`. With rexctl, use `rexctl config set integrations.email.delivery`.
+
+### `FLUXER_EMAIL_PROVIDER`
+
+The older way to pick the email transport, which takes `smtp` or `none`. Use `FLUXER_EMAIL_DELIVERY`. With rexctl, use `rexctl config set integrations.email.delivery`.
+
+### `FLUXER_EMAIL_DELIVERY`
+
+How Fluxer sends email. Use `smtp` or `off`. When it's empty, `FLUXER_EMAIL_ENABLED` and `FLUXER_EMAIL_PROVIDER` decide, and email is off when those are empty too. With rexctl, use `rexctl config set integrations.email.delivery`.
+
+### `FLUXER_EMAIL_FROM_EMAIL`
+
+The address Fluxer sends email from. When it's empty, Fluxer uses `noreply@` followed by `FLUXER_DOMAIN`. With rexctl, use `rexctl config set integrations.email.from_email`.
+
+### `FLUXER_EMAIL_FROM_NAME`
+
+The sender name on email from Fluxer. When it's empty, Fluxer uses the product name of the instance. With rexctl, use `rexctl config set integrations.email.from_name`.
+
+### `FLUXER_EMAIL_REPLY_TO_EMAIL`
+
+The address replies go to, sent as the Reply-To header on every email, such as `[email protected]`. When it's empty, Fluxer sends no Reply-To header. With rexctl, use `rexctl config set FLUXER_EMAIL_REPLY_TO_EMAIL`.
+
+### `FLUXER_EMAIL_APP_BASE_URL`
+
+The base URL Fluxer uses for links in emails, an http or https URL with no credentials, query or fragment. When it's empty, Fluxer uses `FLUXER_APP_ENDPOINT`. With rexctl, use `rexctl config set FLUXER_EMAIL_APP_BASE_URL`.
+
+### `FLUXER_EMAIL_WEBHOOK_SECRET`
+
+The base64 secret Fluxer uses to check the signature on bounce and complaint webhooks from the Sweego email service. When it's empty, Fluxer turns those webhooks away. Keep it secret. With rexctl, use `rexctl config set FLUXER_EMAIL_WEBHOOK_SECRET`.
+
+### `FLUXER_EMAIL_SMTP_HOST`
+
+The hostname of your SMTP server. With rexctl, use `rexctl config set integrations.email.smtp.host`.
+
+### `FLUXER_EMAIL_SMTP_PORT`
+
+The port of your SMTP server. When it's empty, Fluxer uses `587`. With rexctl, use `rexctl config set integrations.email.smtp.port`.
+
+### `FLUXER_EMAIL_SMTP_USERNAME`
+
+The username Fluxer signs in to your SMTP server with. With rexctl, use `rexctl config set integrations.email.smtp.username`.
+
+### `FLUXER_EMAIL_SMTP_PASSWORD`
+
+The password Fluxer signs in to your SMTP server with. Keep it secret. With rexctl, use `rexctl config set integrations.email.smtp.password`.
+
+### `FLUXER_EMAIL_SMTP_TLS_MODE`
+
+How the SMTP connection is encrypted. Use `implicit` for TLS from the start, usually on port 465, `starttls` to upgrade before signing in, usually on port 587, `opportunistic` to upgrade when the server offers it, or `none`. When it's empty, `FLUXER_EMAIL_SMTP_SECURE` decides. When both are empty, Fluxer uses `implicit` on port 465 and `starttls` on any other port. With rexctl, use `rexctl config set integrations.email.smtp.tls_mode`.
+
+### `FLUXER_EMAIL_SMTP_SECURE`
+
+The older way to set `FLUXER_EMAIL_SMTP_TLS_MODE`, used only while that is empty. Use `true` for `implicit` on port 465 and `starttls` on any other port, or `false` for `opportunistic`. With rexctl, use `rexctl config set integrations.email.smtp.tls_mode`.
+
+### `FLUXER_EMAIL_FALLBACK_DOMAINS`
+
+Recipient domains, separated by commas, whose mail goes through the fallback SMTP provider, such as `gmail.com,googlemail.com`. Only exact domain matches count, and `*` alone sends all mail through the fallback provider. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_DOMAINS`.
+
+### `FLUXER_EMAIL_FALLBACK_SMTP_HOST`
+
+The hostname of the fallback SMTP provider. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_HOST`.
+
+### `FLUXER_EMAIL_FALLBACK_SMTP_PORT`
+
+The port of the fallback SMTP provider, from 1 to 65535. When it's empty, Fluxer uses `587`. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_PORT`.
+
+### `FLUXER_EMAIL_FALLBACK_SMTP_USERNAME`
+
+The username Fluxer signs in to the fallback SMTP provider with. Fluxer doesn't start when a fallback provider is set without it. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_USERNAME`.
+
+### `FLUXER_EMAIL_FALLBACK_SMTP_PASSWORD`
+
+The password Fluxer signs in to the fallback SMTP provider with. Fluxer doesn't start when a fallback provider is set without it. Keep it secret. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_PASSWORD`.
+
+### `FLUXER_EMAIL_FALLBACK_SMTP_TLS_MODE`
+
+How Fluxer encrypts the connection to the fallback provider. Use `implicit`, `starttls`, `opportunistic` or `none`. When it's empty, Fluxer uses `implicit` on port 465 and `starttls` on any other port. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_TLS_MODE`.
+
+### `FLUXER_EMAIL_FALLBACK_SMTP_HEADERS`
+
+Extra headers added to every message sent through the fallback provider, as a JSON object that maps header names to string values. Core headers such as From, To, Subject and Reply-To can't be set here. With rexctl, use `rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_HEADERS`.
+
+## Push notifications
+
+### `FLUXER_PUSH_APNS_ENABLED`
+
+Whether the push service sends mobile notifications through Apple Push Notification service with your own credentials. Use `true` or `false`. When it's empty, APNs is off. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_ENABLED`.
+
+### `FLUXER_PUSH_APNS_TEAM_ID`
+
+Your Apple developer team ID. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_TEAM_ID`.
+
+### `FLUXER_PUSH_APNS_KEY_ID`
+
+The ID of your APNs signing key, from your Apple developer account. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_KEY_ID`.
+
+### `FLUXER_PUSH_APNS_PRIVATE_KEY`
+
+Your APNs signing key as PEM text. Set this or `FLUXER_PUSH_APNS_PRIVATE_KEY_PATH`, and this one wins when both are set. Keep it secret. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_PRIVATE_KEY`.
+
+### `FLUXER_PUSH_APNS_PRIVATE_KEY_PATH`
+
+The path to your APNs signing key file inside the push container. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_PRIVATE_KEY_PATH`.
+
+### `FLUXER_PUSH_APNS_APPS`
+
+The apps the push service sends to through APNs, as a JSON array of objects. Each object has an `app_id` and a `topic` with the app's bundle ID, and can have an `environment` of `production` or `development`. APNs sends fail for an app that isn't listed or has no topic. A push relay with APNs on doesn't start until this lists at least one app. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_APPS`.
+
+### `FLUXER_PUSH_APNS_DEFAULT_ENVIRONMENT`
+
+The APNs environment the push service uses for a device that registered without one. Use `production` or `development`. When it's empty, it uses `production`. With rexctl, use `rexctl config set FLUXER_PUSH_APNS_DEFAULT_ENVIRONMENT`.
+
+### `FLUXER_PUSH_FCM_ENABLED`
+
+Whether the push service sends mobile notifications through Firebase Cloud Messaging with your own credentials. Use `true` or `false`. When it's empty, FCM is off. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_ENABLED`.
+
+### `FLUXER_PUSH_FCM_PROJECT_ID`
+
+Your Firebase project ID. When it's empty, the push service uses the one in `FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH`. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_PROJECT_ID`.
+
+### `FLUXER_PUSH_FCM_CLIENT_EMAIL`
+
+The client email of your Firebase service account. When it's empty, the push service uses the one in `FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH`. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_CLIENT_EMAIL`.
+
+### `FLUXER_PUSH_FCM_PRIVATE_KEY`
+
+The private key of your Firebase service account as PEM text. When it's empty, the push service uses `FLUXER_PUSH_FCM_PRIVATE_KEY_PATH` or the key in the service account JSON. Keep it secret. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_PRIVATE_KEY`.
+
+### `FLUXER_PUSH_FCM_PRIVATE_KEY_PATH`
+
+The path to your Firebase service account private key inside the push container. The push service uses it when `FLUXER_PUSH_FCM_PRIVATE_KEY` is empty. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_PRIVATE_KEY_PATH`.
+
+### `FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH`
+
+The path to your Firebase service account JSON file inside the push container. The push service loads the project ID, client email and private key from it when those settings are empty. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH`.
+
+### `FLUXER_PUSH_FCM_TOKEN_URI`
+
+The OAuth token URL the push service uses for FCM. When it's empty, it uses `https://oauth2.googleapis.com/token`. Change it only for a proxy or a test double. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_TOKEN_URI`.
+
+### `FLUXER_PUSH_FCM_APPS`
+
+The apps the push service sends to through FCM, as a JSON array of objects that each have an `app_id` and can have a `project_id`. An app with no entry or no `project_id` uses `FLUXER_PUSH_FCM_PROJECT_ID`. A push relay with FCM on doesn't start until this lists at least one app. With rexctl, use `rexctl config set FLUXER_PUSH_FCM_APPS`.
+
+### `FLUXER_VAPID_EMAIL`
+
+The contact email Fluxer sends to browser push services with its VAPID key. When it's empty, Fluxer uses `admin@` followed by `FLUXER_DOMAIN`. Set it if that mailbox doesn't exist. With rexctl, use `rexctl config set FLUXER_VAPID_EMAIL`.
+
+### `FLUXER_PUSH_SERVICE_QUEUE_CAPACITY`
+
+How many notification jobs the push service queues at once, from 1 to 1000000. When it's empty, it uses `10000`. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_QUEUE_CAPACITY`.
+
+### `FLUXER_PUSH_SERVICE_SEND_CONCURRENCY`
+
+How many provider requests the push service sends at once across all jobs, from 1 to 65536. When it's empty, it uses `256`. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_SEND_CONCURRENCY`.
+
+### `FLUXER_PUSH_SERVICE_APNS_BASE_URL`
+
+A URL that replaces the APNs host in both environments, for a test double only. When it's empty, the push service uses Apple's own hosts. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_APNS_BASE_URL`.
+
+### `FLUXER_PUSH_SERVICE_FCM_BASE_URL`
+
+The FCM host the push service sends to. When it's empty, it uses `https://fcm.googleapis.com`. Change it only for a proxy or a test double. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_FCM_BASE_URL`.
+
+### `FLUXER_PUSH_SERVICE_MANAGED_RELAY_HOSTS`
+
+Hostnames, separated by commas, of the push relay that Fluxer runs. When it's empty, the push service uses `push.fluxer.com`. It sends to these hosts only once relay consent is accepted. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_MANAGED_RELAY_HOSTS`.
+
+### `FLUXER_PUSH_SERVICE_OWN_RELAY_HOSTS`
+
+Hostnames, separated by commas, of a push relay your instance runs itself. The push service sends mobile app notifications addressed to these hosts straight to APNs or FCM with its own credentials. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_OWN_RELAY_HOSTS`.
+
+### `FLUXER_PUSH_SERVICE_PRIVATE_HOSTS`
+
+Hostnames, separated by commas, that push endpoints may use even when they resolve to private or loopback addresses, such as a ntfy service on your own network. The push service refuses every other such endpoint. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_PRIVATE_HOSTS`.
+
+### `FLUXER_PUSH_SERVICE_RELAY_CONSENT_ACCEPTED`
+
+Whether this push service accepts the push relay privacy notice, which lets it send through the relay Fluxer runs. Use `true`, `1` or `yes` to accept. With `false`, `0`, `no` or an empty value, the push relay setting of the instance decides. With rexctl, use `rexctl config set FLUXER_PUSH_SERVICE_RELAY_CONSENT_ACCEPTED`.
+
+## Media
+
+### `FLUXER_CLAMAV_ENABLED`
+
+Whether Fluxer scans uploads for viruses with ClamAV. Use `true` or `false`. When it's empty, Fluxer uses `false`. No ClamAV container ships with the stack. Point `FLUXER_CLAMAV_HOST` at your own. With rexctl, use `rexctl config set FLUXER_CLAMAV_ENABLED`.
+
+### `FLUXER_CLAMAV_HOST`
+
+The hostname or address of your ClamAV scanner. When it's empty, Fluxer uses `127.0.0.1`. With rexctl, use `rexctl config set FLUXER_CLAMAV_HOST`.
+
+### `FLUXER_CLAMAV_PORT`
+
+The port of your ClamAV scanner. When it's empty, Fluxer uses `3310`. With rexctl, use `rexctl config set FLUXER_CLAMAV_PORT`.
+
+### `FLUXER_CLAMAV_FAIL_OPEN`
+
+Whether uploads go through when a ClamAV scan fails, such as when Fluxer can't connect to the scanner or gets no usable answer. Use `true` or `false`. When it's empty, Fluxer rejects the upload. With rexctl, use `rexctl config set FLUXER_CLAMAV_FAIL_OPEN`.
+
+### `FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64`
+
+Keys that sign attachment URLs, separated by commas. Each is standard base64 that decodes to at least 32 bytes. The first entry signs and every entry verifies. To rotate keys, put the new key first. When it's empty, Fluxer returns unsigned attachment URLs. Keep it secret. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT`
+
+The upload relay URL the API hands to clients. When it's empty, the API uses the public origin followed by `/media`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES`
+
+The largest upload the relay accepts, in bytes from 1 to 5 GiB. It can't be more than `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES`. When it's empty, the relay uses `524288000`, which is 500 MiB. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS`
+
+How long an upload relay token stays valid, in seconds. When it's empty, the API uses `900`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_KEEP_DIRECT_COUNTRIES`
+
+Two-letter country codes, separated by commas, whose clients upload to the object store directly and skip the relay. It needs the GeoIP database in `FLUXER_GEOIP_DB_PATH`, and browsers can only upload directly when `FLUXER_S3_PUBLIC_ENDPOINT` is set. When it's empty or there's no GeoIP database, every client uses the relay and browsers never see the internal store address. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_KEEP_DIRECT_COUNTRIES`.
+
+### `FLUXER_MEDIA_PROXY_CORS_MODE`
+
+Whether the media proxy checks the Origin of media requests. Use `off`, `report` or `enforce`. When it's empty, it's off. With `report`, the media proxy logs requests it would refuse, and with `enforce` it refuses them. A request with no Origin header is always served. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_CORS_MODE`.
+
+### `FLUXER_MEDIA_PROXY_CORS_ALLOWED_ORIGINS`
+
+The web origins, separated by commas, that may load media through CORS when `FLUXER_MEDIA_PROXY_CORS_MODE` is `report` or `enforce`. When it's empty, the media proxy uses the public origin. The desktop app is always allowed. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_CORS_ALLOWED_ORIGINS`.
+
+### `FLUXER_MEDIA_PROXY_ATTACHMENT_SIGNATURE_MODE`
+
+Whether attachment downloads need a signed URL. Use `off`, `report` or `enforce`. When it's empty, it's off. With `report`, the media proxy logs downloads it would refuse, and with `enforce` it refuses them. Both need `FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_SIGNATURE_MODE`.
+
+### `FLUXER_MEDIA_PROXY_READ_ONLY`
+
+Whether the media proxy refuses to write to storage. Use `true` or `false`. When it's empty, it writes as usual. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_READ_ONLY`.
+
+### `FLUXER_MEDIA_PROXY_NSFW_THRESHOLD`
+
+The NSFW classifier score, from 0.0 to 1.0, that the media proxy uses as its cutoff. When it's empty, it uses `0.85`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_NSFW_THRESHOLD`.
+
+### `FLUXER_NSFW_SERVICE_ENDPOINT`
+
+The URL of an outside NSFW classifier the media proxy calls. No such service ships with the stack. When it's empty, the media proxy calls none. With rexctl, use `rexctl config set FLUXER_NSFW_SERVICE_ENDPOINT`.
+
+### `FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS`
+
+How many image transforms the media proxy runs at once, from 1 to 128. When it's empty, it uses the number of CPU cores, kept between 2 and 8. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS`.
+
+### `FLUXER_MEDIA_PROXY_WORKER_QUEUE_CAPACITY`
+
+How many transforms may wait in the media proxy's queue, from 1 to 8192. When it's empty, it uses eight times `FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_WORKER_QUEUE_CAPACITY`.
+
+### `FLUXER_MEDIA_PROXY_MAX_ENCODE_DURATION_MS`
+
+The longest animation the media proxy encodes, in milliseconds from 100 to 600000. When it's empty, it uses `30000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_MAX_ENCODE_DURATION_MS`.
+
+### `FLUXER_MEDIA_PROXY_MAX_ENCODE_FRAMES`
+
+The most frames the media proxy encodes in one animation, from 1 to 100000. When it's empty, it uses `20000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_MAX_ENCODE_FRAMES`.
+
+### `FLUXER_MEDIA_PROXY_TRANSFORM_TIMEOUT_MS`
+
+How long one media transform may take, in milliseconds from 1000 to 120000. When it's empty, the media proxy uses `15000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_TIMEOUT_MS`.
+
+### `FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_BYTES`
+
+How much memory the media proxy's transform cache may use, in bytes from 0 to 4 GiB. When it's empty, it uses `268435456`, which is 256 MiB. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_BYTES`.
+
+### `FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_MAX_ENTRY_BYTES`
+
+The largest transform result the media proxy caches, in bytes from 0 to 512 MiB. When it's empty, it uses `67108864`, which is 64 MiB. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_MAX_ENTRY_BYTES`.
+
+### `FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_TTL_MS`
+
+How long the media proxy keeps a transform result in its cache, in milliseconds from 0 to 3600000. When it's empty, it uses `120000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_TTL_MS`.
+
+### `FLUXER_MEDIA_PROXY_SOCKET_IO_TIMEOUT_MS`
+
+How long the media proxy waits on socket input and output, in milliseconds from 0 to 300000. When it's empty, it uses `30000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_SOCKET_IO_TIMEOUT_MS`.
+
+### `FLUXER_MEDIA_PROXY_SHUTDOWN_GRACE_MS`
+
+How long the media proxy waits for open requests and transforms to finish when it stops, in milliseconds from 0 to 300000. When it's empty, it uses `30000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_SHUTDOWN_GRACE_MS`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_S3_TIMEOUT_MS`
+
+How long the relay waits for an upload's write to the object store, in milliseconds from 1000 to 3600000. When it's empty, it uses `900000`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_S3_TIMEOUT_MS`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_BYTES`
+
+The largest upload the relay keeps in memory so it can retry the object store write, in bytes from 0 to 256 MiB. Larger uploads stream to the store without a retry. When it's empty, the relay uses `33554432`, which is 32 MiB. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_BYTES`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_TOTAL_BYTES`
+
+How much memory all buffered relay uploads may use together, in bytes from 0 to 8 GiB. An upload that would go past it streams without a retry. When it's empty, the relay uses `536870912`, which is 512 MiB. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_TOTAL_BYTES`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_DIR`
+
+The directory where the relay spools upload bodies and the media proxy keeps copies of large audio and video files it inspects. It must be writable. When it's empty, the media proxy uses the system temporary directory. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_DIR`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_CHUNK_BYTES`
+
+The chunk size the relay uses when it writes upload bodies to its spool on disk, in bytes from 64 KiB to 64 MiB. When it's empty, it uses `1048576`, which is 1 MiB. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_CHUNK_BYTES`.
+
+### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES`
+
+The most disk space the spool may use at once, in bytes from 0 to 256 GiB, shared by relay uploads and copies of large audio and video files. It must be at least `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES`. The default is `2147483648`, which is 2 GiB. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES`.
+
+### `FLUXER_CACHE_PURGE_ADAPTER`
+
+How Fluxer purges cached copies of deleted or replaced media from your CDN or caching proxy. Use `none`, `http` or `controller`. When it's empty, Fluxer uses `none` and sends no purges. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_ADAPTER`.
+
+### `FLUXER_CACHE_PURGE_HTTP_ENDPOINT`
+
+The URL the worker posts purge requests to when `FLUXER_CACHE_PURGE_ADAPTER` is `http`, as an absolute http or https URL without credentials. Your endpoint then purges the listed media URL prefixes from every cache in front of the media. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_HTTP_ENDPOINT`.
+
+### `FLUXER_CACHE_PURGE_HTTP_TOKEN`
+
+The bearer token Fluxer sends in the Authorization header of each purge request to `FLUXER_CACHE_PURGE_HTTP_ENDPOINT`, in visible ASCII characters with no spaces. Keep it secret. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_HTTP_TOKEN`.
+
+### `FLUXER_CACHE_PURGE_HTTP_TIMEOUT_MS`
+
+How long each purge request to `FLUXER_CACHE_PURGE_HTTP_ENDPOINT` may take, in milliseconds from 1000 to 10000. When it's empty, Fluxer uses `10000`. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_HTTP_TIMEOUT_MS`.
+
+### `FLUXER_CACHE_PURGE_CONTROLLER_ENDPOINT`
+
+The purge URL of the Controller edge site that serves your media, as an absolute https URL without credentials. Fluxer uses it when `FLUXER_CACHE_PURGE_ADAPTER` is `controller`. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_CONTROLLER_ENDPOINT`.
+
+### `FLUXER_CACHE_PURGE_CONTROLLER_TOKEN`
+
+The Controller API key Fluxer sends as a bearer token with each purge request, in visible ASCII characters with no spaces. Keep it secret. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_CONTROLLER_TOKEN`.
+
+### `FLUXER_CACHE_PURGE_CONTROLLER_TIMEOUT_MS`
+
+How long each Controller purge request may take, in milliseconds from 1000 to 10000. When it's empty, Fluxer uses `10000`. With rexctl, use `rexctl config set FLUXER_CACHE_PURGE_CONTROLLER_TIMEOUT_MS`.
+
+## Gateway
+
+### `FLUXER_GATEWAY_MEDIA_PROXY_ENDPOINT`
+
+The public media URL the gateway uses to build avatar links in push notifications. When it's empty, the gateway uses `FLUXER_MEDIA_ENDPOINT`, or the public origin followed by `/media`. With rexctl, use `rexctl config set FLUXER_GATEWAY_MEDIA_PROXY_ENDPOINT`.
+
+### `FLUXER_GATEWAY_STATIC_CDN_ENDPOINT`
+
+The public static file URL the gateway uses to build default avatar links in push notifications. When it's empty, the gateway uses `FLUXER_STATIC_CDN_ENDPOINT`, or the public origin. With rexctl, use `rexctl config set FLUXER_GATEWAY_STATIC_CDN_ENDPOINT`.
+
+### `FLUXER_GATEWAY_PUSH_ENABLED`
+
+Whether the gateway sends push notifications through the push service. Use `true` or `false`. When it's empty, the gateway uses `true`. With rexctl, use `rexctl config set FLUXER_GATEWAY_PUSH_ENABLED`.
+
+### `FLUXER_GATEWAY_PUSH_ENROLLED_CLEAR_NOTIFICATIONS_ENABLED`
+
+Whether the gateway asks the push service to clear a channel's push notifications once the user has caught up on that channel. Use `true` or `false`. When it's empty, the gateway uses `true`. With rexctl, use `rexctl config set FLUXER_GATEWAY_PUSH_ENROLLED_CLEAR_NOTIFICATIONS_ENABLED`.
+
+### `FLUXER_GATEWAY_PUSH_OUTBOX_REQUEST_TIMEOUT_MS`
+
+How long the gateway waits for the push service to answer one push request, in milliseconds. When it's empty, the gateway uses `100000`. With rexctl, use `rexctl config set FLUXER_GATEWAY_PUSH_OUTBOX_REQUEST_TIMEOUT_MS`.
+
+### `FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_ENTRIES`
+
+The most push notifications the gateway keeps back for one user while one of their sessions is active, dropping the oldest first. A value of `0` keeps none. When it's empty, the gateway uses `128`. With rexctl, use `rexctl config set FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_ENTRIES`.
+
+### `FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_BYTES`
+
+The most bytes of push notifications the gateway keeps back for one user while one of their sessions is active. A value of `0` turns off this limit. When it's empty, the gateway uses `1048576`, which is 1 MiB. With rexctl, use `rexctl config set FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_BYTES`.
+
+### `FLUXER_GATEWAY_HTTP_RPC_MAX_CONCURRENCY`
+
+How many HTTP requests the gateway can have open to the API at once. When it's empty, the gateway uses `512`. With rexctl, use `rexctl config set FLUXER_GATEWAY_HTTP_RPC_MAX_CONCURRENCY`.
+
+### `FLUXER_GATEWAY_NATS_RPC_MAX_HANDLERS`
+
+How many NATS RPC requests the gateway works on at once. When it's empty, the gateway uses `512`. With rexctl, use `rexctl config set FLUXER_GATEWAY_NATS_RPC_MAX_HANDLERS`.
+
+### `FLUXER_GATEWAY_ZSTD_WINDOW_LOG`
+
+The base 2 logarithm of the zstd window the gateway compresses websocket traffic with, from 10 to 21. Values outside that range count as the nearest end. Larger values compress better and use more memory per connection. When it's empty, the gateway uses `17`. With rexctl, use `rexctl config set FLUXER_GATEWAY_ZSTD_WINDOW_LOG`.
+
+### `FLUXER_GATEWAY_HTTP_FAILURE_THRESHOLD`
+
+How many failed requests from the gateway to the API in 10 seconds open its circuit breaker, when at least 80 percent of the requests in that time failed. The breaker then stops further requests for a while. When it's empty, the gateway uses `6`. With rexctl, use `rexctl config set FLUXER_GATEWAY_HTTP_FAILURE_THRESHOLD`.
+
+### `FLUXER_GATEWAY_HTTP_RECOVERY_TIMEOUT_MS`
+
+How long the circuit breaker for gateway requests to the API stays open before it tries again, in milliseconds. When it's empty, the gateway uses `15000`. With rexctl, use `rexctl config set FLUXER_GATEWAY_HTTP_RECOVERY_TIMEOUT_MS`.
+
+### `FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_MAX`
+
+The most visitor sessions one community allows, however many members it has. A visitor views a community without joining it. When it's empty, the gateway uses `10000`. With rexctl, use `rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_MAX`.
+
+### `FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_FLOOR`
+
+The fewest visitor sessions one community allows, however few members it has. When it's empty, the gateway uses `500`. With rexctl, use `rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_FLOOR`.
+
+### `FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_MEMBER`
+
+How many visitor sessions a community allows for each of its members, kept between the floor and the maximum. When it's empty, the gateway uses `2`. With rexctl, use `rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_MEMBER`.
+
+### `FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_USER`
+
+How many visitor sessions one account can have in a single community at once. When it's empty, the gateway uses `5`. With rexctl, use `rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_USER`.
+
+### `FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_IP`
+
+How many visitor sessions one IPv4 address or one IPv6 `/64` network can have in a single community at once. When it's empty, the gateway uses `20`. With rexctl, use `rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_IP`.
+
+## Web app
+
+### `DISCOVERY_REFRESH_INTERVAL_MS`
+
+How often the app-proxy service fetches the discovery document, in milliseconds. The document has the branding saved in the admin panel, such as the product name, icons and custom CSS. Values under 1 second count as 1 second. A failed fetch is retried with a growing delay of up to five minutes. The default is `5000`. With rexctl, use `rexctl config set DISCOVERY_REFRESH_INTERVAL_MS`.
+
+### `FLUXER_APP_PROXY_INDEX_UPSTREAM_URL`
+
+An http or https URL that the app-proxy service fetches the web app's `index.html` from. When it's empty, the app-proxy service serves the `index.html` built into its image. With rexctl, use `rexctl config set FLUXER_APP_PROXY_INDEX_UPSTREAM_URL`.
+
+### `FLUXER_APP_PROXY_SAME_ORIGIN_HOSTS`
+
+Extra hostnames that serve the web app, separated by commas or spaces, with no scheme, port or path. On these hostnames, the web app uses the same hostname for the API and for the gateway and media endpoints that share the API's host. Each one must route `/api`, `/gateway` and `/media` like the main one. With rexctl, use `rexctl config set FLUXER_APP_PROXY_SAME_ORIGIN_HOSTS`.
+
+### `FLUXER_APP_PROXY_MANIFEST_SCOPE_EXTENSIONS`
+
+HTTPS origins with no path, separated by commas or spaces, that the app-proxy service adds to the `scope_extensions` list of the web app manifest. An installed web app keeps them inside its window. Each origin must serve `/.well-known/web-app-origin-association` for this web app. Invalid entries are logged and dropped. With rexctl, use `rexctl config set FLUXER_APP_PROXY_MANIFEST_SCOPE_EXTENSIONS`.
+
+### `FLUXER_CSP_EXTRA_DEFAULT_SRC`
+
+Extra sources the app-proxy service adds to the default-src directive of the web app's Content-Security-Policy, separated by commas or spaces. Set one only when a browser must connect to an origin the built-in policy doesn't cover. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_DEFAULT_SRC`.
+
+### `FLUXER_CSP_EXTRA_CONNECT_SRC`
+
+Extra sources the app-proxy service adds to the connect-src directive of the web app's Content-Security-Policy, separated by commas or spaces, such as `wss://livekit.example.com`. A ws or wss source also allows the matching http or https source. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_CONNECT_SRC`.
+
+### `FLUXER_CSP_EXTRA_IMG_SRC`
+
+Extra sources the app-proxy service adds to the img-src directive of the web app's Content-Security-Policy, separated by commas or spaces, such as `https://cdn.example.com`. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_IMG_SRC`.
+
+### `FLUXER_CSP_EXTRA_MEDIA_SRC`
+
+Extra sources the app-proxy service adds to the media-src directive of the web app's Content-Security-Policy, separated by commas or spaces. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_MEDIA_SRC`.
+
+### `FLUXER_CSP_EXTRA_FONT_SRC`
+
+Extra sources the app-proxy service adds to the font-src directive of the web app's Content-Security-Policy, separated by commas or spaces. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_FONT_SRC`.
+
+### `FLUXER_CSP_EXTRA_SCRIPT_SRC`
+
+Extra sources the app-proxy service adds to the script-src directive of the web app's Content-Security-Policy, separated by commas or spaces, such as `https://analytics.example.com`. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_SCRIPT_SRC`.
+
+### `FLUXER_CSP_EXTRA_STYLE_SRC`
+
+Extra sources the app-proxy service adds to the style-src directive of the web app's Content-Security-Policy, separated by commas or spaces. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_STYLE_SRC`.
+
+### `FLUXER_CSP_EXTRA_FRAME_SRC`
+
+Extra sources the app-proxy service adds to the frame-src directive of the web app's Content-Security-Policy, separated by commas or spaces. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_FRAME_SRC`.
+
+### `FLUXER_CSP_EXTRA_WORKER_SRC`
+
+Extra sources the app-proxy service adds to the worker-src directive of the web app's Content-Security-Policy, separated by commas or spaces. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_WORKER_SRC`.
+
+### `FLUXER_CSP_EXTRA_MANIFEST_SRC`
+
+Extra sources the app-proxy service adds to the manifest-src directive of the web app's Content-Security-Policy, separated by commas or spaces. With rexctl, use `rexctl config set FLUXER_CSP_EXTRA_MANIFEST_SRC`.
+
+### `FLUXER_CSP_REPORT_URI`
+
+One http or https URL that browsers send Content-Security-Policy violation reports to. When it's empty, the policy has no report-uri. With rexctl, use `rexctl config set FLUXER_CSP_REPORT_URI`.
+
+## API and worker
+
+### `FLUXER_API_HEADERS_TIMEOUT_MS`
+
+How long a client may take to send the request line and headers to the API, in milliseconds from 1000 to 3600000. It is capped at `FLUXER_API_REQUEST_TIMEOUT_MS`. When it's empty, the API uses `30000`. With rexctl, use `rexctl config set FLUXER_API_HEADERS_TIMEOUT_MS`.
+
+### `FLUXER_API_REQUEST_TIMEOUT_MS`
+
+How long a client may take over a whole request to the API, in milliseconds from 1000 to 3600000. Raise it for large uploads or slow links. When it's empty, the API uses `120000`. With rexctl, use `rexctl config set FLUXER_API_REQUEST_TIMEOUT_MS`.
+
+### `FLUXER_API_MAX_INFLIGHT_REQUESTS`
+
+How many requests the API handles at once before it answers new ones with 503 and a Retry-After header, from 1 to 100000. When it's empty, the API uses `512`. With rexctl, use `rexctl config set FLUXER_API_MAX_INFLIGHT_REQUESTS`.
+
+### `FLUXER_TRUST_CLIENT_IP_HEADER`
+
+Whether Fluxer trusts the client address in the `FLUXER_CLIENT_IP_HEADER_NAME` header. Use `true` or `false`. The api, worker, admin and gateway services and the push relay use it. With `false`, they use the address of the connection, which behind the edge is the edge itself. Outside Docker Compose, the services use `false` when it's empty. The default is `true`. With rexctl, use `rexctl config set FLUXER_TRUST_CLIENT_IP_HEADER`.
+
+### `FLUXER_CLIENT_IP_HEADER_NAME`
+
+The request header that has the client's IP address. When it's empty, the api, worker, admin and gateway services and the push relay use `x-forwarded-for`, the header the edge sets. With rexctl, use `rexctl config set FLUXER_CLIENT_IP_HEADER_NAME`.
+
+### `FLUXER_API_IP_BAN_EXEMPT_IPS`
+
+IP addresses and CIDR ranges, separated by commas, that IP bans never apply to, such as `203.0.113.7,2001:db8::/56`. The API refuses to start when an entry doesn't parse. With rexctl, use `rexctl config set FLUXER_API_IP_BAN_EXEMPT_IPS`.
+
+### `FLUXER_IP_BAN_REFRESH_INTERVAL_MS`
+
+How often the API reloads its IP ban list, in milliseconds. When it's empty, the API uses `300000`. A value of `0` turns the periodic reload off. With rexctl, use `rexctl config set FLUXER_IP_BAN_REFRESH_INTERVAL_MS`.
+
+### `FLUXER_API_DONATION_PROXY_KEY`
+
+An older way to add one trusted caller that may pass the client address for the donation and Operator Pass rate limits. Fluxer's marketing site uses it. It must be at least 32 characters. Your own instance can leave it empty. Keep it secret. With rexctl, use `rexctl config set FLUXER_API_DONATION_PROXY_KEY`.
+
+### `FLUXER_API_TRUSTED_CALLERS`
+
+A JSON array of trusted callers, such as a front end that calls the API for its own visitors. Each entry is an object with a `name`, a `key` of at least 32 characters and `buckets`, a non-empty list of the rate limit buckets the caller may pass a client address for. The caller sends its key in the `X-Fluxer-Internal-Key` header and the client address in the `X-Fluxer-Client-IP` header. Keep it secret. With rexctl, use `rexctl config set FLUXER_API_TRUSTED_CALLERS`.
+
+### `FLUXER_API_WORKER_LANE_CONCURRENCY_OVERRIDES`
+
+How many jobs each worker lane runs at once, as a JSON object that maps each lane to a whole number of at least 1. The lanes are `realtime`, `unfurl`, `lifecycle`, `batch` and `crosspost`. Lanes left out use 10, 20, 8, 12 and 8 in that order, scaled down on machines with fewer than 4 CPU cores. With rexctl, use `rexctl config set FLUXER_API_WORKER_LANE_CONCURRENCY_OVERRIDES`.
+
+## Instance and branding
+
+Fluxer uses the product name, images, theme colour and status page links set here only until the setup wizard finishes or someone saves branding in the admin panel. After that it uses the saved values and ignores these. Make later changes in the admin panel or with `rexctl config set`.
+
+### `FLUXER_APP_PRODUCT_NAME`
+
+The product name the apps show and Fluxer uses in emails and system messages. When it's empty or set to `Fluxer` on a self-hosted instance, Fluxer uses the hostname of the web app. With rexctl, use `rexctl config set app_public.branding.product_name`.
+
+### `FLUXER_APP_ICON_URL`
+
+The URL of the app icon. With rexctl, use `rexctl config set app_public.branding.icon_url`.
+
+### `FLUXER_APP_SYMBOL_URL`
+
+The URL of the symbol mark. With rexctl, use `rexctl config set app_public.branding.symbol_url`.
+
+### `FLUXER_APP_LOGO_URL`
+
+The URL of the logo. With rexctl, use `rexctl config set app_public.branding.logo_url`.
+
+### `FLUXER_APP_WORDMARK_URL`
+
+The URL of the wordmark. With rexctl, use `rexctl config set app_public.branding.wordmark_url`.
+
+### `FLUXER_APP_FAVICON_URL`
+
+The URL of the favicon. With rexctl, use `rexctl config set app_public.branding.favicon_url`.
+
+### `FLUXER_APP_FAVICON_DARK_URL`
+
+The URL of the favicon for browsers in dark mode. With rexctl, use `rexctl config set app_public.branding.favicon_dark_url`.
+
+### `FLUXER_APP_SIGN_IN_BACKDROP_URL`
+
+The URL of the image behind the sign-in screen. With rexctl, use `rexctl config set app_public.branding.sign_in_backdrop_url`.
+
+### `FLUXER_APP_THEME_COLOR`
+
+The brand colour of the web app and the browser theme colour, as a hex value such as `#4641d9`. With rexctl, use `rexctl config set app_public.branding.theme_color`.
+
+### `FLUXER_APP_STATUS_PAGE_URL`
+
+The URL of your public status page. The web app links to it when loading takes a long time. On an Instatus page, the web app also shows its current incidents and maintenance. With rexctl, use `rexctl config set app_public.branding.status_page_url`.
+
+### `FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL`
+
+The URL of the incident history on your status page. The apps don't use it yet. With rexctl, use `rexctl config set app_public.branding.status_page_incident_history_url`.
+
+### `FLUXER_INSTANCE_SETUP_CONFIGURED`
+
+Whether a new instance starts as already set up. Use `true` or `false`. With `true`, the setup wizard is skipped and registration opens without making the first account an admin. Once a setup state is saved, this has no effect. When it's empty, Fluxer uses `false`. With rexctl, use `rexctl config set FLUXER_INSTANCE_SETUP_CONFIGURED`.
+
+### `FLUXER_ACCOUNT_IDENTITY`
+
+How people sign in on a new instance. Use `username` or `email`. Fluxer uses it only on the first start with no saved sign-in method. When it's empty, Fluxer uses `email` if email delivery is set up and `username` otherwise. When `FLUXER_INSTANCE_SETUP_CONFIGURED` is `true` or any account exists, Fluxer uses email sign-in with random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value. With rexctl, use `rexctl config set FLUXER_ACCOUNT_IDENTITY`.
+
+### `FLUXER_TAG_STYLE`
+
+How usernames are tagged on a new instance that signs in by email. Use `none` for unique usernames with no tag or `random` for a random tag on every account. Username sign-in always uses `none`. Fluxer reads this setting only on the first start. When it's empty, Fluxer uses `none`. When `FLUXER_INSTANCE_SETUP_CONFIGURED` is `true` or any account exists, Fluxer uses random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value. With rexctl, use `rexctl config set FLUXER_TAG_STYLE`.
+
+### `FLUXER_AUTO_JOIN_INVITE_CODE`
+
+One or more invite codes, separated by commas or spaces. A new account that signs up without an invite of its own joins the communities these invites lead to. With rexctl, use `rexctl config set FLUXER_AUTO_JOIN_INVITE_CODE`.
+
+### `FLUXER_DISCOVERY_ENABLED`
+
+Whether community discovery is on. Use `true` or `false`. With `false`, discovery search, joining from discovery and discovery applications are turned off. When it's empty, Fluxer uses `true`. With rexctl, use `rexctl config set FLUXER_DISCOVERY_ENABLED`.
+
+### `FLUXER_DISCOVERY_MIN_MEMBER_COUNT`
+
+How many members a community needs before it can be listed in discovery. When it's empty, Fluxer uses `1`. With rexctl, use `rexctl config set FLUXER_DISCOVERY_MIN_MEMBER_COUNT`.
+
+### `FLUXER_DELETION_GRACE_PERIOD_HOURS`
+
+How many hours a deleted account can still be recovered before Fluxer removes it. When it's empty, Fluxer uses `336`, which is 14 days. With rexctl, use `rexctl config set FLUXER_DELETION_GRACE_PERIOD_HOURS`.
+
+### `FLUXER_REPORT_RETENTION_DAYS`
+
+How many days the daily retention job keeps a resolved report, from 1 to 36500. It then deletes the report, its evidence copies and its search entry. A child safety report is kept for at least 365 days after it's resolved, and a report with an enforcement decision for at least 365 days after the decision. The job never deletes a pending report or a report under a legal hold. When it's empty, the worker uses `365`. With rexctl, use `rexctl config set FLUXER_REPORT_RETENTION_DAYS`.
+
+### `FLUXER_REPORT_RETENTION_DRY_RUN`
+
+Whether the report retention job only counts what it would delete and changes nothing. Use `true` or `false`. When it's empty, the worker uses `false`. With rexctl, use `rexctl config set FLUXER_REPORT_RETENTION_DRY_RUN`.
+
+## Billing
+
+The admin panel can also save whether billing is on, the Stripe keys and the prices. A value saved there is used first, and a saved price list replaces all of `FLUXER_STRIPE_PRICES`.
+
+### `FLUXER_STRIPE_ENABLED`
+
+Whether Fluxer sells subscriptions through Stripe. Use `true` or `false`. When it's empty, Fluxer uses `false`. With rexctl, use `rexctl config set billing.enabled`.
+
+### `FLUXER_STRIPE_SECRET_KEY`
+
+Your Stripe secret API key. Keep it secret. With rexctl, use `rexctl config set billing.stripe_secret_key`.
+
+### `FLUXER_STRIPE_WEBHOOK_SECRET`
+
+The signing secret of your Stripe webhook. Keep it secret. With rexctl, use `rexctl config set billing.stripe_webhook_secret`.
+
+### `FLUXER_STRIPE_PRICES`
+
+Your Stripe price IDs as one JSON object, keyed by plan and currency such as `monthly_usd`. With rexctl, use `rexctl config set billing.prices`.
+
+### `FLUXER_STRIPE_LEGACY_PRICES`
+
+Stripe price IDs you have retired, as a JSON object with the same keys as `FLUXER_STRIPE_PRICES` and a list of IDs for each. Subscriptions on these prices keep renewing. With rexctl, use `rexctl config set billing.legacy_prices`.
+
+### `FLUXER_VISIONARIES_GUILD_ID`
+
+The ID of the community that people who buy Visionary are added to. When it's empty on a self-hosted instance, nobody is added. With rexctl, use `rexctl config set FLUXER_VISIONARIES_GUILD_ID`.
+
+### `FLUXER_VISIONARIES_GUILD_VISIONARY_ROLE_ID`
+
+The ID of the role Fluxer gives Visionary buyers in the community set by `FLUXER_VISIONARIES_GUILD_ID`. Set it whenever `FLUXER_VISIONARIES_GUILD_ID` is set. With rexctl, use `rexctl config set FLUXER_VISIONARIES_GUILD_VISIONARY_ROLE_ID`.
+
+## Integrations
+
+The admin panel can also save the Bluesky settings and keys. A value saved there is used first.
+
+### `FLUXER_BREACHED_PASSWORD_CHECK_ENABLED`
+
+Whether Fluxer rejects passwords found in known data breaches, by sending the first five characters of the password's SHA-1 hash to `api.pwnedpasswords.com`. Use `true` or `false`. When it's empty, this is off on a self-hosted instance. With rexctl, use `rexctl config set FLUXER_BREACHED_PASSWORD_CHECK_ENABLED`.
+
+### `FLUXER_BLOCKLIST_FEEDS_ENABLED`
+
+Whether the worker downloads the URLhaus and PhishTank link lists every six hours and the MalwareBazaar file hashes every twelve hours, and checks posted links and uploads against them. Use `true` or `false`. When it's empty, this is off on a self-hosted instance. With rexctl, use `rexctl config set FLUXER_BLOCKLIST_FEEDS_ENABLED`.
+
+### `FLUXER_GEOIP_DB_PATH`
+
+Where the api and worker load the MaxMind GeoIP database from, as a file path or an `s3://bucket/key` URL. An s3 URL needs a `download_path` query parameter with an absolute path. With rexctl, use `rexctl config set FLUXER_GEOIP_DB_PATH`.
+
+### `FLUXER_KLIPY_API_KEY`
+
+The Klipy API key for GIF search and Klipy link previews. A key saved in the admin panel is used first. GIF search is off when neither is set. Keep it secret. With rexctl, use `rexctl config set integrations.gif.klipy_api_key`.
+
+### `FLUXER_YOUTUBE_API_KEY`
+
+The YouTube Data API key Fluxer uses for YouTube link previews. A key saved in the admin panel is used first. Keep it secret. With rexctl, use `rexctl config set integrations.youtube.api_key`.
+
+### `FLUXER_API_UNFURL_IGNORED_HOSTS`
+
+Hostnames, separated by commas, that Fluxer never makes link previews for. A link matches only when its host is exactly one of these. With rexctl, use `rexctl config set FLUXER_API_UNFURL_IGNORED_HOSTS`.
+
+### `FLUXER_AUTH_BLUESKY_ENABLED`
+
+Whether people can link a Bluesky account to their profile. Use `true` or `false`. It needs `FLUXER_AUTH_BLUESKY_KEYS`. When it's empty, Fluxer uses `false`. With rexctl, use `rexctl config set integrations.bluesky.enabled`.
+
+### `FLUXER_AUTH_BLUESKY_CLIENT_NAME`
+
+The app name Bluesky shows when someone links their account. When it's empty, Bluesky shows `Fluxer`, even when `FLUXER_APP_PRODUCT_NAME` is set. With rexctl, use `rexctl config set integrations.bluesky.client_name`.
+
+### `FLUXER_AUTH_BLUESKY_CLIENT_URI`
+
+Fluxer doesn't use this value. Bluesky shows the API address as the home page of your instance.
+
+### `FLUXER_AUTH_BLUESKY_LOGO_URI`
+
+The logo URL Bluesky shows for your instance. With rexctl, use `rexctl config set integrations.bluesky.logo_uri`.
+
+### `FLUXER_AUTH_BLUESKY_TOS_URI`
+
+The terms of service URL Bluesky shows for your instance. With rexctl, use `rexctl config set integrations.bluesky.tos_uri`.
+
+### `FLUXER_AUTH_BLUESKY_POLICY_URI`
+
+The privacy policy URL Bluesky shows for your instance. With rexctl, use `rexctl config set integrations.bluesky.policy_uri`.
+
+### `FLUXER_AUTH_BLUESKY_KEYS`
+
+The keys Fluxer signs Bluesky account linking requests with, as a JSON array of objects with a `kid` and a `private_key` or a `private_key_path`, which is an absolute path inside the api and worker containers. Keys saved in the admin panel replace these. Keep it secret. With rexctl, use `rexctl config set integrations.bluesky.keys`.
+
+## Memory and performance
+
+rexctl sets some of these from the machine's memory and CPU on every start. A value you set wins.
+
+### `FLUXER_TOKIO_WORKER_THREADS`
+
+How many worker threads the async runtime uses in the app-proxy, push, admin, snowflakes, users, gifs, messages and unfurl containers, set as their `TOKIO_WORKER_THREADS`. The default is `2`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_TOKIO_WORKER_THREADS`.
+
+### `FLUXER_MALLOC_ARENA_MAX`
+
+How many memory arenas the glibc allocator may create in the push, admin, snowflakes, users, gifs, messages and unfurl containers, set as their `MALLOC_ARENA_MAX`. Lower values use less memory. The default is `2`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MALLOC_ARENA_MAX`.
+
+### `FLUXER_CADDY_MEMORY_LIMIT`
+
+The memory limit for the edge container, which runs Caddy. The default is `384mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_CADDY_MEMORY_LIMIT`.
+
+### `FLUXER_POSTGRES_MEMORY_LIMIT`
+
+The memory limit for the postgres container. Keep it at or above `FLUXER_POSTGRES_MEMORY_RESERVATION`. The default is `5gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_MEMORY_LIMIT`.
+
+### `FLUXER_POSTGRES_MEMORY_RESERVATION`
+
+The memory reservation for the postgres container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below `FLUXER_POSTGRES_MEMORY_LIMIT`. The default is `3gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_MEMORY_RESERVATION`.
+
+### `FLUXER_POSTGRES_SERVER_MAX_CONNECTIONS`
+
+Postgres `max_connections`, how many connections the database accepts in total. Keep it above the sum of all pool sizes, counting each worker replica. The default is `150`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_SERVER_MAX_CONNECTIONS`.
+
+### `FLUXER_POSTGRES_SHARED_BUFFERS`
+
+Postgres `shared_buffers`, the memory Postgres uses for its own cache. The default is `512MB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_SHARED_BUFFERS`.
+
+### `FLUXER_POSTGRES_EFFECTIVE_CACHE_SIZE`
+
+Postgres `effective_cache_size`, how much disk cache the query planner assumes there is. It allocates no memory. The default is `2GB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_EFFECTIVE_CACHE_SIZE`.
+
+### `FLUXER_POSTGRES_WORK_MEM`
+
+Postgres `work_mem`, the memory each sort or hash step in a query can use before it spills to disk. The default is `8MB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_WORK_MEM`.
+
+### `FLUXER_POSTGRES_MAINTENANCE_WORK_MEM`
+
+Postgres `maintenance_work_mem`, the memory one VACUUM, CREATE INDEX or ALTER TABLE can use. The default is `256MB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_MAINTENANCE_WORK_MEM`.
+
+### `FLUXER_POSTGRES_AUTOVACUUM_WORK_MEM`
+
+Postgres `autovacuum_work_mem`, the memory each autovacuum worker can use. The default is `128MB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_AUTOVACUUM_WORK_MEM`.
+
+### `FLUXER_POSTGRES_RANDOM_PAGE_COST`
+
+Postgres `random_page_cost`, how costly the query planner thinks fetching a random disk page is next to a sequential one. Values near 1 suit SSDs. The default is `1.1`. With rexctl, use `rexctl config set FLUXER_POSTGRES_RANDOM_PAGE_COST`.
+
+### `FLUXER_POSTGRES_EFFECTIVE_IO_CONCURRENCY`
+
+Postgres `effective_io_concurrency`, how many disk requests Postgres may have in flight at once. High values suit SSDs. The default is `200`. With rexctl, use `rexctl config set FLUXER_POSTGRES_EFFECTIVE_IO_CONCURRENCY`.
+
+### `FLUXER_POSTGRES_DEFAULT_STATISTICS_TARGET`
+
+Postgres `default_statistics_target`, how much detail the query planner's table statistics have. Higher values give better plans and a slower ANALYZE. The default is `200`. With rexctl, use `rexctl config set FLUXER_POSTGRES_DEFAULT_STATISTICS_TARGET`.
+
+### `FLUXER_POSTGRES_JIT`
+
+Postgres `jit`, whether Postgres compiles parts of queries with JIT. Use `on` or `off`. The default is `off`. With rexctl, use `rexctl config set FLUXER_POSTGRES_JIT`.
+
+### `FLUXER_POSTGRES_MIN_WAL_SIZE`
+
+Postgres `min_wal_size`, the write-ahead log space Postgres keeps for reuse after a checkpoint. The default is `80MB`. With rexctl, use `rexctl config set FLUXER_POSTGRES_MIN_WAL_SIZE`.
+
+### `FLUXER_POSTGRES_MAX_WAL_SIZE`
+
+Postgres `max_wal_size`, how large the write-ahead log may grow before Postgres starts a checkpoint. The default is `2GB`. With rexctl, use `rexctl config set FLUXER_POSTGRES_MAX_WAL_SIZE`.
+
+### `FLUXER_POSTGRES_CHECKPOINT_COMPLETION_TARGET`
+
+Postgres `checkpoint_completion_target`, how much of the time between checkpoints a checkpoint spreads its writes over, as a fraction. The default is `0.9`. With rexctl, use `rexctl config set FLUXER_POSTGRES_CHECKPOINT_COMPLETION_TARGET`.
+
+### `FLUXER_POSTGRES_WAL_BUFFERS`
+
+Postgres `wal_buffers`, the memory for write-ahead log data not yet written to disk. The default is `16MB`. With rexctl, use `rexctl config set FLUXER_POSTGRES_WAL_BUFFERS`.
+
+### `FLUXER_POSTGRES_WAL_COMPRESSION`
+
+Postgres `wal_compression`, how full-page images in the write-ahead log are compressed, such as `lz4`, `pglz` or `off`. The default is `zstd`. With rexctl, use `rexctl config set FLUXER_POSTGRES_WAL_COMPRESSION`.
+
+### `FLUXER_POSTGRES_BGWRITER_DELAY`
+
+Postgres `bgwriter_delay`, how long the background writer sleeps between rounds, such as `200ms`. The default is `50ms`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_BGWRITER_DELAY`.
+
+### `FLUXER_POSTGRES_BGWRITER_LRU_MAXPAGES`
+
+Postgres `bgwriter_lru_maxpages`, the most buffers the background writer writes to disk in one round. The default is `1000`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_BGWRITER_LRU_MAXPAGES`.
+
+### `FLUXER_POSTGRES_AUTOVACUUM_VACUUM_SCALE_FACTOR`
+
+Postgres `autovacuum_vacuum_scale_factor`, the share of a table's rows that must be updated or deleted before autovacuum vacuums it, as a fraction such as `0.1`. The default is `0.05`. With rexctl, use `rexctl config set FLUXER_POSTGRES_AUTOVACUUM_VACUUM_SCALE_FACTOR`.
+
+### `FLUXER_POSTGRES_AUTOVACUUM_ANALYZE_SCALE_FACTOR`
+
+Postgres `autovacuum_analyze_scale_factor`, the share of a table's rows that must change before autovacuum analyses it again, as a fraction such as `0.05`. The default is `0.02`. With rexctl, use `rexctl config set FLUXER_POSTGRES_AUTOVACUUM_ANALYZE_SCALE_FACTOR`.
+
+### `FLUXER_POSTGRES_AUTOVACUUM_VACUUM_COST_LIMIT`
+
+Postgres `autovacuum_vacuum_cost_limit`, how much disk work autovacuum may do before it pauses. Higher values let it finish sooner. The default is `2000`. With rexctl, use `rexctl config set FLUXER_POSTGRES_AUTOVACUUM_VACUUM_COST_LIMIT`.
+
+### `FLUXER_POSTGRES_AUTOVACUUM_MAX_WORKERS`
+
+Postgres `autovacuum_max_workers`, how many autovacuum processes can run at once. The default is `3`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_AUTOVACUUM_MAX_WORKERS`.
+
+### `FLUXER_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER`
+
+Postgres `max_parallel_workers_per_gather`, how many parallel workers one step of a query can use. The default is `2`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER`.
+
+### `FLUXER_POSTGRES_MAX_PARALLEL_WORKERS`
+
+Postgres `max_parallel_workers`, how many parallel query workers can run at once across the database. Postgres caps it at `max_worker_processes`, and the stack leaves that at 8. The default is `8`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_MAX_PARALLEL_WORKERS`.
+
+### `FLUXER_POSTGRES_TRACK_IO_TIMING`
+
+Postgres `track_io_timing`, whether Postgres times its disk I/O for its statistics. Use `on` or `off`. The default is `on`. With rexctl, use `rexctl config set FLUXER_POSTGRES_TRACK_IO_TIMING`.
+
+### `FLUXER_POSTGRES_SHARED_PRELOAD_LIBRARIES`
+
+Postgres `shared_preload_libraries`, the extensions Postgres loads at start, separated by commas. Keep `pg_stat_statements` in the list. The api turns it on at start. The default is `pg_stat_statements`. With rexctl, use `rexctl config set FLUXER_POSTGRES_SHARED_PRELOAD_LIBRARIES`.
+
+### `FLUXER_POSTGRES_SHM_SIZE`
+
+The shared memory size of the postgres container, used by parallel queries and parallel maintenance. Keep it well above `FLUXER_POSTGRES_MAINTENANCE_WORK_MEM`. The default is `1gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_POSTGRES_SHM_SIZE`.
+
+### `FLUXER_VALKEY_MEMORY_LIMIT`
+
+The memory limit for the valkey container. Keep it above `FLUXER_VALKEY_MAXMEMORY`. The default is `256mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_VALKEY_MEMORY_LIMIT`.
+
+### `FLUXER_VALKEY_MAXMEMORY`
+
+Valkey `maxmemory`, the most memory Valkey may use for stored data. The append-only file buffer and memory fragmentation come on top. Keep it below `FLUXER_VALKEY_MEMORY_LIMIT`. The default is `192mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_VALKEY_MAXMEMORY`.
+
+### `FLUXER_VALKEY_MAXMEMORY_POLICY`
+
+Valkey `maxmemory-policy`, what Valkey does when its data grows to `FLUXER_VALKEY_MAXMEMORY`. With `noeviction`, writes fail when Valkey is full and no data is dropped. The default is `noeviction`. With rexctl, use `rexctl config set FLUXER_VALKEY_MAXMEMORY_POLICY`.
+
+### `FLUXER_NATS_MEMORY_LIMIT`
+
+The memory limit for the nats container. The default is `256mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_NATS_MEMORY_LIMIT`.
+
+### `FLUXER_NATS_GOMEMLIMIT`
+
+The soft memory limit of the Go runtime in NATS, set as its `GOMEMLIMIT`. Keep it below `FLUXER_NATS_MEMORY_LIMIT`. The default is `200MiB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_NATS_GOMEMLIMIT`.
+
+### `FLUXER_NATS_MAX_MEMORY_STORE`
+
+NATS JetStream `max_memory_store`, the most memory JetStream may use for streams kept in memory, such as `128MB`. The default is `64MB`. With rexctl, use `rexctl config set FLUXER_NATS_MAX_MEMORY_STORE`.
+
+### `FLUXER_NATS_MAX_FILE_STORE`
+
+NATS JetStream `max_file_store`, the most disk space JetStream may use for its streams, such as `20GB`. The default is `10GB`. With rexctl, use `rexctl config set FLUXER_NATS_MAX_FILE_STORE`.
+
+### `FLUXER_MEILISEARCH_MEMORY_LIMIT`
+
+The memory limit for the meilisearch container. The default is `1536mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEILISEARCH_MEMORY_LIMIT`.
+
+### `FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY`
+
+The memory Meilisearch aims to stay under while indexing, set as its `MEILI_MAX_INDEXING_MEMORY`, such as `512mb`. Meilisearch can go a little over it. Keep it well below `FLUXER_MEILISEARCH_MEMORY_LIMIT`. The default is `256mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY`.
+
+### `FLUXER_MEILISEARCH_MAX_INDEXING_THREADS`
+
+The most threads Meilisearch may use for indexing, set as its `MEILI_MAX_INDEXING_THREADS`. The default is `2`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEILISEARCH_MAX_INDEXING_THREADS`.
+
+### `FLUXER_SEAWEEDFS_MEMORY_LIMIT`
+
+The memory limit for the seaweedfs container. The default is `2gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_MEMORY_LIMIT`.
+
+### `FLUXER_SEAWEEDFS_GOMEMLIMIT`
+
+The soft memory limit of the Go runtime in SeaweedFS, set as its `GOMEMLIMIT`. Go can't see the container limit. Keep this at 75 to 85 percent of `FLUXER_SEAWEEDFS_MEMORY_LIMIT` and raise both together. The default is `1536MiB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_GOMEMLIMIT`.
+
+### `FLUXER_SEAWEEDFS_VOLUME_GROWTH`
+
+How many volumes SeaweedFS creates at once when a bucket has no writable volume left, set as its `WEED_MASTER_VOLUME_GROWTH_COPY_1`. The default is `1`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_VOLUME_GROWTH`.
+
+### `FLUXER_SEAWEEDFS_VOLUME_SIZE_LIMIT_MB`
+
+The size in MB a volume can grow to before SeaweedFS stops writing to it, set as its `-master.volumeSizeLimitMB`. The default is `1024`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_VOLUME_SIZE_LIMIT_MB`.
+
+### `FLUXER_SEAWEEDFS_GARBAGE_THRESHOLD`
+
+The share of deleted space in a volume that makes SeaweedFS compact it, as a fraction, set as its `-master.garbageThreshold`. The default is `0.1`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_GARBAGE_THRESHOLD`.
+
+### `FLUXER_SEAWEEDFS_VOLUME_MAX`
+
+The most volumes the SeaweedFS volume store may have, set as its `-volume.max`. The default is `10000`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_VOLUME_MAX`.
+
+### `FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT`
+
+The memory limit for the seaweedfs-init container, which creates the buckets, sets up the S3 key and the expiry of the uploads bucket, and then exits. The default is `128mb`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT`.
+
+### `FLUXER_LIVEKIT_MEMORY_LIMIT`
+
+The memory limit for the livekit container. The default is `512mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_LIVEKIT_MEMORY_LIMIT`.
+
+### `FLUXER_LIVEKIT_GOMEMLIMIT`
+
+The soft memory limit of the Go runtime in LiveKit, set as its `GOMEMLIMIT`. Keep it below `FLUXER_LIVEKIT_MEMORY_LIMIT`. The default is `435MiB`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_LIVEKIT_GOMEMLIMIT`.
+
+### `FLUXER_API_MEMORY_LIMIT`
+
+The memory limit for the api container. The default is `2560mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_API_MEMORY_LIMIT`.
+
+### `FLUXER_API_MEMORY_RESERVATION`
+
+The memory reservation for the api container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below `FLUXER_API_MEMORY_LIMIT`. The default is `1gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_API_MEMORY_RESERVATION`.
+
+### `FLUXER_API_NODE_HEAP_MB`
+
+The Node heap limit of the api container, in MB, set as `--max-old-space-size`. When it's empty, Node uses 60 percent of the memory available to the container. A value above `FLUXER_API_MEMORY_LIMIT` lets the heap grow until Docker kills the container for running out of memory. With rexctl, use `rexctl config set FLUXER_API_NODE_HEAP_MB`.
+
+### `FLUXER_API_NODE_OPTIONS`
+
+Extra Node flags for the api container, added to the end of `NODE_OPTIONS`, such as `--dns-result-order=ipv4first`. Set the heap with `FLUXER_API_NODE_HEAP_MB`. While that is empty, a `--max-old-space-size` flag here has no effect. With rexctl, use `rexctl config set FLUXER_API_NODE_OPTIONS`.
+
+### `FLUXER_API_POSTGRES_MAX_CONNECTIONS`
+
+The size of the Postgres connection pool of the api container, from 1 to 1000. The default is `25`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_API_POSTGRES_MAX_CONNECTIONS`.
+
+### `FLUXER_API_EMBEDDED_WORKER`
+
+Whether the api container also runs the background worker jobs inside the api process. Use `true` or `false`. With `true`, rexctl sets `FLUXER_WORKER_REPLICAS` to 0 and gives the api container more memory. Without rexctl, set `FLUXER_WORKER_REPLICAS` to 0 yourself. The default is `false`. With rexctl, use `rexctl config set FLUXER_API_EMBEDDED_WORKER`.
+
+### `FLUXER_WORKER_REPLICAS`
+
+How many worker containers Docker runs. With `FLUXER_API_EMBEDDED_WORKER` set to `true`, rexctl sets it to 0. Without rexctl, set it to 0 yourself. The default is `1`. With rexctl, use `rexctl config set FLUXER_WORKER_REPLICAS`.
+
+### `FLUXER_WORKER_MEMORY_LIMIT`
+
+The memory limit for each worker container. The default is `2560mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_WORKER_MEMORY_LIMIT`.
+
+### `FLUXER_WORKER_MEMORY_RESERVATION`
+
+The memory reservation for each worker container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below `FLUXER_WORKER_MEMORY_LIMIT`. The default is `1gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_WORKER_MEMORY_RESERVATION`.
+
+### `FLUXER_WORKER_NODE_HEAP_MB`
+
+The Node heap limit of each worker container, in MB, set as `--max-old-space-size`. When it's empty, Node uses 55 percent of the memory available to the container. A value above `FLUXER_WORKER_MEMORY_LIMIT` lets the heap grow until Docker kills the container for running out of memory. With rexctl, use `rexctl config set FLUXER_WORKER_NODE_HEAP_MB`.
+
+### `FLUXER_WORKER_NODE_OPTIONS`
+
+Extra Node flags for each worker container, added to the end of `NODE_OPTIONS`, such as `--dns-result-order=ipv4first`. Set the heap with `FLUXER_WORKER_NODE_HEAP_MB`. While that is empty, a `--max-old-space-size` flag here has no effect. With rexctl, use `rexctl config set FLUXER_WORKER_NODE_OPTIONS`.
+
+### `FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS`
+
+The size of the Postgres connection pool of each worker container, from 1 to 1000. It has no effect when `FLUXER_API_EMBEDDED_WORKER` is `true`. The default is `25`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS`.
+
+### `FLUXER_WORKER_POSTGRES_SYNCHRONOUS_COMMIT`
+
+Postgres `synchronous_commit` for the database connections of each worker container. Use `on`, `off`, `local`, `remote_write` or `remote_apply`. When it's empty, the worker uses `off`, and a Postgres crash can lose the worker's most recent writes. It has no effect when `FLUXER_API_EMBEDDED_WORKER` is `true`. With rexctl, use `rexctl config set FLUXER_WORKER_POSTGRES_SYNCHRONOUS_COMMIT`.
+
+### `FLUXER_GATEWAY_MEMORY_LIMIT`
+
+The memory limit for the gateway container. The default is `1gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_GATEWAY_MEMORY_LIMIT`.
+
+### `FLUXER_GATEWAY_MEMORY_RESERVATION`
+
+The memory reservation for the gateway container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below `FLUXER_GATEWAY_MEMORY_LIMIT`. The default is `384mb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_GATEWAY_MEMORY_RESERVATION`.
+
+### `FLUXER_ERLANG_SCHEDULERS`
+
+How many normal schedulers the Erlang VM of the gateway runs, a positive whole number. When it's empty, the gateway uses the container's CPU count kept between `FLUXER_ERLANG_SCHEDULERS_MIN` and `FLUXER_ERLANG_SCHEDULERS_MAX`. With rexctl, use `rexctl config set FLUXER_ERLANG_SCHEDULERS`.
+
+### `FLUXER_ERLANG_SCHEDULERS_MIN`
+
+The lowest scheduler count the gateway picks from the CPU count when `FLUXER_ERLANG_SCHEDULERS` is empty. When it's empty, the gateway uses `2`. With rexctl, use `rexctl config set FLUXER_ERLANG_SCHEDULERS_MIN`.
+
+### `FLUXER_ERLANG_SCHEDULERS_MAX`
+
+The highest scheduler count the gateway picks from the CPU count when `FLUXER_ERLANG_SCHEDULERS` is empty. When it's empty, the gateway uses `16`. With rexctl, use `rexctl config set FLUXER_ERLANG_SCHEDULERS_MAX`.
+
+### `FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS`
+
+How many dirty CPU schedulers the Erlang VM of the gateway runs, a positive whole number. When it's empty, the gateway uses half the normal scheduler count, and at least `1`. With rexctl, use `rexctl config set FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS`.
+
+### `FLUXER_ERLANG_DIRTY_IO_SCHEDULERS`
+
+How many dirty I/O schedulers the Erlang VM of the gateway runs, a positive whole number. When it's empty, the gateway uses the normal scheduler count kept between 2 and 4. With rexctl, use `rexctl config set FLUXER_ERLANG_DIRTY_IO_SCHEDULERS`.
+
+### `FLUXER_MEDIA_PROXY_MEMORY_LIMIT`
+
+The memory limit for the media-proxy container. The default is `1gb`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_MEMORY_LIMIT`.
+
+### `FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS`
+
+How many worker threads the async runtime of the media proxy uses, set as its `TOKIO_WORKER_THREADS`. The default is `4`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS`.
+
+### `FLUXER_PUSH_MEMORY_LIMIT`
+
+The memory limit for the push container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_PUSH_MEMORY_LIMIT`.
+
+### `FLUXER_STATIC_PROXY_MEMORY_LIMIT`
+
+The memory limit for the static-proxy container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_STATIC_PROXY_MEMORY_LIMIT`.
+
+### `FLUXER_APP_PROXY_MEMORY_LIMIT`
+
+The memory limit for the app-proxy container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_APP_PROXY_MEMORY_LIMIT`.
+
+### `FLUXER_SNOWFLAKES_MEMORY_LIMIT`
+
+The memory limit for the snowflakes container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_SNOWFLAKES_MEMORY_LIMIT`.
+
+### `FLUXER_USERS_MEMORY_LIMIT`
+
+The memory limit for the users container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_USERS_MEMORY_LIMIT`.
+
+### `FLUXER_USERS_POSTGRES_MAX_CONNECTIONS`
+
+The size of the Postgres connection pool of the users container. The default is `20`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_USERS_POSTGRES_MAX_CONNECTIONS`.
+
+### `FLUXER_GIFS_MEMORY_LIMIT`
+
+The memory limit for the gifs container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_GIFS_MEMORY_LIMIT`.
+
+### `FLUXER_GIFS_SHARD_CACHE_MAX_BYTES`
+
+How many bytes the gifs service may use for its cache, at least `16777216`, which is 16 MiB. Keep it below `FLUXER_GIFS_MEMORY_LIMIT`. The default is `134217728`, which is 128 MiB. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_GIFS_SHARD_CACHE_MAX_BYTES`.
+
+### `FLUXER_MESSAGES_MEMORY_LIMIT`
+
+The memory limit for the messages container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_MESSAGES_MEMORY_LIMIT`.
+
+### `FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS`
+
+The size of the Postgres connection pool of the messages container. The default is `20`. rexctl sizes this. With rexctl, use `rexctl config set FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS`.
+
+### `FLUXER_UNFURL_MEMORY_LIMIT`
+
+The memory limit for the unfurl container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_UNFURL_MEMORY_LIMIT`.
+
+### `FLUXER_ADMIN_MEMORY_LIMIT`
+
+The memory limit for the admin container. The default is `256mb`. With rexctl, use `rexctl config set FLUXER_ADMIN_MEMORY_LIMIT`.
+
+## Bundled services
+
+These change how the bundled Valkey, Meilisearch and SeaweedFS run.
+
+### `FLUXER_VALKEY_APPENDFSYNC`
+
+Valkey `appendfsync`, how often Valkey flushes its append-only file to disk. Use `always`, `everysec` or `no`. With `everysec`, a crash can lose the last second of writes. The default is `everysec`. With rexctl, use `rexctl config set FLUXER_VALKEY_APPENDFSYNC`.
+
+### `FLUXER_VALKEY_SAVE`
+
+Valkey `save`, when Valkey writes RDB snapshots, as pairs of seconds and changes such as `3600 1 300 100`. When it's empty, snapshots are off and Valkey keeps its data in the append-only file alone. With rexctl, use `rexctl config set FLUXER_VALKEY_SAVE`.
+
+### `FLUXER_MEILISEARCH_ENV`
+
+The Meilisearch environment, set as its `MEILI_ENV`. Use `production` or `development`. With `production`, Meilisearch refuses to start without a master key of at least 16 bytes and turns off its search preview. The default is `production`. With rexctl, use `rexctl config set FLUXER_MEILISEARCH_ENV`.
+
+### `FLUXER_MEILISEARCH_NO_ANALYTICS`
+
+Whether Meilisearch stops sending usage data to the Meilisearch team, set as its `MEILI_NO_ANALYTICS`. Use `true` or `false`. The default is `true`. With rexctl, use `rexctl config set FLUXER_MEILISEARCH_NO_ANALYTICS`.
+
+### `FLUXER_SEAWEEDFS_TELEMETRY`
+
+Whether SeaweedFS sends usage data to the SeaweedFS project, set as its `-master.telemetry`. Use `true` or `false`. The default is `false`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_TELEMETRY`.
+
+## Logs and health checks
+
+### `LOG_LEVEL`
+
+How much the api and worker log. Use `trace`, `debug`, `info`, `warn`, `error` or `fatal`. An empty or unknown value gives `info`. With rexctl, use `rexctl config set LOG_LEVEL`.
+
+### `RUST_LOG`
+
+The log filter of media-proxy, app-proxy, admin, push, snowflakes, users, gifs, messages and unfurl, in tracing EnvFilter format such as `debug` or `off`. An empty or invalid filter gives `info`. With rexctl, use `rexctl config set RUST_LOG`.
+
+### `FLUXER_GATEWAY_LOGGER_LEVEL`
+
+The gateway log level. Use `debug`, `info`, `notice`, `warning`, `error`, `critical`, `alert` or `emergency`. An empty or unknown value gives `info`. `LOGGER_LEVEL` wins over this one. With rexctl, use `rexctl config set FLUXER_GATEWAY_LOGGER_LEVEL`.
+
+### `LOGGER_LEVEL`
+
+The gateway log level, which wins over `FLUXER_GATEWAY_LOGGER_LEVEL` and takes the same levels. An empty or unknown value falls back to `FLUXER_GATEWAY_LOGGER_LEVEL`. With rexctl, use `rexctl config set LOGGER_LEVEL`.
+
+### `FLUXER_MEILISEARCH_LOG_LEVEL`
+
+How much Meilisearch logs, set as its `MEILI_LOG_LEVEL`. Use `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG` or `TRACE`. The default is `WARN`. With rexctl, use `rexctl config set FLUXER_MEILISEARCH_LOG_LEVEL`.
+
+### `FLUXER_LIVEKIT_LOG_LEVEL`
+
+How much LiveKit logs. Use `debug`, `info`, `warn` or `error`. The default is `info`. With rexctl, use `rexctl config set FLUXER_LIVEKIT_LOG_LEVEL`.
+
+### `FLUXER_LOG_MAX_SIZE`
+
+How large the log file of a container grows before Docker rotates it, such as `50m`. The default is `10m`. With rexctl, use `rexctl config set FLUXER_LOG_MAX_SIZE`.
+
+### `FLUXER_LOG_MAX_FILE`
+
+How many log files Docker keeps for each container when it rotates logs. The default is `3`. With rexctl, use `rexctl config set FLUXER_LOG_MAX_FILE`.
+
+### `FLUXER_RESTART_POLICY`
+
+The Docker restart policy of every long-running service, such as `always`, `on-failure` or `no`. The default is `unless-stopped`. With rexctl, use `rexctl config set FLUXER_RESTART_POLICY`.
+
+### `FLUXER_HEALTHCHECK_INTERVAL`
+
+How often Docker runs the health check of each service, such as `30s`. The media-proxy and app-proxy containers have their own interval settings. The default is `10s`. With rexctl, use `rexctl config set FLUXER_HEALTHCHECK_INTERVAL`.
+
+### `FLUXER_MEDIA_PROXY_HEALTHCHECK_INTERVAL`
+
+How often Docker runs the health check of the media-proxy container. The default is `30s`. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_HEALTHCHECK_INTERVAL`.
+
+### `FLUXER_APP_PROXY_HEALTHCHECK_INTERVAL`
+
+How often Docker runs the health check of the app-proxy container. The default is `30s`. With rexctl, use `rexctl config set FLUXER_APP_PROXY_HEALTHCHECK_INTERVAL`.
+
+### `FLUXER_HEALTHCHECK_TIMEOUT`
+
+How long one health check may run before Docker counts it as failed. The default is `5s`. With rexctl, use `rexctl config set FLUXER_HEALTHCHECK_TIMEOUT`.
+
+### `FLUXER_HEALTHCHECK_RETRIES`
+
+How many failed health checks in a row mark the edge, postgres, valkey, nats, meilisearch, livekit, media-proxy, static-proxy and app-proxy containers as unhealthy. The default is `10`. With rexctl, use `rexctl config set FLUXER_HEALTHCHECK_RETRIES`.
+
+### `FLUXER_HEALTHCHECK_START_PERIOD`
+
+How long the edge, postgres, valkey, nats, meilisearch, livekit, media-proxy, static-proxy and app-proxy containers get to start before failed health checks count. The default is `60s`. With rexctl, use `rexctl config set FLUXER_HEALTHCHECK_START_PERIOD`.
+
+### `FLUXER_HEALTHCHECK_START_INTERVAL`
+
+How often Docker runs each health check while a service is still in its start period. The default is `1s`. With rexctl, use `rexctl config set FLUXER_HEALTHCHECK_START_INTERVAL`.
+
+### `FLUXER_APP_HEALTHCHECK_RETRIES`
+
+How many failed health checks in a row mark the api, gateway, push, admin, snowflakes, users, gifs, messages and unfurl containers as unhealthy. The default is `30`. With rexctl, use `rexctl config set FLUXER_APP_HEALTHCHECK_RETRIES`.
+
+### `FLUXER_APP_HEALTHCHECK_START_PERIOD`
+
+How long the api, worker and gateway containers get to start before failed health checks count, such as `120s`. The default is `90s`. With rexctl, use `rexctl config set FLUXER_APP_HEALTHCHECK_START_PERIOD`.
+
+### `FLUXER_SVC_HEALTHCHECK_START_PERIOD`
+
+How long the push, admin, snowflakes, users, gifs, messages and unfurl containers get to start before failed health checks count. The default is `60s`. With rexctl, use `rexctl config set FLUXER_SVC_HEALTHCHECK_START_PERIOD`.
+
+### `FLUXER_SEAWEEDFS_HEALTHCHECK_RETRIES`
+
+How many failed health checks in a row mark the seaweedfs container as unhealthy. The default is `20`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_HEALTHCHECK_RETRIES`.
+
+### `FLUXER_SEAWEEDFS_HEALTHCHECK_START_PERIOD`
+
+How long the seaweedfs container gets to start before failed health checks count. The default is `60s`. With rexctl, use `rexctl config set FLUXER_SEAWEEDFS_HEALTHCHECK_START_PERIOD`.
+
+### `FLUXER_WORKER_HEALTHCHECK_RETRIES`
+
+How many failed health checks in a row mark a worker container as unhealthy. The check passes while the worker has updated its heartbeat file in the last 30 seconds. The default is `3`. With rexctl, use `rexctl config set FLUXER_WORKER_HEALTHCHECK_RETRIES`.
+
+## Images
+
+Set one to use your own mirror or another version. Fluxer's own images are pinned to the release in `docker-compose.yml`.
+
+### `FLUXER_CADDY_IMAGE`
+
+The image the edge container runs. The default is `caddy:2.11-alpine`. With rexctl, use `rexctl config set images.edge`.
+
+### `FLUXER_POSTGRES_IMAGE`
+
+The image the postgres container runs. The default is `postgres:16-alpine`. With rexctl, use `rexctl config set images.postgres`.
+
+### `FLUXER_VALKEY_IMAGE`
+
+The image the valkey container runs. The default is `valkey/valkey:9.1-alpine`. With rexctl, use `rexctl config set images.valkey`.
+
+### `FLUXER_NATS_IMAGE`
+
+The image the nats container runs. The default is `nats:2.14-alpine`. With rexctl, use `rexctl config set images.nats`.
+
+### `FLUXER_MEILISEARCH_IMAGE`
+
+The image the meilisearch container runs. The default is `getmeili/meilisearch:v1.53`. With rexctl, use `rexctl config set images.meilisearch`.
+
+### `FLUXER_SEAWEEDFS_IMAGE`
+
+The image the seaweedfs and seaweedfs-init containers run. The default is `chrislusf/seaweedfs:4.47`. With rexctl, use `rexctl config set images.seaweedfs`.
+
+### `FLUXER_LIVEKIT_IMAGE`
+
+The image the livekit container runs. The default is `livekit/livekit-server:v1.12.0`. With rexctl, use `rexctl config set images.livekit`.
+
+### `FLUXER_REGISTRY`
+
+The registry of Fluxer's own images in the `docker-compose.yml` of the Fluxer repository. When it's empty, that file uses `ghcr.io/` followed by `FLUXER_REGISTRY_OWNER`. The compose bundle pins every Fluxer image to the release.
+
+### `FLUXER_REGISTRY_OWNER`
+
+The owner of Fluxer's own images on `ghcr.io`, in the `docker-compose.yml` of the Fluxer repository. The compose bundle pins every Fluxer image to the release. The default is `fluxerapp`.
+
+### `FLUXER_IMAGE_TAG`
+
+The tag of Fluxer's own images in the `docker-compose.yml` of the Fluxer repository. The compose bundle pins every Fluxer image to the release. `rexctl upgrade --check` reads it to find the release a Docker Compose install runs, and uses `v1` when it's empty. The default is `v1`.
+
+## Values from files
+
+The api, worker, gateway and Rust services also take a setting from a file. Set `NAME_FILE` to the path of a file that has the value, such as a Docker secret, and leave `NAME` unset. A service with both `NAME` and `NAME_FILE` set refuses to start. `docker-compose.yml` passes only the variables it lists. To use a `NAME_FILE` variable, add it to the service's environment in a compose file of your own and list that file in `COMPOSE_FILE`.
+
+These variables don't take the file form. Set them as plain values.
+
+- `BUILD_VERSION`
+- `FLUXER_API_PORT`
+- `FLUXER_CLIENT_IP_HEADER_NAME`
+- `FLUXER_DISABLE_RATE_LIMITS`
+- `FLUXER_ENV`
+- `FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS`
+- `FLUXER_ERLANG_DIRTY_IO_SCHEDULERS`
+- `FLUXER_ERLANG_DIST_PORT`
+- `FLUXER_ERLANG_NODE_NAME`
+- `FLUXER_ERLANG_NODE_NAME_PREFIX`
+- `FLUXER_ERLANG_SCHEDULERS`
+- `FLUXER_ERLANG_SCHEDULERS_MAX`
+- `FLUXER_ERLANG_SCHEDULERS_MIN`
+- `FLUXER_OPERATOR_SOCKET`
+- `HOSTNAME`
+- `LOG_LEVEL`
+- `POD_NAME`
+- `RELX_REPLACE_OS_VARS`
+
+The file form doesn't work for the docs site variables either, or for variables that system libraries and runtimes look up, such as `NODE_OPTIONS`, `MALLOC_ARENA_MAX`, `TOKIO_WORKER_THREADS`, `HTTP_PROXY`, `SSL_CERT_FILE` and `VIPS_CONCURRENCY`. The bundled third-party images follow their own rules.
+
+## rexctl
+
+rexctl and its install scripts look these up in the shell you run them from. A value in `.env` has no effect.
+
+### `REXCTL_RELEASE_URL`
+
+The URL of the release index that rexctl and its install scripts download releases from. When it's empty, they use `https://fluxer.dev/rexctl/release.json`. Another server must answer the same queries as that address, including `version` and `format=sh`.
+
+### `REXCTL_IMAGE_SET`
+
+The path of an image set JSON file with a release and its image list, which rexctl uses for its built-in images. Only tests use it.
+
+### `VISUAL`
+
+The editor `rexctl config edit` opens. When it's empty, rexctl uses `EDITOR`.
+
+### `EDITOR`
+
+The editor `rexctl config edit` opens when `VISUAL` is empty. When both are empty, rexctl uses Notepad on Windows and nano or vi elsewhere.
+
+### `NO_COLOR`
+
+Set it to any value to turn off colour in rexctl and its install scripts. A `TERM` of `dumb` turns colour off too.
+
+### `ACCESSIBLE`
+
+Set it to any value to make rexctl ask questions as plain text prompts and print steps as plain lines for screen readers.
+
+### `DOCKER_HOST`
+
+The engine address rexctl tries first, such as `unix:///run/user/1000/podman/podman.sock`. rexctl reads it for install, takeover and restore, and when the engine an instance uses doesn't answer. When it's empty, rexctl uses the current Docker context and then looks for a Docker or Podman socket.
+
+### `DOCKER_CONTEXT`
+
+The Docker context rexctl tries first when `DOCKER_HOST` is empty. rexctl reads it for install, takeover and restore, and when the engine an instance uses doesn't answer. When it's empty, rexctl uses the current context of the Docker CLI.
+
+### `DOCKER_CONFIG`
+
+The directory of the Docker CLI configuration, which has the current Docker context. When it's empty, rexctl uses `.docker` in your home directory.
+
+## Set by the compose stack
+
+`docker-compose.yml` sets these for the services from the settings above or to fixed values. A value in `.env` has no effect.
+
+### `DISCOVERY_UPSTREAM_URL`
+
+Where app-proxy loads the instance discovery document from. Docker Compose sets it to `http://edge:8088/.well-known/fluxer`.
+
+### `FLUXER_ADMIN_PORT`
+
+The port the admin service listens on inside its container. Docker Compose sets it to `8080`.
+
+### `FLUXER_API_PORT`
+
+The port the api service listens on inside its container. Docker Compose sets it to `8080`.
+
+### `FLUXER_API_PUBLIC_ENDPOINT`
+
+The public API address the admin panel allows images from, set from `FLUXER_API_ENDPOINT`.
+
+### `FLUXER_API_WORKER_ENABLE_CRON_SCHEDULER`
+
+Whether the worker runs the scheduled jobs. Docker Compose sets it to `true`.
+
+### `FLUXER_API_WORKER_MODE`
+
+Which job lanes the worker runs. Docker Compose sets it to `all_lanes`.
+
+### `FLUXER_APP_PROXY_PORT`
+
+The port the app-proxy service listens on inside its container. Docker Compose sets it to `8080`.
+
+### `FLUXER_BASE_DOMAIN`
+
+The domain the services build their addresses from, set from `FLUXER_DOMAIN`.
+
+### `FLUXER_DATABASE_BACKEND`
+
+The database the services use. Docker Compose sets it to `postgres`.
+
+### `FLUXER_EDGE_TLS_DIRECTIVE`
+
+The tls line of the edge Caddyfile, set from `FLUXER_EDGE_TLS`.
+
+### `FLUXER_ENV`
+
+The environment the services run in. Docker Compose sets it to `production`.
+
+### `FLUXER_GATEWAY_PORT`
+
+The port the gateway listens on inside its container. Docker Compose sets it to `8080`.
+
+### `FLUXER_INTERNAL_API_ENDPOINT`
+
+The address the services use to call the api service inside the stack. Docker Compose sets it to `http://api:8080`.
+
+### `FLUXER_INTERNAL_MEDIA_PROXY_ENDPOINT`
+
+The address the services use to call the media proxy inside the stack. Docker Compose sets it to `http://media-proxy:8080`.
+
+### `FLUXER_LIVEKIT_API_KEY`
+
+The LiveKit API key the services use, set from `LIVEKIT_API_KEY`.
+
+### `FLUXER_LIVEKIT_API_SECRET`
+
+The LiveKit API secret the services use, set from `LIVEKIT_API_SECRET`.
+
+### `FLUXER_MEDIA_PROXY_ENDPOINT`
+
+The address the unfurl service uses to call the media proxy. The api and worker also read it when `FLUXER_INTERNAL_MEDIA_PROXY_ENDPOINT` is empty. Docker Compose sets it to `http://media-proxy:8080`.
+
+### `FLUXER_MEDIA_PROXY_MODE`
+
+How the media proxy runs. Docker Compose sets it to `upload`.
+
+### `FLUXER_MEDIA_PROXY_PORT`
+
+The port the media proxy listens on inside its container. Docker Compose sets it to `8080`.
+
+### `FLUXER_MEDIA_PROXY_STORAGE_BACKEND`
+
+Where the media proxy keeps files. Docker Compose sets it to `s3`.
+
+### `FLUXER_POSTGRES_MAX_CONNECTIONS`
+
+The size of each service's Postgres connection pool, set from `FLUXER_API_POSTGRES_MAX_CONNECTIONS`, `FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS`, `FLUXER_USERS_POSTGRES_MAX_CONNECTIONS` or `FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS`.
+
+### `FLUXER_POSTGRES_PASSWORD`
+
+The Postgres password the services use, set from `POSTGRES_PASSWORD`.
+
+### `FLUXER_S3_ACCESS_KEY_ID`
+
+The object store access key the services use, set from `FLUXER_S3_ACCESS_KEY`.
+
+### `FLUXER_S3_SECRET_ACCESS_KEY`
+
+The object store secret key the services use, set from `FLUXER_S3_SECRET_KEY`.
+
+### `FLUXER_SEARCH_API_KEY`
+
+The search API key the services use, set from `MEILI_MASTER_KEY`.
+
+### `FLUXER_SELF_HOSTED`
+
+Whether the services run as a self-hosted instance. Docker Compose sets it to `true`.
+
+### `FLUXER_SVC_MODE`
+
+How the snowflakes, users, gifs, messages and unfurl services run. Docker Compose sets it to `combined`.
+
+### `FLUXER_SVC_NAME`
+
+The service name the internal services use to pick their default for `FLUXER_SVC_MAX_CONCURRENT_REQUESTS`. Each image always runs its own service. Docker Compose sets it to the name of each service, such as `users`.
+
+### `FLUXER_SVC_SHARD_COUNT`
+
+How many shards each internal service has. Docker Compose sets it to `1`.
+
+### `GOMEMLIMIT`
+
+The soft memory limit of the Go runtime in NATS, LiveKit and SeaweedFS, set from `FLUXER_NATS_GOMEMLIMIT`, `FLUXER_LIVEKIT_GOMEMLIMIT` and `FLUXER_SEAWEEDFS_GOMEMLIMIT`.
+
+### `LIVEKIT_CONFIG`
+
+The LiveKit config in YAML, built from the voice and video settings and `LIVEKIT_API_KEY`.
+
+### `LIVEKIT_KEYS`
+
+The LiveKit API key and secret pair, set from `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.
+
+### `MALLOC_ARENA_MAX`
+
+The glibc memory arena limit of the push, admin, snowflakes, users, gifs, messages and unfurl services, set from `FLUXER_MALLOC_ARENA_MAX`.
+
+### `MEILI_ENV`
+
+The Meilisearch environment, set from `FLUXER_MEILISEARCH_ENV`.
+
+### `MEILI_LOG_LEVEL`
+
+The Meilisearch log level, set from `FLUXER_MEILISEARCH_LOG_LEVEL`.
+
+### `MEILI_MAX_INDEXING_MEMORY`
+
+The memory Meilisearch aims to stay under while indexing, set from `FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY`.
+
+### `MEILI_MAX_INDEXING_THREADS`
+
+The most threads Meilisearch may use for indexing, set from `FLUXER_MEILISEARCH_MAX_INDEXING_THREADS`.
+
+### `MEILI_NO_ANALYTICS`
+
+Whether Meilisearch stops sending usage data, set from `FLUXER_MEILISEARCH_NO_ANALYTICS`.
+
+### `MEILI_UPGRADE_DB`
+
+Whether Meilisearch upgrades its database on start after a version change. Docker Compose sets it to `true`.
+
+### `NODE_EXTRA_CA_CERTS`
+
+The extra CA certificates Node trusts in the api and worker services, set from `FLUXER_NODE_EXTRA_CA_CERTS`.
+
+### `NODE_OPTIONS`
+
+The Node options of the api and worker services, built from `FLUXER_API_NODE_HEAP_MB`, `FLUXER_API_NODE_OPTIONS`, `FLUXER_WORKER_NODE_HEAP_MB` and `FLUXER_WORKER_NODE_OPTIONS`.
+
+### `POSTGRES_DB`
+
+The database the bundled Postgres creates on its first start, set from `FLUXER_POSTGRES_DATABASE`.
+
+### `POSTGRES_USER`
+
+The role the bundled Postgres creates on its first start, set from `FLUXER_POSTGRES_USERNAME`.
+
+### `TOKIO_WORKER_THREADS`
+
+How many async worker threads the Rust services use, set from `FLUXER_TOKIO_WORKER_THREADS` or `FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS`.
+
+### `WEED_MASTER_VOLUME_GROWTH_COPY_1`
+
+How many volumes SeaweedFS creates at once, set from `FLUXER_SEAWEEDFS_VOLUME_GROWTH`.
+
+## Not passed by the compose stack
+
+Fluxer's services, their images, some of the libraries they use and the Fluxer Helm chart also use these variables, but `docker-compose.yml` doesn't pass them to any service. A value in `.env` has no effect.
+
+### `ALL_PROXY`
+
+The proxy the Rust services use for HTTP and HTTPS requests when `HTTP_PROXY` or `HTTPS_PROXY` is empty. They also take the lowercase `all_proxy`.
+
+### `BUILD_VERSION`
+
+The build version a service reports. Each image sets its own.
+
+### `FLUXER_ADMIN_HOST`
+
+The address the admin service listens on. When it's empty, it listens on `0.0.0.0`.
+
+### `FLUXER_ADMIN_OAUTH_CLIENT_ID`
+
+The OAuth2 client ID the admin panel signs in with. The stack uses the built-in client ID of the admin service.
+
+### `FLUXER_ADMIN_OAUTH_REDIRECT_URI`
+
+The OAuth2 redirect URL of the admin panel. The admin service works it out from its own address.
+
+### `FLUXER_API_WORKER_LANE`
+
+The job lane a worker runs when `FLUXER_API_WORKER_MODE` is `single_lane`. Each worker container in the stack runs every lane.
+
+### `FLUXER_API_WORKER_METRICS_PORT`
+
+The port the worker serves its metrics on. The stack doesn't collect worker metrics.
+
+### `FLUXER_API_WORKER_TASK`
+
+The one task a worker runs when `FLUXER_API_WORKER_MODE` is `single_task`. Each worker container in the stack runs every lane.
+
+### `FLUXER_APP_PROXY_HOST`
+
+The address the app-proxy service listens on. When it's empty, it listens on `0.0.0.0`.
+
+### `FLUXER_BUILD_VERSION`
+
+The older name for `BUILD_VERSION`, which only the admin and app-proxy services read when `BUILD_VERSION` is empty. Their images set `BUILD_VERSION`.
+
+### `FLUXER_ERLANG_COOKIE_FILE`
+
+A file that has the gateway's Erlang cookie. The stack passes `FLUXER_ERLANG_COOKIE` itself.
+
+### `FLUXER_GATEWAY_API_RPC_ENDPOINT`
+
+The URL the gateway sends API RPC requests to. When it's empty, the gateway uses `FLUXER_INTERNAL_API_ENDPOINT` followed by `/internal/rpc`.
+
+### `FLUXER_GATEWAY_NATS_RPC_ENABLED`
+
+Whether the gateway answers RPC requests over NATS. The gateway answers the API only over NATS RPC and must keep it turned on.
+
+### `FLUXER_GIF_SERVICE_SUBJECT`
+
+The NATS subject the API sends gifs service requests to. The gifs service always listens on `svc.gifs`, and any other value breaks GIF search.
+
+### `FLUXER_MEDIA_PROXY_HOST`
+
+The address the media proxy listens on. When it's empty, it listens on `0.0.0.0`.
+
+### `FLUXER_MEDIA_PROXY_STORAGE_ROOT`
+
+The directory the media proxy keeps files in when it stores them on disk. The stack keeps media in the object store.
+
+### `FLUXER_NATS_CORE_URL`
+
+The older name for `FLUXER_NATS_URL`, which only the api and worker read. Docker Compose passes `FLUXER_NATS_URL`.
+
+### `FLUXER_PUSH_SERVICE_HOST`
+
+The address the push service listens on. When it's empty, it listens on `0.0.0.0`.
+
+### `FLUXER_PUSH_SERVICE_PORT`
+
+The port the push service listens on. When it's empty, it uses `8126`, or `8127` for the push relay.
+
+### `FLUXER_S3_BUCKET_STATIC`
+
+The bucket the media proxy serves files from when `FLUXER_MEDIA_PROXY_MODE` is `static`. The stack runs the media proxy in `upload` mode.
+
+### `FLUXER_SNOWFLAKE_SERVICE_SUBJECT`
+
+The NATS subject the API sends snowflakes service requests to. The snowflakes service always listens on `svc.snowflakes`, and any other value breaks ID generation.
+
+### `FLUXER_STATIC_DIR`
+
+The directory the app-proxy service serves static files from. The app-proxy image has its static files built in.
+
+### `FLUXER_SVC_LISTEN_HOST`
+
+The address an internal service listens on. When it's empty, it listens on `0.0.0.0`.
+
+### `FLUXER_SVC_PORT`
+
+The port an internal service listens on. When it's empty, it uses `8090`.
+
+### `FLUXER_SVC_SHARD_ID`
+
+Which shard of an internal service a container runs. When it's empty, the service takes the number at the end of `POD_NAME`, or `0`. The stack runs one shard of each service.
+
+### `FLUXER_USERS_SERVICE_SUBJECT`
+
+The NATS subject the API sends users service requests to. The users service always listens on `svc.users`, and any other value breaks user lookups.
+
+### `FLUXER_VALKEY_PASSWORD`
+
+The password of the Valkey that the Fluxer Helm chart runs, at least 32 letters and digits. The chart builds `FLUXER_KV_URL` from it.
+
+### `G_MESSAGES_DEBUG`
+
+The GLib log domains whose debug messages libvips prints in the media proxy, or `all`. The media-proxy image sets it to an empty value and GLib prints none.
+
+### `HOSTNAME`
+
+The hostname of the container. Docker sets it.
+
+### `KLIPY_API_KEY`
+
+The older name for `FLUXER_KLIPY_API_KEY`, used only by the unfurl service. Docker Compose passes `FLUXER_KLIPY_API_KEY`.
+
+### `LD_PRELOAD`
+
+Libraries the dynamic loader loads before any others. The media-proxy and app-proxy images set it to `libjemalloc.so.2` to use the jemalloc memory allocator.
+
+### `LIVEKIT_WEBHOOK_URL`
+
+The address the bundled LiveKit sends its webhooks to. The Fluxer Helm chart sets it on the LiveKit pod and adds it to the LiveKit config.
+
+### `MALLOC_CONF`
+
+The jemalloc options of the media proxy and app-proxy. Both images set it to `background_thread:true,metadata_thp:auto,dirty_decay_ms:5000,muzzy_decay_ms:5000`.
+
+### `NODE_ENV`
+
+The Node environment that libraries in the api and worker look up. The api image sets it to `production`.
+
+### `NODE_TLS_REJECT_UNAUTHORIZED`
+
+With `0`, Node in the api and worker checks no certificates on outgoing TLS connections, except Postgres when `FLUXER_POSTGRES_SSL` is `true`. To trust your own CA, use `FLUXER_NODE_EXTRA_CA_CERTS`.
+
+### `PGDATA`
+
+The directory the bundled Postgres keeps its data in. The Fluxer Helm chart sets it on the Postgres pod.
+
+### `PGSSLMODE`
+
+The libpq TLS mode the api and worker use when `FLUXER_POSTGRES_SSL` isn't `true` and `FLUXER_POSTGRES_URL` has no `sslmode`. With `prefer`, `require`, `verify-ca` or `verify-full`, they connect over TLS and check the server certificate. With `no-verify`, they connect over TLS without checking it. The other services don't use it.
+
+### `POD_IP`
+
+The IP address of a gateway pod. The Fluxer Helm chart sets it on the gateway pods and builds `FLUXER_ERLANG_NODE_NAME` from it.
+
+### `POD_NAME`
+
+The name of the pod a service runs in. The api and gateway label their RPC timings with it, or with `HOSTNAME` when it's empty, and the gateway reports it in its node details. When `FLUXER_SVC_SHARD_ID` is empty, an internal service runs the shard numbered at the end of the pod name, such as `2` for `users-2`. The Fluxer Helm chart sets it on the shard pods of the internal services and on the NATS pods.
+
+### `REDISCLI_AUTH`
+
+The password of the bundled Valkey. The Fluxer Helm chart sets it on the Valkey pod from `FLUXER_VALKEY_PASSWORD` and starts Valkey with it.
+
+### `RELEASE_CHANNEL`
+
+The release channel the app-proxy service puts in the web app, `stable` or `canary`. The self-hosted app-proxy service serves the stable channel.
+
+### `RELX_REPLACE_OS_VARS`
+
+Whether the gateway release scripts fill in environment variables in the gateway config. The gateway entrypoint sets it.
+
+### `SSL_CERT_DIR`
+
+Directories of CA certificate files, separated by colons, that the Rust services trust for outgoing TLS. When it or `SSL_CERT_FILE` is set, they trust only those certificates.
+
+### `SSL_CERT_FILE`
+
+A PEM file of CA certificates that the Rust services trust for outgoing TLS, such as to your own object store or Postgres. When it or `SSL_CERT_DIR` is set, they trust only those certificates. Add your CA to a copy of the system bundle.
+
+### `VIPS_CONCURRENCY`
+
+How many threads libvips uses for each image transform. The media proxy always runs libvips with one thread per transform and ignores it. `FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS` sets how many transforms run at once.
+
+### `VIPS_DISC_THRESHOLD`
+
+The image size above which libvips in the media proxy decodes an image to a temporary file on disk. The media-proxy image sets it to `1g`.
+
+### `YOUTUBE_API_KEY`
+
+The older name for `FLUXER_YOUTUBE_API_KEY`, used only by the unfurl service. Docker Compose passes `FLUXER_YOUTUBE_API_KEY`.
+
+### Hosted service only
+
+Only Fluxer's hosted service uses these.
+
+#### `FLUXER_API_AUTOMATED_MESSAGE_DELETION_DELAY_DAYS`
+
+The delay before automated account actions delete messages, in days.
+
+#### `FLUXER_APP_STORE_APPS`
+
+The App Store apps Fluxer sells in.
+
+#### `FLUXER_APP_STORE_ENABLED`
+
+Whether App Store purchases are on.
+
+#### `FLUXER_APP_STORE_ISSUER_ID`
+
+The App Store Connect issuer ID.
+
+#### `FLUXER_APP_STORE_KEY_ID`
+
+The App Store Connect key ID.
+
+#### `FLUXER_APP_STORE_PRIVATE_KEY`
+
+The App Store Connect private key.
+
+#### `FLUXER_APP_STORE_PRIVATE_KEY_PATH`
+
+The path to the App Store Connect private key.
+
+#### `FLUXER_APP_STORE_PRODUCTS`
+
+The App Store products and what they grant.
+
+#### `FLUXER_GOOGLE_PLAY_CLIENT_EMAIL`
+
+The Google Play service account email.
+
+#### `FLUXER_GOOGLE_PLAY_ENABLED`
+
+Whether Google Play purchases are on.
+
+#### `FLUXER_GOOGLE_PLAY_PACKAGES`
+
+The Android packages Fluxer sells in.
+
+#### `FLUXER_GOOGLE_PLAY_PRIVATE_KEY`
+
+The Google Play service account private key.
+
+#### `FLUXER_GOOGLE_PLAY_PRIVATE_KEY_PATH`
+
+The path to the Google Play service account private key.
+
+#### `FLUXER_GOOGLE_PLAY_PRODUCTS`
+
+The Google Play products and what they grant.
+
+#### `FLUXER_GOOGLE_PLAY_PUSH_AUDIENCE`
+
+The audience the API expects in the token on Google Play billing notifications from Pub/Sub.
+
+#### `FLUXER_GOOGLE_PLAY_PUSH_SERVICE_ACCOUNT_EMAIL`
+
+The service account email the API expects in the token on Google Play billing notifications from Pub/Sub.
+
+#### `FLUXER_GOOGLE_PLAY_SELF_SERVICE_REFUNDS`
+
+Whether people can request Google Play refunds themselves.
+
+#### `FLUXER_GOOGLE_PLAY_SERVICE_ACCOUNT_JSON_PATH`
+
+The path to the Google Play service account JSON file.
+
+#### `FLUXER_GOOGLE_PLAY_TOKEN_URI`
+
+The OAuth token URL for Google Play.
+
+#### `FLUXER_LABS_GUILD_ID`
+
+The community Operator Pass holders join.
+
+#### `FLUXER_LABS_OPERATOR_ROLE_ID`
+
+The role Operator Pass holders get in that community.
+
+#### `FLUXER_OPERATOR_PASS_GRACE_MINUTES`
+
+The grace period of the Operator Pass sale, in minutes.
+
+#### `FLUXER_OPERATOR_PASS_MAX_QUANTITY`
+
+The largest Operator Pass quantity in one purchase.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_BRL_ENABLED`
+
+Whether the Operator Pass is sold in BRL.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_DKK_ENABLED`
+
+Whether the Operator Pass is sold in DKK.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_INR_ENABLED`
+
+Whether the Operator Pass is sold in INR.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_NOK_ENABLED`
+
+Whether the Operator Pass is sold in NOK.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_PLN_ENABLED`
+
+Whether the Operator Pass is sold in PLN.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_RISES_AT`
+
+When the Operator Pass price rises.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_SEK_ENABLED`
+
+Whether the Operator Pass is sold in SEK.
+
+#### `FLUXER_OPERATOR_PASS_PRICE_TRY_ENABLED`
+
+Whether the Operator Pass is sold in TRY.
+
+#### `FLUXER_OPERATOR_PASS_RELEASE_LISTS`
+
+The release lists of the Operator Pass sale.
+
+#### `FLUXER_OPERATOR_PASS_SALE_OPENS_AT`
+
+When the Operator Pass sale opens.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_BRL`
+
+The standard Operator Pass price in BRL.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_DKK`
+
+The standard Operator Pass price in DKK.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_EUR`
+
+The standard Operator Pass price in EUR.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_INR`
+
+The standard Operator Pass price in INR.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_NOK`
+
+The standard Operator Pass price in NOK.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_PLN`
+
+The standard Operator Pass price in PLN.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_SEK`
+
+The standard Operator Pass price in SEK.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_TRY`
+
+The standard Operator Pass price in TRY.
+
+#### `FLUXER_OPERATOR_PASS_STANDARD_PRICE_USD`
+
+The standard Operator Pass price in USD.
+
+#### `FLUXER_OPERATOR_PASS_STOPPED_COUNTRIES`
+
+Countries where Operator Pass sales are stopped.
+
+#### `FLUXER_OPERATOR_PASS_TRANSFER_LOCK_HOURS`
+
+How long an Operator Pass transfer stays locked, in hours.
+
+#### `FLUXER_OPERATOR_PASS_WALL_TIERS`
+
+The wall tiers of the Operator Pass sale.
+
+#### `FLUXER_OPERATOR_PASS_WITHDRAWAL_COUNTRIES`
+
+The Operator Pass withdrawal rules for each country.
+
+#### `FLUXER_PAYMENT_DISPUTE_CLOSURE_EFFECTIVE_AT`
+
+When account closures for payment disputes take effect.
+
+#### `FLUXER_STORE_BILLING_SANDBOX_ENTITLES_ALL`
+
+Whether sandbox store purchases count for every account.
+
+#### `FLUXER_STORE_BILLING_SANDBOX_USER_IDS`
+
+The accounts whose sandbox store purchases count.
+
+### Stripe price IDs
+
+Set prices with `FLUXER_STRIPE_PRICES` or in the admin panel.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_BRL`
+
+The price ID of the one-month gift in BRL.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_DKK`
+
+The price ID of the one-month gift in DKK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_EUR`
+
+The price ID of the one-month gift in EUR.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_INR`
+
+The price ID of the one-month gift in INR.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_ISK`
+
+The price ID of the one-month gift in ISK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_NOK`
+
+The price ID of the one-month gift in NOK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_PLN`
+
+The price ID of the one-month gift in PLN.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_SEK`
+
+The price ID of the one-month gift in SEK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_TRY`
+
+The price ID of the one-month gift in TRY.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_MONTH_USD`
+
+The price ID of the one-month gift in USD.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_BRL`
+
+The price ID of the one-year gift in BRL.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_DKK`
+
+The price ID of the one-year gift in DKK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_EUR`
+
+The price ID of the one-year gift in EUR.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_INR`
+
+The price ID of the one-year gift in INR.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_ISK`
+
+The price ID of the one-year gift in ISK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_NOK`
+
+The price ID of the one-year gift in NOK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_PLN`
+
+The price ID of the one-year gift in PLN.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_SEK`
+
+The price ID of the one-year gift in SEK.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_TRY`
+
+The price ID of the one-year gift in TRY.
+
+#### `FLUXER_STRIPE_PRICE_GIFT_1_YEAR_USD`
+
+The price ID of the one-year gift in USD.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_BRL`
+
+The price ID of the monthly plan in BRL.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_DKK`
+
+The price ID of the monthly plan in DKK.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_EUR`
+
+The price ID of the monthly plan in EUR.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_INR`
+
+The price ID of the monthly plan in INR.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_ISK`
+
+The price ID of the monthly plan in ISK.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_NOK`
+
+The price ID of the monthly plan in NOK.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_PLN`
+
+The price ID of the monthly plan in PLN.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_SEK`
+
+The price ID of the monthly plan in SEK.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_TRY`
+
+The price ID of the monthly plan in TRY.
+
+#### `FLUXER_STRIPE_PRICE_MONTHLY_USD`
+
+The price ID of the monthly plan in USD.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_BRL`
+
+The price ID of the yearly plan in BRL.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_DKK`
+
+The price ID of the yearly plan in DKK.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_EUR`
+
+The price ID of the yearly plan in EUR.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_INR`
+
+The price ID of the yearly plan in INR.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_ISK`
+
+The price ID of the yearly plan in ISK.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_NOK`
+
+The price ID of the yearly plan in NOK.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_PLN`
+
+The price ID of the yearly plan in PLN.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_SEK`
+
+The price ID of the yearly plan in SEK.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_TRY`
+
+The price ID of the yearly plan in TRY.
+
+#### `FLUXER_STRIPE_PRICE_YEARLY_USD`
+
+The price ID of the yearly plan in USD.
+
+### Gateway clustering
+
+The stack runs the gateway as one node.
+
+#### `FLUXER_ERLANG_DIST_PORT`
+
+The Erlang distribution port of the gateway.
+
+#### `FLUXER_ERLANG_NODE_NAME`
+
+The Erlang node name of the gateway.
+
+#### `FLUXER_ERLANG_NODE_NAME_PREFIX`
+
+A prefix that gives each gateway node a unique Erlang node name.
+
+#### `FLUXER_GATEWAY_CLUSTER_DISCOVERY_DNS_NAME`
+
+The DNS name gateway nodes find each other through.
+
+#### `FLUXER_GATEWAY_CLUSTER_DISCOVERY_NODE_BASENAME`
+
+The node name gateway nodes use when they find each other through DNS.
+
+#### `FLUXER_GATEWAY_CLUSTER_DISCOVERY_POLL_INTERVAL_MS`
+
+How often gateway nodes look for each other, in milliseconds.
+
+#### `FLUXER_GATEWAY_CLUSTER_ENABLED`
+
+Whether the gateway runs as a cluster.
+
+#### `FLUXER_GATEWAY_CLUSTER_STATIC_PEERS`
+
+A fixed list of the other gateway nodes.
+
+#### `FLUXER_GATEWAY_GUILD_PIN_KEEPER_BASE_MD5S`
+
+The module MD5s a node may have before the gateway patches it.
+
+#### `FLUXER_GATEWAY_GUILD_PIN_KEEPER_BEAM`
+
+The path of the BEAM file the gateway loads onto other nodes to pin communities.
+
+#### `FLUXER_GATEWAY_GUILD_PIN_KEEPER_BEAM_MD5`
+
+The MD5 that the `FLUXER_GATEWAY_GUILD_PIN_KEEPER_BEAM` file must have.
+
+#### `FLUXER_GATEWAY_PINNED_GUILD_IDS`
+
+The communities the gateway pins to particular nodes.
+
+#### `FLUXER_GATEWAY_ROLE`
+
+The role of a gateway node in a cluster.
+
+### Push relay
+
+Only the push relay Fluxer runs for the mobile apps uses these.
+
+#### `FLUXER_PUSH_RELAY_MAX_BODY_BYTES`
+
+The largest request the push relay accepts, in bytes.
+
+#### `FLUXER_PUSH_RELAY_MAX_CONCURRENT`
+
+How many requests the push relay handles at once.
+
+#### `FLUXER_PUSH_RELAY_SOURCE_BUCKET_BURST`
+
+How many requests the push relay allows from one client address in a burst.
+
+#### `FLUXER_PUSH_RELAY_SOURCE_BUCKET_ENABLED`
+
+Whether the push relay rate limits each client address itself.
+
+#### `FLUXER_PUSH_RELAY_SOURCE_BUCKET_ENTRIES`
+
+How many client addresses the push relay rate limit tracks.
+
+#### `FLUXER_PUSH_RELAY_SOURCE_BUCKET_PER_MINUTE`
+
+How many requests a minute the push relay allows from one client address.
+
+#### `FLUXER_PUSH_RELAY_TOKEN_BUCKET_BURST`
+
+How many requests the push relay allows for one device token in a burst.
+
+#### `FLUXER_PUSH_RELAY_TOKEN_BUCKET_ENTRIES`
+
+How many device tokens the push relay rate limit tracks.
+
+#### `FLUXER_PUSH_RELAY_TOKEN_BUCKET_PER_MINUTE`
+
+How many requests a minute the push relay allows for one device token.
+
+#### `FLUXER_PUSH_RELAY_TRUSTED_PROXY_HOPS`
+
+How many proxies in front of the push relay it trusts.
+
+### Cassandra
+
+The stack runs Postgres only.
+
+#### `FLUXER_CASSANDRA_HOSTS`
+
+The Cassandra hosts.
+
+#### `FLUXER_CASSANDRA_KEYSPACE`
+
+The Cassandra keyspace.
+
+#### `FLUXER_CASSANDRA_LOCAL_DC`
+
+The local Cassandra data centre.
+
+#### `FLUXER_CASSANDRA_PASSWORD`
+
+The Cassandra password.
+
+#### `FLUXER_CASSANDRA_PORT`
+
+The Cassandra port.
+
+#### `FLUXER_CASSANDRA_USERNAME`
+
+The Cassandra username.
+
+### Docs site
+
+The docs site isn't part of the compose stack.
+
+#### `FLUXER_DOCS_ENDPOINT`
+
+The public address of the docs site.
+
+#### `FLUXER_DOCS_LISTEN_HOST`
+
+The address the docs site listens on.
+
+#### `FLUXER_DOCS_LISTEN_PORT`
+
+The port the docs site listens on.
+
+#### `FLUXER_DOCS_SEARCH_INDEXING`
+
+Whether search engines may index the docs site.
+
+### Tests and development
+
+Only tests and development use these.
+
+#### `FLUXER_DISABLE_RATE_LIMITS`
+
+Whether rate limits are off.
+
+#### `FLUXER_OPERATOR_PASS_NOW`
+
+A clock override for the Operator Pass sale.
+
+#### `FLUXER_OPERATOR_SOCKET`
+
+The socket path the operator relay connects to. The api listens on `/run/fluxer/operator.sock`.
+
+#### `FLUXER_RELAX_REGISTRATION_RATE_LIMITS`
+
+Whether registration rate limits are relaxed.
+
+#### `FLUXER_TEST_HARNESS_TOKEN`
+
+The token of the test harness.
+
+#### `FLUXER_TEST_MODE_ENABLED`
+
+Whether test mode is on.
+
+#### `FLUXER_VALIDATE_RESPONSES`
+
+Whether the API checks its responses against their schemas.
diff --git a/fluxer_docs/src/content/docs/operator/kubernetes.mdx b/fluxer_docs/src/content/docs/operator/kubernetes.mdx
index 1de1cc102..c3578b127 100644
--- a/fluxer_docs/src/content/docs/operator/kubernetes.mdx
+++ b/fluxer_docs/src/content/docs/operator/kubernetes.mdx
@@ -66,7 +66,7 @@ The chart's `values.yaml` explains every value. These are the ones most installs
| `email` | The contact address for Let's Encrypt and web push |
| `edge.expose` | `ingress`, `gateway`, `loadBalancer` or `none` for a proxy of your own |
| `livekit.expose` | `hostNetwork` (the default, needs a privileged namespace), `loadBalancer` or `nodePort` |
-| `env` | Fluxer settings as `NAME: value` |
+| `env` | Fluxer settings as `NAME: value`, listed on [Environment variables](/operator/environment/) |
| `secrets.extra` | Settings that have a password or a key |
Under Argo CD or `helm template`, set `secrets.generate: false` and give every key in `secrets.values`, or put a Secret you manage in `secrets.existingSecret`.
diff --git a/fluxer_rexctl/cmd/config.go b/fluxer_rexctl/cmd/config.go
index 40e214934..1e9d12279 100644
--- a/fluxer_rexctl/cmd/config.go
+++ b/fluxer_rexctl/cmd/config.go
@@ -218,6 +218,28 @@ func restartText(services []string) string {
return "Restarts " + ui.JoinAnd(parts)
}
+var rexctlKeyHelp = map[string]string{
+ stack.SettingsLoadedVar: "rexctl sets this. Docker Compose refuses to start without it.",
+ instance.SetupTokenVar: "The token the setup wizard asks for before it creates the first admin account. rexctl generates it when it installs Fluxer, and rexctl setup token shows it.",
+}
+
+func keyHelp(k settings.Key) string {
+ if k.Help != "" || k.Kind != settings.Raw {
+ return k.Help
+ }
+ if help := rexctlKeyHelp[k.Name]; help != "" {
+ return help
+ }
+ return instance.EnvHelp(k.Name)
+}
+
+func firstSentence(text string) string {
+ if i := strings.Index(text, ". "); i >= 0 {
+ return text[:i+1]
+ }
+ return text
+}
+
type configRow struct {
Key string `json:"key"`
Kind string `json:"kind"`
@@ -235,7 +257,7 @@ func (v *configView) row(k settings.Key, reveal bool) configRow {
if reveal {
shown = value
}
- r := configRow{Key: k.Name, Kind: "deployment", Type: k.Type, Value: shown, Secret: k.Secret, Help: k.Help, Restarts: []string{}}
+ r := configRow{Key: k.Name, Kind: "deployment", Type: k.Type, Value: shown, Secret: k.Secret, Help: keyHelp(k), Restarts: []string{}}
if k.Name != settings.EngineHost {
r.Restarts = deploy.Promised(v.set, v.custom, k)
}
@@ -263,6 +285,9 @@ func (v *configView) deploymentKeys() []settings.Key {
}
slices.Sort(raw)
for _, name := range slices.Compact(raw) {
+ if name == stack.SettingsLoadedVar {
+ continue
+ }
k, err := settings.Lookup(v.set, v.vars, name, nil)
if err == nil && k.Kind == settings.Raw {
out = append(out, k)
@@ -296,7 +321,7 @@ func newConfigListCmd(app *App) *cobra.Command {
}
}
rows = append(rows, r)
- table = append(table, []string{r.Key, clip(fmt.Sprint(r.Value)), v.applies(k), r.Help})
+ table = append(table, []string{r.Key, clip(fmt.Sprint(r.Value)), v.applies(k), firstSentence(r.Help)})
}
instanceKeys, apiErr := instanceValues(ctx, app)
for _, k := range instanceKeys {
@@ -365,8 +390,8 @@ func newConfigGetCmd(app *App) *cobra.Command {
rows = append(rows, []string{"Default", fmt.Sprint(r.Default)})
}
rows = append(rows, []string{"Applies", v.applies(k)})
- if k.Help != "" {
- rows = append(rows, []string{"Help", k.Help})
+ if r.Help != "" {
+ rows = append(rows, []string{"Help", r.Help})
}
app.UI.Table([]string{"Setting", k.Name}, rows)
return nil
diff --git a/fluxer_rexctl/cmd/config_help_test.go b/fluxer_rexctl/cmd/config_help_test.go
new file mode 100644
index 000000000..d5b58c102
--- /dev/null
+++ b/fluxer_rexctl/cmd/config_help_test.go
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package cmd
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/settings"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/stack"
+)
+
+func TestRawSettingHelp(t *testing.T) {
+ set := stack.Embedded()
+ raw := 0
+ for _, name := range set.Vars {
+ k, err := settings.Lookup(set, nil, name, nil)
+ if err != nil || k.Kind != settings.Raw {
+ continue
+ }
+ raw++
+ help := keyHelp(k)
+ if help == "" {
+ t.Errorf("rexctl config get %s shows no help", name)
+ }
+ if strings.Contains(help, "docker compose ") || strings.Contains(help, "Keep this line") {
+ t.Errorf("rexctl config get %s shows help for Docker Compose users, got %q", name, help)
+ }
+ }
+ if raw == 0 {
+ t.Fatal("no compose setting resolves as a raw setting")
+ }
+}
diff --git a/fluxer_rexctl/cmd/docs.go b/fluxer_rexctl/cmd/docs.go
index b6be3b83a..b11dc6baf 100644
--- a/fluxer_rexctl/cmd/docs.go
+++ b/fluxer_rexctl/cmd/docs.go
@@ -11,6 +11,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/instance"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/mdx"
"github.com/fluxerapp/fluxer/fluxer_rexctl/internal/ui"
)
@@ -24,25 +26,32 @@ This page is made from the help that rexctl prints, and ` + "`rexctl <command> -
`
func newDocsCmd(app *App) *cobra.Command {
- var out string
+ var out, envPage, envExample string
c := &cobra.Command{
Use: "docs",
- Short: "Write the command reference page",
+ Short: "Write the command reference, environment variable page and reference .env.example",
Hidden: true,
Args: noArgs,
RunE: func(c *cobra.Command, _ []string) error {
page := renderDocs(c.Root())
- if out == "" {
+ if out == "" && envPage == "" && envExample == "" {
_, err := app.UI.Stdout().Write(page)
return err
}
- if err := os.WriteFile(out, page, 0o644); err != nil {
- return ui.Wrap(err, fmt.Sprintf("Couldn't write %s.", out), "Check that the folder exists and that you can write to it.")
+ for file, data := range map[string][]byte{out: page, envPage: []byte(instance.EnvPage()), envExample: []byte(instance.ReferenceEnv())} {
+ if file == "" {
+ continue
+ }
+ if err := os.WriteFile(file, data, 0o644); err != nil {
+ return ui.Wrap(err, fmt.Sprintf("Couldn't write %s.", file), "Check that the folder exists and that you can write to it.")
+ }
}
return nil
},
}
c.Flags().StringVar(&out, "out", "", "file to write")
+ c.Flags().StringVar(&envPage, "env-page", "", "environment variable page to write")
+ c.Flags().StringVar(&envExample, "env-example", "", "reference .env.example to write")
return c
}
@@ -70,7 +79,7 @@ func docsCommands(c *cobra.Command) []*cobra.Command {
func writeCommand(b *bytes.Buffer, c *cobra.Command, level int) {
fmt.Fprintf(b, "\n%s %s\n\n", strings.Repeat("#", level), c.CommandPath())
- b.WriteString(docsProse(docsDescription(c)))
+ b.WriteString(mdx.Prose(docsDescription(c)))
b.WriteString("\n")
if c.Runnable() && c.Annotations[helpOnly] == "" {
fmt.Fprintf(b, "\n```sh\n%s\n```\n", c.UseLine())
@@ -118,7 +127,7 @@ func writeFlags(b *bytes.Buffer, fs *pflag.FlagSet) {
if f.Shorthand != "" {
head = "`-" + f.Shorthand + "`, " + head
}
- fmt.Fprintf(b, "- %s\n\n %s", head, docsProse(sentence(usage)))
+ fmt.Fprintf(b, "- %s\n\n %s", head, mdx.Prose(sentence(usage)))
if d := flagDefault(f); d != "" {
fmt.Fprintf(b, " The default is `%s`.", d)
}
@@ -145,18 +154,3 @@ func sentence(s string) string {
}
return s
}
-
-func docsProse(s string) string {
- var b strings.Builder
- code := false
- for _, r := range s {
- if r == '`' {
- code = !code
- }
- if !code && strings.ContainsRune("<{}", r) {
- b.WriteByte('\\')
- }
- b.WriteRune(r)
- }
- return b.String()
-}
diff --git a/fluxer_rexctl/internal/instance/bundleenv.go b/fluxer_rexctl/internal/instance/bundleenv.go
index ee77299ad..66b996f36 100644
--- a/fluxer_rexctl/internal/instance/bundleenv.go
+++ b/fluxer_rexctl/internal/instance/bundleenv.go
@@ -6,6 +6,7 @@ import (
"fmt"
"slices"
"strings"
+ "sync"
"github.com/fluxerapp/fluxer/fluxer_rexctl/internal/secrets"
"github.com/fluxerapp/fluxer/fluxer_rexctl/internal/settings"
@@ -16,26 +17,7 @@ const envWidth = 78
var envRule = "# " + strings.Repeat("=", envWidth-2)
-type envSection struct {
- prefix string
- title string
- intro string
-}
-
-var envSections = []envSection{
- {"edge.", "EDGE AND HTTPS",
- "By default Fluxer listens on ports 80 and 443 and gets its own HTTPS certificate for your domain."},
- {"voice.", "VOICE AND VIDEO",
- "Calls connect directly to this machine on these ports, even when Fluxer is behind your own proxy."},
- {"storage.", "OBJECT STORAGE",
- "Leave these unset to use the bundled object store. To use your own S3-compatible store, set them and add " +
- stack.OverlayFiles[stack.OverlayExternalObjectStore] + " to COMPOSE_FILE."},
- {"network.", "OUTGOING PROXY", ""},
- {"sso.", "SINGLE SIGN-ON", ""},
- {settings.ImagesPrefix, "IMAGES",
- "Set one to use your own mirror or another version. Fluxer's own images are pinned to the release in " +
- stack.ComposeFile + "."},
-}
+const referenceEnvNote = "This is a reference copy. Use the .env.example in the compose bundle of your Fluxer release."
var envOverlays = []struct {
overlay stack.Overlay
@@ -47,155 +29,124 @@ var envOverlays = []struct {
{stack.OverlayIPv6, "for IPv6 on Fluxer's network"},
}
-var envNotes = map[string]string{
- settings.EdgeHTTPSPort: "If people connect to this port directly, set FLUXER_PUBLIC_PORT to the same port.",
- settings.EdgeTrusted: "Separate entries with spaces.",
- settings.VoicePublicIP: "Set FLUXER_LIVEKIT_NODE_IP to the address and FLUXER_LIVEKIT_USE_EXTERNAL_IP to false.",
- settings.NoProxy: "Separate hosts with commas.",
-}
-
var envExamples = map[string]string{
settings.Domain: "chat.example.com",
}
func BundleEnv() string {
- set := stack.Embedded()
- defaults := newEnvDefaults(set)
- required := map[string]bool{}
- for _, s := range secrets.Required {
- required[s.Key] = true
- }
- var domain settings.Key
- bySection := make([][]settings.Key, len(envSections))
- for _, k := range settings.Named() {
- if len(k.Vars) == 0 || !releaseUses(set, k) {
- continue
- }
- if k.Name == settings.Domain {
- domain = k
+ docs := envDocs()
+ var b strings.Builder
+ envBanner(&b)
+ for _, s := range envSections {
+ entries := docs.in(s.id)
+ if len(entries) == 0 {
continue
}
- for i, s := range envSections {
- if strings.HasPrefix(k.Name, s.prefix) {
- bySection[i] = append(bySection[i], k)
- break
- }
+ var list []string
+ if s.id == envComposeSection {
+ list = envOverlayList()
}
- }
-
- var b strings.Builder
- envBanner(&b)
-
- envFrame(&b, "REQUIRED", "Fill these in before the first start.")
- envComment(&b, "# ", fmt.Sprintf("%s refuses to start without this line. Keep it as it is.", stack.ComposeFile))
- fmt.Fprintf(&b, "%s=true\n\n", stack.SettingsLoadedVar)
- envSetting(&b, domain, defaults, required, true)
-
- envFrame(&b, "FIRST ADMIN ACCOUNT", "")
- b.WriteString("# setup token\n")
- envComment(&b, "# ", "The account that signs up with this token becomes Fluxer's first admin. "+
- "Use 32 to 256 characters, such as the output of openssl rand -hex 32. "+
- "If you leave it empty, the api service makes a token and writes it to its log once, on its first start. "+
- "docker compose logs api shows it.")
- envField(&b, "type", "secret")
- fmt.Fprintf(&b, "%s=\n", SetupTokenVar)
-
- envFrame(&b, "SECRETS", "Fill in each empty value before the first start, and keep a copy of .env somewhere safe.")
- envSecrets(&b)
-
- for i, s := range envSections {
- if len(bySection[i]) == 0 {
+ envFrame(&b, strings.ToUpper(s.title), s.intro, list)
+ if s.id == envSecretsSection {
+ envSecrets(&b, docs)
continue
}
- envFrame(&b, s.title, s.intro)
- for j, k := range bySection[i] {
- if j > 0 {
+ for i, d := range entries {
+ if i > 0 {
b.WriteString("\n")
}
- envSetting(&b, k, defaults, required, false)
+ envEntry(&b, d)
}
}
return b.String()
}
-func releaseUses(set *stack.Set, k settings.Key) bool {
- for _, v := range k.Vars {
- if !slices.Contains(set.Vars, v) {
- return false
- }
- }
- return true
+func ReferenceEnv() string {
+ var b strings.Builder
+ b.WriteString(envRule + "\n")
+ envComment(&b, "# ", referenceEnvNote)
+ b.WriteString(envRule + "\n\n")
+ b.WriteString(BundleEnv())
+ return b.String()
}
func envBanner(b *strings.Builder) {
b.WriteString(envRule + "\n")
b.WriteString("# Fluxer settings for the Docker Compose bundle\n#\n")
- envComment(b, "# ", "Copy this file to .env, fill in the required values and run docker compose up -d. "+
- "Settings that start with # are optional and use their default until you remove the #.")
- b.WriteString("#\n")
- envComment(b, "# ", fmt.Sprintf("The optional compose files change how Fluxer runs. To use one, list it after %s in COMPOSE_FILE, "+
- "such as COMPOSE_FILE=%s:%s.", stack.ComposeFile, stack.ComposeFile, stack.OverlayFiles[stack.OverlayProxy]))
+ envComment(b, "# ", "Copy this file to .env, fill in the required values and run `docker compose up -d`. "+
+ "Settings that start with # are optional. To change one, remove the # and set a value.")
b.WriteString("#\n")
+ envComment(b, "# ", "If you move this instance to rexctl later with rexctl takeover, "+
+ "the rexctl line under each setting shows the command that changes it.")
+ b.WriteString(envRule + "\n")
+}
+
+func envOverlayList() []string {
width := 0
for _, o := range envOverlays {
width = max(width, len(stack.OverlayFiles[o.overlay]))
}
+ var out []string
for _, o := range envOverlays {
- fmt.Fprintf(b, "# %-*s %s\n", width, stack.OverlayFiles[o.overlay], o.use)
+ out = append(out, fmt.Sprintf("%-*s %s", width, stack.OverlayFiles[o.overlay], o.use))
}
- b.WriteString("#\n")
- envComment(b, "# ", "If you move this instance to rexctl later with rexctl takeover, "+
- "the rexctl line under each setting shows the command that changes it.")
- b.WriteString(envRule + "\n")
+ return out
}
-func envFrame(b *strings.Builder, title, intro string) {
+func envFrame(b *strings.Builder, title, intro string, list []string) {
b.WriteString("\n\n" + envRule + "\n# " + title + "\n")
if intro != "" {
b.WriteString("#\n")
envComment(b, "# ", intro)
}
+ if len(list) > 0 {
+ b.WriteString("#\n")
+ for _, line := range list {
+ b.WriteString("# " + line + "\n")
+ }
+ }
b.WriteString(envRule + "\n\n")
}
-func envSetting(b *strings.Builder, k settings.Key, defaults envDefaults, required map[string]bool, active bool) {
- help := k.Help + "."
- if note := envNotes[k.Name]; note != "" {
- help += " " + note
- }
- elsewhere := len(k.Vars) == 1 && required[k.Vars[0]] && !active
- if elsewhere {
- help += fmt.Sprintf(" For your own store, change %s under SECRETS above.", k.Vars[0])
- }
- b.WriteString("# " + k.Name + "\n")
- envComment(b, "# ", help)
- envField(b, "type", k.Type)
- if len(k.Options) > 0 {
- envField(b, "options", strings.Join(k.Options, ", "))
- }
- if ex := envExamples[k.Name]; ex != "" {
- envField(b, "example", ex)
+func envEntry(b *strings.Builder, d envDoc) {
+ envComment(b, "# ", envDocText(d))
+ if d.key != nil {
+ if len(d.key.Options) > 0 {
+ envField(b, "options", strings.Join(d.key.Options, ", "))
+ }
+ if ex := envExamples[d.key.Name]; ex != "" {
+ envField(b, "example", ex)
+ }
}
- if len(k.Vars) == 1 {
- for i, d := range defaults.lines(k.Vars[0]) {
- if i == 0 {
- envField(b, "default", d)
- } else {
- envField(b, "", d)
- }
+ for i, line := range d.defaults {
+ label := ""
+ if i == 0 {
+ label = "default"
}
+ envField(b, label, line.String())
}
- envField(b, "rexctl", "rexctl config set "+k.Name)
- if elsewhere {
- return
+ if d.setting != "" {
+ envField(b, "rexctl", "rexctl config set "+d.setting)
}
- for _, v := range k.Vars {
- if active {
- fmt.Fprintf(b, "%s=\n", v)
- } else {
- fmt.Fprintf(b, "# %s=\n", v)
- }
+ if d.active {
+ fmt.Fprintf(b, "%s=%s\n", d.name, d.value)
+ } else {
+ fmt.Fprintf(b, "# %s=%s\n", d.name, d.value)
+ }
+}
+
+func envDocText(d envDoc) string {
+ return strings.Join(slices.DeleteFunc([]string{d.text, d.note, envSecretNote(d)}, func(t string) bool { return t == "" }), " ")
+}
+
+var envDocsOnce = sync.OnceValue(envDocs)
+
+func EnvHelp(name string) string {
+ d := envDocsOnce().get(name)
+ if d.name == "" {
+ return ""
}
+ return strings.ReplaceAll(envDocText(d), "`", "")
}
func envField(b *strings.Builder, label, value string) {
@@ -206,8 +157,13 @@ func envField(b *strings.Builder, label, value string) {
}
func envComment(b *strings.Builder, prefix, text string) {
+ parts := strings.Split(text, "`")
+ for i := 1; i < len(parts); i += 2 {
+ parts[i] = strings.ReplaceAll(parts[i], " ", "\x00")
+ }
line := prefix
- for _, word := range strings.Fields(text) {
+ for _, word := range strings.Fields(strings.Join(parts, "")) {
+ word = strings.ReplaceAll(word, "\x00", " ")
if line != prefix && len(line)+1+len(word) > envWidth {
b.WriteString(line + "\n")
line = prefix
@@ -226,7 +182,7 @@ type secretGroup struct {
keys []secrets.Spec
}
-func envSecrets(b *strings.Builder) {
+func secretGroups() []*secretGroup {
var groups []*secretGroup
for _, s := range secrets.Required {
i := slices.IndexFunc(groups, func(g *secretGroup) bool { return g.kind == s.Kind && g.stateful == s.Stateful })
@@ -236,9 +192,13 @@ func envSecrets(b *strings.Builder) {
}
groups[i].keys = append(groups[i].keys, s)
}
- for i, g := range groups {
+ return groups
+}
+
+func envSecrets(b *strings.Builder, docs envDocList) {
+ for i, g := range secretGroups() {
if i > 0 {
- b.WriteString("\n")
+ b.WriteString("\n\n")
}
text, commands := secretHelp(g)
envComment(b, "# ", text)
@@ -246,11 +206,13 @@ func envSecrets(b *strings.Builder) {
b.WriteString("# " + c + "\n")
}
for _, s := range g.keys {
- value := ""
- if s.Kind == secrets.KindFixed {
- value = s.Fixed
+ b.WriteString("\n")
+ d := docs.get(s.Key)
+ envComment(b, "# ", d.text)
+ if d.setting != "" {
+ envField(b, "rexctl", "rexctl config set "+d.setting)
}
- fmt.Fprintf(b, "%s=%s\n", s.Key, value)
+ fmt.Fprintf(b, "%s=%s\n", s.Key, d.value)
}
}
}
@@ -264,7 +226,7 @@ func secretHelp(g *secretGroup) (string, []string) {
var commands []string
switch g.kind {
case secrets.KindFixed:
- return "These have fixed values. Keep them as they are unless a setting below tells you to change one.", nil
+ return "These have fixed values for the bundled services. Keep them as they are unless the setting tells you otherwise.", nil
case secrets.KindHex32:
commands = []string{"openssl rand -hex 32"}
case secrets.KindBase64_32:
@@ -277,7 +239,7 @@ func secretHelp(g *secretGroup) (string, []string) {
case secrets.KindAlnum64:
commands = []string{"openssl rand -base64 96 | tr -dc A-Za-z0-9 | head -c 64"}
case secrets.KindVAPID:
- text = "This is the key pair for push notifications. These commands print the public key and then the private key."
+ text = "These commands print the public and then the private key of the VAPID key pair for browser push notifications."
keep, on = "the pair", "it"
commands = []string{
"openssl ecparam -name prime256v1 -genkey -noout -out vapid.pem",
@@ -292,7 +254,7 @@ func secretHelp(g *secretGroup) (string, []string) {
text = fmt.Sprintf("Generate %s with this command.", each)
}
if g.stateful {
- text += fmt.Sprintf(" Do this once before the first start and keep %s the same after that, because your stored data depends on %s.", keep, on)
+ text += fmt.Sprintf(" Set %s once before the first start and never change %s.", keep, on)
}
return text, commands
}
@@ -321,8 +283,8 @@ func newEnvDefaults(set *stack.Set) envDefaults {
return out
}
-func (d envDefaults) lines(v string) []string {
- var out []string
+func (d envDefaults) lines(v string) []envDefault {
+ var out []envDefault
base := ""
for i, f := range d {
value := literalDefault(f.defs[v])
@@ -330,10 +292,15 @@ func (d envDefaults) lines(v string) []string {
case i == 0:
base = value
if value != "" {
- out = append(out, value)
+ out = append(out, envDefault{value: value})
}
case value != "" && value != base:
- out = append(out, value+" with "+f.file)
+ j := slices.IndexFunc(out, func(e envDefault) bool { return e.value == value && len(e.files) > 0 })
+ if j < 0 {
+ out = append(out, envDefault{value: value})
+ j = len(out) - 1
+ }
+ out[j].files = append(out[j].files, f.file)
}
}
return out
diff --git a/fluxer_rexctl/internal/instance/bundleenv_test.go b/fluxer_rexctl/internal/instance/bundleenv_test.go
index 38f2c5e08..5f9092d75 100644
--- a/fluxer_rexctl/internal/instance/bundleenv_test.go
+++ b/fluxer_rexctl/internal/instance/bundleenv_test.go
@@ -10,7 +10,6 @@ import (
"github.com/fluxerapp/fluxer/fluxer_rexctl/internal/envfile"
"github.com/fluxerapp/fluxer/fluxer_rexctl/internal/secrets"
- "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/settings"
"github.com/fluxerapp/fluxer/fluxer_rexctl/internal/stack"
)
@@ -36,11 +35,9 @@ func TestBundleEnvKeys(t *testing.T) {
}
var wantCommented []string
- for _, k := range settings.Named() {
- for _, v := range k.Vars {
- if _, ok := wantActive[v]; !ok && slices.Contains(stack.Embedded().Vars, v) {
- wantCommented = append(wantCommented, v)
- }
+ for _, d := range envDocs() {
+ if _, ok := wantActive[d.name]; !ok && d.bundled {
+ wantCommented = append(wantCommented, d.name)
}
}
var gotCommented []string
diff --git a/fluxer_rexctl/internal/instance/defaults.go b/fluxer_rexctl/internal/instance/defaults.go
index 67a24b2c7..97e41d3ea 100644
--- a/fluxer_rexctl/internal/instance/defaults.go
+++ b/fluxer_rexctl/internal/instance/defaults.go
@@ -9,13 +9,17 @@ import (
func composeDefaults(files [][]byte) map[string][]string {
out := map[string][]string{}
+ alt := map[string]bool{}
for _, data := range files {
- scanDefaults(string(data), out)
+ scanDefaults(string(data), out, alt)
+ }
+ for name := range alt {
+ delete(out, name)
}
return out
}
-func scanDefaults(s string, out map[string][]string) {
+func scanDefaults(s string, out map[string][]string, alt map[string]bool) {
for i := 0; i < len(s); i++ {
if s[i] != '$' || i+1 >= len(s) {
continue
@@ -41,6 +45,10 @@ func scanDefaults(s string, out map[string][]string) {
op = ":-"
case s[j] == '-':
op = "-"
+ case strings.HasPrefix(s[j:], ":+"):
+ op = ":+"
+ case s[j] == '+':
+ op = "+"
}
if op == "" {
continue
@@ -51,10 +59,13 @@ func scanDefaults(s string, out map[string][]string) {
continue
}
def := s[start:end]
- if !slices.Contains(out[name], def) {
+ switch {
+ case strings.HasSuffix(op, "+"):
+ alt[name] = true
+ case !slices.Contains(out[name], def):
out[name] = append(out[name], def)
}
- scanDefaults(def, out)
+ scanDefaults(def, out, alt)
i = end
}
}
@@ -63,9 +74,8 @@ func closingBrace(s string, from int) int {
depth := 0
for k := from; k < len(s); k++ {
switch {
- case s[k] == '$' && k+1 < len(s) && s[k+1] == '{':
+ case s[k] == '{':
depth++
- k++
case s[k] == '}':
if depth == 0 {
return k
diff --git a/fluxer_rexctl/internal/instance/envdocs_test.go b/fluxer_rexctl/internal/instance/envdocs_test.go
new file mode 100644
index 000000000..8e02f6ed1
--- /dev/null
+++ b/fluxer_rexctl/internal/instance/envdocs_test.go
@@ -0,0 +1,185 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package instance
+
+import (
+ "io/fs"
+ "maps"
+ "os"
+ "path/filepath"
+ "regexp"
+ "slices"
+ "strings"
+ "testing"
+
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/adminapi"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/secrets"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/settings"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/stack"
+)
+
+const docsContent = "fluxer_docs/src/content/docs"
+
+var (
+ docsEnvName = regexp.MustCompile(`\bFLUXER_[A-Z0-9_]*[A-Z0-9]\b(\*)?`)
+ docsConfigCmd = regexp.MustCompile("rexctl config (?:set|unset|get) ([A-Za-z0-9_.]+)")
+ docsDottedName = regexp.MustCompile("`([a-z][a-z0-9_]*(?:\\.[a-z0-9_]+)+)`")
+ composeSecret = regexp.MustCompile(`(?m)^sed -i "s\|\^([A-Z0-9_]+)=\.\*\|[A-Z0-9_]+=\$\((.*)\)\|" \.env$`)
+ composeLoop = regexp.MustCompile(`(?s)for key in (.*?); do\n\s*sed -i "s\|\^\$key=\.\*\|\$key=\$\((.*?)\)\|" \.env\ndone`)
+)
+
+var helmPages = []string{docsContent + "/operator/kubernetes.mdx"}
+
+func docsPages(t *testing.T) map[string]string {
+ t.Helper()
+ pages := map[string]string{}
+ root := filepath.Join(repoRoot, docsContent)
+ err := filepath.WalkDir(root, func(p string, d fs.DirEntry, err error) error {
+ if err != nil || d.IsDir() || (filepath.Ext(p) != ".md" && filepath.Ext(p) != ".mdx") {
+ return err
+ }
+ data, err := os.ReadFile(p)
+ if err != nil {
+ return err
+ }
+ rel, _ := filepath.Rel(repoRoot, p)
+ pages[filepath.ToSlash(rel)] = string(data)
+ return nil
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ return pages
+}
+
+func TestDocsEnvNames(t *testing.T) {
+ registry := map[string]bool{}
+ for _, v := range envVars {
+ registry[v.name] = true
+ }
+ set := stack.Embedded()
+ schema, err := adminapi.ConfigSchema()
+ if err != nil {
+ t.Fatal(err)
+ }
+ prefixes := map[string]bool{}
+ for _, k := range settings.Named() {
+ first, _, _ := strings.Cut(k.Name, ".")
+ prefixes[first] = true
+ }
+ for _, k := range schema {
+ first, _, _ := strings.Cut(k.Key, ".")
+ prefixes[first] = true
+ }
+ for rel, data := range docsPages(t) {
+ for _, m := range docsEnvName.FindAllStringSubmatch(data, -1) {
+ name := m[0]
+ if m[1] != "" || slices.Contains(notEnvNames, name) {
+ continue
+ }
+ if base, ok := strings.CutSuffix(name, "_FILE"); ok && registry[base] {
+ continue
+ }
+ if !registry[name] {
+ t.Errorf("%s mentions %s, but it has no entry in envVars", rel, name)
+ }
+ }
+ keys := map[string]bool{}
+ for _, m := range docsConfigCmd.FindAllStringSubmatch(data, -1) {
+ keys[strings.TrimSuffix(m[1], ".")] = true
+ }
+ for _, m := range docsDottedName.FindAllStringSubmatch(data, -1) {
+ first, _, _ := strings.Cut(m[1], ".")
+ if prefixes[first] && strings.HasPrefix(rel, docsContent+"/operator/") && !slices.Contains(helmPages, rel) {
+ keys[m[1]] = true
+ }
+ }
+ for key := range keys {
+ if _, err := settings.Lookup(set, nil, key, schema); err != nil {
+ t.Errorf("%s mentions the setting %s, but rexctl doesn't take it: %v", rel, key, err)
+ }
+ }
+ }
+}
+
+func TestComposePageSecrets(t *testing.T) {
+ data, err := os.ReadFile(filepath.Join(repoRoot, docsContent, "operator/docker-compose.mdx"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ page := string(data)
+ commands := map[string]string{}
+ if m := composeLoop.FindStringSubmatch(page); m != nil {
+ for _, key := range strings.Fields(strings.ReplaceAll(m[1], "\\", " ")) {
+ commands[key] = m[2]
+ }
+ } else {
+ t.Error("docker-compose.mdx has no loop that fills in the hex secrets")
+ }
+ for _, m := range composeSecret.FindAllStringSubmatch(page, -1) {
+ commands[m[1]] = m[2]
+ }
+ want := map[secrets.Kind]string{
+ secrets.KindHex32: "openssl rand -hex 32",
+ secrets.KindBase64_32: "openssl rand -base64 32",
+ secrets.KindRSA: "openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform DER | base64",
+ secrets.KindVAPID: "openssl ec -in vapid.pem",
+ secrets.KindAlnum64: "openssl rand -base64 96 | tr -dc A-Za-z0-9 | head -c 64",
+ }
+ for _, s := range secrets.Required {
+ if s.Kind == secrets.KindFixed {
+ continue
+ }
+ cmd, ok := commands[s.Key]
+ switch {
+ case !ok:
+ t.Errorf("docker-compose.mdx doesn't fill in %s", s.Key)
+ case !strings.Contains(cmd, want[s.Kind]):
+ t.Errorf("docker-compose.mdx fills in %s with %q, but it needs %q", s.Key, cmd, want[s.Kind])
+ }
+ delete(commands, s.Key)
+ }
+ if cmd := commands[SetupTokenVar]; !strings.Contains(envVars[slices.IndexFunc(envVars, func(v envVar) bool { return v.name == SetupTokenVar })].help, cmd) {
+ t.Errorf("docker-compose.mdx fills in %s with %q, but its entry in envVars suggests another command", SetupTokenVar, cmd)
+ }
+ delete(commands, SetupTokenVar)
+ for key := range commands {
+ t.Errorf("docker-compose.mdx fills in %s, but it isn't a generated secret", key)
+ }
+}
+
+var (
+ docsLink = regexp.MustCompile(`\]\((/[a-z0-9/_-]*?)/?#([a-z0-9_-]+)\)`)
+ docsHeading = regexp.MustCompile(`(?m)^#{1,6} (.+)$`)
+ slugDrop = regexp.MustCompile(`[^a-z0-9 _-]`)
+)
+
+func docsSlug(heading string) string {
+ return strings.ReplaceAll(slugDrop.ReplaceAllString(strings.ToLower(heading), ""), " ", "-")
+}
+
+func TestDocsAnchors(t *testing.T) {
+ pages := docsPages(t)
+ for _, name := range slices.Sorted(maps.Keys(pages)) {
+ if !strings.HasPrefix(name, docsContent+"/operator/") {
+ continue
+ }
+ for _, m := range docsLink.FindAllStringSubmatch(pages[name], -1) {
+ base := docsContent + m[1]
+ target, ok := "", false
+ for _, c := range []string{base + ".mdx", base + ".md", base + "/index.mdx", base + "/index.md"} {
+ if _, found := pages[c]; found {
+ target, ok = c, true
+ break
+ }
+ }
+ if !ok {
+ t.Errorf("%s links to %s, but there is no such page", name, m[1])
+ continue
+ }
+ if !slices.ContainsFunc(docsHeading.FindAllStringSubmatch(pages[target], -1), func(h []string) bool { return docsSlug(h[1]) == m[2] }) {
+ t.Errorf("%s links to %s#%s, but %s has no heading with that anchor", name, m[1], m[2], target)
+ }
+ }
+ }
+}
diff --git a/fluxer_rexctl/internal/instance/envinventory_test.go b/fluxer_rexctl/internal/instance/envinventory_test.go
new file mode 100644
index 000000000..100a672dc
--- /dev/null
+++ b/fluxer_rexctl/internal/instance/envinventory_test.go
@@ -0,0 +1,1904 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package instance
+
+import (
+ "encoding/json"
+ "fmt"
+ "io/fs"
+ "maps"
+ "os"
+ "path"
+ "path/filepath"
+ "regexp"
+ "slices"
+ "strconv"
+ "strings"
+ "testing"
+ "unicode/utf8"
+
+ "go.yaml.in/yaml/v4"
+
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/secrets"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/settings"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/stack"
+)
+
+const repoRoot = "../../.."
+
+var codeRoots = []string{
+ "fluxer_api/src", "fluxer_api/pkgs", "fluxer_api/bin", "packages",
+ "fluxer_gateway/src", "fluxer_gateway/include", "fluxer_gateway/native", "fluxer_gateway/config", "fluxer_gateway/scripts",
+ "fluxer_media_proxy/src", "fluxer_push/src", "fluxer_app_proxy/src", "fluxer_admin/src",
+ "fluxer_common/src", "fluxer_svc/src", "fluxer_gifs/src", "fluxer_messages/src",
+ "fluxer_snowflakes/src", "fluxer_users/src", "fluxer_unfurl/src", "fluxer_docs/src/server", "fluxer_docs/src/pages",
+ "fluxer_docs/src/installer", "fluxer_docs/scripts",
+ "fluxer_static",
+}
+
+var devScripts = "packages/config/scripts/"
+
+var caddyfiles = map[string]string{"fluxer_static/Caddyfile": "static-proxy"}
+
+var dockerOSVars = []string{"HOME", "PATH", "XDG_CONFIG_HOME", "XDG_DATA_HOME"}
+
+var libraryEnvVars = []string{"ALL_PROXY", "NODE_TLS_REJECT_UNAUTHORIZED", "PGSSLMODE", "SSL_CERT_DIR", "SSL_CERT_FILE"}
+
+var libraryEnvAnchors = map[string][][2]string{
+ "ALL_PROXY": {{"fluxer_push/Cargo.toml", `reqwest = [^\n]*"rustls"`}},
+ "NODE_TLS_REJECT_UNAUTHORIZED": {{"fluxer_api/Dockerfile", `(?m)^CMD \["node"`}},
+ "PGSSLMODE": {{"fluxer_api/pkgs/postgres/src/Client.ts", `\bssl: this\.config\.ssl \?[^\n]*: undefined,`}},
+ "SSL_CERT_DIR": {{"fluxer_svc/src/postgres.rs", `MakeRustlsConnect::with_native_certs\(\)`}, {"fluxer_push/Cargo.toml", `reqwest = [^\n]*"rustls"`}},
+ "SSL_CERT_FILE": {{"fluxer_svc/src/postgres.rs", `MakeRustlsConnect::with_native_certs\(\)`}, {"fluxer_push/Cargo.toml", `reqwest = [^\n]*"rustls"`}},
+}
+
+var noProxyFiles = []string{"fluxer_common/src/healthcheck.rs"}
+
+var chartInputVars = []string{"FLUXER_VALKEY_PASSWORD"}
+
+var codeServices = map[string][]string{
+ "fluxer_api/": {"api", "worker"},
+ "packages/": {"api", "worker"},
+ "fluxer_gateway/": {"gateway"},
+ "fluxer_media_proxy/": {"media-proxy"},
+ "fluxer_push/": {"push"},
+ "fluxer_app_proxy/": {"app-proxy"},
+ "fluxer_admin/": {"admin"},
+ "fluxer_common/": {"admin", "app-proxy", "gifs", "media-proxy", "messages", "push", "snowflakes", "unfurl", "users"},
+ "fluxer_svc/": {"gifs", "messages", "push", "snowflakes", "unfurl", "users"},
+ "fluxer_gifs/": {"gifs"},
+ "fluxer_messages/": {"messages"},
+ "fluxer_snowflakes/": {"snowflakes"},
+ "fluxer_users/": {"users"},
+ "fluxer_unfurl/": {"unfurl"},
+ "fluxer_static/": {"static-proxy"},
+}
+
+const helmChart = "deploy/helm/fluxer"
+
+var rexctlRoots = []string{"fluxer_rexctl", "fluxer_docs/src/installer"}
+
+var rexctlOSVars = []string{
+ "HOME", "LOCALAPPDATA", "OS", "PATH", "PROCESSOR_ARCHITECTURE", "PROCESSOR_ARCHITEW6432", "PWD", "Path",
+ "ProgramFiles", "SUDO_USER", "TERM", "USER", "USERNAME", "XDG_CONFIG_HOME", "XDG_RUNTIME_DIR",
+}
+
+var rexctlLibraryVars = []string{"DOCKER_CONFIG", "DOCKER_CONTEXT"}
+
+var rexctlProxyVars = []string{"HTTPS_PROXY", "HTTP_PROXY", "NO_PROXY"}
+
+var runtimeEnvVars = []string{"MALLOC_ARENA_MAX", "NODE_EXTRA_CA_CERTS", "NODE_OPTIONS", "TOKIO_WORKER_THREADS"}
+
+var (
+ quotedEnv = regexp.MustCompile("[\"'`](FLUXER_[A-Z0-9_]*[A-Z0-9])[\"'`]")
+ keyEnv = regexp.MustCompile(`(?m)^\s*(FLUXER_[A-Z0-9_]*[A-Z0-9]): \{`)
+ envCall = regexp.MustCompile(`(?:\b[a-z_]*(?:env|getenv|var|from)[a-z_]*|\b[a-z]*[A-Z][A-Za-z]*Env[A-Za-z]*)\s*\(\s*(?:&?get,\s*|&?env,\s*|process\.env,\s*)?["']([A-Z][A-Z0-9_]*)["']`)
+ envListCall = regexp.MustCompile(`(?:\b[a-z_]*(?:env|getenv|var|from)[a-z_]*|\b[a-z]*[A-Z][A-Za-z]*Env[A-Za-z]*)\s*\(\s*(?:&?get,\s*|&?env,\s*|process\.env,\s*)?&?\[([^\]]*)\]`)
+ listName = regexp.MustCompile("[\"'`]([A-Z][A-Z0-9_]*)[\"'`]")
+ processEnv = regexp.MustCompile("(?:process\\.env|Bun\\.env|import\\.meta\\.env|\\benv)(?:\\??\\.|\\??\\.?\\[[\"'`])([A-Z_][A-Z0-9_]*)")
+ destructEnv = regexp.MustCompile(`\{([^{}]*)\}\s*=\s*(?:process|Bun|import\.meta)\.env\b`)
+ envPrefix = regexp.MustCompile(`\b[a-z_]+_config\(\s*&?env,\s*"([A-Z][A-Z0-9_]*)"`)
+ envSuffix = regexp.MustCompile(`format!\("\{prefix\}_([A-Z][A-Z0-9_]*)"\)`)
+ builtEnv = regexp.MustCompile(`env::var(?:_os)?\(\s*&?(?:format|concat)!\(\s*"([A-Z][A-Z0-9_]*)`)
+ mapEnv = regexp.MustCompile(`\.(?:get|require)\(\s*"([A-Z][A-Z0-9_]*)"`)
+ shellEnv = regexp.MustCompile(`\$\{?([A-Z][A-Z0-9_]*)`)
+ psEnv = regexp.MustCompile(`\$env:([A-Za-z_][A-Za-z0-9_]*)`)
+ directEnv = regexp.MustCompile("(?:process\\.env|Bun\\.env|import\\.meta\\.env)(?:\\??\\.|\\??\\.?\\[[\"'`])([A-Z_][A-Z0-9_]*)|os:getenv\\(\"([A-Z][A-Z0-9_]*)\"|env::var(?:_os)?\\(\"([A-Z][A-Z0-9_]*)\"|\\b(?:g_|secure_)?getenv\\(\\s*\"([A-Z_][A-Z0-9_]*)\"")
+ goEnv = regexp.MustCompile(`os\.(?:Getenv|LookupEnv)\(\s*"([A-Za-z_][A-Za-z0-9_]*)"|(?s)range \[\]string\{([^}]*)\}\s*\{[^}]*?os\.(?:Getenv|LookupEnv)\(|Env\s*=\s*"([A-Z][A-Z0-9_]*)"`)
+ dockerEnv = regexp.MustCompile(`(?m)^ENV\s+((?:[^\n]*\\\n)*[^\n]*)`)
+ envAssign = regexp.MustCompile(`\b([A-Z_][A-Z0-9_]*)=`)
+ caddyEnv = regexp.MustCompile(`\{(?:\$|env\.)([A-Z][A-Z0-9_]*)`)
+ composeSh = regexp.MustCompile(`\$\$\{?([A-Z][A-Z0-9_]*)`)
+ constEnv = regexp.MustCompile("(?m)(?:\\bconst|\\bstatic|\\blet|\\bvar)\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*(?::[^=\\n]+)?=\\s*[\"'`]([A-Z][A-Z0-9_]*)[\"'`]|-define\\(\\s*([A-Za-z_][A-Za-z0-9_]*)\\s*,\\s*\"([A-Z][A-Z0-9_]*)\"")
+ identEnv = regexp.MustCompile(`(?:\b[a-z_]*(?:env|getenv|var|from)[a-z_]*|\b[a-z]*[A-Z][A-Za-z]*Env[A-Za-z]*)\s*\(\s*(?:&?get,\s*|&?env,\s*|process\.env,\s*|&\[\s*)?&?\??([A-Z][A-Z0-9_]*)\s*[,)\]]|(?:process\.env|Bun\.env|import\.meta\.env|\benv)\??\.?\[\s*([A-Z][A-Z0-9_]*)\s*\]`)
+ cEnv = regexp.MustCompile(`\b(?:g_|secure_)?getenv\(\s*"([A-Z_][A-Z0-9_]*)"`)
+ tsImport = regexp.MustCompile(`(?:from|import)\s*\(?\s*'([^']+)'`)
+ goConst = regexp.MustCompile(`(?m)^\s*(?:const\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*(?:string\s*)?(?:=|:=)\s*"([A-Z][A-Z0-9_]*)"`)
+ goIdentEnv = regexp.MustCompile(`os\.(?:Getenv|LookupEnv)\(\s*(?:[a-z][A-Za-z0-9_]*\.)?([A-Za-z_][A-Za-z0-9_]*)\s*\)`)
+ goEnviron = regexp.MustCompile(`\bk == "([A-Z][A-Z0-9_]*)"|\blookup\("([A-Z][A-Z0-9_]*)"\)`)
+ dockerRun = regexp.MustCompile(`(?m)^(?:HEALTHCHECK|CMD|ENTRYPOINT)\b((?:[^\n]*\\\n)*[^\n]*)`)
+ tsFunc = regexp.MustCompile(`\bfunction\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)|\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?\(([^)]*)\)[^=;]*=>`)
+ rsFunc = regexp.MustCompile(`\bfn\s+([a-z_][a-z0-9_]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)`)
+ erlFunc = regexp.MustCompile(`(?m)^([a-z][A-Za-z0-9_]*)\(((?:[^()\n]|\([^()\n]*\))*)\)\s*(?:when\b[^\n]*?)?->`)
+ erlForm = regexp.MustCompile(`(?m)^[a-z-]`)
+ erlEnvCallee = regexp.MustCompile(`^(?:getenv|env_[a-z_]+|[a-z_]+_env)$`)
+ callStart = regexp.MustCompile(`\b([A-Za-z_$][\w$]*)\s*\(`)
+ quotedName = regexp.MustCompile("^[\"'`]([A-Z][A-Z0-9_]*)[\"'`]$")
+ identName = regexp.MustCompile(`^&?([A-Z][A-Z0-9_]*)$`)
+ paramEnv = regexp.MustCompile(`(?:process\.env|Bun\.env|import\.meta\.env|\benv)\??\.?\[\s*([a-z_$][\w$]*)\s*\]|env::var(?:_os)?\(\s*&?([a-z_][a-z0-9_]*)\s*\)|\b(?:env|vars)\.get\(\s*&?([a-z_][a-z0-9_]*)\b`)
+ envCallee = regexp.MustCompile(`^(?:[a-z_]*(?:env|getenv|var|from)[a-z_]*|[a-z]*[A-Z][A-Za-z]*Env[A-Za-z]*)$`)
+ localEnv = regexp.MustCompile(`(?:\b[a-z_]*(?:env|getenv|var|from)[a-z_]*|\b[a-z]*[A-Z][A-Za-z]*Env[A-Za-z]*)\s*\(\s*(?:&?get,\s*|&?env,\s*|process\.env,\s*)?&?\??([A-Za-z_][A-Za-z0-9_]*)\s*[,)]|(?:process\.env|Bun\.env|import\.meta\.env|\benv)\??\.?\[\s*([A-Za-z_$][\w$]*)\s*\]`)
+ erlBind = regexp.MustCompile(`\b([A-Z][A-Za-z0-9_]*)\s*=\s*"([A-Z][A-Z0-9_]*)"`)
+ rustForList = regexp.MustCompile(`\bfor\s+([a-z_][a-z0-9_]*)\s+in\s+&?\[([^\]]*)\]\s*\{`)
+ fieldRead = regexp.MustCompile(`\|\(\s*_\s*,\s*([a-z_][a-z0-9_]*)\s*\)\|\s*([a-z_][a-z0-9_]*)\(\s*&?([a-z_][a-z0-9_]*)\s*\)`)
+ fieldPair = regexp.MustCompile(`\(\s*"[a-z_]+"\s*,\s*"([A-Z][A-Z0-9_]*)"\s*\)`)
+)
+
+var notEnvNames = []string{"FLUXER_MESSAGE", "FLUXER_CACHE_PURGE_HTTP", "FLUXER_CACHE_PURGE_CONTROLLER"}
+
+func testPath(p string) bool {
+ for _, part := range strings.Split(filepath.ToSlash(p), "/") {
+ switch part {
+ case "test", "tests", "__tests__", "fuzz", "node_modules", "target", "dist":
+ return true
+ }
+ }
+ base := filepath.Base(p)
+ return strings.Contains(base, ".test.") || strings.HasSuffix(base, "_test.rs") || strings.HasSuffix(base, "_tests.rs") ||
+ base == "tests.rs" || base == "test_fixtures.rs" || strings.HasPrefix(base, "test_") || strings.HasSuffix(base, "_SUITE.erl")
+}
+
+func scriptLang(p string) string {
+ switch filepath.Ext(p) {
+ case ".ts", ".mts", ".tsx", ".mjs", ".js", ".cjs", ".astro":
+ return "ts"
+ case ".rs", ".erl", ".hrl":
+ return "native"
+ case ".c", ".h":
+ return "c"
+ case ".sh", ".src", ".template":
+ return "shell"
+ case ".ps1":
+ return "ps"
+ case ".go":
+ if !strings.HasSuffix(p, "_test.go") {
+ return "go"
+ }
+ }
+ return ""
+}
+
+func addFound(found map[string][]string, name, rel string) {
+ if name != "" && !slices.Contains(notEnvNames, name) && !slices.Contains(found[name], rel) {
+ found[name] = append(found[name], rel)
+ }
+}
+
+type codeFile struct {
+ rel, lang, data string
+ test bool
+}
+
+func walkCode(t *testing.T, roots []string, fn func(rel, lang, data string)) {
+ t.Helper()
+ var files []codeFile
+ byRel := map[string]bool{}
+ for _, root := range roots {
+ dir := filepath.Join(repoRoot, root)
+ err := filepath.WalkDir(dir, func(p string, d fs.DirEntry, err error) error {
+ if err != nil {
+ return err
+ }
+ if d.IsDir() {
+ if base := d.Name(); base == "node_modules" || base == "target" || base == "dist" {
+ return filepath.SkipDir
+ }
+ return nil
+ }
+ lang := scriptLang(p)
+ if lang == "" {
+ return nil
+ }
+ data, err := os.ReadFile(p)
+ if err != nil {
+ return err
+ }
+ inner, _ := filepath.Rel(dir, p)
+ rel, _ := filepath.Rel(repoRoot, p)
+ rel = filepath.ToSlash(rel)
+ text := string(data)
+ if filepath.Ext(p) == ".rs" {
+ text = stripRustTests(text)
+ }
+ files = append(files, codeFile{rel: rel, lang: lang, data: text, test: testPath(inner)})
+ byRel[rel] = true
+ return nil
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ }
+ imported := map[string]bool{}
+ for _, f := range files {
+ if f.test || f.lang != "ts" {
+ continue
+ }
+ for _, m := range tsImport.FindAllStringSubmatch(f.data, -1) {
+ if rel := resolveImport(f.rel, m[1], byRel); rel != "" {
+ imported[rel] = true
+ }
+ }
+ }
+ for _, f := range files {
+ if !f.test || imported[f.rel] {
+ fn(f.rel, f.lang, f.data)
+ }
+ }
+}
+
+func resolveImport(from, spec string, files map[string]bool) string {
+ var base string
+ switch {
+ case strings.HasPrefix(spec, "@app/"):
+ base = "fluxer_api/src/" + strings.TrimPrefix(spec, "@app/")
+ case strings.HasPrefix(spec, "@fluxer/"):
+ pkg, rest, _ := strings.Cut(strings.TrimPrefix(spec, "@fluxer/"), "/")
+ base = "packages/" + pkg + "/" + rest
+ if _, err := os.Stat(filepath.Join(repoRoot, "packages", pkg)); err != nil {
+ base = "fluxer_api/pkgs/" + pkg + "/" + rest
+ }
+ case strings.HasPrefix(spec, "."):
+ base = path.Join(path.Dir(from), spec)
+ default:
+ return ""
+ }
+ base = strings.TrimSuffix(base, ".js")
+ for _, c := range []string{base, base + ".ts", base + ".tsx", base + "/index.ts"} {
+ if files[c] {
+ return c
+ }
+ }
+ return ""
+}
+
+func codeEnvNames(t *testing.T) (reads, mentions map[string][]string) {
+ t.Helper()
+ var files []codeFile
+ walkCode(t, codeRoots, func(rel, lang, data string) {
+ files = append(files, codeFile{rel: rel, lang: lang, data: data})
+ })
+ return scanEnvNames(files)
+}
+
+func runtimeReads(code map[string][]string) map[string][]string {
+ out := map[string][]string{}
+ for name, rels := range code {
+ for _, rel := range rels {
+ if !strings.HasPrefix(rel, devScripts) {
+ out[name] = append(out[name], rel)
+ }
+ }
+ }
+ return out
+}
+
+func addListNames(found map[string][]string, list, rel string) {
+ for _, m := range listName.FindAllStringSubmatch(list, -1) {
+ addFound(found, m[1], rel)
+ }
+}
+
+func scanEnvNames(files []codeFile) (reads, mentions map[string][]string) {
+ found := map[string][]string{}
+ mentions = map[string][]string{}
+ consts := map[string][]string{}
+ type pending struct{ rel, ident string }
+ var idents []pending
+ sources := map[string]string{}
+ for _, f := range files {
+ rel, lang, data := f.rel, f.lang, f.data
+ if lang == "ts" || lang == "native" {
+ sources[rel] = data
+ for _, m := range envListCall.FindAllStringSubmatch(data, -1) {
+ addListNames(found, m[1], rel)
+ }
+ }
+ if (lang == "shell" || lang == "ps") && slices.ContainsFunc(rexctlRoots, func(root string) bool { return strings.HasPrefix(rel, root+"/") }) {
+ continue
+ }
+ if lang == "ts" || lang == "native" {
+ local := map[string][]string{}
+ for _, m := range constEnv.FindAllStringSubmatch(data, -1) {
+ ident, value := m[1]+m[3], m[2]+m[4]
+ local[ident] = append(local[ident], value)
+ consts[ident] = append(consts[ident], value)
+ }
+ if erlangFile(rel) {
+ for _, m := range erlBind.FindAllStringSubmatch(data, -1) {
+ local[m[1]] = append(local[m[1]], m[2])
+ }
+ }
+ for _, m := range localEnv.FindAllStringSubmatch(data, -1) {
+ for _, v := range local[m[1]+m[2]] {
+ addFound(found, v, rel)
+ }
+ }
+ for _, loc := range rustForList.FindAllStringSubmatchIndex(data, -1) {
+ ident, open := data[loc[2]:loc[3]], loc[1]-1
+ for _, m := range localEnv.FindAllStringSubmatch(data[open:rustBlockEnd(data, open)], -1) {
+ if m[1]+m[2] == ident {
+ addListNames(found, data[loc[4]:loc[5]], rel)
+ }
+ }
+ }
+ for _, m := range fieldRead.FindAllStringSubmatch(data, -1) {
+ if m[1] == m[3] && envCallee.MatchString(m[2]) {
+ for _, p := range fieldPair.FindAllStringSubmatch(data, -1) {
+ addFound(found, p[1], rel)
+ }
+ }
+ }
+ for _, m := range identEnv.FindAllStringSubmatch(data, -1) {
+ ident := m[1] + m[2]
+ if values, ok := local[ident]; ok {
+ for _, v := range values {
+ addFound(found, v, rel)
+ }
+ } else {
+ idents = append(idents, pending{rel, ident})
+ }
+ }
+ }
+ var patterns, named []*regexp.Regexp
+ prefixes := map[string]bool{}
+ switch lang {
+ case "ts":
+ patterns, named = []*regexp.Regexp{envCall, processEnv}, []*regexp.Regexp{quotedEnv, keyEnv}
+ if rel == configOverrides {
+ patterns = append(patterns, keyEnv)
+ if block := namedAliases.FindStringSubmatch(data); block != nil {
+ for _, m := range aliasPair.FindAllStringSubmatch(block[1], -1) {
+ addFound(found, m[2], rel)
+ }
+ }
+ }
+ for _, m := range destructEnv.FindAllStringSubmatch(data, -1) {
+ for _, field := range strings.Split(m[1], ",") {
+ name, _, _ := strings.Cut(strings.TrimSpace(field), ":")
+ name, _, _ = strings.Cut(name, "=")
+ addFound(found, strings.TrimSpace(name), rel)
+ }
+ }
+ case "native":
+ patterns, named = []*regexp.Regexp{envCall, mapEnv, builtEnv}, []*regexp.Regexp{quotedEnv}
+ for _, m := range envPrefix.FindAllStringSubmatch(data, -1) {
+ prefixes[m[1]] = true
+ for _, s := range envSuffix.FindAllStringSubmatch(data, -1) {
+ addFound(found, m[1]+"_"+s[1], rel)
+ }
+ }
+ case "c":
+ patterns = []*regexp.Regexp{cEnv}
+ case "shell":
+ patterns = []*regexp.Regexp{shellEnv}
+ case "ps":
+ patterns = []*regexp.Regexp{psEnv}
+ }
+ for _, re := range patterns {
+ for _, m := range re.FindAllStringSubmatch(data, -1) {
+ if !prefixes[m[1]] {
+ addFound(found, m[1], rel)
+ }
+ }
+ }
+ for _, re := range named {
+ for _, m := range re.FindAllStringSubmatch(data, -1) {
+ if !prefixes[m[1]] {
+ addFound(mentions, m[1], rel)
+ }
+ }
+ }
+ }
+ helpers := envHelpers(sources)
+ for rel, data := range sources {
+ for _, h := range helpers {
+ if h.erl != erlangFile(rel) || !strings.Contains(data, h.name) {
+ continue
+ }
+ for _, c := range regexp.MustCompile(`\b`+regexp.QuoteMeta(h.name)+`\s*\(`).FindAllStringIndex(data, -1) {
+ args := splitArgs(data, c[1]-1)
+ if h.arg >= len(args) {
+ continue
+ }
+ arg := args[h.arg]
+ if strings.HasPrefix(strings.TrimPrefix(arg, "&"), "[") {
+ addListNames(found, arg, rel)
+ } else if m := quotedName.FindStringSubmatch(arg); m != nil {
+ addFound(found, m[1], rel)
+ } else if m := identName.FindStringSubmatch(arg); m != nil {
+ idents = append(idents, pending{rel, m[1]})
+ }
+ }
+ }
+ }
+ for _, p := range idents {
+ for _, v := range consts[p.ident] {
+ addFound(found, v, p.rel)
+ }
+ }
+ for name, rels := range found {
+ for _, rel := range rels {
+ addFound(mentions, name, rel)
+ }
+ }
+ return found, mentions
+}
+
+type envHelper struct {
+ name string
+ arg int
+ erl bool
+}
+
+func erlangFile(rel string) bool {
+ ext := filepath.Ext(rel)
+ return ext == ".erl" || ext == ".hrl"
+}
+
+func splitArgs(data string, open int) []string {
+ var args []string
+ depth, start := 0, open+1
+ var quote byte
+ for i := open; i < len(data); i++ {
+ c := data[i]
+ switch {
+ case quote != 0:
+ if c == '\\' {
+ i++
+ } else if c == quote {
+ quote = 0
+ }
+ case c == '"' || c == '\'' || c == '`':
+ quote = c
+ case c == '(' || c == '[' || c == '{':
+ depth++
+ case c == ')' || c == ']' || c == '}':
+ depth--
+ if depth == 0 {
+ return append(args, strings.TrimSpace(data[start:i]))
+ }
+ case c == ',' && depth == 1:
+ args = append(args, strings.TrimSpace(data[start:i]))
+ start = i + 1
+ }
+ }
+ return args
+}
+
+func funcBody(data string, from int) string {
+ end := min(len(data), from+4000)
+ i := strings.IndexAny(data[from:end], "{\n")
+ if i < 0 {
+ return data[from:end]
+ }
+ if data[from+i] == '\n' {
+ return data[from : from+i]
+ }
+ depth := 0
+ for j := from + i; j < end; j++ {
+ switch data[j] {
+ case '{':
+ depth++
+ case '}':
+ depth--
+ if depth == 0 {
+ return data[from : j+1]
+ }
+ }
+ }
+ return data[from:end]
+}
+
+func splitParams(params string) []string {
+ var out []string
+ depth, start := 0, 0
+ for i, c := range params {
+ switch c {
+ case '<', '(', '[', '{':
+ depth++
+ case '>', ')', ']', '}':
+ depth--
+ case ',':
+ if depth == 0 {
+ out = append(out, params[start:i])
+ start = i + 1
+ }
+ }
+ }
+ return append(out, params[start:])
+}
+
+func paramName(p string) string {
+ p = strings.TrimSpace(p)
+ p = strings.TrimPrefix(strings.TrimPrefix(p, "mut "), "...")
+ if i := strings.IndexAny(p, ":=?"); i >= 0 {
+ p = p[:i]
+ }
+ return strings.TrimSpace(p)
+}
+
+func erlParam(p string) string {
+ p = strings.TrimPrefix(strings.TrimSpace(p), "[")
+ p, _, _ = strings.Cut(p, "|")
+ return strings.TrimSpace(p)
+}
+
+func stripRustTests(data string) string {
+ const attr = "#[cfg(test)]"
+ var b strings.Builder
+ for {
+ i := strings.Index(data, attr)
+ if i < 0 {
+ b.WriteString(data)
+ return b.String()
+ }
+ b.WriteString(data[:i])
+ data = data[rustItemEnd(data, i+len(attr)):]
+ }
+}
+
+func rustSkip(data string, i int) int {
+ switch {
+ case strings.HasPrefix(data[i:], "//"):
+ if j := strings.IndexByte(data[i:], '\n'); j >= 0 {
+ return i + j
+ }
+ return len(data)
+ case strings.HasPrefix(data[i:], "/*"):
+ if j := strings.Index(data[i+2:], "*/"); j >= 0 {
+ return i + 2 + j + 1
+ }
+ return len(data)
+ case data[i] == 'r' && (strings.HasPrefix(data[i+1:], "\"") || strings.HasPrefix(data[i+1:], "#")) && (i == 0 || !isIdent(data[i-1])):
+ hashes := 0
+ for i+1+hashes < len(data) && data[i+1+hashes] == '#' {
+ hashes++
+ }
+ if i+1+hashes >= len(data) || data[i+1+hashes] != '"' {
+ return i
+ }
+ if j := strings.Index(data[i+2+hashes:], "\""+strings.Repeat("#", hashes)); j >= 0 {
+ return i + 2 + hashes + j + hashes
+ }
+ return len(data)
+ case data[i] == '"':
+ for j := i + 1; j < len(data); j++ {
+ switch data[j] {
+ case '\\':
+ j++
+ case '"':
+ return j
+ }
+ }
+ return len(data)
+ case data[i] == '\'':
+ if i+1 < len(data) && data[i+1] == '\\' {
+ if j := strings.IndexByte(data[i+2:], '\''); j >= 0 {
+ return i + 2 + j
+ }
+ }
+ _, size := utf8.DecodeRuneInString(data[i+1:])
+ if i+1+size < len(data) && data[i+1+size] == '\'' {
+ return i + 1 + size
+ }
+ }
+ return i
+}
+
+func isIdent(c byte) bool {
+ return c == '_' || c >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'
+}
+
+func rustItemEnd(data string, from int) int {
+ depth, angle := 0, 0
+ for i := from; i < len(data); i++ {
+ if j := rustSkip(data, i); j != i {
+ i = j
+ continue
+ }
+ switch c := data[i]; {
+ case (c == '-' || c == '=') && i+1 < len(data) && data[i+1] == '>':
+ i++
+ case c == '(' || c == '[':
+ depth++
+ case c == ')' || c == ']':
+ depth--
+ case c == '<' && depth == 0:
+ angle++
+ case c == '>' && depth == 0 && angle > 0:
+ angle--
+ case c == '{' && depth == 0 && angle == 0:
+ return rustBlockEnd(data, i)
+ case c == '{':
+ depth++
+ case c == '}' && depth == 0:
+ return i
+ case c == '}':
+ depth--
+ case (c == ';' || c == ',') && depth == 0 && angle == 0:
+ return i + 1
+ }
+ }
+ return len(data)
+}
+
+func rustBlockEnd(data string, open int) int {
+ depth := 0
+ for i := open; i < len(data); i++ {
+ if j := rustSkip(data, i); j != i {
+ i = j
+ continue
+ }
+ switch data[i] {
+ case '{':
+ depth++
+ case '}':
+ depth--
+ if depth == 0 {
+ return i + 1
+ }
+ }
+ }
+ return len(data)
+}
+
+func envHelpers(files map[string]string) []envHelper {
+ type fn struct {
+ name string
+ params []string
+ body string
+ }
+ var fns, erlFns []fn
+ for rel, data := range files {
+ if erlangFile(rel) {
+ for _, m := range erlFunc.FindAllStringSubmatchIndex(data, -1) {
+ var names []string
+ for _, p := range splitParams(data[m[4]:m[5]]) {
+ names = append(names, erlParam(p))
+ }
+ end := len(data)
+ if next := erlForm.FindStringIndex(data[m[1]:]); next != nil {
+ end = m[1] + next[0]
+ }
+ erlFns = append(erlFns, fn{data[m[2]:m[3]], names, data[m[1]:end]})
+ }
+ continue
+ }
+ re := tsFunc
+ if scriptLang(rel) == "native" {
+ re = rsFunc
+ }
+ for _, m := range re.FindAllStringSubmatchIndex(data, -1) {
+ name, params := "", ""
+ if m[2] >= 0 {
+ name, params = data[m[2]:m[3]], data[m[4]:m[5]]
+ }
+ if len(m) > 6 && m[6] >= 0 {
+ name, params = data[m[6]:m[7]], data[m[8]:m[9]]
+ }
+ var names []string
+ for _, p := range splitParams(params) {
+ names = append(names, paramName(p))
+ }
+ fns = append(fns, fn{name, names, funcBody(data, m[1])})
+ }
+ }
+ known := map[string]bool{}
+ var out []envHelper
+ add := func(f fn, i int) bool {
+ key := f.name + "/" + strconv.Itoa(i)
+ if known[key] || envCallee.MatchString(f.name) {
+ return false
+ }
+ known[key] = true
+ out = append(out, envHelper{name: f.name, arg: i})
+ return true
+ }
+ for _, f := range fns {
+ if !strings.Contains(f.body, "env") && !strings.Contains(f.body, "vars") {
+ continue
+ }
+ for _, m := range paramEnv.FindAllStringSubmatch(f.body, -1) {
+ if i := slices.Index(f.params, m[1]+m[2]+m[3]); i >= 0 {
+ add(f, i)
+ }
+ }
+ }
+ for changed := len(out) > 0; changed; {
+ changed = false
+ for _, f := range fns {
+ for _, c := range callStart.FindAllStringSubmatchIndex(f.body, -1) {
+ callee := f.body[c[2]:c[3]]
+ if callee == f.name || !envCallee.MatchString(callee) && !slices.ContainsFunc(out, func(h envHelper) bool { return h.name == callee }) {
+ continue
+ }
+ for j, arg := range splitArgs(f.body, c[1]-1) {
+ i := slices.Index(f.params, strings.TrimPrefix(arg, "&"))
+ if i >= 0 && (envCallee.MatchString(callee) || known[callee+"/"+strconv.Itoa(j)]) && add(f, i) {
+ changed = true
+ }
+ }
+ }
+ }
+ }
+ for changed := true; changed; {
+ changed = false
+ for _, f := range erlFns {
+ for _, c := range callStart.FindAllStringSubmatchIndex(f.body, -1) {
+ callee := f.body[c[2]:c[3]]
+ for j, arg := range splitArgs(f.body, c[1]-1) {
+ i := slices.Index(f.params, arg)
+ key := f.name + "/" + strconv.Itoa(i)
+ if i < 0 || callee == f.name || known[key] || envCallee.MatchString(f.name) ||
+ !erlEnvCallee.MatchString(callee) && !known[callee+"/"+strconv.Itoa(j)] {
+ continue
+ }
+ known[key] = true
+ out = append(out, envHelper{name: f.name, arg: i, erl: true})
+ changed = true
+ }
+ }
+ }
+ }
+ return out
+}
+
+func dockerfileEnvNames(t *testing.T) map[string][]string {
+ t.Helper()
+ files, err := filepath.Glob(filepath.Join(repoRoot, "fluxer_*", "Dockerfile"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ found := map[string][]string{}
+ for _, p := range files {
+ data, err := os.ReadFile(p)
+ if err != nil {
+ t.Fatal(err)
+ }
+ rel, _ := filepath.Rel(repoRoot, p)
+ final := string(data)
+ if i := strings.LastIndex(final, "\nFROM "); i >= 0 {
+ final = final[i:]
+ }
+ for _, m := range dockerEnv.FindAllStringSubmatch(final, -1) {
+ for _, a := range envAssign.FindAllStringSubmatch(m[1], -1) {
+ addFound(found, a[1], filepath.ToSlash(rel))
+ }
+ }
+ for _, m := range dockerRun.FindAllStringSubmatch(final, -1) {
+ for _, a := range shellEnv.FindAllStringSubmatch(m[1], -1) {
+ addFound(found, a[1], filepath.ToSlash(rel))
+ }
+ }
+ }
+ return found
+}
+
+type composeService struct {
+ Image string `yaml:"image"`
+ Environment map[string]any `yaml:"environment"`
+}
+
+func composeEnv(t *testing.T, set *stack.Set) (fluxer, other map[string][]string, feeds map[[2]string][]string) {
+ t.Helper()
+ fluxer, other, feeds = map[string][]string{}, map[string][]string{}, map[[2]string][]string{}
+ names, err := stack.ComposeFileNames(set.Files)
+ if err != nil {
+ t.Fatal(err)
+ }
+ images := map[string]string{}
+ files := map[string]map[string]composeService{}
+ for _, name := range names {
+ data, err := fs.ReadFile(set.Files, name)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var file struct {
+ Services map[string]composeService `yaml:"services"`
+ }
+ if err := yaml.Unmarshal(data, &file); err != nil {
+ t.Fatalf("%s: %v", name, err)
+ }
+ files[name] = file.Services
+ for svc, body := range file.Services {
+ if body.Image != "" {
+ images[svc] = body.Image
+ }
+ }
+ }
+ for _, services := range files {
+ for svc, body := range services {
+ to := other
+ if strings.Contains(images[svc], "/fluxer-") {
+ to = fluxer
+ }
+ for k, value := range body.Environment {
+ if !slices.Contains(to[k], svc) {
+ to[k] = append(to[k], svc)
+ }
+ for _, m := range composeRef.FindAllStringSubmatch(fmt.Sprint(value), -1) {
+ if from := [2]string{m[1], svc}; m[1] != k && !slices.Contains(feeds[from], k) {
+ feeds[from] = append(feeds[from], k)
+ }
+ }
+ }
+ }
+ }
+ return fluxer, other, feeds
+}
+
+var composeRef = regexp.MustCompile(`\$\{([A-Z][A-Z0-9_]*)`)
+
+type composeScripts struct {
+ Command any `yaml:"command"`
+ Entrypoint any `yaml:"entrypoint"`
+ Healthcheck struct {
+ Test any `yaml:"test"`
+ } `yaml:"healthcheck"`
+}
+
+func composeOwnEnv(t *testing.T, set *stack.Set) (own map[string][]string, scripts map[string][]string) {
+ t.Helper()
+ own, scripts = map[string][]string{}, map[string][]string{}
+ names, err := stack.ComposeFileNames(set.Files)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, name := range names {
+ data, err := fs.ReadFile(set.Files, name)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var file struct {
+ Services map[string]yaml.Node `yaml:"services"`
+ }
+ if err := yaml.Unmarshal(data, &file); err != nil {
+ t.Fatalf("%s: %v", name, err)
+ }
+ for svc, node := range file.Services {
+ var body composeScripts
+ if err := node.Decode(&body); err != nil {
+ t.Fatalf("%s: %s: %v", name, svc, err)
+ }
+ for _, part := range []any{body.Command, body.Entrypoint, body.Healthcheck.Test} {
+ if part != nil {
+ scripts[svc] = append(scripts[svc], fmt.Sprint(part))
+ }
+ }
+ for i := 0; i+1 < len(node.Content); i += 2 {
+ if node.Content[i].Value != "environment" || node.Content[i+1].Kind != yaml.MappingNode {
+ continue
+ }
+ env := node.Content[i+1].Content
+ for j := 0; j+1 < len(env); j += 2 {
+ if k := env[j].Value; k != "<<" && !slices.Contains(own[k], svc) {
+ own[k] = append(own[k], svc)
+ }
+ }
+ }
+ }
+ }
+ return own, scripts
+}
+
+var (
+ emptyClause = regexp.MustCompile(`\b(?:it's|both are|[Aa]n) empty\b`)
+ suchAs = regexp.MustCompile("such as [^,.]*")
+ backticked = regexp.MustCompile("`([^`]+)`")
+ anyEmpty = regexp.MustCompile(`(?:^|[^-\w])empty\b`)
+ otherEmpty = regexp.MustCompile("(?:\\b[A-Z][A-Z0-9_]+`?|\\bthat) is empty\\b")
+ overridePath = regexp.MustCompile(`(?m)^\s*(FLUXER_[A-Z0-9_]*[A-Z0-9]): \{path: \[([^\]]*)\]`)
+ defaultLine = regexp.MustCompile(`^(\t*)(\w+): (.*?),?$`)
+ rustRead = regexp.MustCompile(`"([A-Z][A-Z0-9_]*[A-Z0-9])"`)
+ rustFallback = regexp.MustCompile(`\.unwrap_or(?:_else)?\((?:\|\|\s*)?("[^"]*"|-?[\d_.]+|true|false|[A-Z][A-Z0-9_]*)[),.]`)
+ rustArgument = regexp.MustCompile(`^\)\s*,\s*("[^"]*"|-?[\d_.]+|true|false|[A-Z][A-Z0-9_]*)\s*,`)
+ rustConst = regexp.MustCompile(`(?m)^\s*(?:pub(?:\([a-z]+\))? )?const ([A-Z][A-Z0-9_]*): [^=]+= ([^;]+);`)
+ codeRange = regexp.MustCompile(`\bfrom (\d+(?:\.\d+)?(?: [KMG]iB)?) to (\d+(?:\.\d+)?(?: [KMG]iB)?)\b`)
+ codeBound = regexp.MustCompile("\\b(?:at least|at most|capped at) `(\\d+)`|\\bValues (?:under|over) (\\d+)(?: [a-z]+)? count as (\\d+)\\b")
+ digitGroups = regexp.MustCompile(`(\d)_(\d)`)
+ products = regexp.MustCompile(`\b\d+(?:\s*\*\s*\d+)+\b`)
+)
+
+var configOverrides = "packages/config/src/config_loader/EnvironmentOverrides.ts"
+
+var configDefaults = []string{"packages/config/src/ConfigLoader.ts", "packages/config/src/EndpointDerivation.ts"}
+
+var envDefaultFiles = map[string][]string{
+ "FLUXER_GATEWAY_ZSTD_WINDOW_LOG": {"fluxer_gateway/src/gateway/gateway_compress.erl"},
+ "FLUXER_MEDIA_PROXY_MAX_ENCODE_FRAMES": {"fluxer_media_proxy/src/constants.rs"},
+ "DISCOVERY_REFRESH_INTERVAL_MS": {"fluxer_app_proxy/src/branding_images.rs"},
+ "FLUXER_EMAIL_SMTP_PORT": {"fluxer_api/src/api/instance/EmailDelivery.ts"},
+ "FLUXER_GATEWAY_ENDPOINT": {"packages/config/src/EndpointDerivation.ts"},
+ "FLUXER_CLAMAV_HOST": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_CLAMAV_PORT": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_CACHE_PURGE_HTTP_TIMEOUT_MS": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_CACHE_PURGE_CONTROLLER_TIMEOUT_MS": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_DISCOVERY_MIN_MEMBER_COUNT": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_DELETION_GRACE_PERIOD_HOURS": {"packages/config/src/ConfigLoader.ts"},
+ "FLUXER_S3_READ_BUCKET_STYLE": {"fluxer_media_proxy/src/config/parse.rs"},
+ "FLUXER_GATEWAY_API_RPC_ENDPOINT": {"fluxer_gateway/src/gateway/rpc_client.erl"},
+ "RUST_LOG": {"fluxer_admin/src/main.rs", "fluxer_app_proxy/src/main.rs", "fluxer_media_proxy/src/main.rs", "fluxer_svc/src/lib.rs"},
+}
+
+var (
+ namedAliases = regexp.MustCompile(`(?s)NAMED_FLUXER_ENV_ALIASES\b[^=]*=\s*\{(.*?)\n\}`)
+ aliasPair = regexp.MustCompile(`\b(FLUXER_[A-Z0-9_]*[A-Z0-9])\s*:\s*'(FLUXER_[A-Z0-9_]*[A-Z0-9])'`)
+)
+
+func configAliases(t *testing.T, overrides string) map[string]string {
+ t.Helper()
+ block := namedAliases.FindStringSubmatch(overrides)
+ if block == nil {
+ t.Fatalf("%s has no NAMED_FLUXER_ENV_ALIASES", configOverrides)
+ }
+ out := map[string]string{}
+ for _, m := range aliasPair.FindAllStringSubmatch(block[1], -1) {
+ out[m[2]] = m[1]
+ }
+ if len(out) == 0 {
+ t.Fatalf("NAMED_FLUXER_ENV_ALIASES in %s has no entries", configOverrides)
+ }
+ return out
+}
+
+func helpSentences(help string) []string {
+ var sentences []string
+ start, quoted := 0, false
+ for i, r := range help {
+ switch {
+ case r == '`':
+ quoted = !quoted
+ case r == '.' && !quoted && (i+1 == len(help) || help[i+1] == ' '):
+ sentences = append(sentences, help[start:i])
+ start = i + 1
+ }
+ }
+ return append(sentences, help[start:])
+}
+
+func emptyDefaults(help string) []string {
+ var out []string
+ for _, sentence := range helpSentences(help) {
+ if !emptyClause.MatchString(sentence) {
+ continue
+ }
+ for _, m := range backticked.FindAllStringSubmatch(suchAs.ReplaceAllString(sentence, ""), -1) {
+ if !slices.Contains(out, m[1]) {
+ out = append(out, m[1])
+ }
+ }
+ }
+ return out
+}
+
+func literal(v string) string {
+ v = strings.TrimSpace(digitGroups.ReplaceAllString(v, "$1$2"))
+ if len(v) >= 2 && (v[0] == '\'' || v[0] == '"') && v[len(v)-1] == v[0] {
+ return v[1 : len(v)-1]
+ }
+ if _, err := strconv.ParseFloat(v, 64); err == nil || v == "true" || v == "false" {
+ return v
+ }
+ return ""
+}
+
+func configDefaultValues(t *testing.T, overrides string) map[string]string {
+ t.Helper()
+ data, err := os.ReadFile(filepath.Join(repoRoot, configDefaults[0]))
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, body, ok := strings.Cut(string(data), "function defaultConfig(): MasterConfig {\n\treturn {\n")
+ body, _, _ = strings.Cut(body, "\n\t};\n}")
+ if !ok || body == "" {
+ t.Fatalf("%s has no defaultConfig()", configDefaults[0])
+ }
+ byPath := map[string]string{}
+ var keys []string
+ for _, line := range strings.Split(body, "\n") {
+ m := defaultLine.FindStringSubmatch(line)
+ if m == nil {
+ continue
+ }
+ depth := len(m[1]) - 2
+ if depth < 0 || depth > len(keys) {
+ t.Fatalf("defaultConfig() in %s has an unexpected indent at %q", configDefaults[0], line)
+ }
+ keys = append(keys[:depth], m[2])
+ byPath[strings.Join(keys, ".")] = literal(m[3])
+ }
+ out := map[string]string{}
+ for _, m := range overridePath.FindAllStringSubmatch(overrides, -1) {
+ var path []string
+ for _, part := range strings.Split(m[2], ",") {
+ path = append(path, strings.Trim(strings.TrimSpace(part), "'"))
+ }
+ if v, ok := byPath[strings.Join(path, ".")]; ok && v != "" {
+ out[m[1]] = v
+ }
+ }
+ if len(out) == 0 {
+ t.Fatalf("found no defaults for NAMED_FLUXER_ENV_OVERRIDES in %s", configDefaults[0])
+ }
+ return out
+}
+
+func rustDefaultValues(name string, rels []string, sources map[string]string) []string {
+ var out []string
+ for _, rel := range rels {
+ if !strings.HasSuffix(rel, ".rs") {
+ continue
+ }
+ data := sources[rel]
+ consts := map[string]string{}
+ for _, m := range rustConst.FindAllStringSubmatch(data, -1) {
+ consts[m[1]] = m[2]
+ }
+ for _, loc := range rustRead.FindAllStringSubmatchIndex(data, -1) {
+ if data[loc[2]:loc[3]] != name {
+ continue
+ }
+ rest := data[loc[1]:]
+ if next := rustRead.FindStringIndex(rest); next != nil {
+ rest = rest[:next[0]]
+ }
+ rest, _, _ = strings.Cut(rest, ";")
+ depth := 0
+ for i, r := range rest {
+ if r == '(' {
+ depth++
+ } else if r == ')' {
+ depth--
+ }
+ if depth < -1 {
+ rest = rest[:i]
+ break
+ }
+ }
+ m := rustArgument.FindStringSubmatch(rest)
+ if m == nil {
+ m = rustFallback.FindStringSubmatch(rest)
+ }
+ if m != nil {
+ raw := m[1]
+ if c, ok := consts[raw]; ok {
+ raw = c
+ }
+ if v := literal(raw); v != "" && !slices.Contains(out, v) {
+ out = append(out, v)
+ }
+ }
+ }
+ }
+ return out
+}
+
+func codeDefaultValues(name string, rels []string, sources map[string]string) []string {
+ out := rustDefaultValues(name, rels, sources)
+ q := regexp.QuoteMeta(name)
+ reads := map[string]*regexp.Regexp{
+ ".erl": regexp.MustCompile(`\b(?:env_[a-z_]+|os:getenv)\(\s*"` + q + `"\s*,\s*(<<"[^"]*">>|<<>>|"[^"]*"|-?[\d.]+|true|false)\s*\)`),
+ ".ts": regexp.MustCompile(`(?:\(\s*["'` + "`" + `]` + q + `["'` + "`" + `]\s*\)|\benv\??\.` + q + `\b)(?:\??\.[A-Za-z]+\(\))*\s*(?:\?\?|\|\|)\s*('[^']*'|"[^"]*"|-?[\d.]+|true|false)`),
+ ".sh": regexp.MustCompile(`\|\|\s*` + q + `=([^\s;]+)|\$\{` + q + `:[-=]([^}]+)\}`),
+ }
+ for _, rel := range rels {
+ ext := path.Ext(rel)
+ if ext == ".hrl" {
+ ext = ".erl"
+ } else if slices.Contains([]string{".mts", ".tsx", ".mjs", ".js", ".cjs"}, ext) {
+ ext = ".ts"
+ }
+ re := reads[ext]
+ if re == nil {
+ continue
+ }
+ for _, m := range re.FindAllStringSubmatch(sources[rel], -1) {
+ raw := strings.TrimSuffix(strings.TrimPrefix(m[1], "<<"), ">>")
+ v := literal(raw)
+ if ext == ".sh" {
+ v = strings.Trim(m[1]+m[2], `"'`)
+ }
+ if v != "" && !slices.Contains(out, v) {
+ out = append(out, v)
+ }
+ }
+ }
+ return out
+}
+
+func clampBounds(name string, rels []string, sources map[string]string) []string {
+ re := regexp.MustCompile(`(?m)^\s*` + regexp.QuoteMeta(name) + `="\$\(clamp_int\s+"[^"]*"\s+("?[^"\s)]+"?)\s+("?[^"\s)]+"?)\)"`)
+ var out []string
+ for _, rel := range rels {
+ if !strings.HasSuffix(rel, ".sh") {
+ continue
+ }
+ for _, m := range re.FindAllStringSubmatch(sources[rel], -1) {
+ for _, b := range m[1:] {
+ if _, err := strconv.Atoi(b); err == nil {
+ out = append(out, b)
+ }
+ }
+ }
+ }
+ return out
+}
+
+func rangeValue(v string) string {
+ n, unit, ok := strings.Cut(v, " ")
+ if !ok {
+ return v
+ }
+ x, _ := strconv.ParseInt(n, 10, 64)
+ return strconv.FormatInt(x<<map[string]int{"KiB": 10, "MiB": 20, "GiB": 30}[unit], 10)
+}
+
+func TestEnvInventory(t *testing.T) {
+ var err error
+ set := stack.Embedded()
+ reads, all := codeEnvNames(t)
+ code := runtimeReads(reads)
+ fluxer, other, feeds := composeEnv(t, set)
+ docker := dockerfileEnvNames(t)
+ helm := helmEnvNames(t)
+ passed := func(name string) bool { return fluxer[name] != nil || other[name] != nil }
+ registry := map[string]envVar{}
+ sections := map[string]bool{}
+ for _, s := range slices.Concat(envSections, envInternalGroups) {
+ sections[s.id] = true
+ }
+ for _, v := range envVars {
+ if _, dup := registry[v.name]; dup {
+ t.Errorf("%s is listed twice", v.name)
+ }
+ registry[v.name] = v
+ switch {
+ case !sections[v.section]:
+ t.Errorf("%s has an unknown section %q", v.name, v.section)
+ case v.section == envStackSection:
+ if slices.Contains(set.Vars, v.name) || !passed(v.name) {
+ t.Errorf("%s is listed as set by the compose stack, but compose doesn't set it for any service, or it's a .env setting", v.name)
+ }
+ case v.section == envRexctlSection:
+ if passed(v.name) {
+ t.Errorf("%s is listed in the rexctl section, but compose passes it", v.name)
+ }
+ case envTopSection(v.section) == envInternalSection:
+ used := code[v.name] != nil || slices.Contains(libraryEnvVars, v.name)
+ if !strings.HasPrefix(v.name, "FLUXER_") || slices.Contains(chartInputVars, v.name) {
+ used = used || docker[v.name] != nil || helm[v.name] != nil
+ }
+ if !used || passed(v.name) {
+ t.Errorf("%s is listed as not passed by the compose stack, but no code reads it, or compose passes it", v.name)
+ }
+ case !slices.Contains(set.Vars, v.name) && !strings.HasPrefix(v.name, "COMPOSE_"):
+ t.Errorf("%s is listed as a .env setting, but no compose file uses it", v.name)
+ }
+ }
+
+ for _, v := range set.Vars {
+ if _, ok := registry[v]; !ok {
+ t.Errorf("%s is used by a compose file but has no entry in envVars", v)
+ }
+ }
+ for _, k := range slices.Sorted(maps.Keys(fluxer)) {
+ if _, ok := registry[k]; !ok {
+ t.Errorf("compose sets %s for %v but it has no entry in envVars", k, fluxer[k])
+ }
+ }
+ for _, k := range slices.Sorted(maps.Keys(other)) {
+ if _, ok := registry[k]; !ok {
+ t.Errorf("compose sets %s for %v but it has no entry in envVars", k, other[k])
+ }
+ }
+ for _, name := range slices.Sorted(maps.Keys(all)) {
+ if _, ok := registry[name]; !ok {
+ t.Errorf("%s is looked up in %v but has no entry in envVars", name, all[name])
+ }
+ }
+
+ runtime := slices.Concat(libraryEnvVars, runtimeEnvVars, rexctlProxyVars)
+ for _, k := range slices.Sorted(maps.Keys(fluxer)) {
+ if code[k] == nil && !slices.Contains(runtime, strings.ToUpper(k)) {
+ t.Errorf("compose passes %s to %v but no Fluxer code looks it up", k, fluxer[k])
+ }
+ }
+ serviceReads := func(k, svc string) bool {
+ var prefixes []string
+ for prefix, services := range codeServices {
+ if slices.Contains(services, svc) {
+ prefixes = append(prefixes, prefix)
+ }
+ }
+ return slices.ContainsFunc(code[k], func(rel string) bool {
+ return slices.ContainsFunc(prefixes, func(p string) bool { return strings.HasPrefix(rel, p) })
+ }) || slices.ContainsFunc(docker[k], func(f string) bool {
+ return slices.ContainsFunc(prefixes, func(p string) bool { return f == p+"Dockerfile" })
+ })
+ }
+ own, scripts := composeOwnEnv(t, set)
+ for _, k := range slices.Sorted(maps.Keys(own)) {
+ if slices.Contains(runtime, strings.ToUpper(k)) {
+ continue
+ }
+ for _, svc := range own[k] {
+ if slices.Contains(fluxer[k], svc) && !serviceReads(k, svc) {
+ t.Errorf("compose passes %s to %s, but no code that service runs looks it up", k, svc)
+ }
+ }
+ }
+ services := map[string]bool{}
+ for _, list := range codeServices {
+ for _, svc := range list {
+ services[svc] = true
+ }
+ }
+ for _, v := range envVars {
+ for _, m := range serviceList.FindAllStringSubmatch(v.help, -1) {
+ for _, svc := range strings.FieldsFunc(strings.ReplaceAll(m[1], " and ", ","), func(r rune) bool { return r == ',' || r == ' ' }) {
+ if services[svc] && !serviceReads(v.name, svc) && !slices.ContainsFunc(feeds[[2]string{v.name, svc}], func(k string) bool { return serviceReads(k, svc) }) && !slices.Contains(runtime, v.name) {
+ t.Errorf("the entry for %s says the %s service uses it, but no code that service runs looks it up", v.name, svc)
+ }
+ }
+ }
+ }
+ for _, svc := range slices.Sorted(maps.Keys(scripts)) {
+ seen := map[string]bool{}
+ for _, text := range scripts[svc] {
+ for _, m := range composeSh.FindAllStringSubmatch(text, -1) {
+ if seen[m[1]] {
+ continue
+ }
+ seen[m[1]] = true
+ if _, ok := registry[m[1]]; !ok {
+ t.Errorf("the %s service's command uses %s but it has no entry in envVars", svc, m[1])
+ }
+ if !slices.Contains(other[m[1]], svc) && !slices.Contains(fluxer[m[1]], svc) {
+ t.Errorf("the %s service's command uses %s but compose doesn't set it for that service", svc, m[1])
+ }
+ }
+ }
+ }
+ shell := map[string]bool{}
+ for _, name := range []string{stack.ComposeFile, stack.Caddyfile} {
+ data, err := fs.ReadFile(set.Files, name)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, re := range []*regexp.Regexp{caddyEnv, composeSh} {
+ for _, m := range re.FindAllStringSubmatch(string(data), -1) {
+ shell[m[1]] = true
+ }
+ }
+ }
+ for _, k := range slices.Sorted(maps.Keys(other)) {
+ if strings.HasPrefix(k, "FLUXER_") && !shell[k] {
+ t.Errorf("compose passes %s to %v but nothing there uses it", k, other[k])
+ }
+ }
+
+ caddy := map[string][]byte{}
+ if caddy[stack.Caddyfile], err = fs.ReadFile(set.Files, stack.Caddyfile); err != nil {
+ t.Fatal(err)
+ }
+ for name := range caddyfiles {
+ if caddy[name], err = os.ReadFile(filepath.Join(repoRoot, name)); err != nil {
+ t.Fatal(err)
+ }
+ }
+ for _, name := range slices.Sorted(maps.Keys(caddy)) {
+ svc := caddyfiles[name]
+ if svc == "" {
+ svc = "edge"
+ }
+ for _, m := range caddyEnv.FindAllStringSubmatch(string(caddy[name]), -1) {
+ if _, ok := registry[m[1]]; !ok {
+ t.Errorf("%s uses %s but it has no entry in envVars", name, m[1])
+ }
+ if !slices.Contains(other[m[1]], svc) && !slices.Contains(fluxer[m[1]], svc) {
+ t.Errorf("%s uses %s but compose doesn't set it for the %s service", name, m[1], svc)
+ }
+ }
+ }
+
+ for _, name := range slices.Sorted(maps.Keys(docker)) {
+ if _, ok := registry[name]; !ok && !slices.Contains(dockerOSVars, name) {
+ t.Errorf("%v sets %s but it has no entry in envVars", docker[name], name)
+ }
+ }
+
+ for _, k := range settings.Named() {
+ for _, v := range k.Vars {
+ if _, ok := registry[v]; !ok || !slices.Contains(set.Vars, v) {
+ t.Errorf("the %s setting writes %s, but compose doesn't use it or it has no entry in envVars", k.Name, v)
+ }
+ }
+ }
+ written := slices.Concat(stack.SizingKeys(), stack.ProfileKeys(set), settings.DerivedVars(), slices.Sorted(maps.Keys(settings.Twins)),
+ slices.Sorted(maps.Keys(stack.FoldWorker(stack.Hardware{}, nil, map[string]string{stack.EmbeddedWorkerVar: "true"}))))
+ for _, v := range written {
+ if _, ok := registry[v]; !ok || !slices.Contains(set.Vars, v) {
+ t.Errorf("rexctl writes %s, but compose doesn't use it or it has no entry in envVars", v)
+ }
+ }
+
+ values := composeValues(set)
+ literals := composeLiterals(set)
+ for _, v := range envVars {
+ if v.section != envStackSection {
+ continue
+ }
+ if lit := literals[v.name]; lit != "" && strings.Contains(v.help, lit) {
+ t.Errorf("%s repeats the compose value %q in its description", v.name, lit)
+ }
+ if _, from, ok := strings.Cut(v.help, " from "); ok {
+ for _, ref := range envNamePattern.FindAllString(from, -1) {
+ if !slices.ContainsFunc(values[v.name], func(s string) bool { return strings.Contains(s, ref) }) {
+ t.Errorf("%s says compose sets it from %s, but its compose value is %v", v.name, ref, values[v.name])
+ }
+ }
+ }
+ }
+
+ sources := map[string]string{}
+ byRel := map[string]bool{}
+ walkCode(t, codeRoots, func(rel, lang, data string) {
+ data = digitGroups.ReplaceAllString(data, "$1$2")
+ for _, m := range products.FindAllString(data, -1) {
+ n := 1
+ for _, f := range strings.Split(m, "*") {
+ x, _ := strconv.Atoi(strings.TrimSpace(f))
+ n *= x
+ }
+ data += " " + strconv.Itoa(n)
+ }
+ sources[rel] = data
+ byRel[rel] = true
+ })
+ overrides, err := os.ReadFile(filepath.Join(repoRoot, configOverrides))
+ if err != nil {
+ t.Fatal(err)
+ }
+ loaderDefaults := configDefaultValues(t, string(overrides))
+ for _, v := range envVars {
+ if code[v.name] == nil {
+ continue
+ }
+ defaults := emptyDefaults(v.help)
+ inCompose := func(w string) bool {
+ token := regexp.MustCompile(`(?:^|[^\w.])` + regexp.QuoteMeta(w) + `(?:$|[^\w.]|\.(?:\D|$))`)
+ return slices.ContainsFunc(values[v.name], func(s string) bool { return token.MatchString(s) })
+ }
+ if len(defaults) > 0 && !slices.ContainsFunc(defaults, inCompose) {
+ exact := codeDefaultValues(v.name, code[v.name], sources)
+ if lit := loaderDefaults[v.name]; lit != "" && slices.Contains(code[v.name], configOverrides) {
+ exact = append(exact, lit)
+ }
+ for _, lit := range exact {
+ if !slices.Contains(defaults, lit) {
+ t.Errorf("%s says an empty value gives %v, but the code falls back to %q", v.name, defaults, lit)
+ }
+ }
+ }
+ for _, b := range clampBounds(v.name, code[v.name], sources) {
+ if !regexp.MustCompile(`\b` + b + `\b`).MatchString(v.help) {
+ t.Errorf("%s doesn't mention %s, a bound the code keeps an empty value within", v.name, b)
+ }
+ }
+ want := slices.Clone(defaults)
+ for _, m := range codeRange.FindAllStringSubmatch(v.help, -1) {
+ want = append(want, rangeValue(m[1]), rangeValue(m[2]))
+ }
+ for _, m := range codeBound.FindAllStringSubmatch(v.help, -1) {
+ for _, n := range m[1:] {
+ if n != "" && !slices.Contains(want, n) {
+ want = append(want, n)
+ }
+ }
+ }
+ files := slices.Concat(code[v.name], envDefaultFiles[v.name])
+ if envDefaultFiles[v.name] == nil {
+ if slices.Contains(code[v.name], configOverrides) {
+ files = append(files, configDefaults...)
+ }
+ for _, rel := range code[v.name] {
+ for _, m := range tsImport.FindAllStringSubmatch(sources[rel], -1) {
+ if imp := resolveImport(rel, m[1], byRel); imp != "" {
+ files = append(files, imp)
+ }
+ }
+ }
+ }
+ for _, w := range want {
+ token := regexp.MustCompile(`(?:^|[^\w.])` + regexp.QuoteMeta(w) + `(?:$|[^\w.]|\.(?:\D|$))`)
+ inCode := slices.ContainsFunc(files, func(rel string) bool { return token.MatchString(sources[rel]) })
+ if !inCode && !inCompose(w) {
+ t.Errorf("%s says %q, but neither compose nor %v has it", v.name, w, slices.Concat(code[v.name], envDefaultFiles[v.name]))
+ }
+ }
+ }
+
+ composeFiles := []string{stack.ComposeFile}
+ for _, o := range envOverlays {
+ composeFiles = append(composeFiles, stack.OverlayFiles[o.overlay])
+ }
+ for i, file := range composeFiles {
+ data, err := stack.ReadFile(set, file)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defs := map[string][]string{}
+ scanDefaults(string(data), defs, map[string]bool{})
+ for _, k := range slices.Sorted(maps.Keys(defs)) {
+ var lits []string
+ empty := false
+ for _, d := range defs[k] {
+ if d == "" {
+ empty = true
+ } else if !strings.Contains(d, "$") && !slices.Contains(lits, d) {
+ lits = append(lits, d)
+ }
+ }
+ if len(lits) > 1 {
+ t.Errorf("%s gives %s different defaults %v", file, k, lits)
+ continue
+ }
+ if i > 0 || len(lits) == 0 {
+ continue
+ }
+ if d := emptyDefaults(registry[k].help); len(d) > 0 && !slices.Contains(d, lits[0]) && !strings.Contains(registry[k].help, "Outside Docker Compose") {
+ t.Errorf("%s says an empty value gives %v, but compose falls back to %q", k, d, lits[0])
+ }
+ if !empty {
+ continue
+ }
+ exact := codeDefaultValues(k, code[k], sources)
+ if lit := loaderDefaults[k]; lit != "" && slices.Contains(code[k], configOverrides) {
+ exact = append(exact, lit)
+ }
+ slices.Sort(exact)
+ for _, lit := range slices.Compact(exact) {
+ if lit != lits[0] {
+ t.Errorf("compose gives %s the default %q for one service and an empty value for another, where the code falls back to %q", k, lits[0], lit)
+ }
+ }
+ }
+ }
+
+ aliases := configAliases(t, string(overrides))
+ for _, alias := range slices.Sorted(maps.Keys(aliases)) {
+ if v, ok := registry[alias]; !ok || !strings.Contains(v.help, aliases[alias]) {
+ t.Errorf("the config loader reads %s when %s is empty, but the entry for %s doesn't mention %s", alias, aliases[alias], alias, aliases[alias])
+ }
+ }
+ for _, m := range keyEnv.FindAllStringSubmatch(string(overrides), -1) {
+ if envTopSection(registry[m[1]].section) != envInternalSection && !slices.Contains(fluxer[m[1]], "api") && !slices.Contains(workerOnlyVars, m[1]) {
+ t.Errorf("the config loader looks up %s, but compose doesn't pass it to the api", m[1])
+ }
+ }
+ for _, name := range workerOnlyVars {
+ if slices.Contains(fluxer[name], "api") || !slices.Contains(fluxer[name], "worker") {
+ t.Errorf("%s is listed as passed to the worker only, but compose passes it to %v", name, fluxer[name])
+ }
+ }
+ for _, name := range slices.Sorted(maps.Keys(code)) {
+ if envTopSection(registry[name].section) == envInternalSection {
+ continue
+ }
+ for _, rel := range code[name] {
+ if rel == configOverrides && aliases[name] != "" {
+ continue
+ }
+ var want []string
+ image := ""
+ for prefix, services := range codeServices {
+ if strings.HasPrefix(rel, prefix) {
+ want, image = services, prefix+"Dockerfile"
+ }
+ }
+ if len(want) > 0 && !slices.Contains(docker[name], image) && !slices.ContainsFunc(want, func(svc string) bool {
+ return slices.Contains(fluxer[name], svc) || slices.Contains(other[name], svc)
+ }) {
+ t.Errorf("%s looks up %s, but compose passes it to none of %v", rel, name, want)
+ }
+ }
+ }
+ for _, name := range slices.Sorted(maps.Keys(helm)) {
+ if _, ok := registry[name]; !ok {
+ t.Errorf("%v sets %s but it has no entry in envVars", helm[name], name)
+ }
+ }
+
+ for _, name := range envSecretVars {
+ if v, ok := registry[name]; !ok || slices.Contains(envUnbundledSections, envTopSection(v.section)) {
+ t.Errorf("%s is listed as a secret but isn't a .env setting", name)
+ }
+ }
+ for _, s := range secrets.Required {
+ if s.Kind != secrets.KindFixed && s.Key != secrets.VAPIDPublicKey && !slices.Contains(envSecretVars, s.Key) {
+ t.Errorf("%s is a generated secret but isn't in envSecretVars", s.Key)
+ }
+ }
+}
+
+var serviceList = regexp.MustCompile(`\b((?:[a-z][a-z-]*, )*[a-z][a-z-]* and [a-z][a-z-]*) services\b`)
+
+var workerOnlyVars = []string{"FLUXER_API_WORKER_ENABLE_CRON_SCHEDULER", "FLUXER_API_WORKER_MODE"}
+
+var helmPodEnv = regexp.MustCompile(`(?m)^\s*-\s*name:\s*"?([A-Z][A-Z0-9_]*)"?\s*$|"name"\s+"([A-Z][A-Z0-9_]*)"|\bset \$c "([A-Z][A-Z0-9_]*)"`)
+
+func helmEnvNames(t *testing.T) map[string][]string {
+ t.Helper()
+ found := map[string][]string{}
+ root := filepath.Join(repoRoot, helmChart)
+ err := filepath.WalkDir(filepath.Join(root, "templates"), func(p string, d fs.DirEntry, err error) error {
+ if err != nil {
+ return err
+ }
+ if d.IsDir() {
+ if d.Name() == "tests" {
+ return filepath.SkipDir
+ }
+ return nil
+ }
+ data, err := os.ReadFile(p)
+ if err != nil {
+ return err
+ }
+ rel, _ := filepath.Rel(repoRoot, p)
+ for _, m := range helmPodEnv.FindAllStringSubmatch(string(data), -1) {
+ addFound(found, m[1]+m[2]+m[3], filepath.ToSlash(rel))
+ }
+ return nil
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ data, err := os.ReadFile(filepath.Join(root, "values.yaml"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ var values struct {
+ Secrets struct {
+ Values map[string]any `yaml:"values"`
+ } `yaml:"secrets"`
+ }
+ if err := yaml.Unmarshal(data, &values); err != nil {
+ t.Fatal(err)
+ }
+ if len(values.Secrets.Values) == 0 {
+ t.Fatal("the Helm chart values have no secrets.values keys")
+ }
+ for _, name := range slices.Sorted(maps.Keys(values.Secrets.Values)) {
+ addFound(found, name, helmChart+"/values.yaml")
+ }
+ return found
+}
+
+func TestEnvDefaults(t *testing.T) {
+ docs := envDocs()
+ if d := docs.get("FLUXER_LIVEKIT_DEFAULT_REGION"); len(d.defaults) != 1 || !json.Valid([]byte(d.defaults[0].value)) {
+ t.Errorf("the FLUXER_LIVEKIT_DEFAULT_REGION default isn't one JSON value, got %v", d.defaults)
+ }
+ for _, name := range []string{"FLUXER_API_NODE_HEAP_MB", "FLUXER_WORKER_NODE_HEAP_MB"} {
+ if d := docs.get(name); len(d.defaults) != 0 {
+ t.Errorf("%s has the default %v, which belongs to another flag", name, d.defaults)
+ }
+ }
+}
+
+func TestEnvFileForms(t *testing.T) {
+ direct := map[string]bool{}
+ shellNames := map[string]bool{}
+ walkCode(t, codeRoots, func(rel, lang, data string) {
+ if strings.HasPrefix(rel, "fluxer_docs/") {
+ return
+ }
+ switch lang {
+ case "ts", "native", "c":
+ for _, m := range directEnv.FindAllStringSubmatch(data, -1) {
+ direct[m[1]+m[2]+m[3]+m[4]] = true
+ }
+ case "shell":
+ for _, m := range shellEnv.FindAllStringSubmatch(data, -1) {
+ shellNames[m[1]] = true
+ }
+ }
+ })
+ for name := range shellNames {
+ if !strings.HasSuffix(name, "_FILE") && !shellNames[name+"_FILE"] {
+ direct[name] = true
+ }
+ }
+ got := slices.Sorted(maps.Keys(direct))
+ want := slices.Sorted(slices.Values(envNoFileVars))
+ if !slices.Equal(got, want) {
+ t.Errorf("Fluxer code looks up these variables without the _FILE form\n got %v\nwant %v (envNoFileVars)", got, want)
+ }
+}
+
+func TestRexctlEnv(t *testing.T) {
+ found := map[string][]string{}
+ local := map[string]map[string][]string{}
+ global := map[string][]string{}
+ type pending struct{ rel, ident string }
+ var idents []pending
+ walkCode(t, rexctlRoots, func(rel, lang, data string) {
+ switch lang {
+ case "go":
+ dir := path.Dir(rel)
+ if local[dir] == nil {
+ local[dir] = map[string][]string{}
+ }
+ for _, m := range goConst.FindAllStringSubmatch(data, -1) {
+ local[dir][m[1]] = append(local[dir][m[1]], m[2])
+ global[m[1]] = append(global[m[1]], m[2])
+ }
+ for _, m := range goIdentEnv.FindAllStringSubmatch(data, -1) {
+ idents = append(idents, pending{rel, m[1]})
+ }
+ if strings.Contains(data, "os.Environ()") || strings.Contains(data, "environ []string") {
+ for _, m := range goEnviron.FindAllStringSubmatch(data, -1) {
+ addFound(found, m[1]+m[2], rel)
+ }
+ }
+ for _, m := range goEnv.FindAllStringSubmatch(data, -1) {
+ addFound(found, m[1]+m[3], rel)
+ for _, q := range regexp.MustCompile(`"([A-Za-z_][A-Za-z0-9_]*)"`).FindAllStringSubmatch(m[2], -1) {
+ addFound(found, q[1], rel)
+ }
+ }
+ case "shell":
+ for _, m := range shellEnv.FindAllStringSubmatch(data, -1) {
+ addFound(found, m[1], rel)
+ }
+ case "ps":
+ for _, m := range psEnv.FindAllStringSubmatch(data, -1) {
+ addFound(found, m[1], rel)
+ }
+ }
+ })
+ for _, p := range idents {
+ values, ok := local[path.Dir(p.rel)][p.ident]
+ if !ok && p.ident[0] >= 'A' && p.ident[0] <= 'Z' {
+ values = global[p.ident]
+ }
+ for _, v := range values {
+ addFound(found, v, p.rel)
+ }
+ }
+ registry := map[string]envVar{}
+ for _, v := range envVars {
+ registry[v.name] = v
+ }
+ for _, name := range rexctlLibraryVars {
+ addFound(found, name, "the Docker CLI library")
+ }
+ network := slices.IndexFunc(envSections, func(s envSection) bool { return s.id == envNetworkSection })
+ for _, name := range rexctlProxyVars {
+ if registry[name].section != envNetworkSection || network < 0 || !strings.Contains(envSections[network].intro, name) {
+ t.Errorf("rexctl and install.sh take %s from the shell, but the outgoing proxy section doesn't say so", name)
+ }
+ }
+ for _, name := range slices.Sorted(maps.Keys(found)) {
+ if s := registry[name].section; s != envRexctlSection && s != envComposeSection && !slices.Contains(rexctlOSVars, name) {
+ t.Errorf("%v looks up %s but envVars doesn't list it in the rexctl or compose section", found[name], name)
+ }
+ }
+ for _, v := range envVars {
+ if v.section == envRexctlSection && found[v.name] == nil {
+ t.Errorf("%s is listed in the rexctl section but neither rexctl nor its install scripts look it up", v.name)
+ }
+ }
+}
+
+var unbundledImages = []string{"fluxer_docs"}
+
+func TestEnvCodeRoots(t *testing.T) {
+ dockerfiles, err := filepath.Glob(filepath.Join(repoRoot, "fluxer_*", "Dockerfile"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, p := range dockerfiles {
+ dir := filepath.Base(filepath.Dir(p))
+ if !slices.ContainsFunc(codeRoots, func(root string) bool { return strings.HasPrefix(root, dir+"/") || root == dir }) {
+ t.Errorf("%s has a Dockerfile but no directory of it is in codeRoots", dir)
+ }
+ if _, ok := codeServices[dir+"/"]; !ok && !slices.Contains(unbundledImages, dir) {
+ t.Errorf("%s has a Dockerfile but codeServices doesn't list its compose services", dir)
+ }
+ }
+ fluxer, _, _ := composeEnv(t, stack.Embedded())
+ services := map[string]bool{}
+ for _, svcs := range fluxer {
+ for _, svc := range svcs {
+ services[svc] = true
+ }
+ }
+ for _, svc := range slices.Sorted(maps.Keys(services)) {
+ if !slices.ContainsFunc(slices.Collect(maps.Values(codeServices)), func(list []string) bool { return slices.Contains(list, svc) }) {
+ t.Errorf("compose runs %s from a Fluxer image, but no codeServices entry lists it", svc)
+ }
+ }
+}
+
+func TestEnvWorkflowPaths(t *testing.T) {
+ data, err := os.ReadFile(filepath.Join(repoRoot, ".github/workflows/env-reference.yaml"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ var wf struct {
+ On struct {
+ PullRequest struct {
+ Paths []string `yaml:"paths"`
+ } `yaml:"pull_request"`
+ Push struct {
+ Paths []string `yaml:"paths"`
+ } `yaml:"push"`
+ } `yaml:"on"`
+ }
+ if err := yaml.Unmarshal(data, &wf); err != nil {
+ t.Fatal(err)
+ }
+ if !slices.Equal(wf.On.PullRequest.Paths, wf.On.Push.Paths) {
+ t.Errorf("the pull_request and push paths of env-reference.yaml differ")
+ }
+ dockerfiles, err := filepath.Glob(filepath.Join(repoRoot, "fluxer_*", "Dockerfile"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ inputs := slices.Concat(codeRoots, rexctlRoots, slices.Sorted(maps.Keys(caddyfiles)), []string{configOverrides, docsContent, helmChart})
+ for _, p := range dockerfiles {
+ rel, _ := filepath.Rel(repoRoot, p)
+ inputs = append(inputs, filepath.ToSlash(rel))
+ }
+ for _, in := range inputs {
+ if !slices.ContainsFunc(wf.On.PullRequest.Paths, func(glob string) bool {
+ if dir, ok := strings.CutSuffix(glob, "**"); ok {
+ return strings.HasPrefix(in+"/", dir)
+ }
+ ok, _ := path.Match(glob, in)
+ return ok
+ }) {
+ t.Errorf("env-reference.yaml doesn't run for changes to %s", in)
+ }
+ }
+}
+
+var envHelpBanned = regexp.MustCompile(`[<>{}|;–—“”‘’]|[a-z)]: [A-Za-z]`)
+
+func envProse(text string) string {
+ parts := strings.Split(text, "`")
+ for i := 1; i < len(parts); i += 2 {
+ parts[i] = "code"
+ }
+ return strings.Join(parts, "")
+}
+
+func TestEnvHelp(t *testing.T) {
+ named := map[string]bool{}
+ for _, k := range settings.Named() {
+ for _, v := range k.Vars {
+ named[v] = true
+ }
+ }
+ for _, v := range envVars {
+ if v.help == "" && !named[v.name] {
+ t.Errorf("%s has no description", v.name)
+ }
+ for _, sentence := range helpSentences(v.help) {
+ rest := suchAs.ReplaceAllString(sentence, "")
+ if anyEmpty.MatchString(rest) && backticked.MatchString(rest) && !emptyClause.MatchString(rest) && !otherEmpty.MatchString(rest) {
+ t.Errorf("%s states a value for an empty setting in a form the default check can't read: %q", v.name, strings.TrimSpace(sentence))
+ }
+ }
+ }
+ check := func(what, text string) {
+ if text == "" {
+ return
+ }
+ if !strings.HasSuffix(text, ".") {
+ t.Errorf("%s doesn't end with a full stop", what)
+ }
+ if m := envHelpBanned.FindString(envProse(text)); m != "" {
+ t.Errorf("%s has %q", what, m)
+ }
+ }
+ for _, d := range envDocs() {
+ if strings.TrimSpace(d.text) == "" {
+ t.Errorf("%s renders without a description", d.name)
+ }
+ check(d.name, d.text)
+ check(d.name+" note", d.note)
+ }
+ for _, s := range slices.Concat(envSections, envInternalGroups) {
+ check("the "+s.title+" section intro", s.intro)
+ check("the "+s.title+" page intro", s.page)
+ if m := envHelpBanned.FindString(s.title); m != "" {
+ t.Errorf("the %s section title has %q", s.title, m)
+ }
+ }
+ check("the note on values from files", envNoFileNote)
+ check("the reference note", referenceEnvNote)
+ for _, g := range []*secretGroup{{kind: secrets.KindFixed}, {kind: secrets.KindHex32, stateful: true}, {kind: secrets.KindVAPID, stateful: true}} {
+ text, _ := secretHelp(g)
+ check("the secrets help", text)
+ }
+}
+
+func TestLibraryEnvAnchors(t *testing.T) {
+ for _, name := range libraryEnvVars {
+ anchors := libraryEnvAnchors[name]
+ if len(anchors) == 0 {
+ t.Errorf("%s has no code anchor in libraryEnvAnchors", name)
+ }
+ for _, a := range anchors {
+ data, err := os.ReadFile(filepath.Join(repoRoot, a[0]))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !regexp.MustCompile(a[1]).Match(data) {
+ t.Errorf("%s no longer matches %s, which the %s entry depends on", a[0], a[1], name)
+ }
+ }
+ }
+ walkCode(t, codeRoots, func(rel, lang, data string) {
+ if lang == "native" && strings.Contains(data, ".no_proxy()") && !slices.Contains(noProxyFiles, rel) {
+ t.Errorf("%s turns off the proxy, which the ALL_PROXY entry doesn't cover", rel)
+ }
+ })
+}
+
+func TestEnvScanner(t *testing.T) {
+ files := []codeFile{
+ {rel: "fixture/timings.erl", lang: "native", data: "pod() ->\n first_name([\"FX_POD\", \"FX_HOST\"], x).\n\nfirst_name([], Fallback) ->\n Fallback;\nfirst_name([Name | Rest], Fallback) ->\n case config:env_value(Name) of\n undefined -> first_name(Rest, Fallback);\n Value -> Value\n end.\n"},
+ {rel: "fixture/version.rs", lang: "native", data: stripRustTests("fn version() -> String {\n read_first_env(&[\"FX_BUILD\", \"FX_VERSION\"])\n}\n#[cfg(test)]\nmod tests {\n fn reads() {\n let _ = (\"}\", '{');\n std::env::var(\"FX_TEST_ONLY\");\n }\n}\nfn after() {\n std::env::var(\"FX_AFTER\");\n}\n")},
+ {rel: "fixture/built.rs", lang: "native", data: "fn built(x: &str) {\n std::env::var(format!(\"FX_BUILT_{}\", x));\n std::env::var_os(concat!(\"FX_JOINED_\", \"X\"));\n}\n"},
+ {rel: "fixture/check.ts", lang: "ts", data: "if (days < 1) {\n\tthrow new Error('FLUXER_FX_MESSAGE must be at least 1');\n}\nassertIntegerInRange(days, 'FLUXER_FX_MESSAGE', 1, 10);\n"},
+ {rel: "fixture/mod.rs", lang: "native", data: stripRustTests("#[cfg(test)]\nmod tests;\nfn port(env: &Env) {\n read(env, \"FX_PORT\");\n}\nfn read(env: &Env, name: &str) {\n env.get(name);\n}\n")},
+ {rel: "fixture/required.rs", lang: "native", data: "fn load(env: &Env) {\n env.require(\"FX_REQUIRED\");\n}\n"},
+ {rel: "fixture/key.ts", lang: "ts", data: "const key = 'FX_KEY';\nexport const value = process.env[key];\n"},
+ {rel: "fixture/list.rs", lang: "native", data: "fn first() {\n for k in [\"FX_FIRST\", \"FX_SECOND\"] {\n let _ = std::env::var(k);\n }\n let n = \"FX_LOCAL\";\n let _ = std::env::var(n);\n}\n"},
+ {rel: "fixture/node.erl", lang: "native", data: "node() ->\n Name = \"FX_NODE\",\n os:getenv(Name).\n"},
+ {rel: "fixture/branding.rs", lang: "native", data: "const ICON: (&str, &str) = (\"icon_url\", \"FX_ICON\");\nfn snapshot<F: FnMut(&str) -> Option<String>>(mut read_var: F) {\n fields(|(_, name)| read_var(name));\n}\n"},
+ {rel: "fixture/scheme.ts", lang: "ts", data: "function readString(name: string, fallback: string) {\n\treturn process.env[name] ?? fallback;\n}\nfunction readScheme(name: string) {\n\treturn readString(name, 'http');\n}\nexport const scheme = readScheme('FX_SCHEME');\n"},
+ }
+ got, mentioned := scanEnvNames(files)
+ for _, name := range []string{"FX_POD", "FX_HOST", "FX_BUILD", "FX_VERSION", "FX_AFTER", "FX_PORT", "FX_BUILT_", "FX_JOINED_", "FX_REQUIRED", "FX_SCHEME", "FX_KEY", "FX_FIRST", "FX_SECOND", "FX_LOCAL", "FX_NODE", "FX_ICON"} {
+ if got[name] == nil {
+ t.Errorf("the scanner misses %s", name)
+ }
+ }
+ if got["FX_TEST_ONLY"] != nil {
+ t.Errorf("the scanner counts FX_TEST_ONLY, which only test code reads")
+ }
+ if got["FLUXER_FX_MESSAGE"] != nil || mentioned["FLUXER_FX_MESSAGE"] == nil {
+ t.Errorf("the scanner counts FLUXER_FX_MESSAGE as a read, which only an error message has, or misses it as a mention")
+ }
+}
+
+var envAlias = regexp.MustCompile(`([A-Za-z_$][\w$]*)\??\s*(?::\s*[^=,;()\n]+)?=\s*(?:process|Bun|import\.meta)\.env\s*(?:[,;)\n]|$)|([A-Za-z_$][\w$]*)\??\s*:\s*NodeJS\.ProcessEnv\b`)
+
+func TestEnvAliases(t *testing.T) {
+ walkCode(t, codeRoots, func(rel, lang, data string) {
+ if lang != "ts" {
+ return
+ }
+ for _, m := range envAlias.FindAllStringSubmatch(data, -1) {
+ if name := m[1] + m[2]; name != "env" {
+ t.Errorf("%s keeps the environment in %s, and the scanner only follows reads through env", rel, name)
+ }
+ }
+ })
+}
diff --git a/fluxer_rexctl/internal/instance/envref.go b/fluxer_rexctl/internal/instance/envref.go
new file mode 100644
index 000000000..78f3bf39e
--- /dev/null
+++ b/fluxer_rexctl/internal/instance/envref.go
@@ -0,0 +1,472 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package instance
+
+import (
+ "fmt"
+ "regexp"
+ "slices"
+ "strconv"
+ "strings"
+
+ "go.yaml.in/yaml/v4"
+
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/mdx"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/secrets"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/settings"
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/stack"
+)
+
+const (
+ envRequiredSection = "required"
+ envAdminSection = "admin"
+ envSecretsSection = "secrets"
+ envComposeSection = "compose"
+ envFilesSection = "files"
+ envRexctlSection = "rexctl"
+ envStackSection = "stack"
+ envInternalSection = "internal"
+ envNetworkSection = "network"
+)
+
+type envSection struct {
+ id string
+ title string
+ intro string
+ page string
+}
+
+var envSections = []envSection{
+ {envRequiredSection, "Required", "Fill these in before the first start.", ""},
+ {envAdminSection, "First admin account", "", ""},
+ {envSecretsSection, "Secrets", "Fill these in before the first start, and keep a copy of .env somewhere safe. Only FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64 may stay empty.",
+ "rexctl generates these when it installs Fluxer. With Docker Compose, [these commands](/operator/docker-compose/#fill-in-env) fill them in."},
+ {envComposeSection, "Compose files", fmt.Sprintf("The optional compose files change how Fluxer runs. "+
+ "To use one, list it after %s in COMPOSE_FILE, such as COMPOSE_FILE=%s:%s.",
+ stack.ComposeFile, stack.ComposeFile, stack.OverlayFiles[stack.OverlayProxy]), ""},
+ {"address", "Public address", "Fluxer works out every address from FLUXER_DOMAIN. Set these only when a part of Fluxer runs on another address.", ""},
+ {"edge", "Edge and HTTPS", "By default Fluxer listens on ports 80 and 443 and gets its own HTTPS certificate for your domain.", ""},
+ {"voice", "Voice and video", "Calls connect directly to this machine on FLUXER_LIVEKIT_TCP_PORT and FLUXER_LIVEKIT_UDP_PORT, even when Fluxer is behind your own proxy.", ""},
+ {"storage", "Object storage", "By default Fluxer keeps files in the bundled object store. To use your own S3-compatible store, set its address and buckets, add " +
+ stack.OverlayFiles[stack.OverlayExternalObjectStore] + " to COMPOSE_FILE and put its keys in FLUXER_S3_ACCESS_KEY and FLUXER_S3_SECRET_KEY.", ""},
+ {"database", "Database", "Leave these unset to use the bundled Postgres.", ""},
+ {"services", "Cache, queue and search", "Leave these unset to use the bundled Valkey, NATS and Meilisearch.", ""},
+ {envNetworkSection, "Outgoing proxy", "These settings are for Fluxer's services. rexctl and the Linux and macOS install script take HTTPS_PROXY, HTTP_PROXY and NO_PROXY from the shell you run them from.", ""},
+ {"sso", "Sign-in", "", ""},
+ {"email", "Email", "The admin panel can also save the delivery mode, the sender and the SMTP server. A value saved there is used first.", ""},
+ {"push", "Push notifications", "", ""},
+ {"media", "Media", "", ""},
+ {"gateway", "Gateway", "", ""},
+ {"app", "Web app", "", ""},
+ {"api", "API and worker", "", ""},
+ {"instance", "Instance and branding", "Fluxer uses the product name, images, theme colour and status page links set here only until the setup wizard finishes or someone saves branding in the admin panel. After that it uses the saved values and ignores these. Make later changes in the admin panel or with `rexctl config set`.", ""},
+ {"billing", "Billing", "The admin panel can also save whether billing is on, the Stripe keys and the prices. A value saved there is used first, and a saved price list replaces all of FLUXER_STRIPE_PRICES.", ""},
+ {"integrations", "Integrations", "The admin panel can also save the Bluesky settings and keys. A value saved there is used first.", ""},
+ {"tuning", "Memory and performance", "rexctl sets some of these from the machine's memory and CPU on every start. A value you set wins.", ""},
+ {"bundled", "Bundled services", "These change how the bundled Valkey, Meilisearch and SeaweedFS run.", ""},
+ {"operations", "Logs and health checks", "", ""},
+ {settings.ImagesPrefix[:len(settings.ImagesPrefix)-1], "Images",
+ "Set one to use your own mirror or another version. Fluxer's own images are pinned to the release in " + stack.ComposeFile + ".", ""},
+ {envFilesSection, "Values from files", "The api, worker, gateway and Rust services also take a setting from a file. " +
+ "Set `NAME_FILE` to the path of a file that has the value, such as a Docker secret, and leave `NAME` unset. " +
+ "A service with both `NAME` and `NAME_FILE` set refuses to start. " + stack.ComposeFile + " passes only the variables it lists. " +
+ "To use a `NAME_FILE` variable, add it to the service's environment in a compose file of your own and list that file in COMPOSE_FILE.", ""},
+ {envRexctlSection, "rexctl", "rexctl and its install scripts look these up in the shell you run them from. A value in .env has no effect.", ""},
+ {envStackSection, "Set by the compose stack", stack.ComposeFile + " sets these for the services from the settings above or to fixed values. A value in .env has no effect.", ""},
+ {envInternalSection, "Not passed by the compose stack", "Fluxer's services, their images, some of the libraries they use and the Fluxer Helm chart also use these variables, but " + stack.ComposeFile + " doesn't pass them to any service. A value in .env has no effect.", ""},
+}
+
+var envInternalGroups = []envSection{
+ {"hosted", "Hosted service only", "Only Fluxer's hosted service uses these.", ""},
+ {"prices", "Stripe price IDs", "Set prices with FLUXER_STRIPE_PRICES or in the admin panel.", ""},
+ {"cluster", "Gateway clustering", "The stack runs the gateway as one node.", ""},
+ {"relay", "Push relay", "Only the push relay Fluxer runs for the mobile apps uses these.", ""},
+ {"cassandra", "Cassandra", "The stack runs Postgres only.", ""},
+ {"docs", "Docs site", "The docs site isn't part of the compose stack.", ""},
+ {"dev", "Tests and development", "Only tests and development use these.", ""},
+}
+
+func envTopSection(id string) string {
+ if slices.ContainsFunc(envInternalGroups, func(g envSection) bool { return g.id == id }) {
+ return envInternalSection
+ }
+ return id
+}
+
+type envVar struct {
+ name string
+ section string
+ help string
+}
+
+type envDoc struct {
+ envVar
+ text string
+ note string
+ key *settings.Key
+ setting string
+ defaults []envDefault
+ value string
+ active bool
+ secret bool
+ bundled bool
+}
+
+type envDefault struct {
+ value string
+ files []string
+}
+
+func (d envDefault) String() string {
+ if len(d.files) == 0 {
+ return d.value
+ }
+ return d.value + " with " + orList(d.files)
+}
+
+func orList(items []string) string {
+ if len(items) < 2 {
+ return strings.Join(items, "")
+ }
+ return strings.Join(items[:len(items)-1], ", ") + " or " + items[len(items)-1]
+}
+
+type envDocList []envDoc
+
+func (l envDocList) in(section string) []envDoc {
+ var out []envDoc
+ for _, d := range l {
+ if d.section == section && d.bundled {
+ out = append(out, d)
+ }
+ }
+ return out
+}
+
+func (l envDocList) get(name string) envDoc {
+ for _, d := range l {
+ if d.name == name {
+ return d
+ }
+ }
+ return envDoc{}
+}
+
+func envDocs() envDocList {
+ set := stack.Embedded()
+ defaults := newEnvDefaults(set)
+ named := map[string]settings.Key{}
+ for _, k := range settings.Named() {
+ for _, v := range k.Vars {
+ named[v] = k
+ }
+ }
+ required := map[string]secrets.Spec{}
+ for _, s := range secrets.Required {
+ required[s.Key] = s
+ }
+ sized := map[string]bool{}
+ for _, v := range stack.SizingKeys() {
+ sized[v] = true
+ }
+ for _, p := range set.Profiles {
+ for v := range p {
+ sized[v] = true
+ }
+ }
+ derived := settings.DerivedVars()
+ literals := composeLiterals(set)
+
+ out := make(envDocList, 0, len(envVars))
+ for _, v := range envVars {
+ d := envDoc{envVar: v, defaults: defaults.lines(v.name), bundled: !slices.Contains(legacyImageVars, v.name) && !slices.Contains(envUnbundledSections, envTopSection(v.section))}
+ d.active = v.section == envRequiredSection || v.section == envAdminSection || v.section == envSecretsSection
+ d.secret = slices.Contains(envSecretVars, v.name)
+ notes := []string{v.help}
+ spec, isRequired := required[v.name]
+ switch k, ok := named[v.name]; {
+ case ok:
+ d.key, d.setting = &k, k.Name
+ switch {
+ case v.help == "":
+ notes[0] = k.Help + "."
+ case k.Vars[0] == v.name:
+ notes = []string{k.Help + ".", v.help}
+ }
+ case settings.Twins[v.name] != "" && !slices.Contains(envNoRexctlVars, v.name):
+ d.setting = settings.Twins[v.name]
+ case settings.Twins[v.name] != "":
+ case !isRequired && d.bundled && v.name != SetupTokenVar && v.name != stack.SettingsLoadedVar && !strings.HasPrefix(v.name, "COMPOSE_") && !slices.Contains(envNoRexctlVars, v.name):
+ d.setting = v.name
+ }
+ switch {
+ case isRequired && spec.Kind == secrets.KindFixed:
+ d.value = spec.Fixed
+ case isRequired && spec.Stateful && spec.Kind == secrets.KindVAPID:
+ d.note = "Set the pair once before the first start and never change it."
+ case isRequired && slices.Contains(envRotatableVars, v.name):
+ d.note = "With Docker Compose, a new value applies the next time it starts the services."
+ case isRequired && spec.Stateful:
+ d.note = "Set it once before the first start and never change it."
+ case isRequired:
+ case v.name == stack.SettingsLoadedVar:
+ d.value = "true"
+ case envSizedNotes[v.name] != "":
+ d.note = envSizedNotes[v.name]
+ case sized[v.name]:
+ d.note = "rexctl sizes this."
+ case slices.Contains(derived, v.name):
+ d.note = "rexctl sets this from your domain and edge settings unless you set it."
+ case v.section == envStackSection && literals[v.name] != "":
+ d.note = "Docker Compose sets it to `" + literals[v.name] + "`."
+ }
+ d.text = strings.Join(notes, " ")
+ out = append(out, d)
+ }
+ return out
+}
+
+var envUnbundledSections = []string{envRexctlSection, envStackSection, envInternalSection}
+
+var envRotatableVars = []string{"FLUXER_S3_SECRET_KEY", "LIVEKIT_API_SECRET"}
+
+var envNoRexctlVars = []string{"FLUXER_CADDY_SITE_ADDRESS", "FLUXER_AUTH_BLUESKY_CLIENT_URI"}
+
+var envSizedNotes = map[string]string{
+ "FLUXER_EDGE_PROTOCOLS": "On a machine with little memory, rexctl turns off HTTP/3 unless you set it.",
+}
+
+func composeValues(set *stack.Set) map[string][]string {
+ data, err := stack.ReadFile(set, stack.ComposeFile)
+ if err != nil {
+ return nil
+ }
+ var file struct {
+ Services map[string]struct {
+ Environment map[string]any `yaml:"environment"`
+ } `yaml:"services"`
+ }
+ if err := yaml.Unmarshal(data, &file); err != nil {
+ return nil
+ }
+ out := map[string][]string{}
+ for _, svc := range file.Services {
+ for k, v := range svc.Environment {
+ if s := fmt.Sprint(v); !slices.Contains(out[k], s) {
+ out[k] = append(out[k], s)
+ }
+ }
+ }
+ return out
+}
+
+func composeLiterals(set *stack.Set) map[string]string {
+ out := map[string]string{}
+ for k, vs := range composeValues(set) {
+ if len(vs) == 1 && vs[0] != "" && !strings.ContainsAny(vs[0], "$\n") {
+ out[k] = vs[0]
+ }
+ }
+ return out
+}
+
+const envPageHeader = `---
+# SPDX-License-Identifier: AGPL-3.0-or-later
+title: Environment variables
+description: Every environment variable Fluxer and the Docker Compose bundle use.
+sidebar:
+ label: Environment variables
+---
+
+rexctl generates this page and the ` + "`.env.example`" + ` in the compose bundle of each release. Use the ` + "`.env.example`" + ` that came with your release. An entry for a setting rexctl manages ends with the ` + "`rexctl config set`" + ` command that changes it.
+`
+
+var (
+ envNamePattern = regexp.MustCompile(`\b[A-Z][A-Z0-9]*_[A-Z0-9_]*[A-Z0-9]\b(=\S+)?`)
+ envCodePattern = regexp.MustCompile(`\b(?:https?|wss?|s3|postgres)://[^\s,]*[^\s,.)]|(?:^|[\s(])\.env(?:\.example)?\b|\b[\w.-]+\.(?:yml|json|html)\b|(?:^|[\s(])/[\w./:-]*[\w/]`)
+)
+
+func EnvPage() string {
+ docs := envDocs()
+ var b strings.Builder
+ b.WriteString(envPageHeader)
+ for _, s := range envSections {
+ var entries []envDoc
+ for _, d := range docs {
+ if d.section == s.id {
+ entries = append(entries, d)
+ }
+ }
+ if s.id == envSecretsSection {
+ entries = envSecretOrder(entries)
+ }
+ if len(entries) == 0 && s.id != envFilesSection {
+ continue
+ }
+ fmt.Fprintf(&b, "\n## %s\n", s.title)
+ if intro := strings.TrimSpace(envMarkdown(s.intro) + " " + s.page); intro != "" {
+ b.WriteString("\n" + intro + "\n")
+ }
+ switch s.id {
+ case envComposeSection:
+ b.WriteString("\n")
+ for _, o := range envOverlays {
+ fmt.Fprintf(&b, "- `%s` %s\n", stack.OverlayFiles[o.overlay], o.use)
+ }
+ case envFilesSection:
+ b.WriteString("\n" + envMarkdown("These variables don't take the file form. Set them as plain values.") + "\n\n")
+ for _, name := range envNoFileVars {
+ fmt.Fprintf(&b, "- `%s`\n", name)
+ }
+ b.WriteString("\n" + envMarkdown(envNoFileNote) + "\n")
+ }
+ envPageEntries(&b, docs, entries, "###")
+ if s.id != envInternalSection {
+ continue
+ }
+ for _, g := range envInternalGroups {
+ fmt.Fprintf(&b, "\n### %s\n\n%s\n", g.title, envMarkdown(g.intro))
+ var group []envDoc
+ for _, d := range docs {
+ if d.section == g.id {
+ group = append(group, d)
+ }
+ }
+ envPageEntries(&b, docs, group, "####")
+ }
+ }
+ return b.String()
+}
+
+func envPageEntries(b *strings.Builder, docs envDocList, entries []envDoc, heading string) {
+ for _, d := range entries {
+ if envLowerTwin(docs, d.name) {
+ continue
+ }
+ if lower := docs.get(strings.ToLower(d.name)); lower.name != "" && lower.name != d.name {
+ d.text = strings.TrimSpace(d.text + " " + lower.text + " " + lower.note)
+ }
+ fmt.Fprintf(b, "\n%s `%s`\n\n%s\n", heading, d.name, envPageText(d))
+ }
+}
+
+const envNoFileNote = "The file form doesn't work for the docs site variables either, or for variables that system libraries and runtimes look up, such as NODE_OPTIONS, MALLOC_ARENA_MAX, TOKIO_WORKER_THREADS, HTTP_PROXY, SSL_CERT_FILE and VIPS_CONCURRENCY. The bundled third-party images follow their own rules."
+
+func envLowerTwin(docs envDocList, name string) bool {
+ upper := strings.ToUpper(name)
+ return upper != name && docs.get(upper).name != ""
+}
+
+func envPageDefault(d envDoc) string {
+ switch {
+ case d.value != "" && d.setting != "":
+ return "The default is `" + d.value + "`."
+ case d.value != "" && !strings.Contains(d.text, "`"+d.value+"`"):
+ return "The value is `" + d.value + "`."
+ case d.value != "":
+ return ""
+ }
+ if len(d.defaults) == 0 {
+ return ""
+ }
+ lines := make([]string, len(d.defaults))
+ for i, def := range d.defaults {
+ lines[i] = "`" + def.value + "`"
+ if len(def.files) > 0 {
+ files := make([]string, len(def.files))
+ for j, f := range def.files {
+ files[j] = "`" + f + "`"
+ }
+ lines[i] += " with " + orList(files)
+ }
+ if size := envByteSize(d.name, def.value); size != "" {
+ lines[i] += ", which is " + size
+ }
+ }
+ return "The default is " + strings.Join(lines, ", or ") + "."
+}
+
+func envByteSize(name, value string) string {
+ n, err := strconv.ParseInt(value, 10, 64)
+ if !strings.HasSuffix(name, "_BYTES") || err != nil || n < 1024 {
+ return ""
+ }
+ for _, u := range []struct {
+ unit string
+ size int64
+ }{{"GiB", 1 << 30}, {"MiB", 1 << 20}, {"KiB", 1 << 10}} {
+ if n%u.size == 0 {
+ return strconv.FormatInt(n/u.size, 10) + " " + u.unit
+ }
+ }
+ return ""
+}
+
+func envSecretOrder(entries []envDoc) []envDoc {
+ var out []envDoc
+ for _, g := range secretGroups() {
+ for _, s := range g.keys {
+ if i := slices.IndexFunc(entries, func(d envDoc) bool { return d.name == s.Key }); i >= 0 {
+ out = append(out, entries[i])
+ }
+ }
+ }
+ for _, d := range entries {
+ if !slices.ContainsFunc(out, func(o envDoc) bool { return o.name == d.name }) {
+ out = append(out, d)
+ }
+ }
+ return out
+}
+
+func envSecretNote(d envDoc) string {
+ if !d.secret || strings.Contains(d.text, envKeepSecret) {
+ return ""
+ }
+ return "Keep it secret."
+}
+
+const envKeepSecret = "Keep the value secret"
+
+func envPageText(d envDoc) string {
+ text := envMarkdown(d.text)
+ if d.key != nil && envExamples[d.key.Name] != "" {
+ first, rest, _ := strings.Cut(text, ". ")
+ text = strings.TrimSpace(strings.TrimSuffix(first, ".") + ", such as `" + envExamples[d.key.Name] + "`. " + rest)
+ }
+ if def := envPageDefault(d); def != "" {
+ text += " " + def
+ }
+ if d.note != "" {
+ text += " " + envMarkdown(d.note)
+ }
+ if note := envSecretNote(d); note != "" {
+ text += " " + note
+ }
+ if d.setting != "" {
+ text += " With rexctl, use `rexctl config set " + d.setting + "`."
+ }
+ return text
+}
+
+func envMarkdown(text string) string {
+ text = outsideCode(text, envNamePattern, func(name string) string {
+ if code, ok := strings.CutSuffix(name, "."); ok {
+ return "`" + code + "`."
+ }
+ return "`" + name + "`"
+ })
+ text = outsideCode(text, envCodePattern, func(m string) string {
+ lead := strings.TrimLeft(m, " \t\n(")
+ return m[:len(m)-len(lead)] + "`" + lead + "`"
+ })
+ return mdx.Prose(text)
+}
+
+func outsideCode(text string, re *regexp.Regexp, fn func(string) string) string {
+ parts := strings.Split(text, "`")
+ for i := 0; i < len(parts); i += 2 {
+ parts[i] = re.ReplaceAllStringFunc(parts[i], fn)
+ }
+ return strings.Join(parts, "`")
+}
diff --git a/fluxer_rexctl/internal/instance/envvars.go b/fluxer_rexctl/internal/instance/envvars.go
new file mode 100644
index 000000000..3c479ca25
--- /dev/null
+++ b/fluxer_rexctl/internal/instance/envvars.go
@@ -0,0 +1,684 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package instance
+
+var envSecretVars = []string{
+ "FLUXER_SETUP_TOKEN", "POSTGRES_PASSWORD", "MEILI_MASTER_KEY", "FLUXER_S3_SECRET_KEY", "LIVEKIT_API_SECRET",
+ "FLUXER_SUDO_MODE_SECRET", "FLUXER_CONNECTION_INITIATION_SECRET", "FLUXER_PROFILE_PSEUDONYM_SECRET", "FLUXER_VAPID_PRIVATE_KEY",
+ "FLUXER_GATEWAY_RPC_AUTH_TOKEN", "FLUXER_MEDIA_PROXY_SECRET_KEY", "FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64",
+ "FLUXER_ADMIN_SECRET_KEY_BASE", "FLUXER_ADMIN_OAUTH_CLIENT_SECRET", "FLUXER_ERLANG_COOKIE", "FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64",
+ "FLUXER_API_DONATION_PROXY_KEY", "FLUXER_API_TRUSTED_CALLERS", "FLUXER_CACHE_PURGE_HTTP_TOKEN", "FLUXER_CACHE_PURGE_CONTROLLER_TOKEN",
+ "FLUXER_NATS_AUTH_TOKEN", "FLUXER_SEARCH_PASSWORD", "FLUXER_AUTH_BLUESKY_KEYS", "FLUXER_EMAIL_WEBHOOK_SECRET",
+ "FLUXER_EMAIL_SMTP_PASSWORD", "FLUXER_EMAIL_FALLBACK_SMTP_PASSWORD", "FLUXER_PUSH_APNS_PRIVATE_KEY", "FLUXER_PUSH_FCM_PRIVATE_KEY",
+ "FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64", "FLUXER_STRIPE_SECRET_KEY", "FLUXER_STRIPE_WEBHOOK_SECRET",
+ "FLUXER_KLIPY_API_KEY", "FLUXER_YOUTUBE_API_KEY", "FLUXER_S3_SESSION_TOKEN", "FLUXER_POSTGRES_URL",
+}
+
+var envNoFileVars = []string{
+ "BUILD_VERSION",
+ "FLUXER_API_PORT",
+ "FLUXER_CLIENT_IP_HEADER_NAME",
+ "FLUXER_DISABLE_RATE_LIMITS",
+ "FLUXER_ENV",
+ "FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS",
+ "FLUXER_ERLANG_DIRTY_IO_SCHEDULERS",
+ "FLUXER_ERLANG_DIST_PORT",
+ "FLUXER_ERLANG_NODE_NAME",
+ "FLUXER_ERLANG_NODE_NAME_PREFIX",
+ "FLUXER_ERLANG_SCHEDULERS",
+ "FLUXER_ERLANG_SCHEDULERS_MAX",
+ "FLUXER_ERLANG_SCHEDULERS_MIN",
+ "FLUXER_OPERATOR_SOCKET",
+ "HOSTNAME",
+ "LOG_LEVEL",
+ "POD_NAME",
+ "RELX_REPLACE_OS_VARS",
+}
+
+var envVars = []envVar{
+ {"FLUXER_SETTINGS_LOADED", "required", "Leave it set to `true`. Docker Compose won't start without it."},
+ {"FLUXER_DOMAIN", "required", ""},
+ {"FLUXER_SETUP_TOKEN", "admin", "The token the setup wizard asks for before it creates the first admin account. Use 32 to 256 printable characters, such as the output of `openssl rand -hex 32`. When it's empty, the API generates one on its first start and writes it to its log once. With Docker Compose, `docker compose logs api` shows it."},
+ {"POSTGRES_PASSWORD", "secrets", "The Postgres password. Docker Compose passes it to Fluxer as FLUXER_POSTGRES_PASSWORD and to the bundled Postgres, which sets it only on its first start with an empty data directory."},
+ {"MEILI_MASTER_KEY", "secrets", "The Meilisearch master key. Docker Compose passes it to the bundled Meilisearch and to Fluxer as FLUXER_SEARCH_API_KEY."},
+ {"FLUXER_S3_ACCESS_KEY", "secrets", "Keep the default for the bundled object store, or set the access key of your own store."},
+ {"FLUXER_S3_SECRET_KEY", "secrets", "For your own object store, set its secret key, and update it when you rotate the key at the store."},
+ {"LIVEKIT_API_KEY", "secrets", "The LiveKit API key. Docker Compose passes it to the bundled LiveKit as its API key and webhook key, and to Fluxer as FLUXER_LIVEKIT_API_KEY."},
+ {"LIVEKIT_API_SECRET", "secrets", "The LiveKit API secret that goes with LIVEKIT_API_KEY, at least 32 characters. Docker Compose passes it to the bundled LiveKit and to Fluxer as FLUXER_LIVEKIT_API_SECRET."},
+ {"FLUXER_SUDO_MODE_SECRET", "secrets", "The key Fluxer signs sudo mode tokens with and derives a few other internal signing keys from. Changing it ends every active sudo mode session, voids codes already emailed and makes every remembered device count as new."},
+ {"FLUXER_CONNECTION_INITIATION_SECRET", "secrets", "The key that signs connection initiation tokens, data export links and admin download links. Changing it breaks tokens not yet verified and download links already sent."},
+ {"FLUXER_PROFILE_PSEUDONYM_SECRET", "secrets", "The key Fluxer uses to derive the placeholder name and tag that others see while an account's profile is hidden. The api, worker and users services must have the same value. Changing it gives every hidden profile a new placeholder."},
+ {"FLUXER_VAPID_PUBLIC_KEY", "secrets", "The public half of the VAPID key pair for browser push notifications, as unpadded base64url of the 65-byte uncompressed P-256 point. The value is 87 characters long."},
+ {"FLUXER_VAPID_PRIVATE_KEY", "secrets", "The private half of the VAPID key pair for browser push notifications, as unpadded base64url of the 32-byte P-256 private key. The value is 43 characters long. It must match FLUXER_VAPID_PUBLIC_KEY."},
+ {"FLUXER_GATEWAY_RPC_AUTH_TOKEN", "secrets", "The token the api, worker, gateway and push services use to authenticate internal calls to each other. Every service must have the same value."},
+ {"FLUXER_MEDIA_PROXY_SECRET_KEY", "secrets", "The key that signs media proxy URLs. The api, worker, media-proxy, gifs and unfurl services must have the same value."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64", "secrets", "The key that signs upload relay tokens, as standard base64 that decodes to at least 32 bytes. The api, worker and media-proxy services must have the same value."},
+ {"FLUXER_ADMIN_SECRET_KEY_BASE", "secrets", "The key the admin panel signs its sessions, CSRF tokens and OAuth state with. Changing it signs everyone out of the admin panel."},
+ {"FLUXER_ADMIN_OAUTH_CLIENT_SECRET", "secrets", "The OAuth2 client secret the admin panel uses to sign in through the API. The api and admin services must have the same value."},
+ {"FLUXER_ERLANG_COOKIE", "secrets", "The shared secret for Erlang distribution in the gateway. Anyone who can connect to the distribution port with this value can run code in the gateway. Keep the value secret and the port private."},
+ {"FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64", "secrets", "The RSA private key the unfurl service signs ActivityPub requests with when it builds link previews for fediverse posts. Use base64 DER in PKCS#8 or PKCS#1 form. When it's empty, the unfurl service makes those requests unsigned."},
+ {"COMPOSE_FILE", "compose", "The compose files Docker Compose uses, with docker-compose.yml first. Separate them with colons, or with semicolons on Windows. rexctl takeover uses the value in your shell first and then the one in .env. Leave it commented out to use docker-compose.yml and, if there is one, docker-compose.override.yml. An empty value stops Docker Compose from finding any file."},
+ {"COMPOSE_PATH_SEPARATOR", "compose", "The separator between the files in COMPOSE_FILE. When it's empty, Docker Compose and rexctl use a colon, or a semicolon on Windows."},
+ {"COMPOSE_PROJECT_NAME", "compose", "The Docker Compose project name, which Docker Compose puts in front of every container and volume name. When it's empty, Docker Compose uses `fluxer` from docker-compose.yml. rexctl eject writes the project name rexctl ran the instance under. Keep that value, or Docker Compose starts new containers with new, empty volumes. rexctl takeover uses the value in your shell first and then the one in .env."},
+ {"FLUXER_PUBLIC_SCHEME", "address", "The scheme browsers use to open the instance. Use `https` or `http`. Fluxer builds public addresses from it and FLUXER_DOMAIN when FLUXER_PUBLIC_ORIGIN is empty. With `http`, also set FLUXER_PUBLIC_PORT, usually to `80`. Without rexctl, the edge also uses it for its default site address."},
+ {"FLUXER_PUBLIC_ORIGIN", "address", "The origin browsers use to open the instance, as a scheme, host and optional port with no path or trailing slash, such as https://chat.example.com:8443. When it's set, the default public addresses of the api, worker and other services come from it. Keep FLUXER_DOMAIN set to the same host. The edge site address, the passkey relying party ID, the default sender and VAPID contact addresses and the gateway still use FLUXER_DOMAIN."},
+ {"FLUXER_APP_ORIGIN_ALIASES", "address", "More web app origins, separated by commas, for an instance that serves the web app on more than one hostname. Each must be an http or https origin. The API allows each one through CORS and accepts it for sign-in handoff. For passkeys on these origins, list them and the web app origin in FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS."},
+ {"FLUXER_API_ENDPOINT", "address", "The public base URL of the API. When it's empty, Fluxer uses the public origin followed by /api."},
+ {"FLUXER_API_CLIENT_ENDPOINT", "address", "The API base URL Fluxer hands to clients. When it's empty, Fluxer uses the public origin followed by /api."},
+ {"FLUXER_APP_ENDPOINT", "address", "The address of the web app, which Fluxer allows through CORS and uses in links. When it's empty, Fluxer uses the public origin."},
+ {"FLUXER_GATEWAY_ENDPOINT", "address", "The public WebSocket URL of the gateway, starting with `ws` or `wss`. When it's empty, Fluxer uses `wss` on the public host followed by /gateway, or `ws` when the public scheme is `http`."},
+ {"FLUXER_MEDIA_ENDPOINT", "address", "The public address of the media proxy. When it's empty, Fluxer uses the public origin followed by /media."},
+ {"FLUXER_MEDIA_PROXY_PUBLIC_ENDPOINT", "address", "The public media proxy address that the gifs, unfurl and media-proxy services use when they build media links. When it's empty, they use FLUXER_MEDIA_ENDPOINT, or the public origin followed by /media."},
+ {"FLUXER_STATIC_CDN_ENDPOINT", "address", "The origin Fluxer serves static assets such as the favicon and app icons from. When it's empty, the api and worker services derive it from FLUXER_STATIC_CDN_DOMAIN or the public origin, and the admin and gateway services use the public origin. The app-proxy service uses it only when it's set, and serves its own copies of the web app files otherwise."},
+ {"FLUXER_ADMIN_ENDPOINT", "address", "The public address of the admin panel. When it's empty, Fluxer uses the public origin followed by FLUXER_ADMIN_BASE_PATH. The admin sign-in redirect is this address followed by /oauth2_callback, and the admin panel uses secure cookies when the address starts with `https`."},
+ {"FLUXER_MARKETING_ENDPOINT", "address", "The address of the marketing site, which Fluxer allows through CORS and uses in some links. When it's empty, Fluxer uses the public origin."},
+ {"FLUXER_INVITE_ENDPOINT", "address", "The base URL of invite links. When it's empty, Fluxer uses FLUXER_INVITE_DOMAIN or the public host, followed by /invite."},
+ {"FLUXER_GIFT_ENDPOINT", "address", "The base URL of gift links. When it's empty, Fluxer uses FLUXER_GIFT_DOMAIN or the public host, followed by /gift."},
+ {"FLUXER_STATIC_CDN_DOMAIN", "address", "A separate hostname for static assets, with no scheme, port or path. When it's set, the default static address of the api and worker services is `https://` followed by this host."},
+ {"FLUXER_INVITE_DOMAIN", "address", "A separate hostname for invite links, with no scheme, port or path. When it's set, the default invite address uses this host."},
+ {"FLUXER_GIFT_DOMAIN", "address", "A separate hostname for gift links, with no scheme, port or path. When it's set, the default gift address uses this host."},
+ {"FLUXER_PUBLIC_PORT", "edge", ""},
+ {"FLUXER_HTTP_PORT", "edge", "docker-compose.proxy.yml and tunnel.compose.yml ignore it and use FLUXER_EDGE_BIND."},
+ {"FLUXER_HTTPS_PORT", "edge", "If people connect to this port directly, set FLUXER_PUBLIC_PORT to the same port. docker-compose.proxy.yml and tunnel.compose.yml ignore it and use FLUXER_EDGE_BIND."},
+ {"FLUXER_EDGE_BIND", "edge", ""},
+ {"FLUXER_ADMIN_BASE_PATH", "edge", "The path the admin panel is served under, with a leading slash and no trailing slash, such as /panel. The edge serves the admin panel under this path, the admin service builds its links with it, and the default FLUXER_ADMIN_ENDPOINT follows it."},
+ {"FLUXER_EDGE_SITE_ADDRESS", "edge", "The site address the edge serves in its Caddyfile, including the scheme. When it's empty, Docker Compose uses FLUXER_CADDY_SITE_ADDRESS, or FLUXER_PUBLIC_SCHEME followed by `://` and FLUXER_DOMAIN. docker-compose.proxy.yml and tunnel.compose.yml set their own value."},
+ {"FLUXER_CADDY_SITE_ADDRESS", "edge", "The old name for FLUXER_EDGE_SITE_ADDRESS. Docker Compose uses it only without rexctl and when FLUXER_EDGE_SITE_ADDRESS is empty. rexctl takeover and rexctl upgrade move it to FLUXER_EDGE_SITE_ADDRESS."},
+ {"FLUXER_EDGE_TRUSTED_PROXIES", "edge", ""},
+ {"FLUXER_EDGE_ENCODE", "edge", "The response compression the edge offers, written as the arguments of the Caddy encode directive, such as `gzip` alone."},
+ {"FLUXER_EDGE_PROTOCOLS", "edge", "The HTTP versions the edge serves, as the arguments of the Caddy protocols option, such as `h1 h2` to turn off HTTP/3."},
+ {"FLUXER_EDGE_GLOBAL_OPTIONS", "edge", "Extra Caddy global options on one line, added to the global block of the edge Caddyfile, such as `email [email protected]` for the certificate account. An empty value adds nothing."},
+ {"FLUXER_EDGE_TLS", "edge", "The arguments of a Caddy tls directive for the edge, such as `internal` for a certificate from Caddy's own local CA, or a certificate and key path under /certs. When it's empty, the edge adds no tls line and Caddy gets certificates on its own. docker-compose.proxy.yml and tunnel.compose.yml ignore it."},
+ {"FLUXER_LIVEKIT_ENABLED", "voice", "Whether voice and video calls are turned on. Use `true` or `false`."},
+ {"FLUXER_LIVEKIT_INTERNAL_URL", "voice", "The URL the API uses for the LiveKit control API of the bundled LiveKit, the first server in the default voice region. Servers added in the admin panel use their own address."},
+ {"FLUXER_LIVEKIT_DEFAULT_REGION", "voice", "The voice region Fluxer creates when no voice regions exist yet, as a JSON object with `id`, `name`, `emoji`, `latitude` and `longitude`."},
+ {"FLUXER_LIVEKIT_URL", "voice", "The URL browsers and apps use for voice signalling. When it's empty, Fluxer uses the public origin, or FLUXER_PUBLIC_SCHEME, FLUXER_DOMAIN and FLUXER_PUBLIC_PORT, followed by /livekit. Set it only when LiveKit runs on another host."},
+ {"FLUXER_VOICE_P2P_STUN_URLS", "voice", "STUN URLs for peer-to-peer calls, separated by commas, such as `stun:stun.example.com:3478`. When it's empty, peer-to-peer calls work only between devices with a direct route to each other, such as on one local network."},
+ {"FLUXER_LIVEKIT_TCP_PORT", "voice", ""},
+ {"FLUXER_LIVEKIT_UDP_PORT", "voice", ""},
+ {"FLUXER_LIVEKIT_NODE_IP", "voice", "Set FLUXER_LIVEKIT_USE_EXTERNAL_IP to `false` with it."},
+ {"FLUXER_LIVEKIT_USE_EXTERNAL_IP", "voice", "Whether LiveKit finds its public IP address through STUN. Use `true` or `false`. Set it to `false` when you set FLUXER_LIVEKIT_NODE_IP."},
+ {"FLUXER_LIVEKIT_STUN_PRIMARY", "voice", "The first STUN host LiveKit asks to find its public IP address, as `host:port`. Point it at another STUN host to avoid contacting Google."},
+ {"FLUXER_LIVEKIT_STUN_SECONDARY", "voice", "The second STUN host LiveKit asks to find its public IP address, as `host:port`."},
+ {"FLUXER_S3_ENDPOINT", "storage", ""},
+ {"FLUXER_S3_PUBLIC_ENDPOINT", "storage", "When it's empty, the api and worker use FLUXER_S3_ENDPOINT, and the web app doesn't let browsers upload to the object store."},
+ {"FLUXER_S3_REGION", "storage", ""},
+ {"FLUXER_S3_FORCE_PATH_STYLE", "storage", "Use `true` or `false`."},
+ {"FLUXER_S3_SESSION_TOKEN", "storage", "A temporary S3 session token the media proxy sends with its object store requests. When it's empty, the media proxy sends none."},
+ {"FLUXER_S3_BUCKET_CDN", "storage", "The bucket for processed media such as avatars and other served assets. The bundled object store creates it, and an outside store needs it to exist already."},
+ {"FLUXER_S3_BUCKET_UPLOADS", "storage", "The bucket for raw uploads. The bundled object store creates it, and an outside store needs it to exist already."},
+ {"FLUXER_S3_BUCKET_REPORTS", "storage", "The bucket for abuse report evidence. The bundled object store creates it, and an outside store needs it to exist already."},
+ {"FLUXER_S3_BUCKET_HARVESTS", "storage", "The bucket for data export archives. The bundled object store creates it, and an outside store needs it to exist already."},
+ {"FLUXER_S3_READ_ENDPOINT", "storage", "A separate http or https address, with no credentials, that the media proxy fetches objects in FLUXER_S3_READ_BUCKET from. When it's empty, the media proxy fetches everything through FLUXER_S3_ENDPOINT."},
+ {"FLUXER_S3_READ_BUCKET", "storage", "The bucket the media proxy fetches through FLUXER_S3_READ_ENDPOINT. When it's empty, the media proxy uses FLUXER_S3_BUCKET_CDN."},
+ {"FLUXER_S3_READ_BUCKET_STYLE", "storage", "How the bucket appears in URLs to FLUXER_S3_READ_ENDPOINT. Use `path`, `virtual` or `root`. When it's empty, the media proxy uses `path` when FLUXER_S3_FORCE_PATH_STYLE is on and `virtual` when it's off."},
+ {"FLUXER_S3_READ_SIGNED", "storage", "Whether the media proxy signs its requests to FLUXER_S3_READ_ENDPOINT. Use `true` or `false`. Use `false` only for a bucket that allows anonymous downloads."},
+ {"FLUXER_API_PRESIGNED_ATTACHMENT_UPLOADS_ENABLED", "storage", "Whether the API hands clients upload URLs that let them upload attachments before they send the message. Use `true` or `false`."},
+ {"FLUXER_API_PRESIGNED_HARVEST_DOWNLOADS_ENABLED", "storage", "Whether data export and admin download links are presigned URLs to the object store. Use `true` or `false`. With `false`, the API serves those downloads itself. Turn it on only once browsers can connect to FLUXER_S3_PUBLIC_ENDPOINT."},
+ {"FLUXER_API_STORAGE_CHANGE_FEED_ENABLED", "storage", "Whether the api and worker services publish a record of each object store write and delete they make to a NATS JetStream stream. Uploads written by the media proxy relay or sent straight to the store by clients are not in it. Use `true` or `false`. When it's empty, the feed is off."},
+ {"FLUXER_API_STORAGE_CHANGE_FEED_STREAM", "storage", "The JetStream stream the storage change feed publishes to, in letters, digits, underscores or hyphens. When it's empty, Fluxer uses STORAGE_CHANGES."},
+ {"FLUXER_API_STORAGE_CHANGE_FEED_SKIP_BUCKETS", "storage", "Buckets the storage change feed leaves out, separated by commas, or `none` to leave out no bucket. When it's empty, the feed leaves out the uploads bucket."},
+ {"FLUXER_SEAWEEDFS_INIT_ATTEMPTS", "storage", "How many rounds, about two seconds apart, the bundled object store's setup job tries to create the buckets and set up access before it gives up."},
+ {"FLUXER_SEAWEEDFS_UPLOADS_TTL", "storage", "How long the bundled object store keeps files in the uploads bucket before it deletes them, such as `1d` or `12h`. Use `off` to keep them. A new value applies to uploads written after the next start, and files already stored keep their old expiry."},
+ {"FLUXER_POSTGRES_HOST", "database", "The hostname or address of the Postgres database. Set it when Postgres runs outside the stack."},
+ {"FLUXER_POSTGRES_PORT", "database", "The Postgres port, from 1 to 65535. When it's empty, Fluxer uses `5432`."},
+ {"FLUXER_POSTGRES_DATABASE", "database", "The Postgres database name. When it's empty, Fluxer uses `fluxer`. The bundled Postgres creates this database only on its first start with an empty data directory."},
+ {"FLUXER_POSTGRES_USERNAME", "database", "The Postgres role Fluxer connects as. When it's empty, Fluxer uses `fluxer`. The bundled Postgres creates this role only on its first start with an empty data directory."},
+ {"FLUXER_POSTGRES_URL", "database", "A full Postgres connection URL, such as postgres://fluxer:[email protected]:5432/fluxer. When it's set, Fluxer connects with it and ignores the host, port, database, username and password settings. An `sslmode` in the URL can turn TLS on when FLUXER_POSTGRES_SSL isn't `true`. For the api and worker, it also wins over FLUXER_POSTGRES_SSL."},
+ {"FLUXER_POSTGRES_SSL", "database", "Whether Fluxer connects to Postgres over TLS. Use `true` or `false`. When it isn't `true` and FLUXER_POSTGRES_URL has no `sslmode`, the api and worker follow `PGSSLMODE` and the other services connect without TLS."},
+ {"FLUXER_POSTGRES_SSL_CA", "database", "A CA certificate in PEM form that Fluxer trusts for the Postgres TLS connection, with `\\n` for line breaks. The Rust services use it whenever the connection uses TLS. The api and worker use it only when FLUXER_POSTGRES_SSL is `true` and FLUXER_POSTGRES_URL has no `sslmode`."},
+ {"FLUXER_POSTGRES_PREPARED_STATEMENTS", "database", "Whether Fluxer uses Postgres prepared statements. Use `true` or `false`. When it's empty, Fluxer uses them. Set it to `false` behind a transaction-pooling pooler such as PgBouncer."},
+ {"FLUXER_POSTGRES_KV_TABLE", "database", "The Postgres table for Fluxer's key-value data, a plain identifier of letters, digits and underscores that starts with a letter or an underscore. When it's empty, Fluxer uses `fluxer_kv`."},
+ {"FLUXER_KV_URL", "services", "The Valkey or Redis URL Fluxer uses for its cache, rate limits and other short-lived data."},
+ {"FLUXER_KV_MODE", "services", "How Fluxer connects to the key-value store. Use `standalone` for a single Valkey or Redis node or `cluster` for a Redis-compatible cluster. When it's empty, Fluxer uses `standalone`."},
+ {"FLUXER_NATS_URL", "services", "The core NATS address the api, worker and gateway services use, including for requests to the internal services and the push service. The internal services and JetStream follow it unless FLUXER_SVC_NATS_URL or FLUXER_NATS_JETSTREAM_URL is set."},
+ {"FLUXER_NATS_JETSTREAM_URL", "services", "The NATS address the api and worker services use for JetStream. When it's empty, they use FLUXER_NATS_URL."},
+ {"FLUXER_NATS_AUTH_TOKEN", "services", "The token every service sends when it connects to NATS. When it's empty, services connect without a token. The bundled NATS needs none."},
+ {"FLUXER_SVC_NATS_URL", "services", "The NATS address the internal services and the push service listen on. When it's empty, they use FLUXER_NATS_URL. The api and worker send their requests to these services over FLUXER_NATS_URL, and both addresses must lead to the same NATS cluster."},
+ {"FLUXER_SVC_MAX_CONCURRENT_REQUESTS", "services", "How many requests each internal service handles at once before it turns new ones away. When it's empty, the messages service uses `192`, the snowflakes service `320` and the others `64`. One value you set applies to all of them. rexctl takeover and rexctl upgrade remove a value under `320`."},
+ {"FLUXER_SVC_CACHE_MAX_ENTRIES", "services", "The most entries each internal service process keeps in its cache. When it's empty, the internal services use `100000`."},
+ {"FLUXER_SVC_CACHE_TTL_MS", "services", "How long the internal services keep cached entries, in milliseconds. When it's empty, they use `30000`."},
+ {"FLUXER_GIF_SERVICE_NATS_CLIENT_NAME", "services", "The client name the API gives its NATS connection to the gifs service, which shows in NATS monitoring. When it's empty, the API uses `fluxer-api-gifs`."},
+ {"FLUXER_GIF_SERVICE_TIMEOUT_MS", "services", "How long the API waits for gifs service requests such as searches, in milliseconds. When it's empty, the API uses `12000`. Recording a share uses FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS."},
+ {"FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS", "services", "How long the API waits for the gifs service to record that someone shared a GIF, in milliseconds. When it's empty, the API uses `3000`."},
+ {"FLUXER_USERS_SERVICE_NATS_CLIENT_NAME", "services", "The client name the API gives its NATS connection to the users service, which shows in NATS monitoring. When it's empty, the API uses `fluxer-api-users`."},
+ {"FLUXER_USERS_SERVICE_TIMEOUT_MS", "services", "How long the API waits for the users service, in milliseconds. When it's empty, the API uses `6000`."},
+ {"FLUXER_USERS_SERVICE_INFLIGHT_MAX_ENTRIES", "services", "How many user lookups the API tracks in flight, which lets requests for the same user share one call to the users service. Lookups past this limit go to the service on their own. When it's empty, the API uses `10000`."},
+ {"FLUXER_SNOWFLAKE_SERVICE_NATS_CLIENT_NAME", "services", "The client name the API gives its NATS connection to the snowflakes service, which shows in NATS monitoring. When it's empty, the API uses `fluxer-api-snowflakes`."},
+ {"FLUXER_SNOWFLAKE_SERVICE_BATCH_SIZE", "services", "How many IDs the API fetches from the snowflakes service at a time, from 1 to 512. When it's empty, the API uses `128`."},
+ {"FLUXER_SNOWFLAKE_SERVICE_LOW_WATERMARK", "services", "The number of unused IDs at which the API fetches a new batch, from 0 to one less than the batch size. When it's empty, the API uses `32`, or one less than the batch size if that's smaller."},
+ {"FLUXER_SNOWFLAKE_SERVICE_MAX_BUFFER_AGE_MS", "services", "How long the API keeps a fetched batch of IDs before it throws the rest away, in milliseconds from 1 to 60000. When it's empty, the API uses `5000`."},
+ {"FLUXER_SNOWFLAKE_SERVICE_REQUEST_TIMEOUT_MS", "services", "How long the API waits for the snowflakes service, in milliseconds from 1 to 60000. When it's empty, the API uses `6000`."},
+ {"FLUXER_SEARCH_ENGINE", "services", "Which search engine Fluxer uses. Use `meilisearch` or `elasticsearch`, or `none` to turn search off. With `elasticsearch`, set MEILI_MASTER_KEY to your Elasticsearch API key. Docker Compose passes it to Fluxer as FLUXER_SEARCH_API_KEY."},
+ {"FLUXER_SEARCH_URL", "services", "The address of the search engine."},
+ {"FLUXER_SEARCH_USERNAME", "services", "The basic auth username for Elasticsearch. Fluxer uses it only when FLUXER_SEARCH_API_KEY is empty. Docker Compose always sets that key from MEILI_MASTER_KEY. To use basic auth, set FLUXER_SEARCH_API_KEY to an empty value for the api and worker in a compose file of your own."},
+ {"FLUXER_SEARCH_PASSWORD", "services", "The basic auth password for Elasticsearch. Fluxer uses it only when FLUXER_SEARCH_API_KEY is empty, the same as FLUXER_SEARCH_USERNAME."},
+ {"FLUXER_SEARCH_TLS_REJECT_UNAUTHORIZED", "services", "Whether Fluxer checks the Elasticsearch TLS certificate. Use `true` or `false`. When it's empty, Fluxer checks it. Meilisearch connections don't use it."},
+ {"HTTP_PROXY", "network", "The api, worker and gateway don't use it."},
+ {"HTTPS_PROXY", "network", "The api, worker and gateway don't use it."},
+ {"NO_PROXY", "network", ""},
+ {"FLUXER_NODE_EXTRA_CA_CERTS", "network", "The path of a PEM file of CA certificates that the api and worker trust for outgoing TLS on top of Node's built-in ones. The path is inside their containers. A file you set replaces the system bundle. Add your CA to a copy of that bundle. The Rust services don't use it and take their CA certificates from SSL_CERT_FILE."},
+ {"FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES", "sso", "Use `true` or `false`. When it's empty, Fluxer uses `false`."},
+ {"FLUXER_PASSKEY_RP_ID", "sso", "The relying party ID that passkeys are tied to, a domain such as `chat.example.com`. When it's empty, Fluxer uses FLUXER_DOMAIN. Changing it makes every passkey registered against the old value stop working."},
+ {"FLUXER_PASSKEY_RP_NAME", "sso", "The title browsers show for Fluxer when someone creates or uses a passkey. When it's empty, browsers show `Fluxer`."},
+ {"FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS", "sso", "Every origin where passkeys work, separated by commas. When it's empty, Docker Compose uses FLUXER_PUBLIC_ORIGIN, or FLUXER_PUBLIC_SCHEME followed by `://` and FLUXER_DOMAIN. A list you set replaces it and must include the web app origin. Set a list when FLUXER_APP_ENDPOINT is on another origin. Each entry is an http or https origin or an Android app, written as `android:apk-key-hash:` followed by its signing certificate's SHA-256 hash in unpadded base64url."},
+ {"FLUXER_EMAIL_ENABLED", "email", "The older way to turn email on. Use FLUXER_EMAIL_DELIVERY."},
+ {"FLUXER_EMAIL_PROVIDER", "email", "The older way to pick the email transport, which takes `smtp` or `none`. Use FLUXER_EMAIL_DELIVERY."},
+ {"FLUXER_EMAIL_DELIVERY", "email", "How Fluxer sends email. Use `smtp` or `off`. When it's empty, FLUXER_EMAIL_ENABLED and FLUXER_EMAIL_PROVIDER decide, and email is off when those are empty too."},
+ {"FLUXER_EMAIL_FROM_EMAIL", "email", "The address Fluxer sends email from. When it's empty, Fluxer uses `noreply@` followed by FLUXER_DOMAIN."},
+ {"FLUXER_EMAIL_FROM_NAME", "email", "The sender name on email from Fluxer. When it's empty, Fluxer uses the product name of the instance."},
+ {"FLUXER_EMAIL_REPLY_TO_EMAIL", "email", "The address replies go to, sent as the Reply-To header on every email, such as `[email protected]`. When it's empty, Fluxer sends no Reply-To header."},
+ {"FLUXER_EMAIL_APP_BASE_URL", "email", "The base URL Fluxer uses for links in emails, an http or https URL with no credentials, query or fragment. When it's empty, Fluxer uses FLUXER_APP_ENDPOINT."},
+ {"FLUXER_EMAIL_WEBHOOK_SECRET", "email", "The base64 secret Fluxer uses to check the signature on bounce and complaint webhooks from the Sweego email service. When it's empty, Fluxer turns those webhooks away."},
+ {"FLUXER_EMAIL_SMTP_HOST", "email", "The hostname of your SMTP server."},
+ {"FLUXER_EMAIL_SMTP_PORT", "email", "The port of your SMTP server. When it's empty, Fluxer uses `587`."},
+ {"FLUXER_EMAIL_SMTP_USERNAME", "email", "The username Fluxer signs in to your SMTP server with."},
+ {"FLUXER_EMAIL_SMTP_PASSWORD", "email", "The password Fluxer signs in to your SMTP server with."},
+ {"FLUXER_EMAIL_SMTP_TLS_MODE", "email", "How the SMTP connection is encrypted. Use `implicit` for TLS from the start, usually on port 465, `starttls` to upgrade before signing in, usually on port 587, `opportunistic` to upgrade when the server offers it, or `none`. When it's empty, FLUXER_EMAIL_SMTP_SECURE decides. When both are empty, Fluxer uses `implicit` on port 465 and `starttls` on any other port."},
+ {"FLUXER_EMAIL_SMTP_SECURE", "email", "The older way to set FLUXER_EMAIL_SMTP_TLS_MODE, used only while that is empty. Use `true` for `implicit` on port 465 and `starttls` on any other port, or `false` for `opportunistic`."},
+ {"FLUXER_EMAIL_FALLBACK_DOMAINS", "email", "Recipient domains, separated by commas, whose mail goes through the fallback SMTP provider, such as `gmail.com,googlemail.com`. Only exact domain matches count, and `*` alone sends all mail through the fallback provider."},
+ {"FLUXER_EMAIL_FALLBACK_SMTP_HOST", "email", "The hostname of the fallback SMTP provider."},
+ {"FLUXER_EMAIL_FALLBACK_SMTP_PORT", "email", "The port of the fallback SMTP provider, from 1 to 65535. When it's empty, Fluxer uses `587`."},
+ {"FLUXER_EMAIL_FALLBACK_SMTP_USERNAME", "email", "The username Fluxer signs in to the fallback SMTP provider with. Fluxer doesn't start when a fallback provider is set without it."},
+ {"FLUXER_EMAIL_FALLBACK_SMTP_PASSWORD", "email", "The password Fluxer signs in to the fallback SMTP provider with. Fluxer doesn't start when a fallback provider is set without it."},
+ {"FLUXER_EMAIL_FALLBACK_SMTP_TLS_MODE", "email", "How Fluxer encrypts the connection to the fallback provider. Use `implicit`, `starttls`, `opportunistic` or `none`. When it's empty, Fluxer uses `implicit` on port 465 and `starttls` on any other port."},
+ {"FLUXER_EMAIL_FALLBACK_SMTP_HEADERS", "email", "Extra headers added to every message sent through the fallback provider, as a JSON object that maps header names to string values. Core headers such as From, To, Subject and Reply-To can't be set here."},
+ {"FLUXER_PUSH_APNS_ENABLED", "push", "Whether the push service sends mobile notifications through Apple Push Notification service with your own credentials. Use `true` or `false`. When it's empty, APNs is off."},
+ {"FLUXER_PUSH_APNS_TEAM_ID", "push", "Your Apple developer team ID."},
+ {"FLUXER_PUSH_APNS_KEY_ID", "push", "The ID of your APNs signing key, from your Apple developer account."},
+ {"FLUXER_PUSH_APNS_PRIVATE_KEY", "push", "Your APNs signing key as PEM text. Set this or FLUXER_PUSH_APNS_PRIVATE_KEY_PATH, and this one wins when both are set."},
+ {"FLUXER_PUSH_APNS_PRIVATE_KEY_PATH", "push", "The path to your APNs signing key file inside the push container."},
+ {"FLUXER_PUSH_APNS_APPS", "push", "The apps the push service sends to through APNs, as a JSON array of objects. Each object has an `app_id` and a `topic` with the app's bundle ID, and can have an `environment` of `production` or `development`. APNs sends fail for an app that isn't listed or has no topic. A push relay with APNs on doesn't start until this lists at least one app."},
+ {"FLUXER_PUSH_APNS_DEFAULT_ENVIRONMENT", "push", "The APNs environment the push service uses for a device that registered without one. Use `production` or `development`. When it's empty, it uses `production`."},
+ {"FLUXER_PUSH_FCM_ENABLED", "push", "Whether the push service sends mobile notifications through Firebase Cloud Messaging with your own credentials. Use `true` or `false`. When it's empty, FCM is off."},
+ {"FLUXER_PUSH_FCM_PROJECT_ID", "push", "Your Firebase project ID. When it's empty, the push service uses the one in FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH."},
+ {"FLUXER_PUSH_FCM_CLIENT_EMAIL", "push", "The client email of your Firebase service account. When it's empty, the push service uses the one in FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH."},
+ {"FLUXER_PUSH_FCM_PRIVATE_KEY", "push", "The private key of your Firebase service account as PEM text. When it's empty, the push service uses FLUXER_PUSH_FCM_PRIVATE_KEY_PATH or the key in the service account JSON."},
+ {"FLUXER_PUSH_FCM_PRIVATE_KEY_PATH", "push", "The path to your Firebase service account private key inside the push container. The push service uses it when FLUXER_PUSH_FCM_PRIVATE_KEY is empty."},
+ {"FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH", "push", "The path to your Firebase service account JSON file inside the push container. The push service loads the project ID, client email and private key from it when those settings are empty."},
+ {"FLUXER_PUSH_FCM_TOKEN_URI", "push", "The OAuth token URL the push service uses for FCM. When it's empty, it uses https://oauth2.googleapis.com/token. Change it only for a proxy or a test double."},
+ {"FLUXER_PUSH_FCM_APPS", "push", "The apps the push service sends to through FCM, as a JSON array of objects that each have an `app_id` and can have a `project_id`. An app with no entry or no `project_id` uses FLUXER_PUSH_FCM_PROJECT_ID. A push relay with FCM on doesn't start until this lists at least one app."},
+ {"FLUXER_VAPID_EMAIL", "push", "The contact email Fluxer sends to browser push services with its VAPID key. When it's empty, Fluxer uses `admin@` followed by FLUXER_DOMAIN. Set it if that mailbox doesn't exist."},
+ {"FLUXER_PUSH_SERVICE_QUEUE_CAPACITY", "push", "How many notification jobs the push service queues at once, from 1 to 1000000. When it's empty, it uses `10000`."},
+ {"FLUXER_PUSH_SERVICE_SEND_CONCURRENCY", "push", "How many provider requests the push service sends at once across all jobs, from 1 to 65536. When it's empty, it uses `256`."},
+ {"FLUXER_PUSH_SERVICE_APNS_BASE_URL", "push", "A URL that replaces the APNs host in both environments, for a test double only. When it's empty, the push service uses Apple's own hosts."},
+ {"FLUXER_PUSH_SERVICE_FCM_BASE_URL", "push", "The FCM host the push service sends to. When it's empty, it uses https://fcm.googleapis.com. Change it only for a proxy or a test double."},
+ {"FLUXER_PUSH_SERVICE_MANAGED_RELAY_HOSTS", "push", "Hostnames, separated by commas, of the push relay that Fluxer runs. When it's empty, the push service uses `push.fluxer.com`. It sends to these hosts only once relay consent is accepted."},
+ {"FLUXER_PUSH_SERVICE_OWN_RELAY_HOSTS", "push", "Hostnames, separated by commas, of a push relay your instance runs itself. The push service sends mobile app notifications addressed to these hosts straight to APNs or FCM with its own credentials."},
+ {"FLUXER_PUSH_SERVICE_PRIVATE_HOSTS", "push", "Hostnames, separated by commas, that push endpoints may use even when they resolve to private or loopback addresses, such as a ntfy service on your own network. The push service refuses every other such endpoint."},
+ {"FLUXER_PUSH_SERVICE_RELAY_CONSENT_ACCEPTED", "push", "Whether this push service accepts the push relay privacy notice, which lets it send through the relay Fluxer runs. Use `true`, `1` or `yes` to accept. With `false`, `0`, `no` or an empty value, the push relay setting of the instance decides."},
+ {"FLUXER_CLAMAV_ENABLED", "media", "Whether Fluxer scans uploads for viruses with ClamAV. Use `true` or `false`. When it's empty, Fluxer uses `false`. No ClamAV container ships with the stack. Point FLUXER_CLAMAV_HOST at your own."},
+ {"FLUXER_CLAMAV_HOST", "media", "The hostname or address of your ClamAV scanner. When it's empty, Fluxer uses `127.0.0.1`."},
+ {"FLUXER_CLAMAV_PORT", "media", "The port of your ClamAV scanner. When it's empty, Fluxer uses `3310`."},
+ {"FLUXER_CLAMAV_FAIL_OPEN", "media", "Whether uploads go through when a ClamAV scan fails, such as when Fluxer can't connect to the scanner or gets no usable answer. Use `true` or `false`. When it's empty, Fluxer rejects the upload."},
+ {"FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64", "media", "Keys that sign attachment URLs, separated by commas. Each is standard base64 that decodes to at least 32 bytes. The first entry signs and every entry verifies. To rotate keys, put the new key first. When it's empty, Fluxer returns unsigned attachment URLs."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT", "media", "The upload relay URL the API hands to clients. When it's empty, the API uses the public origin followed by /media."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES", "media", "The largest upload the relay accepts, in bytes from 1 to 5 GiB. It can't be more than FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES. When it's empty, the relay uses `524288000`, which is 500 MiB."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS", "media", "How long an upload relay token stays valid, in seconds. When it's empty, the API uses `900`."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_KEEP_DIRECT_COUNTRIES", "media", "Two-letter country codes, separated by commas, whose clients upload to the object store directly and skip the relay. It needs the GeoIP database in FLUXER_GEOIP_DB_PATH, and browsers can only upload directly when FLUXER_S3_PUBLIC_ENDPOINT is set. When it's empty or there's no GeoIP database, every client uses the relay and browsers never see the internal store address."},
+ {"FLUXER_MEDIA_PROXY_CORS_MODE", "media", "Whether the media proxy checks the Origin of media requests. Use `off`, `report` or `enforce`. When it's empty, it's off. With `report`, the media proxy logs requests it would refuse, and with `enforce` it refuses them. A request with no Origin header is always served."},
+ {"FLUXER_MEDIA_PROXY_CORS_ALLOWED_ORIGINS", "media", "The web origins, separated by commas, that may load media through CORS when FLUXER_MEDIA_PROXY_CORS_MODE is `report` or `enforce`. When it's empty, the media proxy uses the public origin. The desktop app is always allowed."},
+ {"FLUXER_MEDIA_PROXY_ATTACHMENT_SIGNATURE_MODE", "media", "Whether attachment downloads need a signed URL. Use `off`, `report` or `enforce`. When it's empty, it's off. With `report`, the media proxy logs downloads it would refuse, and with `enforce` it refuses them. Both need FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64."},
+ {"FLUXER_MEDIA_PROXY_READ_ONLY", "media", "Whether the media proxy refuses to write to storage. Use `true` or `false`. When it's empty, it writes as usual."},
+ {"FLUXER_MEDIA_PROXY_NSFW_THRESHOLD", "media", "The NSFW classifier score, from 0.0 to 1.0, that the media proxy uses as its cutoff. When it's empty, it uses `0.85`."},
+ {"FLUXER_NSFW_SERVICE_ENDPOINT", "media", "The URL of an outside NSFW classifier the media proxy calls. No such service ships with the stack. When it's empty, the media proxy calls none."},
+ {"FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS", "media", "How many image transforms the media proxy runs at once, from 1 to 128. When it's empty, it uses the number of CPU cores, kept between 2 and 8."},
+ {"FLUXER_MEDIA_PROXY_WORKER_QUEUE_CAPACITY", "media", "How many transforms may wait in the media proxy's queue, from 1 to 8192. When it's empty, it uses eight times FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS."},
+ {"FLUXER_MEDIA_PROXY_MAX_ENCODE_DURATION_MS", "media", "The longest animation the media proxy encodes, in milliseconds from 100 to 600000. When it's empty, it uses `30000`."},
+ {"FLUXER_MEDIA_PROXY_MAX_ENCODE_FRAMES", "media", "The most frames the media proxy encodes in one animation, from 1 to 100000. When it's empty, it uses `20000`."},
+ {"FLUXER_MEDIA_PROXY_TRANSFORM_TIMEOUT_MS", "media", "How long one media transform may take, in milliseconds from 1000 to 120000. When it's empty, the media proxy uses `15000`."},
+ {"FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_BYTES", "media", "How much memory the media proxy's transform cache may use, in bytes from 0 to 4 GiB. When it's empty, it uses `268435456`, which is 256 MiB."},
+ {"FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_MAX_ENTRY_BYTES", "media", "The largest transform result the media proxy caches, in bytes from 0 to 512 MiB. When it's empty, it uses `67108864`, which is 64 MiB."},
+ {"FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_TTL_MS", "media", "How long the media proxy keeps a transform result in its cache, in milliseconds from 0 to 3600000. When it's empty, it uses `120000`."},
+ {"FLUXER_MEDIA_PROXY_SOCKET_IO_TIMEOUT_MS", "media", "How long the media proxy waits on socket input and output, in milliseconds from 0 to 300000. When it's empty, it uses `30000`."},
+ {"FLUXER_MEDIA_PROXY_SHUTDOWN_GRACE_MS", "media", "How long the media proxy waits for open requests and transforms to finish when it stops, in milliseconds from 0 to 300000. When it's empty, it uses `30000`."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_S3_TIMEOUT_MS", "media", "How long the relay waits for an upload's write to the object store, in milliseconds from 1000 to 3600000. When it's empty, it uses `900000`."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_BYTES", "media", "The largest upload the relay keeps in memory so it can retry the object store write, in bytes from 0 to 256 MiB. Larger uploads stream to the store without a retry. When it's empty, the relay uses `33554432`, which is 32 MiB."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_TOTAL_BYTES", "media", "How much memory all buffered relay uploads may use together, in bytes from 0 to 8 GiB. An upload that would go past it streams without a retry. When it's empty, the relay uses `536870912`, which is 512 MiB."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_DIR", "media", "The directory where the relay spools upload bodies and the media proxy keeps copies of large audio and video files it inspects. It must be writable. When it's empty, the media proxy uses the system temporary directory."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_CHUNK_BYTES", "media", "The chunk size the relay uses when it writes upload bodies to its spool on disk, in bytes from 64 KiB to 64 MiB. When it's empty, it uses `1048576`, which is 1 MiB."},
+ {"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES", "media", "The most disk space the spool may use at once, in bytes from 0 to 256 GiB, shared by relay uploads and copies of large audio and video files. It must be at least FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES."},
+ {"FLUXER_CACHE_PURGE_ADAPTER", "media", "How Fluxer purges cached copies of deleted or replaced media from your CDN or caching proxy. Use `none`, `http` or `controller`. When it's empty, Fluxer uses `none` and sends no purges."},
+ {"FLUXER_CACHE_PURGE_HTTP_ENDPOINT", "media", "The URL the worker posts purge requests to when FLUXER_CACHE_PURGE_ADAPTER is `http`, as an absolute http or https URL without credentials. Your endpoint then purges the listed media URL prefixes from every cache in front of the media."},
+ {"FLUXER_CACHE_PURGE_HTTP_TOKEN", "media", "The bearer token Fluxer sends in the Authorization header of each purge request to FLUXER_CACHE_PURGE_HTTP_ENDPOINT, in visible ASCII characters with no spaces."},
+ {"FLUXER_CACHE_PURGE_HTTP_TIMEOUT_MS", "media", "How long each purge request to FLUXER_CACHE_PURGE_HTTP_ENDPOINT may take, in milliseconds from 1000 to 10000. When it's empty, Fluxer uses `10000`."},
+ {"FLUXER_CACHE_PURGE_CONTROLLER_ENDPOINT", "media", "The purge URL of the Controller edge site that serves your media, as an absolute https URL without credentials. Fluxer uses it when FLUXER_CACHE_PURGE_ADAPTER is `controller`."},
+ {"FLUXER_CACHE_PURGE_CONTROLLER_TOKEN", "media", "The Controller API key Fluxer sends as a bearer token with each purge request, in visible ASCII characters with no spaces."},
+ {"FLUXER_CACHE_PURGE_CONTROLLER_TIMEOUT_MS", "media", "How long each Controller purge request may take, in milliseconds from 1000 to 10000. When it's empty, Fluxer uses `10000`."},
+ {"FLUXER_GATEWAY_MEDIA_PROXY_ENDPOINT", "gateway", "The public media URL the gateway uses to build avatar links in push notifications. When it's empty, the gateway uses FLUXER_MEDIA_ENDPOINT, or the public origin followed by /media."},
+ {"FLUXER_GATEWAY_STATIC_CDN_ENDPOINT", "gateway", "The public static file URL the gateway uses to build default avatar links in push notifications. When it's empty, the gateway uses FLUXER_STATIC_CDN_ENDPOINT, or the public origin."},
+ {"FLUXER_GATEWAY_PUSH_ENABLED", "gateway", "Whether the gateway sends push notifications through the push service. Use `true` or `false`. When it's empty, the gateway uses `true`."},
+ {"FLUXER_GATEWAY_PUSH_ENROLLED_CLEAR_NOTIFICATIONS_ENABLED", "gateway", "Whether the gateway asks the push service to clear a channel's push notifications once the user has caught up on that channel. Use `true` or `false`. When it's empty, the gateway uses `true`."},
+ {"FLUXER_GATEWAY_PUSH_OUTBOX_REQUEST_TIMEOUT_MS", "gateway", "How long the gateway waits for the push service to answer one push request, in milliseconds. When it's empty, the gateway uses `100000`."},
+ {"FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_ENTRIES", "gateway", "The most push notifications the gateway keeps back for one user while one of their sessions is active, dropping the oldest first. A value of `0` keeps none. When it's empty, the gateway uses `128`."},
+ {"FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_BYTES", "gateway", "The most bytes of push notifications the gateway keeps back for one user while one of their sessions is active. A value of `0` turns off this limit. When it's empty, the gateway uses `1048576`, which is 1 MiB."},
+ {"FLUXER_GATEWAY_HTTP_RPC_MAX_CONCURRENCY", "gateway", "How many HTTP requests the gateway can have open to the API at once. When it's empty, the gateway uses `512`."},
+ {"FLUXER_GATEWAY_NATS_RPC_MAX_HANDLERS", "gateway", "How many NATS RPC requests the gateway works on at once. When it's empty, the gateway uses `512`."},
+ {"FLUXER_GATEWAY_ZSTD_WINDOW_LOG", "gateway", "The base 2 logarithm of the zstd window the gateway compresses websocket traffic with, from 10 to 21. Values outside that range count as the nearest end. Larger values compress better and use more memory per connection. When it's empty, the gateway uses `17`."},
+ {"FLUXER_GATEWAY_HTTP_FAILURE_THRESHOLD", "gateway", "How many failed requests from the gateway to the API in 10 seconds open its circuit breaker, when at least 80 percent of the requests in that time failed. The breaker then stops further requests for a while. When it's empty, the gateway uses `6`."},
+ {"FLUXER_GATEWAY_HTTP_RECOVERY_TIMEOUT_MS", "gateway", "How long the circuit breaker for gateway requests to the API stays open before it tries again, in milliseconds. When it's empty, the gateway uses `15000`."},
+ {"FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_MAX", "gateway", "The most visitor sessions one community allows, however many members it has. A visitor views a community without joining it. When it's empty, the gateway uses `10000`."},
+ {"FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_FLOOR", "gateway", "The fewest visitor sessions one community allows, however few members it has. When it's empty, the gateway uses `500`."},
+ {"FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_MEMBER", "gateway", "How many visitor sessions a community allows for each of its members, kept between the floor and the maximum. When it's empty, the gateway uses `2`."},
+ {"FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_USER", "gateway", "How many visitor sessions one account can have in a single community at once. When it's empty, the gateway uses `5`."},
+ {"FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_IP", "gateway", "How many visitor sessions one IPv4 address or one IPv6 /64 network can have in a single community at once. When it's empty, the gateway uses `20`."},
+ {"DISCOVERY_REFRESH_INTERVAL_MS", "app", "How often the app-proxy service fetches the discovery document, in milliseconds. The document has the branding saved in the admin panel, such as the product name, icons and custom CSS. Values under 1 second count as 1 second. A failed fetch is retried with a growing delay of up to five minutes."},
+ {"FLUXER_APP_PROXY_INDEX_UPSTREAM_URL", "app", "An http or https URL that the app-proxy service fetches the web app's index.html from. When it's empty, the app-proxy service serves the index.html built into its image."},
+ {"FLUXER_APP_PROXY_SAME_ORIGIN_HOSTS", "app", "Extra hostnames that serve the web app, separated by commas or spaces, with no scheme, port or path. On these hostnames, the web app uses the same hostname for the API and for the gateway and media endpoints that share the API's host. Each one must route /api, /gateway and /media like the main one."},
+ {"FLUXER_APP_PROXY_MANIFEST_SCOPE_EXTENSIONS", "app", "HTTPS origins with no path, separated by commas or spaces, that the app-proxy service adds to the `scope_extensions` list of the web app manifest. An installed web app keeps them inside its window. Each origin must serve /.well-known/web-app-origin-association for this web app. Invalid entries are logged and dropped."},
+ {"FLUXER_CSP_EXTRA_DEFAULT_SRC", "app", "Extra sources the app-proxy service adds to the default-src directive of the web app's Content-Security-Policy, separated by commas or spaces. Set one only when a browser must connect to an origin the built-in policy doesn't cover."},
+ {"FLUXER_CSP_EXTRA_CONNECT_SRC", "app", "Extra sources the app-proxy service adds to the connect-src directive of the web app's Content-Security-Policy, separated by commas or spaces, such as wss://livekit.example.com. A ws or wss source also allows the matching http or https source."},
+ {"FLUXER_CSP_EXTRA_IMG_SRC", "app", "Extra sources the app-proxy service adds to the img-src directive of the web app's Content-Security-Policy, separated by commas or spaces, such as https://cdn.example.com."},
+ {"FLUXER_CSP_EXTRA_MEDIA_SRC", "app", "Extra sources the app-proxy service adds to the media-src directive of the web app's Content-Security-Policy, separated by commas or spaces."},
+ {"FLUXER_CSP_EXTRA_FONT_SRC", "app", "Extra sources the app-proxy service adds to the font-src directive of the web app's Content-Security-Policy, separated by commas or spaces."},
+ {"FLUXER_CSP_EXTRA_SCRIPT_SRC", "app", "Extra sources the app-proxy service adds to the script-src directive of the web app's Content-Security-Policy, separated by commas or spaces, such as https://analytics.example.com."},
+ {"FLUXER_CSP_EXTRA_STYLE_SRC", "app", "Extra sources the app-proxy service adds to the style-src directive of the web app's Content-Security-Policy, separated by commas or spaces."},
+ {"FLUXER_CSP_EXTRA_FRAME_SRC", "app", "Extra sources the app-proxy service adds to the frame-src directive of the web app's Content-Security-Policy, separated by commas or spaces."},
+ {"FLUXER_CSP_EXTRA_WORKER_SRC", "app", "Extra sources the app-proxy service adds to the worker-src directive of the web app's Content-Security-Policy, separated by commas or spaces."},
+ {"FLUXER_CSP_EXTRA_MANIFEST_SRC", "app", "Extra sources the app-proxy service adds to the manifest-src directive of the web app's Content-Security-Policy, separated by commas or spaces."},
+ {"FLUXER_CSP_REPORT_URI", "app", "One http or https URL that browsers send Content-Security-Policy violation reports to. When it's empty, the policy has no report-uri."},
+ {"FLUXER_API_HEADERS_TIMEOUT_MS", "api", "How long a client may take to send the request line and headers to the API, in milliseconds from 1000 to 3600000. It is capped at FLUXER_API_REQUEST_TIMEOUT_MS. When it's empty, the API uses `30000`."},
+ {"FLUXER_API_REQUEST_TIMEOUT_MS", "api", "How long a client may take over a whole request to the API, in milliseconds from 1000 to 3600000. Raise it for large uploads or slow links. When it's empty, the API uses `120000`."},
+ {"FLUXER_API_MAX_INFLIGHT_REQUESTS", "api", "How many requests the API handles at once before it answers new ones with 503 and a Retry-After header, from 1 to 100000. When it's empty, the API uses `512`."},
+ {"FLUXER_TRUST_CLIENT_IP_HEADER", "api", "Whether Fluxer trusts the client address in the FLUXER_CLIENT_IP_HEADER_NAME header. Use `true` or `false`. The api, worker, admin and gateway services and the push relay use it. With `false`, they use the address of the connection, which behind the edge is the edge itself. Outside Docker Compose, the services use `false` when it's empty."},
+ {"FLUXER_CLIENT_IP_HEADER_NAME", "api", "The request header that has the client's IP address. When it's empty, the api, worker, admin and gateway services and the push relay use `x-forwarded-for`, the header the edge sets."},
+ {"FLUXER_API_IP_BAN_EXEMPT_IPS", "api", "IP addresses and CIDR ranges, separated by commas, that IP bans never apply to, such as `203.0.113.7,2001:db8::/56`. The API refuses to start when an entry doesn't parse."},
+ {"FLUXER_IP_BAN_REFRESH_INTERVAL_MS", "api", "How often the API reloads its IP ban list, in milliseconds. When it's empty, the API uses `300000`. A value of `0` turns the periodic reload off."},
+ {"FLUXER_API_DONATION_PROXY_KEY", "api", "An older way to add one trusted caller that may pass the client address for the donation and Operator Pass rate limits. Fluxer's marketing site uses it. It must be at least 32 characters. Your own instance can leave it empty."},
+ {"FLUXER_API_TRUSTED_CALLERS", "api", "A JSON array of trusted callers, such as a front end that calls the API for its own visitors. Each entry is an object with a `name`, a `key` of at least 32 characters and `buckets`, a non-empty list of the rate limit buckets the caller may pass a client address for. The caller sends its key in the `X-Fluxer-Internal-Key` header and the client address in the `X-Fluxer-Client-IP` header."},
+ {"FLUXER_API_WORKER_LANE_CONCURRENCY_OVERRIDES", "api", "How many jobs each worker lane runs at once, as a JSON object that maps each lane to a whole number of at least 1. The lanes are `realtime`, `unfurl`, `lifecycle`, `batch` and `crosspost`. Lanes left out use 10, 20, 8, 12 and 8 in that order, scaled down on machines with fewer than 4 CPU cores."},
+ {"FLUXER_APP_PRODUCT_NAME", "instance", "The product name the apps show and Fluxer uses in emails and system messages. When it's empty or set to `Fluxer` on a self-hosted instance, Fluxer uses the hostname of the web app."},
+ {"FLUXER_APP_ICON_URL", "instance", "The URL of the app icon."},
+ {"FLUXER_APP_SYMBOL_URL", "instance", "The URL of the symbol mark."},
+ {"FLUXER_APP_LOGO_URL", "instance", "The URL of the logo."},
+ {"FLUXER_APP_WORDMARK_URL", "instance", "The URL of the wordmark."},
+ {"FLUXER_APP_FAVICON_URL", "instance", "The URL of the favicon."},
+ {"FLUXER_APP_FAVICON_DARK_URL", "instance", "The URL of the favicon for browsers in dark mode."},
+ {"FLUXER_APP_SIGN_IN_BACKDROP_URL", "instance", "The URL of the image behind the sign-in screen."},
+ {"FLUXER_APP_THEME_COLOR", "instance", "The brand colour of the web app and the browser theme colour, as a hex value such as `#4641d9`."},
+ {"FLUXER_APP_STATUS_PAGE_URL", "instance", "The URL of your public status page. The web app links to it when loading takes a long time. On an Instatus page, the web app also shows its current incidents and maintenance."},
+ {"FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL", "instance", "The URL of the incident history on your status page. The apps don't use it yet."},
+ {"FLUXER_INSTANCE_SETUP_CONFIGURED", "instance", "Whether a new instance starts as already set up. Use `true` or `false`. With `true`, the setup wizard is skipped and registration opens without making the first account an admin. Once a setup state is saved, this has no effect. When it's empty, Fluxer uses `false`."},
+ {"FLUXER_ACCOUNT_IDENTITY", "instance", "How people sign in on a new instance. Use `username` or `email`. Fluxer uses it only on the first start with no saved sign-in method. When it's empty, Fluxer uses `email` if email delivery is set up and `username` otherwise. When FLUXER_INSTANCE_SETUP_CONFIGURED is `true` or any account exists, Fluxer uses email sign-in with random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value."},
+ {"FLUXER_TAG_STYLE", "instance", "How usernames are tagged on a new instance that signs in by email. Use `none` for unique usernames with no tag or `random` for a random tag on every account. Username sign-in always uses `none`. Fluxer reads this setting only on the first start. When it's empty, Fluxer uses `none`. When FLUXER_INSTANCE_SETUP_CONFIGURED is `true` or any account exists, Fluxer uses random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value."},
+ {"FLUXER_AUTO_JOIN_INVITE_CODE", "instance", "One or more invite codes, separated by commas or spaces. A new account that signs up without an invite of its own joins the communities these invites lead to."},
+ {"FLUXER_DISCOVERY_ENABLED", "instance", "Whether community discovery is on. Use `true` or `false`. With `false`, discovery search, joining from discovery and discovery applications are turned off. When it's empty, Fluxer uses `true`."},
+ {"FLUXER_DISCOVERY_MIN_MEMBER_COUNT", "instance", "How many members a community needs before it can be listed in discovery. When it's empty, Fluxer uses `1`."},
+ {"FLUXER_DELETION_GRACE_PERIOD_HOURS", "instance", "How many hours a deleted account can still be recovered before Fluxer removes it. When it's empty, Fluxer uses `336`, which is 14 days."},
+ {"FLUXER_REPORT_RETENTION_DAYS", "instance", "How many days the daily retention job keeps a resolved report, from 1 to 36500. It then deletes the report, its evidence copies and its search entry. A child safety report is kept for at least 365 days after it's resolved, and a report with an enforcement decision for at least 365 days after the decision. The job never deletes a pending report or a report under a legal hold. When it's empty, the worker uses `365`."},
+ {"FLUXER_REPORT_RETENTION_DRY_RUN", "instance", "Whether the report retention job only counts what it would delete and changes nothing. Use `true` or `false`. When it's empty, the worker uses `false`."},
+ {"FLUXER_STRIPE_ENABLED", "billing", "Whether Fluxer sells subscriptions through Stripe. Use `true` or `false`. When it's empty, Fluxer uses `false`."},
+ {"FLUXER_STRIPE_SECRET_KEY", "billing", "Your Stripe secret API key."},
+ {"FLUXER_STRIPE_WEBHOOK_SECRET", "billing", "The signing secret of your Stripe webhook."},
+ {"FLUXER_STRIPE_PRICES", "billing", "Your Stripe price IDs as one JSON object, keyed by plan and currency such as `monthly_usd`."},
+ {"FLUXER_STRIPE_LEGACY_PRICES", "billing", "Stripe price IDs you have retired, as a JSON object with the same keys as FLUXER_STRIPE_PRICES and a list of IDs for each. Subscriptions on these prices keep renewing."},
+ {"FLUXER_VISIONARIES_GUILD_ID", "billing", "The ID of the community that people who buy Visionary are added to. When it's empty on a self-hosted instance, nobody is added."},
+ {"FLUXER_VISIONARIES_GUILD_VISIONARY_ROLE_ID", "billing", "The ID of the role Fluxer gives Visionary buyers in the community set by FLUXER_VISIONARIES_GUILD_ID. Set it whenever FLUXER_VISIONARIES_GUILD_ID is set."},
+ {"FLUXER_BREACHED_PASSWORD_CHECK_ENABLED", "integrations", "Whether Fluxer rejects passwords found in known data breaches, by sending the first five characters of the password's SHA-1 hash to `api.pwnedpasswords.com`. Use `true` or `false`. When it's empty, this is off on a self-hosted instance."},
+ {"FLUXER_BLOCKLIST_FEEDS_ENABLED", "integrations", "Whether the worker downloads the URLhaus and PhishTank link lists every six hours and the MalwareBazaar file hashes every twelve hours, and checks posted links and uploads against them. Use `true` or `false`. When it's empty, this is off on a self-hosted instance."},
+ {"FLUXER_GEOIP_DB_PATH", "integrations", "Where the api and worker load the MaxMind GeoIP database from, as a file path or an `s3://bucket/key` URL. An s3 URL needs a `download_path` query parameter with an absolute path."},
+ {"FLUXER_KLIPY_API_KEY", "integrations", "The Klipy API key for GIF search and Klipy link previews. A key saved in the admin panel is used first. GIF search is off when neither is set."},
+ {"FLUXER_YOUTUBE_API_KEY", "integrations", "The YouTube Data API key Fluxer uses for YouTube link previews. A key saved in the admin panel is used first."},
+ {"FLUXER_API_UNFURL_IGNORED_HOSTS", "integrations", "Hostnames, separated by commas, that Fluxer never makes link previews for. A link matches only when its host is exactly one of these."},
+ {"FLUXER_AUTH_BLUESKY_ENABLED", "integrations", "Whether people can link a Bluesky account to their profile. Use `true` or `false`. It needs FLUXER_AUTH_BLUESKY_KEYS. When it's empty, Fluxer uses `false`."},
+ {"FLUXER_AUTH_BLUESKY_CLIENT_NAME", "integrations", "The app name Bluesky shows when someone links their account. When it's empty, Bluesky shows `Fluxer`, even when FLUXER_APP_PRODUCT_NAME is set."},
+ {"FLUXER_AUTH_BLUESKY_CLIENT_URI", "integrations", "Fluxer doesn't use this value. Bluesky shows the API address as the home page of your instance."},
+ {"FLUXER_AUTH_BLUESKY_LOGO_URI", "integrations", "The logo URL Bluesky shows for your instance."},
+ {"FLUXER_AUTH_BLUESKY_TOS_URI", "integrations", "The terms of service URL Bluesky shows for your instance."},
+ {"FLUXER_AUTH_BLUESKY_POLICY_URI", "integrations", "The privacy policy URL Bluesky shows for your instance."},
+ {"FLUXER_AUTH_BLUESKY_KEYS", "integrations", "The keys Fluxer signs Bluesky account linking requests with, as a JSON array of objects with a `kid` and a `private_key` or a `private_key_path`, which is an absolute path inside the api and worker containers. Keys saved in the admin panel replace these."},
+ {"FLUXER_TOKIO_WORKER_THREADS", "tuning", "How many worker threads the async runtime uses in the app-proxy, push, admin, snowflakes, users, gifs, messages and unfurl containers, set as their TOKIO_WORKER_THREADS."},
+ {"FLUXER_MALLOC_ARENA_MAX", "tuning", "How many memory arenas the glibc allocator may create in the push, admin, snowflakes, users, gifs, messages and unfurl containers, set as their MALLOC_ARENA_MAX. Lower values use less memory."},
+ {"FLUXER_CADDY_MEMORY_LIMIT", "tuning", "The memory limit for the edge container, which runs Caddy."},
+ {"FLUXER_POSTGRES_MEMORY_LIMIT", "tuning", "The memory limit for the postgres container. Keep it at or above FLUXER_POSTGRES_MEMORY_RESERVATION."},
+ {"FLUXER_POSTGRES_MEMORY_RESERVATION", "tuning", "The memory reservation for the postgres container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below FLUXER_POSTGRES_MEMORY_LIMIT."},
+ {"FLUXER_POSTGRES_SERVER_MAX_CONNECTIONS", "tuning", "Postgres `max_connections`, how many connections the database accepts in total. Keep it above the sum of all pool sizes, counting each worker replica."},
+ {"FLUXER_POSTGRES_SHARED_BUFFERS", "tuning", "Postgres `shared_buffers`, the memory Postgres uses for its own cache."},
+ {"FLUXER_POSTGRES_EFFECTIVE_CACHE_SIZE", "tuning", "Postgres `effective_cache_size`, how much disk cache the query planner assumes there is. It allocates no memory."},
+ {"FLUXER_POSTGRES_WORK_MEM", "tuning", "Postgres `work_mem`, the memory each sort or hash step in a query can use before it spills to disk."},
+ {"FLUXER_POSTGRES_MAINTENANCE_WORK_MEM", "tuning", "Postgres `maintenance_work_mem`, the memory one VACUUM, CREATE INDEX or ALTER TABLE can use."},
+ {"FLUXER_POSTGRES_AUTOVACUUM_WORK_MEM", "tuning", "Postgres `autovacuum_work_mem`, the memory each autovacuum worker can use."},
+ {"FLUXER_POSTGRES_RANDOM_PAGE_COST", "tuning", "Postgres `random_page_cost`, how costly the query planner thinks fetching a random disk page is next to a sequential one. Values near 1 suit SSDs."},
+ {"FLUXER_POSTGRES_EFFECTIVE_IO_CONCURRENCY", "tuning", "Postgres `effective_io_concurrency`, how many disk requests Postgres may have in flight at once. High values suit SSDs."},
+ {"FLUXER_POSTGRES_DEFAULT_STATISTICS_TARGET", "tuning", "Postgres `default_statistics_target`, how much detail the query planner's table statistics have. Higher values give better plans and a slower ANALYZE."},
+ {"FLUXER_POSTGRES_JIT", "tuning", "Postgres `jit`, whether Postgres compiles parts of queries with JIT. Use `on` or `off`."},
+ {"FLUXER_POSTGRES_MIN_WAL_SIZE", "tuning", "Postgres `min_wal_size`, the write-ahead log space Postgres keeps for reuse after a checkpoint."},
+ {"FLUXER_POSTGRES_MAX_WAL_SIZE", "tuning", "Postgres `max_wal_size`, how large the write-ahead log may grow before Postgres starts a checkpoint."},
+ {"FLUXER_POSTGRES_CHECKPOINT_COMPLETION_TARGET", "tuning", "Postgres `checkpoint_completion_target`, how much of the time between checkpoints a checkpoint spreads its writes over, as a fraction."},
+ {"FLUXER_POSTGRES_WAL_BUFFERS", "tuning", "Postgres `wal_buffers`, the memory for write-ahead log data not yet written to disk."},
+ {"FLUXER_POSTGRES_WAL_COMPRESSION", "tuning", "Postgres `wal_compression`, how full-page images in the write-ahead log are compressed, such as `lz4`, `pglz` or `off`."},
+ {"FLUXER_POSTGRES_BGWRITER_DELAY", "tuning", "Postgres `bgwriter_delay`, how long the background writer sleeps between rounds, such as `200ms`."},
+ {"FLUXER_POSTGRES_BGWRITER_LRU_MAXPAGES", "tuning", "Postgres `bgwriter_lru_maxpages`, the most buffers the background writer writes to disk in one round."},
+ {"FLUXER_POSTGRES_AUTOVACUUM_VACUUM_SCALE_FACTOR", "tuning", "Postgres `autovacuum_vacuum_scale_factor`, the share of a table's rows that must be updated or deleted before autovacuum vacuums it, as a fraction such as `0.1`."},
+ {"FLUXER_POSTGRES_AUTOVACUUM_ANALYZE_SCALE_FACTOR", "tuning", "Postgres `autovacuum_analyze_scale_factor`, the share of a table's rows that must change before autovacuum analyses it again, as a fraction such as `0.05`."},
+ {"FLUXER_POSTGRES_AUTOVACUUM_VACUUM_COST_LIMIT", "tuning", "Postgres `autovacuum_vacuum_cost_limit`, how much disk work autovacuum may do before it pauses. Higher values let it finish sooner."},
+ {"FLUXER_POSTGRES_AUTOVACUUM_MAX_WORKERS", "tuning", "Postgres `autovacuum_max_workers`, how many autovacuum processes can run at once."},
+ {"FLUXER_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER", "tuning", "Postgres `max_parallel_workers_per_gather`, how many parallel workers one step of a query can use."},
+ {"FLUXER_POSTGRES_MAX_PARALLEL_WORKERS", "tuning", "Postgres `max_parallel_workers`, how many parallel query workers can run at once across the database. Postgres caps it at `max_worker_processes`, and the stack leaves that at 8."},
+ {"FLUXER_POSTGRES_TRACK_IO_TIMING", "tuning", "Postgres `track_io_timing`, whether Postgres times its disk I/O for its statistics. Use `on` or `off`."},
+ {"FLUXER_POSTGRES_SHARED_PRELOAD_LIBRARIES", "tuning", "Postgres `shared_preload_libraries`, the extensions Postgres loads at start, separated by commas. Keep `pg_stat_statements` in the list. The api turns it on at start."},
+ {"FLUXER_POSTGRES_SHM_SIZE", "tuning", "The shared memory size of the postgres container, used by parallel queries and parallel maintenance. Keep it well above FLUXER_POSTGRES_MAINTENANCE_WORK_MEM."},
+ {"FLUXER_VALKEY_MEMORY_LIMIT", "tuning", "The memory limit for the valkey container. Keep it above FLUXER_VALKEY_MAXMEMORY."},
+ {"FLUXER_VALKEY_MAXMEMORY", "tuning", "Valkey `maxmemory`, the most memory Valkey may use for stored data. The append-only file buffer and memory fragmentation come on top. Keep it below FLUXER_VALKEY_MEMORY_LIMIT."},
+ {"FLUXER_VALKEY_MAXMEMORY_POLICY", "tuning", "Valkey `maxmemory-policy`, what Valkey does when its data grows to FLUXER_VALKEY_MAXMEMORY. With `noeviction`, writes fail when Valkey is full and no data is dropped."},
+ {"FLUXER_NATS_MEMORY_LIMIT", "tuning", "The memory limit for the nats container."},
+ {"FLUXER_NATS_GOMEMLIMIT", "tuning", "The soft memory limit of the Go runtime in NATS, set as its `GOMEMLIMIT`. Keep it below FLUXER_NATS_MEMORY_LIMIT."},
+ {"FLUXER_NATS_MAX_MEMORY_STORE", "tuning", "NATS JetStream `max_memory_store`, the most memory JetStream may use for streams kept in memory, such as `128MB`."},
+ {"FLUXER_NATS_MAX_FILE_STORE", "tuning", "NATS JetStream `max_file_store`, the most disk space JetStream may use for its streams, such as `20GB`."},
+ {"FLUXER_MEILISEARCH_MEMORY_LIMIT", "tuning", "The memory limit for the meilisearch container."},
+ {"FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY", "tuning", "The memory Meilisearch aims to stay under while indexing, set as its MEILI_MAX_INDEXING_MEMORY, such as `512mb`. Meilisearch can go a little over it. Keep it well below FLUXER_MEILISEARCH_MEMORY_LIMIT."},
+ {"FLUXER_MEILISEARCH_MAX_INDEXING_THREADS", "tuning", "The most threads Meilisearch may use for indexing, set as its MEILI_MAX_INDEXING_THREADS."},
+ {"FLUXER_SEAWEEDFS_MEMORY_LIMIT", "tuning", "The memory limit for the seaweedfs container."},
+ {"FLUXER_SEAWEEDFS_GOMEMLIMIT", "tuning", "The soft memory limit of the Go runtime in SeaweedFS, set as its `GOMEMLIMIT`. Go can't see the container limit. Keep this at 75 to 85 percent of FLUXER_SEAWEEDFS_MEMORY_LIMIT and raise both together."},
+ {"FLUXER_SEAWEEDFS_VOLUME_GROWTH", "tuning", "How many volumes SeaweedFS creates at once when a bucket has no writable volume left, set as its WEED_MASTER_VOLUME_GROWTH_COPY_1."},
+ {"FLUXER_SEAWEEDFS_VOLUME_SIZE_LIMIT_MB", "tuning", "The size in MB a volume can grow to before SeaweedFS stops writing to it, set as its `-master.volumeSizeLimitMB`."},
+ {"FLUXER_SEAWEEDFS_GARBAGE_THRESHOLD", "tuning", "The share of deleted space in a volume that makes SeaweedFS compact it, as a fraction, set as its `-master.garbageThreshold`."},
+ {"FLUXER_SEAWEEDFS_VOLUME_MAX", "tuning", "The most volumes the SeaweedFS volume store may have, set as its `-volume.max`."},
+ {"FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT", "tuning", "The memory limit for the seaweedfs-init container, which creates the buckets, sets up the S3 key and the expiry of the uploads bucket, and then exits."},
+ {"FLUXER_LIVEKIT_MEMORY_LIMIT", "tuning", "The memory limit for the livekit container."},
+ {"FLUXER_LIVEKIT_GOMEMLIMIT", "tuning", "The soft memory limit of the Go runtime in LiveKit, set as its `GOMEMLIMIT`. Keep it below FLUXER_LIVEKIT_MEMORY_LIMIT."},
+ {"FLUXER_API_MEMORY_LIMIT", "tuning", "The memory limit for the api container."},
+ {"FLUXER_API_MEMORY_RESERVATION", "tuning", "The memory reservation for the api container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below FLUXER_API_MEMORY_LIMIT."},
+ {"FLUXER_API_NODE_HEAP_MB", "tuning", "The Node heap limit of the api container, in MB, set as `--max-old-space-size`. When it's empty, Node uses 60 percent of the memory available to the container. A value above FLUXER_API_MEMORY_LIMIT lets the heap grow until Docker kills the container for running out of memory."},
+ {"FLUXER_API_NODE_OPTIONS", "tuning", "Extra Node flags for the api container, added to the end of NODE_OPTIONS, such as `--dns-result-order=ipv4first`. Set the heap with FLUXER_API_NODE_HEAP_MB. While that is empty, a `--max-old-space-size` flag here has no effect."},
+ {"FLUXER_API_POSTGRES_MAX_CONNECTIONS", "tuning", "The size of the Postgres connection pool of the api container, from 1 to 1000."},
+ {"FLUXER_API_EMBEDDED_WORKER", "tuning", "Whether the api container also runs the background worker jobs inside the api process. Use `true` or `false`. With `true`, rexctl sets FLUXER_WORKER_REPLICAS to 0 and gives the api container more memory. Without rexctl, set FLUXER_WORKER_REPLICAS to 0 yourself."},
+ {"FLUXER_WORKER_REPLICAS", "tuning", "How many worker containers Docker runs. With FLUXER_API_EMBEDDED_WORKER set to `true`, rexctl sets it to 0. Without rexctl, set it to 0 yourself."},
+ {"FLUXER_WORKER_MEMORY_LIMIT", "tuning", "The memory limit for each worker container."},
+ {"FLUXER_WORKER_MEMORY_RESERVATION", "tuning", "The memory reservation for each worker container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below FLUXER_WORKER_MEMORY_LIMIT."},
+ {"FLUXER_WORKER_NODE_HEAP_MB", "tuning", "The Node heap limit of each worker container, in MB, set as `--max-old-space-size`. When it's empty, Node uses 55 percent of the memory available to the container. A value above FLUXER_WORKER_MEMORY_LIMIT lets the heap grow until Docker kills the container for running out of memory."},
+ {"FLUXER_WORKER_NODE_OPTIONS", "tuning", "Extra Node flags for each worker container, added to the end of NODE_OPTIONS, such as `--dns-result-order=ipv4first`. Set the heap with FLUXER_WORKER_NODE_HEAP_MB. While that is empty, a `--max-old-space-size` flag here has no effect."},
+ {"FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS", "tuning", "The size of the Postgres connection pool of each worker container, from 1 to 1000. It has no effect when FLUXER_API_EMBEDDED_WORKER is `true`."},
+ {"FLUXER_WORKER_POSTGRES_SYNCHRONOUS_COMMIT", "tuning", "Postgres `synchronous_commit` for the database connections of each worker container. Use `on`, `off`, `local`, `remote_write` or `remote_apply`. When it's empty, the worker uses `off`, and a Postgres crash can lose the worker's most recent writes. It has no effect when FLUXER_API_EMBEDDED_WORKER is `true`."},
+ {"FLUXER_GATEWAY_MEMORY_LIMIT", "tuning", "The memory limit for the gateway container."},
+ {"FLUXER_GATEWAY_MEMORY_RESERVATION", "tuning", "The memory reservation for the gateway container, the amount Docker tries to keep for it when the machine runs low. Keep it at or below FLUXER_GATEWAY_MEMORY_LIMIT."},
+ {"FLUXER_ERLANG_SCHEDULERS", "tuning", "How many normal schedulers the Erlang VM of the gateway runs, a positive whole number. When it's empty, the gateway uses the container's CPU count kept between FLUXER_ERLANG_SCHEDULERS_MIN and FLUXER_ERLANG_SCHEDULERS_MAX."},
+ {"FLUXER_ERLANG_SCHEDULERS_MIN", "tuning", "The lowest scheduler count the gateway picks from the CPU count when FLUXER_ERLANG_SCHEDULERS is empty. When it's empty, the gateway uses `2`."},
+ {"FLUXER_ERLANG_SCHEDULERS_MAX", "tuning", "The highest scheduler count the gateway picks from the CPU count when FLUXER_ERLANG_SCHEDULERS is empty. When it's empty, the gateway uses `16`."},
+ {"FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS", "tuning", "How many dirty CPU schedulers the Erlang VM of the gateway runs, a positive whole number. When it's empty, the gateway uses half the normal scheduler count, and at least `1`."},
+ {"FLUXER_ERLANG_DIRTY_IO_SCHEDULERS", "tuning", "How many dirty I/O schedulers the Erlang VM of the gateway runs, a positive whole number. When it's empty, the gateway uses the normal scheduler count kept between 2 and 4."},
+ {"FLUXER_MEDIA_PROXY_MEMORY_LIMIT", "tuning", "The memory limit for the media-proxy container."},
+ {"FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS", "tuning", "How many worker threads the async runtime of the media proxy uses, set as its TOKIO_WORKER_THREADS."},
+ {"FLUXER_PUSH_MEMORY_LIMIT", "tuning", "The memory limit for the push container."},
+ {"FLUXER_STATIC_PROXY_MEMORY_LIMIT", "tuning", "The memory limit for the static-proxy container."},
+ {"FLUXER_APP_PROXY_MEMORY_LIMIT", "tuning", "The memory limit for the app-proxy container."},
+ {"FLUXER_SNOWFLAKES_MEMORY_LIMIT", "tuning", "The memory limit for the snowflakes container."},
+ {"FLUXER_USERS_MEMORY_LIMIT", "tuning", "The memory limit for the users container."},
+ {"FLUXER_USERS_POSTGRES_MAX_CONNECTIONS", "tuning", "The size of the Postgres connection pool of the users container."},
+ {"FLUXER_GIFS_MEMORY_LIMIT", "tuning", "The memory limit for the gifs container."},
+ {"FLUXER_GIFS_SHARD_CACHE_MAX_BYTES", "tuning", "How many bytes the gifs service may use for its cache, at least `16777216`, which is 16 MiB. Keep it below FLUXER_GIFS_MEMORY_LIMIT."},
+ {"FLUXER_MESSAGES_MEMORY_LIMIT", "tuning", "The memory limit for the messages container."},
+ {"FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS", "tuning", "The size of the Postgres connection pool of the messages container."},
+ {"FLUXER_UNFURL_MEMORY_LIMIT", "tuning", "The memory limit for the unfurl container."},
+ {"FLUXER_ADMIN_MEMORY_LIMIT", "tuning", "The memory limit for the admin container."},
+ {"FLUXER_VALKEY_APPENDFSYNC", "bundled", "Valkey `appendfsync`, how often Valkey flushes its append-only file to disk. Use `always`, `everysec` or `no`. With `everysec`, a crash can lose the last second of writes."},
+ {"FLUXER_VALKEY_SAVE", "bundled", "Valkey `save`, when Valkey writes RDB snapshots, as pairs of seconds and changes such as `3600 1 300 100`. When it's empty, snapshots are off and Valkey keeps its data in the append-only file alone."},
+ {"FLUXER_MEILISEARCH_ENV", "bundled", "The Meilisearch environment, set as its MEILI_ENV. Use `production` or `development`. With `production`, Meilisearch refuses to start without a master key of at least 16 bytes and turns off its search preview."},
+ {"FLUXER_MEILISEARCH_NO_ANALYTICS", "bundled", "Whether Meilisearch stops sending usage data to the Meilisearch team, set as its MEILI_NO_ANALYTICS. Use `true` or `false`."},
+ {"FLUXER_SEAWEEDFS_TELEMETRY", "bundled", "Whether SeaweedFS sends usage data to the SeaweedFS project, set as its `-master.telemetry`. Use `true` or `false`."},
+ {"LOG_LEVEL", "operations", "How much the api and worker log. Use `trace`, `debug`, `info`, `warn`, `error` or `fatal`. An empty or unknown value gives `info`."},
+ {"RUST_LOG", "operations", "The log filter of media-proxy, app-proxy, admin, push, snowflakes, users, gifs, messages and unfurl, in tracing EnvFilter format such as `debug` or `off`. An empty or invalid filter gives `info`."},
+ {"FLUXER_GATEWAY_LOGGER_LEVEL", "operations", "The gateway log level. Use `debug`, `info`, `notice`, `warning`, `error`, `critical`, `alert` or `emergency`. An empty or unknown value gives `info`. LOGGER_LEVEL wins over this one."},
+ {"LOGGER_LEVEL", "operations", "The gateway log level, which wins over FLUXER_GATEWAY_LOGGER_LEVEL and takes the same levels. An empty or unknown value falls back to FLUXER_GATEWAY_LOGGER_LEVEL."},
+ {"FLUXER_MEILISEARCH_LOG_LEVEL", "operations", "How much Meilisearch logs, set as its MEILI_LOG_LEVEL. Use `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG` or `TRACE`."},
+ {"FLUXER_LIVEKIT_LOG_LEVEL", "operations", "How much LiveKit logs. Use `debug`, `info`, `warn` or `error`."},
+ {"FLUXER_LOG_MAX_SIZE", "operations", "How large the log file of a container grows before Docker rotates it, such as `50m`."},
+ {"FLUXER_LOG_MAX_FILE", "operations", "How many log files Docker keeps for each container when it rotates logs."},
+ {"FLUXER_RESTART_POLICY", "operations", "The Docker restart policy of every long-running service, such as `always`, `on-failure` or `no`."},
+ {"FLUXER_HEALTHCHECK_INTERVAL", "operations", "How often Docker runs the health check of each service, such as `30s`. The media-proxy and app-proxy containers have their own interval settings."},
+ {"FLUXER_MEDIA_PROXY_HEALTHCHECK_INTERVAL", "operations", "How often Docker runs the health check of the media-proxy container."},
+ {"FLUXER_APP_PROXY_HEALTHCHECK_INTERVAL", "operations", "How often Docker runs the health check of the app-proxy container."},
+ {"FLUXER_HEALTHCHECK_TIMEOUT", "operations", "How long one health check may run before Docker counts it as failed."},
+ {"FLUXER_HEALTHCHECK_RETRIES", "operations", "How many failed health checks in a row mark the edge, postgres, valkey, nats, meilisearch, livekit, media-proxy, static-proxy and app-proxy containers as unhealthy."},
+ {"FLUXER_HEALTHCHECK_START_PERIOD", "operations", "How long the edge, postgres, valkey, nats, meilisearch, livekit, media-proxy, static-proxy and app-proxy containers get to start before failed health checks count."},
+ {"FLUXER_HEALTHCHECK_START_INTERVAL", "operations", "How often Docker runs each health check while a service is still in its start period."},
+ {"FLUXER_APP_HEALTHCHECK_RETRIES", "operations", "How many failed health checks in a row mark the api, gateway, push, admin, snowflakes, users, gifs, messages and unfurl containers as unhealthy."},
+ {"FLUXER_APP_HEALTHCHECK_START_PERIOD", "operations", "How long the api, worker and gateway containers get to start before failed health checks count, such as `120s`."},
+ {"FLUXER_SVC_HEALTHCHECK_START_PERIOD", "operations", "How long the push, admin, snowflakes, users, gifs, messages and unfurl containers get to start before failed health checks count."},
+ {"FLUXER_SEAWEEDFS_HEALTHCHECK_RETRIES", "operations", "How many failed health checks in a row mark the seaweedfs container as unhealthy."},
+ {"FLUXER_SEAWEEDFS_HEALTHCHECK_START_PERIOD", "operations", "How long the seaweedfs container gets to start before failed health checks count."},
+ {"FLUXER_WORKER_HEALTHCHECK_RETRIES", "operations", "How many failed health checks in a row mark a worker container as unhealthy. The check passes while the worker has updated its heartbeat file in the last 30 seconds."},
+ {"FLUXER_CADDY_IMAGE", "images", ""},
+ {"FLUXER_POSTGRES_IMAGE", "images", ""},
+ {"FLUXER_VALKEY_IMAGE", "images", ""},
+ {"FLUXER_NATS_IMAGE", "images", ""},
+ {"FLUXER_MEILISEARCH_IMAGE", "images", ""},
+ {"FLUXER_SEAWEEDFS_IMAGE", "images", ""},
+ {"FLUXER_LIVEKIT_IMAGE", "images", ""},
+ {"FLUXER_REGISTRY", "images", "The registry of Fluxer's own images in the docker-compose.yml of the Fluxer repository. When it's empty, that file uses `ghcr.io/` followed by FLUXER_REGISTRY_OWNER. The compose bundle pins every Fluxer image to the release."},
+ {"FLUXER_REGISTRY_OWNER", "images", "The owner of Fluxer's own images on `ghcr.io`, in the docker-compose.yml of the Fluxer repository. The compose bundle pins every Fluxer image to the release."},
+ {"FLUXER_IMAGE_TAG", "images", "The tag of Fluxer's own images in the docker-compose.yml of the Fluxer repository. The compose bundle pins every Fluxer image to the release. `rexctl upgrade --check` reads it to find the release a Docker Compose install runs, and uses `v1` when it's empty."},
+ {"REXCTL_RELEASE_URL", "rexctl", "The URL of the release index that rexctl and its install scripts download releases from. When it's empty, they use https://fluxer.dev/rexctl/release.json. Another server must answer the same queries as that address, including `version` and `format=sh`."},
+ {"REXCTL_IMAGE_SET", "rexctl", "The path of an image set JSON file with a release and its image list, which rexctl uses for its built-in images. Only tests use it."},
+ {"VISUAL", "rexctl", "The editor `rexctl config edit` opens. When it's empty, rexctl uses `EDITOR`."},
+ {"EDITOR", "rexctl", "The editor `rexctl config edit` opens when `VISUAL` is empty. When both are empty, rexctl uses Notepad on Windows and nano or vi elsewhere."},
+ {"NO_COLOR", "rexctl", "Set it to any value to turn off colour in rexctl and its install scripts. A `TERM` of `dumb` turns colour off too."},
+ {"ACCESSIBLE", "rexctl", "Set it to any value to make rexctl ask questions as plain text prompts and print steps as plain lines for screen readers."},
+ {"DOCKER_HOST", "rexctl", "The engine address rexctl tries first, such as `unix:///run/user/1000/podman/podman.sock`. rexctl reads it for install, takeover and restore, and when the engine an instance uses doesn't answer. When it's empty, rexctl uses the current Docker context and then looks for a Docker or Podman socket."},
+ {"DOCKER_CONTEXT", "rexctl", "The Docker context rexctl tries first when DOCKER_HOST is empty. rexctl reads it for install, takeover and restore, and when the engine an instance uses doesn't answer. When it's empty, rexctl uses the current context of the Docker CLI."},
+ {"DOCKER_CONFIG", "rexctl", "The directory of the Docker CLI configuration, which has the current Docker context. When it's empty, rexctl uses `.docker` in your home directory."},
+ {"DISCOVERY_UPSTREAM_URL", "stack", "Where app-proxy loads the instance discovery document from."},
+ {"FLUXER_ADMIN_PORT", "stack", "The port the admin service listens on inside its container."},
+ {"FLUXER_API_PORT", "stack", "The port the api service listens on inside its container."},
+ {"FLUXER_API_PUBLIC_ENDPOINT", "stack", "The public API address the admin panel allows images from, set from FLUXER_API_ENDPOINT."},
+ {"FLUXER_API_WORKER_ENABLE_CRON_SCHEDULER", "stack", "Whether the worker runs the scheduled jobs."},
+ {"FLUXER_API_WORKER_MODE", "stack", "Which job lanes the worker runs."},
+ {"FLUXER_APP_PROXY_PORT", "stack", "The port the app-proxy service listens on inside its container."},
+ {"FLUXER_BASE_DOMAIN", "stack", "The domain the services build their addresses from, set from FLUXER_DOMAIN."},
+ {"FLUXER_DATABASE_BACKEND", "stack", "The database the services use."},
+ {"FLUXER_EDGE_TLS_DIRECTIVE", "stack", "The tls line of the edge Caddyfile, set from FLUXER_EDGE_TLS."},
+ {"FLUXER_ENV", "stack", "The environment the services run in."},
+ {"FLUXER_GATEWAY_PORT", "stack", "The port the gateway listens on inside its container."},
+ {"FLUXER_INTERNAL_API_ENDPOINT", "stack", "The address the services use to call the api service inside the stack."},
+ {"FLUXER_INTERNAL_MEDIA_PROXY_ENDPOINT", "stack", "The address the services use to call the media proxy inside the stack."},
+ {"FLUXER_LIVEKIT_API_KEY", "stack", "The LiveKit API key the services use, set from LIVEKIT_API_KEY."},
+ {"FLUXER_LIVEKIT_API_SECRET", "stack", "The LiveKit API secret the services use, set from LIVEKIT_API_SECRET."},
+ {"FLUXER_MEDIA_PROXY_ENDPOINT", "stack", "The address the unfurl service uses to call the media proxy. The api and worker also read it when FLUXER_INTERNAL_MEDIA_PROXY_ENDPOINT is empty."},
+ {"FLUXER_MEDIA_PROXY_MODE", "stack", "How the media proxy runs."},
+ {"FLUXER_MEDIA_PROXY_PORT", "stack", "The port the media proxy listens on inside its container."},
+ {"FLUXER_MEDIA_PROXY_STORAGE_BACKEND", "stack", "Where the media proxy keeps files."},
+ {"FLUXER_POSTGRES_MAX_CONNECTIONS", "stack", "The size of each service's Postgres connection pool, set from FLUXER_API_POSTGRES_MAX_CONNECTIONS, FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS, FLUXER_USERS_POSTGRES_MAX_CONNECTIONS or FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS."},
+ {"FLUXER_POSTGRES_PASSWORD", "stack", "The Postgres password the services use, set from POSTGRES_PASSWORD."},
+ {"FLUXER_S3_ACCESS_KEY_ID", "stack", "The object store access key the services use, set from FLUXER_S3_ACCESS_KEY."},
+ {"FLUXER_S3_SECRET_ACCESS_KEY", "stack", "The object store secret key the services use, set from FLUXER_S3_SECRET_KEY."},
+ {"FLUXER_SEARCH_API_KEY", "stack", "The search API key the services use, set from MEILI_MASTER_KEY."},
+ {"FLUXER_SELF_HOSTED", "stack", "Whether the services run as a self-hosted instance."},
+ {"FLUXER_SVC_MODE", "stack", "How the snowflakes, users, gifs, messages and unfurl services run."},
+ {"FLUXER_SVC_NAME", "stack", "The service name the internal services use to pick their default for FLUXER_SVC_MAX_CONCURRENT_REQUESTS. Each image always runs its own service. Docker Compose sets it to the name of each service, such as `users`."},
+ {"FLUXER_SVC_SHARD_COUNT", "stack", "How many shards each internal service has."},
+ {"GOMEMLIMIT", "stack", "The soft memory limit of the Go runtime in NATS, LiveKit and SeaweedFS, set from FLUXER_NATS_GOMEMLIMIT, FLUXER_LIVEKIT_GOMEMLIMIT and FLUXER_SEAWEEDFS_GOMEMLIMIT."},
+ {"LIVEKIT_CONFIG", "stack", "The LiveKit config in YAML, built from the voice and video settings and LIVEKIT_API_KEY."},
+ {"LIVEKIT_KEYS", "stack", "The LiveKit API key and secret pair, set from LIVEKIT_API_KEY and LIVEKIT_API_SECRET."},
+ {"MALLOC_ARENA_MAX", "stack", "The glibc memory arena limit of the push, admin, snowflakes, users, gifs, messages and unfurl services, set from FLUXER_MALLOC_ARENA_MAX."},
+ {"MEILI_ENV", "stack", "The Meilisearch environment, set from FLUXER_MEILISEARCH_ENV."},
+ {"MEILI_LOG_LEVEL", "stack", "The Meilisearch log level, set from FLUXER_MEILISEARCH_LOG_LEVEL."},
+ {"MEILI_MAX_INDEXING_MEMORY", "stack", "The memory Meilisearch aims to stay under while indexing, set from FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY."},
+ {"MEILI_MAX_INDEXING_THREADS", "stack", "The most threads Meilisearch may use for indexing, set from FLUXER_MEILISEARCH_MAX_INDEXING_THREADS."},
+ {"MEILI_NO_ANALYTICS", "stack", "Whether Meilisearch stops sending usage data, set from FLUXER_MEILISEARCH_NO_ANALYTICS."},
+ {"MEILI_UPGRADE_DB", "stack", "Whether Meilisearch upgrades its database on start after a version change."},
+ {"NODE_EXTRA_CA_CERTS", "stack", "The extra CA certificates Node trusts in the api and worker services, set from FLUXER_NODE_EXTRA_CA_CERTS."},
+ {"NODE_OPTIONS", "stack", "The Node options of the api and worker services, built from FLUXER_API_NODE_HEAP_MB, FLUXER_API_NODE_OPTIONS, FLUXER_WORKER_NODE_HEAP_MB and FLUXER_WORKER_NODE_OPTIONS."},
+ {"POSTGRES_DB", "stack", "The database the bundled Postgres creates on its first start, set from FLUXER_POSTGRES_DATABASE."},
+ {"POSTGRES_USER", "stack", "The role the bundled Postgres creates on its first start, set from FLUXER_POSTGRES_USERNAME."},
+ {"TOKIO_WORKER_THREADS", "stack", "How many async worker threads the Rust services use, set from FLUXER_TOKIO_WORKER_THREADS or FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS."},
+ {"WEED_MASTER_VOLUME_GROWTH_COPY_1", "stack", "How many volumes SeaweedFS creates at once, set from FLUXER_SEAWEEDFS_VOLUME_GROWTH."},
+ {"http_proxy", "stack", "Docker Compose also sets `http_proxy` to this value for tools that only look up the lowercase name."},
+ {"https_proxy", "stack", "Docker Compose also sets `https_proxy` to this value for tools that only look up the lowercase name."},
+ {"no_proxy", "stack", "Docker Compose also sets `no_proxy` to this value for tools that only look up the lowercase name."},
+ {"ALL_PROXY", "internal", "The proxy the Rust services use for HTTP and HTTPS requests when HTTP_PROXY or HTTPS_PROXY is empty. They also take the lowercase `all_proxy`."},
+ {"BUILD_VERSION", "internal", "The build version a service reports. Each image sets its own."},
+ {"FLUXER_ADMIN_HOST", "internal", "The address the admin service listens on. When it's empty, it listens on `0.0.0.0`."},
+ {"FLUXER_ADMIN_OAUTH_CLIENT_ID", "internal", "The OAuth2 client ID the admin panel signs in with. The stack uses the built-in client ID of the admin service."},
+ {"FLUXER_ADMIN_OAUTH_REDIRECT_URI", "internal", "The OAuth2 redirect URL of the admin panel. The admin service works it out from its own address."},
+ {"FLUXER_API_AUTOMATED_MESSAGE_DELETION_DELAY_DAYS", "hosted", "The delay before automated account actions delete messages, in days."},
+ {"FLUXER_API_WORKER_LANE", "internal", "The job lane a worker runs when FLUXER_API_WORKER_MODE is `single_lane`. Each worker container in the stack runs every lane."},
+ {"FLUXER_API_WORKER_METRICS_PORT", "internal", "The port the worker serves its metrics on. The stack doesn't collect worker metrics."},
+ {"FLUXER_API_WORKER_TASK", "internal", "The one task a worker runs when FLUXER_API_WORKER_MODE is `single_task`. Each worker container in the stack runs every lane."},
+ {"FLUXER_APP_PROXY_HOST", "internal", "The address the app-proxy service listens on. When it's empty, it listens on `0.0.0.0`."},
+ {"FLUXER_APP_STORE_APPS", "hosted", "The App Store apps Fluxer sells in."},
+ {"FLUXER_APP_STORE_ENABLED", "hosted", "Whether App Store purchases are on."},
+ {"FLUXER_APP_STORE_ISSUER_ID", "hosted", "The App Store Connect issuer ID."},
+ {"FLUXER_APP_STORE_KEY_ID", "hosted", "The App Store Connect key ID."},
+ {"FLUXER_APP_STORE_PRIVATE_KEY", "hosted", "The App Store Connect private key."},
+ {"FLUXER_APP_STORE_PRIVATE_KEY_PATH", "hosted", "The path to the App Store Connect private key."},
+ {"FLUXER_APP_STORE_PRODUCTS", "hosted", "The App Store products and what they grant."},
+ {"FLUXER_BUILD_VERSION", "internal", "The older name for BUILD_VERSION, which only the admin and app-proxy services read when BUILD_VERSION is empty. Their images set BUILD_VERSION."},
+ {"FLUXER_CASSANDRA_HOSTS", "cassandra", "The Cassandra hosts."},
+ {"FLUXER_CASSANDRA_KEYSPACE", "cassandra", "The Cassandra keyspace."},
+ {"FLUXER_CASSANDRA_LOCAL_DC", "cassandra", "The local Cassandra data centre."},
+ {"FLUXER_CASSANDRA_PASSWORD", "cassandra", "The Cassandra password."},
+ {"FLUXER_CASSANDRA_PORT", "cassandra", "The Cassandra port."},
+ {"FLUXER_CASSANDRA_USERNAME", "cassandra", "The Cassandra username."},
+ {"FLUXER_DISABLE_RATE_LIMITS", "dev", "Whether rate limits are off."},
+ {"FLUXER_DOCS_ENDPOINT", "docs", "The public address of the docs site."},
+ {"FLUXER_DOCS_LISTEN_HOST", "docs", "The address the docs site listens on."},
+ {"FLUXER_DOCS_LISTEN_PORT", "docs", "The port the docs site listens on."},
+ {"FLUXER_DOCS_SEARCH_INDEXING", "docs", "Whether search engines may index the docs site."},
+ {"FLUXER_ERLANG_COOKIE_FILE", "internal", "A file that has the gateway's Erlang cookie. The stack passes FLUXER_ERLANG_COOKIE itself."},
+ {"FLUXER_ERLANG_DIST_PORT", "cluster", "The Erlang distribution port of the gateway."},
+ {"FLUXER_ERLANG_NODE_NAME", "cluster", "The Erlang node name of the gateway."},
+ {"FLUXER_ERLANG_NODE_NAME_PREFIX", "cluster", "A prefix that gives each gateway node a unique Erlang node name."},
+ {"FLUXER_GATEWAY_API_RPC_ENDPOINT", "internal", "The URL the gateway sends API RPC requests to. When it's empty, the gateway uses FLUXER_INTERNAL_API_ENDPOINT followed by `/internal/rpc`."},
+ {"FLUXER_GATEWAY_CLUSTER_DISCOVERY_DNS_NAME", "cluster", "The DNS name gateway nodes find each other through."},
+ {"FLUXER_GATEWAY_CLUSTER_DISCOVERY_NODE_BASENAME", "cluster", "The node name gateway nodes use when they find each other through DNS."},
+ {"FLUXER_GATEWAY_CLUSTER_DISCOVERY_POLL_INTERVAL_MS", "cluster", "How often gateway nodes look for each other, in milliseconds."},
+ {"FLUXER_GATEWAY_CLUSTER_ENABLED", "cluster", "Whether the gateway runs as a cluster."},
+ {"FLUXER_GATEWAY_CLUSTER_STATIC_PEERS", "cluster", "A fixed list of the other gateway nodes."},
+ {"FLUXER_GATEWAY_GUILD_PIN_KEEPER_BASE_MD5S", "cluster", "The module MD5s a node may have before the gateway patches it."},
+ {"FLUXER_GATEWAY_GUILD_PIN_KEEPER_BEAM", "cluster", "The path of the BEAM file the gateway loads onto other nodes to pin communities."},
+ {"FLUXER_GATEWAY_GUILD_PIN_KEEPER_BEAM_MD5", "cluster", "The MD5 that the FLUXER_GATEWAY_GUILD_PIN_KEEPER_BEAM file must have."},
+ {"FLUXER_GATEWAY_NATS_RPC_ENABLED", "internal", "Whether the gateway answers RPC requests over NATS. The gateway answers the API only over NATS RPC and must keep it turned on."},
+ {"FLUXER_GATEWAY_PINNED_GUILD_IDS", "cluster", "The communities the gateway pins to particular nodes."},
+ {"FLUXER_GATEWAY_ROLE", "cluster", "The role of a gateway node in a cluster."},
+ {"FLUXER_GIF_SERVICE_SUBJECT", "internal", "The NATS subject the API sends gifs service requests to. The gifs service always listens on `svc.gifs`, and any other value breaks GIF search."},
+ {"FLUXER_GOOGLE_PLAY_CLIENT_EMAIL", "hosted", "The Google Play service account email."},
+ {"FLUXER_GOOGLE_PLAY_ENABLED", "hosted", "Whether Google Play purchases are on."},
+ {"FLUXER_GOOGLE_PLAY_PACKAGES", "hosted", "The Android packages Fluxer sells in."},
+ {"FLUXER_GOOGLE_PLAY_PRIVATE_KEY", "hosted", "The Google Play service account private key."},
+ {"FLUXER_GOOGLE_PLAY_PRIVATE_KEY_PATH", "hosted", "The path to the Google Play service account private key."},
+ {"FLUXER_GOOGLE_PLAY_PRODUCTS", "hosted", "The Google Play products and what they grant."},
+ {"FLUXER_GOOGLE_PLAY_PUSH_AUDIENCE", "hosted", "The audience the API expects in the token on Google Play billing notifications from Pub/Sub."},
+ {"FLUXER_GOOGLE_PLAY_PUSH_SERVICE_ACCOUNT_EMAIL", "hosted", "The service account email the API expects in the token on Google Play billing notifications from Pub/Sub."},
+ {"FLUXER_GOOGLE_PLAY_SELF_SERVICE_REFUNDS", "hosted", "Whether people can request Google Play refunds themselves."},
+ {"FLUXER_GOOGLE_PLAY_SERVICE_ACCOUNT_JSON_PATH", "hosted", "The path to the Google Play service account JSON file."},
+ {"FLUXER_GOOGLE_PLAY_TOKEN_URI", "hosted", "The OAuth token URL for Google Play."},
+ {"FLUXER_LABS_GUILD_ID", "hosted", "The community Operator Pass holders join."},
+ {"FLUXER_LABS_OPERATOR_ROLE_ID", "hosted", "The role Operator Pass holders get in that community."},
+ {"FLUXER_MEDIA_PROXY_HOST", "internal", "The address the media proxy listens on. When it's empty, it listens on `0.0.0.0`."},
+ {"FLUXER_MEDIA_PROXY_STORAGE_ROOT", "internal", "The directory the media proxy keeps files in when it stores them on disk. The stack keeps media in the object store."},
+ {"FLUXER_NATS_CORE_URL", "internal", "The older name for FLUXER_NATS_URL, which only the api and worker read. Docker Compose passes FLUXER_NATS_URL."},
+ {"FLUXER_OPERATOR_PASS_GRACE_MINUTES", "hosted", "The grace period of the Operator Pass sale, in minutes."},
+ {"FLUXER_OPERATOR_PASS_MAX_QUANTITY", "hosted", "The largest Operator Pass quantity in one purchase."},
+ {"FLUXER_OPERATOR_PASS_NOW", "dev", "A clock override for the Operator Pass sale."},
+ {"FLUXER_OPERATOR_PASS_PRICE_BRL_ENABLED", "hosted", "Whether the Operator Pass is sold in BRL."},
+ {"FLUXER_OPERATOR_PASS_PRICE_DKK_ENABLED", "hosted", "Whether the Operator Pass is sold in DKK."},
+ {"FLUXER_OPERATOR_PASS_PRICE_INR_ENABLED", "hosted", "Whether the Operator Pass is sold in INR."},
+ {"FLUXER_OPERATOR_PASS_PRICE_NOK_ENABLED", "hosted", "Whether the Operator Pass is sold in NOK."},
+ {"FLUXER_OPERATOR_PASS_PRICE_PLN_ENABLED", "hosted", "Whether the Operator Pass is sold in PLN."},
+ {"FLUXER_OPERATOR_PASS_PRICE_RISES_AT", "hosted", "When the Operator Pass price rises."},
+ {"FLUXER_OPERATOR_PASS_PRICE_SEK_ENABLED", "hosted", "Whether the Operator Pass is sold in SEK."},
+ {"FLUXER_OPERATOR_PASS_PRICE_TRY_ENABLED", "hosted", "Whether the Operator Pass is sold in TRY."},
+ {"FLUXER_OPERATOR_PASS_RELEASE_LISTS", "hosted", "The release lists of the Operator Pass sale."},
+ {"FLUXER_OPERATOR_PASS_SALE_OPENS_AT", "hosted", "When the Operator Pass sale opens."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_BRL", "hosted", "The standard Operator Pass price in BRL."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_DKK", "hosted", "The standard Operator Pass price in DKK."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_EUR", "hosted", "The standard Operator Pass price in EUR."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_INR", "hosted", "The standard Operator Pass price in INR."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_NOK", "hosted", "The standard Operator Pass price in NOK."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_PLN", "hosted", "The standard Operator Pass price in PLN."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_SEK", "hosted", "The standard Operator Pass price in SEK."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_TRY", "hosted", "The standard Operator Pass price in TRY."},
+ {"FLUXER_OPERATOR_PASS_STANDARD_PRICE_USD", "hosted", "The standard Operator Pass price in USD."},
+ {"FLUXER_OPERATOR_PASS_STOPPED_COUNTRIES", "hosted", "Countries where Operator Pass sales are stopped."},
+ {"FLUXER_OPERATOR_PASS_TRANSFER_LOCK_HOURS", "hosted", "How long an Operator Pass transfer stays locked, in hours."},
+ {"FLUXER_OPERATOR_PASS_WALL_TIERS", "hosted", "The wall tiers of the Operator Pass sale."},
+ {"FLUXER_OPERATOR_PASS_WITHDRAWAL_COUNTRIES", "hosted", "The Operator Pass withdrawal rules for each country."},
+ {"FLUXER_OPERATOR_SOCKET", "dev", "The socket path the operator relay connects to. The api listens on /run/fluxer/operator.sock."},
+ {"FLUXER_PAYMENT_DISPUTE_CLOSURE_EFFECTIVE_AT", "hosted", "When account closures for payment disputes take effect."},
+ {"FLUXER_PUSH_RELAY_MAX_BODY_BYTES", "relay", "The largest request the push relay accepts, in bytes."},
+ {"FLUXER_PUSH_RELAY_MAX_CONCURRENT", "relay", "How many requests the push relay handles at once."},
+ {"FLUXER_PUSH_RELAY_SOURCE_BUCKET_BURST", "relay", "How many requests the push relay allows from one client address in a burst."},
+ {"FLUXER_PUSH_RELAY_SOURCE_BUCKET_ENABLED", "relay", "Whether the push relay rate limits each client address itself."},
+ {"FLUXER_PUSH_RELAY_SOURCE_BUCKET_ENTRIES", "relay", "How many client addresses the push relay rate limit tracks."},
+ {"FLUXER_PUSH_RELAY_SOURCE_BUCKET_PER_MINUTE", "relay", "How many requests a minute the push relay allows from one client address."},
+ {"FLUXER_PUSH_RELAY_TOKEN_BUCKET_BURST", "relay", "How many requests the push relay allows for one device token in a burst."},
+ {"FLUXER_PUSH_RELAY_TOKEN_BUCKET_ENTRIES", "relay", "How many device tokens the push relay rate limit tracks."},
+ {"FLUXER_PUSH_RELAY_TOKEN_BUCKET_PER_MINUTE", "relay", "How many requests a minute the push relay allows for one device token."},
+ {"FLUXER_PUSH_RELAY_TRUSTED_PROXY_HOPS", "relay", "How many proxies in front of the push relay it trusts."},
+ {"FLUXER_PUSH_SERVICE_HOST", "internal", "The address the push service listens on. When it's empty, it listens on `0.0.0.0`."},
+ {"FLUXER_PUSH_SERVICE_PORT", "internal", "The port the push service listens on. When it's empty, it uses `8126`, or `8127` for the push relay."},
+ {"FLUXER_RELAX_REGISTRATION_RATE_LIMITS", "dev", "Whether registration rate limits are relaxed."},
+ {"FLUXER_S3_BUCKET_STATIC", "internal", "The bucket the media proxy serves files from when FLUXER_MEDIA_PROXY_MODE is `static`. The stack runs the media proxy in `upload` mode."},
+ {"FLUXER_SNOWFLAKE_SERVICE_SUBJECT", "internal", "The NATS subject the API sends snowflakes service requests to. The snowflakes service always listens on `svc.snowflakes`, and any other value breaks ID generation."},
+ {"FLUXER_STATIC_DIR", "internal", "The directory the app-proxy service serves static files from. The app-proxy image has its static files built in."},
+ {"FLUXER_STORE_BILLING_SANDBOX_ENTITLES_ALL", "hosted", "Whether sandbox store purchases count for every account."},
+ {"FLUXER_STORE_BILLING_SANDBOX_USER_IDS", "hosted", "The accounts whose sandbox store purchases count."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_BRL", "prices", "The price ID of the one-month gift in BRL."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_DKK", "prices", "The price ID of the one-month gift in DKK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_EUR", "prices", "The price ID of the one-month gift in EUR."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_INR", "prices", "The price ID of the one-month gift in INR."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_ISK", "prices", "The price ID of the one-month gift in ISK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_NOK", "prices", "The price ID of the one-month gift in NOK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_PLN", "prices", "The price ID of the one-month gift in PLN."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_SEK", "prices", "The price ID of the one-month gift in SEK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_TRY", "prices", "The price ID of the one-month gift in TRY."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_MONTH_USD", "prices", "The price ID of the one-month gift in USD."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_BRL", "prices", "The price ID of the one-year gift in BRL."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_DKK", "prices", "The price ID of the one-year gift in DKK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_EUR", "prices", "The price ID of the one-year gift in EUR."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_INR", "prices", "The price ID of the one-year gift in INR."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_ISK", "prices", "The price ID of the one-year gift in ISK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_NOK", "prices", "The price ID of the one-year gift in NOK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_PLN", "prices", "The price ID of the one-year gift in PLN."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_SEK", "prices", "The price ID of the one-year gift in SEK."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_TRY", "prices", "The price ID of the one-year gift in TRY."},
+ {"FLUXER_STRIPE_PRICE_GIFT_1_YEAR_USD", "prices", "The price ID of the one-year gift in USD."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_BRL", "prices", "The price ID of the monthly plan in BRL."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_DKK", "prices", "The price ID of the monthly plan in DKK."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_EUR", "prices", "The price ID of the monthly plan in EUR."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_INR", "prices", "The price ID of the monthly plan in INR."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_ISK", "prices", "The price ID of the monthly plan in ISK."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_NOK", "prices", "The price ID of the monthly plan in NOK."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_PLN", "prices", "The price ID of the monthly plan in PLN."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_SEK", "prices", "The price ID of the monthly plan in SEK."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_TRY", "prices", "The price ID of the monthly plan in TRY."},
+ {"FLUXER_STRIPE_PRICE_MONTHLY_USD", "prices", "The price ID of the monthly plan in USD."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_BRL", "prices", "The price ID of the yearly plan in BRL."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_DKK", "prices", "The price ID of the yearly plan in DKK."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_EUR", "prices", "The price ID of the yearly plan in EUR."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_INR", "prices", "The price ID of the yearly plan in INR."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_ISK", "prices", "The price ID of the yearly plan in ISK."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_NOK", "prices", "The price ID of the yearly plan in NOK."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_PLN", "prices", "The price ID of the yearly plan in PLN."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_SEK", "prices", "The price ID of the yearly plan in SEK."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_TRY", "prices", "The price ID of the yearly plan in TRY."},
+ {"FLUXER_STRIPE_PRICE_YEARLY_USD", "prices", "The price ID of the yearly plan in USD."},
+ {"FLUXER_SVC_LISTEN_HOST", "internal", "The address an internal service listens on. When it's empty, it listens on `0.0.0.0`."},
+ {"FLUXER_SVC_PORT", "internal", "The port an internal service listens on. When it's empty, it uses `8090`."},
+ {"FLUXER_SVC_SHARD_ID", "internal", "Which shard of an internal service a container runs. When it's empty, the service takes the number at the end of POD_NAME, or `0`. The stack runs one shard of each service."},
+ {"FLUXER_TEST_HARNESS_TOKEN", "dev", "The token of the test harness."},
+ {"FLUXER_TEST_MODE_ENABLED", "dev", "Whether test mode is on."},
+ {"FLUXER_USERS_SERVICE_SUBJECT", "internal", "The NATS subject the API sends users service requests to. The users service always listens on `svc.users`, and any other value breaks user lookups."},
+ {"FLUXER_VALKEY_PASSWORD", "internal", "The password of the Valkey that the Fluxer Helm chart runs, at least 32 letters and digits. The chart builds FLUXER_KV_URL from it."},
+ {"FLUXER_VALIDATE_RESPONSES", "dev", "Whether the API checks its responses against their schemas."},
+ {"G_MESSAGES_DEBUG", "internal", "The GLib log domains whose debug messages libvips prints in the media proxy, or `all`. The media-proxy image sets it to an empty value and GLib prints none."},
+ {"HOSTNAME", "internal", "The hostname of the container. Docker sets it."},
+ {"KLIPY_API_KEY", "internal", "The older name for FLUXER_KLIPY_API_KEY, used only by the unfurl service. Docker Compose passes FLUXER_KLIPY_API_KEY."},
+ {"LD_PRELOAD", "internal", "Libraries the dynamic loader loads before any others. The media-proxy and app-proxy images set it to `libjemalloc.so.2` to use the jemalloc memory allocator."},
+ {"LIVEKIT_WEBHOOK_URL", "internal", "The address the bundled LiveKit sends its webhooks to. The Fluxer Helm chart sets it on the LiveKit pod and adds it to the LiveKit config."},
+ {"MALLOC_CONF", "internal", "The jemalloc options of the media proxy and app-proxy. Both images set it to `background_thread:true,metadata_thp:auto,dirty_decay_ms:5000,muzzy_decay_ms:5000`."},
+ {"NODE_ENV", "internal", "The Node environment that libraries in the api and worker look up. The api image sets it to `production`."},
+ {"NODE_TLS_REJECT_UNAUTHORIZED", "internal", "With `0`, Node in the api and worker checks no certificates on outgoing TLS connections, except Postgres when FLUXER_POSTGRES_SSL is `true`. To trust your own CA, use FLUXER_NODE_EXTRA_CA_CERTS."},
+ {"PGDATA", "internal", "The directory the bundled Postgres keeps its data in. The Fluxer Helm chart sets it on the Postgres pod."},
+ {"PGSSLMODE", "internal", "The libpq TLS mode the api and worker use when FLUXER_POSTGRES_SSL isn't `true` and FLUXER_POSTGRES_URL has no `sslmode`. With `prefer`, `require`, `verify-ca` or `verify-full`, they connect over TLS and check the server certificate. With `no-verify`, they connect over TLS without checking it. The other services don't use it."},
+ {"POD_IP", "internal", "The IP address of a gateway pod. The Fluxer Helm chart sets it on the gateway pods and builds FLUXER_ERLANG_NODE_NAME from it."},
+ {"POD_NAME", "internal", "The name of the pod a service runs in. The api and gateway label their RPC timings with it, or with `HOSTNAME` when it's empty, and the gateway reports it in its node details. When FLUXER_SVC_SHARD_ID is empty, an internal service runs the shard numbered at the end of the pod name, such as `2` for `users-2`. The Fluxer Helm chart sets it on the shard pods of the internal services and on the NATS pods."},
+ {"REDISCLI_AUTH", "internal", "The password of the bundled Valkey. The Fluxer Helm chart sets it on the Valkey pod from FLUXER_VALKEY_PASSWORD and starts Valkey with it."},
+ {"RELEASE_CHANNEL", "internal", "The release channel the app-proxy service puts in the web app, `stable` or `canary`. The self-hosted app-proxy service serves the stable channel."},
+ {"RELX_REPLACE_OS_VARS", "internal", "Whether the gateway release scripts fill in environment variables in the gateway config. The gateway entrypoint sets it."},
+ {"SSL_CERT_DIR", "internal", "Directories of CA certificate files, separated by colons, that the Rust services trust for outgoing TLS. When it or SSL_CERT_FILE is set, they trust only those certificates."},
+ {"SSL_CERT_FILE", "internal", "A PEM file of CA certificates that the Rust services trust for outgoing TLS, such as to your own object store or Postgres. When it or SSL_CERT_DIR is set, they trust only those certificates. Add your CA to a copy of the system bundle."},
+ {"VIPS_CONCURRENCY", "internal", "How many threads libvips uses for each image transform. The media proxy always runs libvips with one thread per transform and ignores it. FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS sets how many transforms run at once."},
+ {"VIPS_DISC_THRESHOLD", "internal", "The image size above which libvips in the media proxy decodes an image to a temporary file on disk. The media-proxy image sets it to `1g`."},
+ {"YOUTUBE_API_KEY", "internal", "The older name for FLUXER_YOUTUBE_API_KEY, used only by the unfurl service. Docker Compose passes FLUXER_YOUTUBE_API_KEY."},
+}
diff --git a/fluxer_rexctl/internal/instance/shipped.json b/fluxer_rexctl/internal/instance/shipped.json
index 03528fa1a..455b7d7da 100644
--- a/fluxer_rexctl/internal/instance/shipped.json
+++ b/fluxer_rexctl/internal/instance/shipped.json
@@ -81,6 +81,7 @@
"e38726fc3b4e576d508a802de8d1895847dcaee19a96c2e4e69ec69f8767f137",
"e627bc200a090fe621c5bf4a37a08232a51d92f1469a13ec56ca767bfbe32533",
"e63134f1ade042a11b5bfaa59875ffe0a4901ba906a3df7f2cc5dbca3db5421e",
+ "e9568f8e2b1bbf1a069ebde3963936c5522bd4fd2cb3c425ccf56a04f1b9c04b",
"ebc9f56fa49a171f9371df6846b3cdb66352854732203b299da73d0d687b0107",
"f022666ee8ed968329315c408ac3700e5f4f7e3a79eebfd7ce5fa951af3251f9",
"f175f1c9e5baab1acbdafccc34c87b0643b701fe256b7ccc58f5b9c88c3c84f2",
@@ -214,6 +215,7 @@
"bfc19bc0e3349dd34b6fc9a2fd7fbb91cdd2a5ee8ad1d9c8c657357e210a0565",
"c3a465d03d5b5586e034e0cf4233f44af04a2d1c23d914746d8b1ccdfabf6755",
"c56fb86903863572911f77bb8fd5b50a7ca349b609e885a998f8ff73b0013f75",
+ "c786df7186b0fd5d30395fffa21d840048767e8a23e05f1564656d0a4cae24f1",
"ca06da11049cb7bfe07606ab5544dd0eb9f03c688859bdc716ea17a1f5c1f537",
"ca4d5b546e7f382e4da53856409ede3a4ce5e1e04f911f404ebad079fc986a93",
"cb4e7e88c507e8fc897dcd9c433accfcf44e3ad30c0bcfa6301e935d023ac8c1",
diff --git a/fluxer_rexctl/internal/mdx/mdx.go b/fluxer_rexctl/internal/mdx/mdx.go
new file mode 100644
index 000000000..084cd9e3e
--- /dev/null
+++ b/fluxer_rexctl/internal/mdx/mdx.go
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package mdx
+
+import "strings"
+
+func Prose(s string) string {
+ var b strings.Builder
+ code := false
+ for _, r := range s {
+ if r == '`' {
+ code = !code
+ }
+ if !code && strings.ContainsRune("<{}", r) {
+ b.WriteByte('\\')
+ }
+ b.WriteRune(r)
+ }
+ return b.String()
+}
diff --git a/fluxer_rexctl/internal/settings/effective.go b/fluxer_rexctl/internal/settings/effective.go
index 6af610cb3..34355bb87 100644
--- a/fluxer_rexctl/internal/settings/effective.go
+++ b/fluxer_rexctl/internal/settings/effective.go
@@ -4,6 +4,7 @@ package settings
import (
"fmt"
+ "maps"
"net"
"slices"
"strconv"
@@ -157,6 +158,10 @@ func derived(chosen map[string]string) map[string]string {
return out
}
+func DerivedVars() []string {
+ return slices.Sorted(maps.Keys(derived(map[string]string{Domain: "example.com"})))
+}
+
func RewriteRegistry(ref, registry string) string {
name, digest, ok := strings.Cut(ref, "@")
if !ok || !strings.HasPrefix(digest, "sha256:") || registry == "" {
diff --git a/fluxer_rexctl/internal/settings/keys.go b/fluxer_rexctl/internal/settings/keys.go
index 28557abd0..26869af3d 100644
--- a/fluxer_rexctl/internal/settings/keys.go
+++ b/fluxer_rexctl/internal/settings/keys.go
@@ -89,7 +89,7 @@ func buildNamed() []Key {
Help: "The domain Fluxer runs on",
Confirm: "Fluxer gets a new certificate for the new domain. Passkeys made for the old domain stop working. The domain_migration settings help people move over."},
{Name: EdgeMode, Type: "choice", Options: []string{EdgeBundled, EdgeProxy, EdgeTunnel}, Validate: oneOf(EdgeBundled, EdgeProxy, EdgeTunnel),
- Help: "Whether Fluxer serves HTTPS itself, sits behind your reverse proxy or behind a tunnel"},
+ Help: "Whether Fluxer serves HTTPS itself or runs behind your reverse proxy or a tunnel"},
{Name: EdgeBind, Type: "address", Vars: []string{"FLUXER_EDGE_BIND"}, Validate: validBind,
Help: "The address your reverse proxy or tunnel connects to"},
{Name: EdgeHTTPPort, Type: "port", Vars: []string{"FLUXER_HTTP_PORT"}, Validate: validPort,
@@ -99,7 +99,7 @@ func buildNamed() []Key {
{Name: EdgePublicPort, Type: "port", Vars: []string{"FLUXER_PUBLIC_PORT"}, Validate: validPort,
Help: "The port people use in Fluxer's address, when it differs from the one Fluxer listens on"},
{Name: EdgeTrusted, Type: "list", Vars: []string{"FLUXER_EDGE_TRUSTED_PROXIES"}, Validate: validTrustedProxies,
- Help: "Proxies whose client address headers Fluxer trusts"},
+ Help: "Proxies whose client address headers Fluxer trusts, separated by spaces"},
{Name: VoiceTCPPort, Type: "port", Vars: []string{"FLUXER_LIVEKIT_TCP_PORT"}, Validate: validPort,
Help: "The TCP port for voice and video"},
{Name: VoiceUDPPort, Type: "port", Vars: []string{"FLUXER_LIVEKIT_UDP_PORT"}, Validate: validPort,
@@ -107,7 +107,7 @@ func buildNamed() []Key {
{Name: VoicePublicIP, Type: "ip", Vars: []string{"FLUXER_LIVEKIT_NODE_IP", "FLUXER_LIVEKIT_USE_EXTERNAL_IP"}, Validate: validIP,
Help: "The public IP address voice and video use, when Fluxer can't find it by itself"},
{Name: StorageEndpoint, Type: "url", Vars: []string{"FLUXER_S3_ENDPOINT"}, Validate: validURL, Confirm: storageConfirm,
- Help: "Your own S3-compatible object store"},
+ Help: "The address of the S3-compatible object store"},
{Name: StoragePublic, Type: "url", Vars: []string{"FLUXER_S3_PUBLIC_ENDPOINT"}, Validate: validURL, Confirm: storageConfirm,
Help: "The object store address browsers use, when it differs from the one Fluxer uses"},
{Name: StorageRegion, Type: "text", Vars: []string{"FLUXER_S3_REGION"}, Validate: validText, Confirm: storageConfirm,
@@ -119,25 +119,28 @@ func buildNamed() []Key {
{Name: StorageSecret, Type: "secret", Vars: []string{"FLUXER_S3_SECRET_KEY"}, Validate: validText, Secret: true, Confirm: storageConfirm,
Help: "The object store secret key"},
{Name: HTTPProxy, Type: "url", Vars: []string{"HTTP_PROXY"}, Validate: validURL,
- Help: "The proxy Fluxer uses for outgoing HTTP requests"},
+ Help: "The proxy the Rust services other than the app-proxy use for outgoing HTTP requests"},
{Name: HTTPSProxy, Type: "url", Vars: []string{"HTTPS_PROXY"}, Validate: validURL,
- Help: "The proxy Fluxer uses for outgoing HTTPS requests"},
+ Help: "The proxy the Rust services other than the app-proxy use for outgoing HTTPS requests"},
{Name: NoProxy, Type: "list", Vars: []string{"NO_PROXY"}, Validate: validText,
- Help: "Hosts Fluxer connects to without the proxy"},
+ Help: "Hosts the Rust services other than the app-proxy connect to without the proxy, separated by commas"},
{Name: IPv6, Type: "bool", Validate: validBool, Confirm: "Every Fluxer service restarts.",
Help: "Whether Fluxer's network uses IPv6"},
{Name: SSOPrivate, Type: "bool", Vars: []string{"FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES"}, Validate: validBool,
Help: "Whether single sign-on can use a provider on a private or local network address"},
{Name: ImagesRegistry, Type: "registry", Validate: validRegistry,
- Help: "A registry mirror for the database, cache, search, storage, voice and edge images"},
+ Help: "A registry mirror for the database, cache, queue, search, storage, voice and edge images"},
{Name: MemoryProfile, Type: "choice", Options: []string{"small", "medium", "large"}, Validate: oneOf("small", "medium", "large"),
- Help: "A fixed amount of memory for Fluxer's services, instead of sizing them to this machine on every start"},
+ Help: "A fixed amount of memory for Fluxer's services, or empty to size them to this machine on every start"},
{Name: EngineHost, Type: "endpoint", Validate: validEndpoint,
Help: "The Docker or Podman engine that runs Fluxer"},
}
for _, svc := range slices.Sorted(maps.Keys(ImageVars)) {
- keys = append(keys, Key{Name: ImagesPrefix + svc, Type: "image", Vars: []string{ImageVars[svc]}, Validate: validImage,
- Help: "The image for " + svc})
+ help := "The image the " + svc + " container runs"
+ if svc == "seaweedfs" {
+ help = "The image the seaweedfs and seaweedfs-init containers run"
+ }
+ keys = append(keys, Key{Name: ImagesPrefix + svc, Type: "image", Vars: []string{ImageVars[svc]}, Validate: validImage, Help: help})
}
for i := range keys {
keys[i].Kind = Deployment
diff --git a/fluxer_rexctl/internal/stack/files/.env.example b/fluxer_rexctl/internal/stack/files/.env.example
new file mode 100644
index 000000000..493969548
--- /dev/null
+++ b/fluxer_rexctl/internal/stack/files/.env.example
@@ -0,0 +1,2614 @@
+# ============================================================================
+# This is a reference copy. Use the .env.example in the compose bundle of
+# your Fluxer release.
+# ============================================================================
+
+# ============================================================================
+# Fluxer settings for the Docker Compose bundle
+#
+# Copy this file to .env, fill in the required values and run
+# docker compose up -d. Settings that start with # are optional. To change
+# one, remove the # and set a value.
+#
+# If you move this instance to rexctl later with rexctl takeover, the rexctl
+# line under each setting shows the command that changes it.
+# ============================================================================
+
+
+# ============================================================================
+# REQUIRED
+#
+# Fill these in before the first start.
+# ============================================================================
+
+# Leave it set to true. Docker Compose won't start without it.
+FLUXER_SETTINGS_LOADED=true
+
+# The domain Fluxer runs on.
+# example: chat.example.com
+# rexctl: rexctl config set domain
+FLUXER_DOMAIN=
+
+
+# ============================================================================
+# FIRST ADMIN ACCOUNT
+# ============================================================================
+
+# The token the setup wizard asks for before it creates the first admin
+# account. Use 32 to 256 printable characters, such as the output of
+# openssl rand -hex 32. When it's empty, the API generates one on its first
+# start and writes it to its log once. With Docker Compose,
+# docker compose logs api shows it. Keep it secret.
+FLUXER_SETUP_TOKEN=
+
+
+# ============================================================================
+# SECRETS
+#
+# Fill these in before the first start, and keep a copy of .env somewhere
+# safe. Only FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64 may stay empty.
+# ============================================================================
+
+# These have fixed values for the bundled services. Keep them as they are
+# unless the setting tells you otherwise.
+
+# The object store access key. Keep the default for the bundled object store,
+# or set the access key of your own store.
+# rexctl: rexctl config set storage.access_key
+FLUXER_S3_ACCESS_KEY=fluxer
+
+# The LiveKit API key. Docker Compose passes it to the bundled LiveKit as its
+# API key and webhook key, and to Fluxer as FLUXER_LIVEKIT_API_KEY.
+LIVEKIT_API_KEY=fluxer
+
+
+# Generate each value with this command. Set them once before the first start
+# and never change them.
+# openssl rand -hex 32
+
+# The Postgres password. Docker Compose passes it to Fluxer as
+# FLUXER_POSTGRES_PASSWORD and to the bundled Postgres, which sets it only on
+# its first start with an empty data directory.
+POSTGRES_PASSWORD=
+
+# The Meilisearch master key. Docker Compose passes it to the bundled
+# Meilisearch and to Fluxer as FLUXER_SEARCH_API_KEY.
+MEILI_MASTER_KEY=
+
+# The object store secret key. For your own object store, set its secret key,
+# and update it when you rotate the key at the store.
+# rexctl: rexctl config set storage.secret_key
+FLUXER_S3_SECRET_KEY=
+
+# The LiveKit API secret that goes with LIVEKIT_API_KEY, at least 32
+# characters. Docker Compose passes it to the bundled LiveKit and to Fluxer as
+# FLUXER_LIVEKIT_API_SECRET.
+LIVEKIT_API_SECRET=
+
+
+# Generate each value with this command.
+# openssl rand -hex 32
+
+# The key Fluxer signs sudo mode tokens with and derives a few other internal
+# signing keys from. Changing it ends every active sudo mode session, voids
+# codes already emailed and makes every remembered device count as new.
+FLUXER_SUDO_MODE_SECRET=
+
+# The key that signs connection initiation tokens, data export links and admin
+# download links. Changing it breaks tokens not yet verified and download
+# links already sent.
+FLUXER_CONNECTION_INITIATION_SECRET=
+
+# The key Fluxer uses to derive the placeholder name and tag that others see
+# while an account's profile is hidden. The api, worker and users services
+# must have the same value. Changing it gives every hidden profile a new
+# placeholder.
+FLUXER_PROFILE_PSEUDONYM_SECRET=
+
+# The token the api, worker, gateway and push services use to authenticate
+# internal calls to each other. Every service must have the same value.
+FLUXER_GATEWAY_RPC_AUTH_TOKEN=
+
+# The shared secret for Erlang distribution in the gateway. Anyone who can
+# connect to the distribution port with this value can run code in the
+# gateway. Keep the value secret and the port private.
+FLUXER_ERLANG_COOKIE=
+
+# The key that signs media proxy URLs. The api, worker, media-proxy, gifs and
+# unfurl services must have the same value.
+FLUXER_MEDIA_PROXY_SECRET_KEY=
+
+# The key the admin panel signs its sessions, CSRF tokens and OAuth state
+# with. Changing it signs everyone out of the admin panel.
+FLUXER_ADMIN_SECRET_KEY_BASE=
+
+# The OAuth2 client secret the admin panel uses to sign in through the API.
+# The api and admin services must have the same value.
+FLUXER_ADMIN_OAUTH_CLIENT_SECRET=
+
+
+# Generate the value with this command.
+# openssl rand -base64 32
+
+# The key that signs upload relay tokens, as standard base64 that decodes to
+# at least 32 bytes. The api, worker and media-proxy services must have the
+# same value.
+FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=
+
+
+# Generate the value with this command.
+# openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform DER |
+# base64 | tr -d '\n'
+
+# The RSA private key the unfurl service signs ActivityPub requests with when
+# it builds link previews for fediverse posts. Use base64 DER in PKCS#8 or
+# PKCS#1 form. When it's empty, the unfurl service makes those requests
+# unsigned.
+FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64=
+
+
+# These commands print the public and then the private key of the VAPID key
+# pair for browser push notifications. Set the pair once before the first
+# start and never change it.
+# openssl ecparam -name prime256v1 -genkey -noout -out vapid.pem
+# openssl ec -in vapid.pem -pubout -outform DER | tail -c 65 | base64 |
+# tr '/+' '_-' | tr -d '=\n'
+# openssl ec -in vapid.pem -outform DER | tail -c +8 | head -c 32 |
+# base64 | tr '/+' '_-' | tr -d '=\n'
+# rm vapid.pem
+
+# The public half of the VAPID key pair for browser push notifications, as
+# unpadded base64url of the 65-byte uncompressed P-256 point. The value is 87
+# characters long.
+FLUXER_VAPID_PUBLIC_KEY=
+
+# The private half of the VAPID key pair for browser push notifications, as
+# unpadded base64url of the 32-byte P-256 private key. The value is 43
+# characters long. It must match FLUXER_VAPID_PUBLIC_KEY.
+FLUXER_VAPID_PRIVATE_KEY=
+
+
+# ============================================================================
+# COMPOSE FILES
+#
+# The optional compose files change how Fluxer runs. To use one, list it
+# after docker-compose.yml in COMPOSE_FILE, such as
+# COMPOSE_FILE=docker-compose.yml:docker-compose.proxy.yml.
+#
+# docker-compose.proxy.yml for your own reverse proxy
+# tunnel.compose.yml for a tunnel
+# external-object-store.compose.yml for your own object store
+# ipv6.compose.yml for IPv6 on Fluxer's network
+# ============================================================================
+
+# The compose files Docker Compose uses, with docker-compose.yml first.
+# Separate them with colons, or with semicolons on Windows. rexctl takeover
+# uses the value in your shell first and then the one in .env. Leave it
+# commented out to use docker-compose.yml and, if there is one,
+# docker-compose.override.yml. An empty value stops Docker Compose from
+# finding any file.
+# COMPOSE_FILE=
+
+# The separator between the files in COMPOSE_FILE. When it's empty, Docker
+# Compose and rexctl use a colon, or a semicolon on Windows.
+# COMPOSE_PATH_SEPARATOR=
+
+# The Docker Compose project name, which Docker Compose puts in front of every
+# container and volume name. When it's empty, Docker Compose uses fluxer from
+# docker-compose.yml. rexctl eject writes the project name rexctl ran the
+# instance under. Keep that value, or Docker Compose starts new containers
+# with new, empty volumes. rexctl takeover uses the value in your shell first
+# and then the one in .env.
+# COMPOSE_PROJECT_NAME=
+
+
+# ============================================================================
+# PUBLIC ADDRESS
+#
+# Fluxer works out every address from FLUXER_DOMAIN. Set these only when a
+# part of Fluxer runs on another address.
+# ============================================================================
+
+# The scheme browsers use to open the instance. Use https or http. Fluxer
+# builds public addresses from it and FLUXER_DOMAIN when FLUXER_PUBLIC_ORIGIN
+# is empty. With http, also set FLUXER_PUBLIC_PORT, usually to 80. Without
+# rexctl, the edge also uses it for its default site address. rexctl sets this
+# from your domain and edge settings unless you set it.
+# default: https
+# rexctl: rexctl config set FLUXER_PUBLIC_SCHEME
+# FLUXER_PUBLIC_SCHEME=
+
+# The origin browsers use to open the instance, as a scheme, host and optional
+# port with no path or trailing slash, such as https://chat.example.com:8443.
+# When it's set, the default public addresses of the api, worker and other
+# services come from it. Keep FLUXER_DOMAIN set to the same host. The edge
+# site address, the passkey relying party ID, the default sender and VAPID
+# contact addresses and the gateway still use FLUXER_DOMAIN. rexctl sets this
+# from your domain and edge settings unless you set it.
+# rexctl: rexctl config set FLUXER_PUBLIC_ORIGIN
+# FLUXER_PUBLIC_ORIGIN=
+
+# More web app origins, separated by commas, for an instance that serves the
+# web app on more than one hostname. Each must be an http or https origin. The
+# API allows each one through CORS and accepts it for sign-in handoff. For
+# passkeys on these origins, list them and the web app origin in
+# FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS.
+# rexctl: rexctl config set FLUXER_APP_ORIGIN_ALIASES
+# FLUXER_APP_ORIGIN_ALIASES=
+
+# The public base URL of the API. When it's empty, Fluxer uses the public
+# origin followed by /api.
+# rexctl: rexctl config set FLUXER_API_ENDPOINT
+# FLUXER_API_ENDPOINT=
+
+# The API base URL Fluxer hands to clients. When it's empty, Fluxer uses the
+# public origin followed by /api.
+# rexctl: rexctl config set FLUXER_API_CLIENT_ENDPOINT
+# FLUXER_API_CLIENT_ENDPOINT=
+
+# The address of the web app, which Fluxer allows through CORS and uses in
+# links. When it's empty, Fluxer uses the public origin.
+# rexctl: rexctl config set FLUXER_APP_ENDPOINT
+# FLUXER_APP_ENDPOINT=
+
+# The public WebSocket URL of the gateway, starting with ws or wss. When it's
+# empty, Fluxer uses wss on the public host followed by /gateway, or ws when
+# the public scheme is http.
+# rexctl: rexctl config set FLUXER_GATEWAY_ENDPOINT
+# FLUXER_GATEWAY_ENDPOINT=
+
+# The public address of the media proxy. When it's empty, Fluxer uses the
+# public origin followed by /media.
+# rexctl: rexctl config set FLUXER_MEDIA_ENDPOINT
+# FLUXER_MEDIA_ENDPOINT=
+
+# The public media proxy address that the gifs, unfurl and media-proxy
+# services use when they build media links. When it's empty, they use
+# FLUXER_MEDIA_ENDPOINT, or the public origin followed by /media.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_PUBLIC_ENDPOINT
+# FLUXER_MEDIA_PROXY_PUBLIC_ENDPOINT=
+
+# The origin Fluxer serves static assets such as the favicon and app icons
+# from. When it's empty, the api and worker services derive it from
+# FLUXER_STATIC_CDN_DOMAIN or the public origin, and the admin and gateway
+# services use the public origin. The app-proxy service uses it only when it's
+# set, and serves its own copies of the web app files otherwise.
+# rexctl: rexctl config set FLUXER_STATIC_CDN_ENDPOINT
+# FLUXER_STATIC_CDN_ENDPOINT=
+
+# The public address of the admin panel. When it's empty, Fluxer uses the
+# public origin followed by FLUXER_ADMIN_BASE_PATH. The admin sign-in redirect
+# is this address followed by /oauth2_callback, and the admin panel uses
+# secure cookies when the address starts with https.
+# rexctl: rexctl config set FLUXER_ADMIN_ENDPOINT
+# FLUXER_ADMIN_ENDPOINT=
+
+# The address of the marketing site, which Fluxer allows through CORS and uses
+# in some links. When it's empty, Fluxer uses the public origin.
+# rexctl: rexctl config set FLUXER_MARKETING_ENDPOINT
+# FLUXER_MARKETING_ENDPOINT=
+
+# The base URL of invite links. When it's empty, Fluxer uses
+# FLUXER_INVITE_DOMAIN or the public host, followed by /invite.
+# rexctl: rexctl config set FLUXER_INVITE_ENDPOINT
+# FLUXER_INVITE_ENDPOINT=
+
+# The base URL of gift links. When it's empty, Fluxer uses FLUXER_GIFT_DOMAIN
+# or the public host, followed by /gift.
+# rexctl: rexctl config set FLUXER_GIFT_ENDPOINT
+# FLUXER_GIFT_ENDPOINT=
+
+# A separate hostname for static assets, with no scheme, port or path. When
+# it's set, the default static address of the api and worker services is
+# https:// followed by this host.
+# rexctl: rexctl config set FLUXER_STATIC_CDN_DOMAIN
+# FLUXER_STATIC_CDN_DOMAIN=
+
+# A separate hostname for invite links, with no scheme, port or path. When
+# it's set, the default invite address uses this host.
+# rexctl: rexctl config set FLUXER_INVITE_DOMAIN
+# FLUXER_INVITE_DOMAIN=
+
+# A separate hostname for gift links, with no scheme, port or path. When it's
+# set, the default gift address uses this host.
+# rexctl: rexctl config set FLUXER_GIFT_DOMAIN
+# FLUXER_GIFT_DOMAIN=
+
+
+# ============================================================================
+# EDGE AND HTTPS
+#
+# By default Fluxer listens on ports 80 and 443 and gets its own HTTPS
+# certificate for your domain.
+# ============================================================================
+
+# The port people use in Fluxer's address, when it differs from the one Fluxer
+# listens on. rexctl sets this from your domain and edge settings unless you
+# set it.
+# default: 443
+# rexctl: rexctl config set edge.public_port
+# FLUXER_PUBLIC_PORT=
+
+# The port Fluxer listens on for HTTP. docker-compose.proxy.yml and
+# tunnel.compose.yml ignore it and use FLUXER_EDGE_BIND.
+# default: 80
+# rexctl: rexctl config set edge.http_port
+# FLUXER_HTTP_PORT=
+
+# The port Fluxer listens on for HTTPS. If people connect to this port
+# directly, set FLUXER_PUBLIC_PORT to the same port. docker-compose.proxy.yml
+# and tunnel.compose.yml ignore it and use FLUXER_EDGE_BIND.
+# default: 443
+# rexctl: rexctl config set edge.https_port
+# FLUXER_HTTPS_PORT=
+
+# The address your reverse proxy or tunnel connects to.
+# default: 127.0.0.1:8080 with docker-compose.proxy.yml
+# 127.0.0.1:80 with tunnel.compose.yml
+# rexctl: rexctl config set edge.bind
+# FLUXER_EDGE_BIND=
+
+# The path the admin panel is served under, with a leading slash and no
+# trailing slash, such as /panel. The edge serves the admin panel under this
+# path, the admin service builds its links with it, and the default
+# FLUXER_ADMIN_ENDPOINT follows it.
+# default: /admin
+# rexctl: rexctl config set FLUXER_ADMIN_BASE_PATH
+# FLUXER_ADMIN_BASE_PATH=
+
+# The site address the edge serves in its Caddyfile, including the scheme.
+# When it's empty, Docker Compose uses FLUXER_CADDY_SITE_ADDRESS, or
+# FLUXER_PUBLIC_SCHEME followed by :// and FLUXER_DOMAIN.
+# docker-compose.proxy.yml and tunnel.compose.yml set their own value. rexctl
+# sets this from your domain and edge settings unless you set it.
+# rexctl: rexctl config set FLUXER_EDGE_SITE_ADDRESS
+# FLUXER_EDGE_SITE_ADDRESS=
+
+# The old name for FLUXER_EDGE_SITE_ADDRESS. Docker Compose uses it only
+# without rexctl and when FLUXER_EDGE_SITE_ADDRESS is empty. rexctl takeover
+# and rexctl upgrade move it to FLUXER_EDGE_SITE_ADDRESS.
+# FLUXER_CADDY_SITE_ADDRESS=
+
+# Proxies whose client address headers Fluxer trusts, separated by spaces.
+# default: 127.0.0.1/32
+# private_ranges with docker-compose.proxy.yml or tunnel.compose.yml
+# rexctl: rexctl config set edge.trusted_proxies
+# FLUXER_EDGE_TRUSTED_PROXIES=
+
+# The response compression the edge offers, written as the arguments of the
+# Caddy encode directive, such as gzip alone.
+# default: zstd gzip
+# rexctl: rexctl config set FLUXER_EDGE_ENCODE
+# FLUXER_EDGE_ENCODE=
+
+# The HTTP versions the edge serves, as the arguments of the Caddy protocols
+# option, such as h1 h2 to turn off HTTP/3. On a machine with little memory,
+# rexctl turns off HTTP/3 unless you set it.
+# default: h1 h2 h3
+# rexctl: rexctl config set FLUXER_EDGE_PROTOCOLS
+# FLUXER_EDGE_PROTOCOLS=
+
+# Extra Caddy global options on one line, added to the global block of the
+# edge Caddyfile, such as email [email protected] for the certificate
+# account. An empty value adds nothing.
+# rexctl: rexctl config set FLUXER_EDGE_GLOBAL_OPTIONS
+# FLUXER_EDGE_GLOBAL_OPTIONS=
+
+# The arguments of a Caddy tls directive for the edge, such as internal for a
+# certificate from Caddy's own local CA, or a certificate and key path under
+# /certs. When it's empty, the edge adds no tls line and Caddy gets
+# certificates on its own. docker-compose.proxy.yml and tunnel.compose.yml
+# ignore it.
+# rexctl: rexctl config set FLUXER_EDGE_TLS
+# FLUXER_EDGE_TLS=
+
+
+# ============================================================================
+# VOICE AND VIDEO
+#
+# Calls connect directly to this machine on FLUXER_LIVEKIT_TCP_PORT and
+# FLUXER_LIVEKIT_UDP_PORT, even when Fluxer is behind your own proxy.
+# ============================================================================
+
+# Whether voice and video calls are turned on. Use true or false.
+# default: true
+# rexctl: rexctl config set FLUXER_LIVEKIT_ENABLED
+# FLUXER_LIVEKIT_ENABLED=
+
+# The URL the API uses for the LiveKit control API of the bundled LiveKit, the
+# first server in the default voice region. Servers added in the admin panel
+# use their own address.
+# default: http://livekit:7880
+# rexctl: rexctl config set FLUXER_LIVEKIT_INTERNAL_URL
+# FLUXER_LIVEKIT_INTERNAL_URL=
+
+# The voice region Fluxer creates when no voice regions exist yet, as a JSON
+# object with id, name, emoji, latitude and longitude.
+# default: {"id":"default","name":"Default","emoji":"🌍","latitude":0,"longitude":0}
+# rexctl: rexctl config set FLUXER_LIVEKIT_DEFAULT_REGION
+# FLUXER_LIVEKIT_DEFAULT_REGION=
+
+# The URL browsers and apps use for voice signalling. When it's empty, Fluxer
+# uses the public origin, or FLUXER_PUBLIC_SCHEME, FLUXER_DOMAIN and
+# FLUXER_PUBLIC_PORT, followed by /livekit. Set it only when LiveKit runs on
+# another host.
+# rexctl: rexctl config set FLUXER_LIVEKIT_URL
+# FLUXER_LIVEKIT_URL=
+
+# STUN URLs for peer-to-peer calls, separated by commas, such as
+# stun:stun.example.com:3478. When it's empty, peer-to-peer calls work only
+# between devices with a direct route to each other, such as on one local
+# network.
+# rexctl: rexctl config set FLUXER_VOICE_P2P_STUN_URLS
+# FLUXER_VOICE_P2P_STUN_URLS=
+
+# The TCP port for voice and video.
+# default: 7881
+# rexctl: rexctl config set voice.tcp_port
+# FLUXER_LIVEKIT_TCP_PORT=
+
+# The UDP port for voice and video.
+# default: 7882
+# rexctl: rexctl config set voice.udp_port
+# FLUXER_LIVEKIT_UDP_PORT=
+
+# The public IP address voice and video use, when Fluxer can't find it by
+# itself. Set FLUXER_LIVEKIT_USE_EXTERNAL_IP to false with it.
+# rexctl: rexctl config set voice.public_ip
+# FLUXER_LIVEKIT_NODE_IP=
+
+# Whether LiveKit finds its public IP address through STUN. Use true or false.
+# Set it to false when you set FLUXER_LIVEKIT_NODE_IP.
+# default: true
+# rexctl: rexctl config set voice.public_ip
+# FLUXER_LIVEKIT_USE_EXTERNAL_IP=
+
+# The first STUN host LiveKit asks to find its public IP address, as
+# host:port. Point it at another STUN host to avoid contacting Google.
+# default: stun.l.google.com:19302
+# rexctl: rexctl config set FLUXER_LIVEKIT_STUN_PRIMARY
+# FLUXER_LIVEKIT_STUN_PRIMARY=
+
+# The second STUN host LiveKit asks to find its public IP address, as
+# host:port.
+# default: stun1.l.google.com:19302
+# rexctl: rexctl config set FLUXER_LIVEKIT_STUN_SECONDARY
+# FLUXER_LIVEKIT_STUN_SECONDARY=
+
+
+# ============================================================================
+# OBJECT STORAGE
+#
+# By default Fluxer keeps files in the bundled object store. To use your own
+# S3-compatible store, set its address and buckets, add
+# external-object-store.compose.yml to COMPOSE_FILE and put its keys in
+# FLUXER_S3_ACCESS_KEY and FLUXER_S3_SECRET_KEY.
+# ============================================================================
+
+# The address of the S3-compatible object store.
+# default: http://seaweedfs:8333
+# rexctl: rexctl config set storage.endpoint
+# FLUXER_S3_ENDPOINT=
+
+# The object store address browsers use, when it differs from the one Fluxer
+# uses. When it's empty, the api and worker use FLUXER_S3_ENDPOINT, and the
+# web app doesn't let browsers upload to the object store.
+# rexctl: rexctl config set storage.public_endpoint
+# FLUXER_S3_PUBLIC_ENDPOINT=
+
+# The object store region.
+# default: us-east-1
+# rexctl: rexctl config set storage.region
+# FLUXER_S3_REGION=
+
+# Whether the object store needs path-style addresses. Use true or false.
+# default: true
+# rexctl: rexctl config set storage.path_style
+# FLUXER_S3_FORCE_PATH_STYLE=
+
+# A temporary S3 session token the media proxy sends with its object store
+# requests. When it's empty, the media proxy sends none. Keep it secret.
+# rexctl: rexctl config set FLUXER_S3_SESSION_TOKEN
+# FLUXER_S3_SESSION_TOKEN=
+
+# The bucket for processed media such as avatars and other served assets. The
+# bundled object store creates it, and an outside store needs it to exist
+# already.
+# default: fluxer
+# rexctl: rexctl config set FLUXER_S3_BUCKET_CDN
+# FLUXER_S3_BUCKET_CDN=
+
+# The bucket for raw uploads. The bundled object store creates it, and an
+# outside store needs it to exist already.
+# default: fluxer-uploads
+# rexctl: rexctl config set FLUXER_S3_BUCKET_UPLOADS
+# FLUXER_S3_BUCKET_UPLOADS=
+
+# The bucket for abuse report evidence. The bundled object store creates it,
+# and an outside store needs it to exist already.
+# default: fluxer-reports
+# rexctl: rexctl config set FLUXER_S3_BUCKET_REPORTS
+# FLUXER_S3_BUCKET_REPORTS=
+
+# The bucket for data export archives. The bundled object store creates it,
+# and an outside store needs it to exist already.
+# default: fluxer-harvests
+# rexctl: rexctl config set FLUXER_S3_BUCKET_HARVESTS
+# FLUXER_S3_BUCKET_HARVESTS=
+
+# A separate http or https address, with no credentials, that the media proxy
+# fetches objects in FLUXER_S3_READ_BUCKET from. When it's empty, the media
+# proxy fetches everything through FLUXER_S3_ENDPOINT.
+# rexctl: rexctl config set FLUXER_S3_READ_ENDPOINT
+# FLUXER_S3_READ_ENDPOINT=
+
+# The bucket the media proxy fetches through FLUXER_S3_READ_ENDPOINT. When
+# it's empty, the media proxy uses FLUXER_S3_BUCKET_CDN.
+# rexctl: rexctl config set FLUXER_S3_READ_BUCKET
+# FLUXER_S3_READ_BUCKET=
+
+# How the bucket appears in URLs to FLUXER_S3_READ_ENDPOINT. Use path, virtual
+# or root. When it's empty, the media proxy uses path when
+# FLUXER_S3_FORCE_PATH_STYLE is on and virtual when it's off.
+# rexctl: rexctl config set FLUXER_S3_READ_BUCKET_STYLE
+# FLUXER_S3_READ_BUCKET_STYLE=
+
+# Whether the media proxy signs its requests to FLUXER_S3_READ_ENDPOINT. Use
+# true or false. Use false only for a bucket that allows anonymous downloads.
+# default: true
+# rexctl: rexctl config set FLUXER_S3_READ_SIGNED
+# FLUXER_S3_READ_SIGNED=
+
+# Whether the API hands clients upload URLs that let them upload attachments
+# before they send the message. Use true or false.
+# default: true
+# rexctl: rexctl config set FLUXER_API_PRESIGNED_ATTACHMENT_UPLOADS_ENABLED
+# FLUXER_API_PRESIGNED_ATTACHMENT_UPLOADS_ENABLED=
+
+# Whether data export and admin download links are presigned URLs to the
+# object store. Use true or false. With false, the API serves those downloads
+# itself. Turn it on only once browsers can connect to
+# FLUXER_S3_PUBLIC_ENDPOINT.
+# default: false
+# rexctl: rexctl config set FLUXER_API_PRESIGNED_HARVEST_DOWNLOADS_ENABLED
+# FLUXER_API_PRESIGNED_HARVEST_DOWNLOADS_ENABLED=
+
+# Whether the api and worker services publish a record of each object store
+# write and delete they make to a NATS JetStream stream. Uploads written by
+# the media proxy relay or sent straight to the store by clients are not in
+# it. Use true or false. When it's empty, the feed is off.
+# rexctl: rexctl config set FLUXER_API_STORAGE_CHANGE_FEED_ENABLED
+# FLUXER_API_STORAGE_CHANGE_FEED_ENABLED=
+
+# The JetStream stream the storage change feed publishes to, in letters,
+# digits, underscores or hyphens. When it's empty, Fluxer uses
+# STORAGE_CHANGES.
+# rexctl: rexctl config set FLUXER_API_STORAGE_CHANGE_FEED_STREAM
+# FLUXER_API_STORAGE_CHANGE_FEED_STREAM=
+
+# Buckets the storage change feed leaves out, separated by commas, or none to
+# leave out no bucket. When it's empty, the feed leaves out the uploads
+# bucket.
+# rexctl: rexctl config set FLUXER_API_STORAGE_CHANGE_FEED_SKIP_BUCKETS
+# FLUXER_API_STORAGE_CHANGE_FEED_SKIP_BUCKETS=
+
+# How many rounds, about two seconds apart, the bundled object store's setup
+# job tries to create the buckets and set up access before it gives up.
+# default: 60
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_INIT_ATTEMPTS
+# FLUXER_SEAWEEDFS_INIT_ATTEMPTS=
+
+# How long the bundled object store keeps files in the uploads bucket before
+# it deletes them, such as 1d or 12h. Use off to keep them. A new value
+# applies to uploads written after the next start, and files already stored
+# keep their old expiry.
+# default: 1d
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_UPLOADS_TTL
+# FLUXER_SEAWEEDFS_UPLOADS_TTL=
+
+
+# ============================================================================
+# DATABASE
+#
+# Leave these unset to use the bundled Postgres.
+# ============================================================================
+
+# The hostname or address of the Postgres database. Set it when Postgres runs
+# outside the stack.
+# default: postgres
+# rexctl: rexctl config set FLUXER_POSTGRES_HOST
+# FLUXER_POSTGRES_HOST=
+
+# The Postgres port, from 1 to 65535. When it's empty, Fluxer uses 5432.
+# rexctl: rexctl config set FLUXER_POSTGRES_PORT
+# FLUXER_POSTGRES_PORT=
+
+# The Postgres database name. When it's empty, Fluxer uses fluxer. The bundled
+# Postgres creates this database only on its first start with an empty data
+# directory.
+# rexctl: rexctl config set FLUXER_POSTGRES_DATABASE
+# FLUXER_POSTGRES_DATABASE=
+
+# The Postgres role Fluxer connects as. When it's empty, Fluxer uses fluxer.
+# The bundled Postgres creates this role only on its first start with an empty
+# data directory.
+# rexctl: rexctl config set FLUXER_POSTGRES_USERNAME
+# FLUXER_POSTGRES_USERNAME=
+
+# A full Postgres connection URL, such as
+# postgres://fluxer:[email protected]:5432/fluxer. When it's set, Fluxer
+# connects with it and ignores the host, port, database, username and password
+# settings. An sslmode in the URL can turn TLS on when FLUXER_POSTGRES_SSL
+# isn't true. For the api and worker, it also wins over FLUXER_POSTGRES_SSL.
+# Keep it secret.
+# rexctl: rexctl config set FLUXER_POSTGRES_URL
+# FLUXER_POSTGRES_URL=
+
+# Whether Fluxer connects to Postgres over TLS. Use true or false. When it
+# isn't true and FLUXER_POSTGRES_URL has no sslmode, the api and worker follow
+# PGSSLMODE and the other services connect without TLS.
+# rexctl: rexctl config set FLUXER_POSTGRES_SSL
+# FLUXER_POSTGRES_SSL=
+
+# A CA certificate in PEM form that Fluxer trusts for the Postgres TLS
+# connection, with \n for line breaks. The Rust services use it whenever the
+# connection uses TLS. The api and worker use it only when FLUXER_POSTGRES_SSL
+# is true and FLUXER_POSTGRES_URL has no sslmode.
+# rexctl: rexctl config set FLUXER_POSTGRES_SSL_CA
+# FLUXER_POSTGRES_SSL_CA=
+
+# Whether Fluxer uses Postgres prepared statements. Use true or false. When
+# it's empty, Fluxer uses them. Set it to false behind a transaction-pooling
+# pooler such as PgBouncer.
+# rexctl: rexctl config set FLUXER_POSTGRES_PREPARED_STATEMENTS
+# FLUXER_POSTGRES_PREPARED_STATEMENTS=
+
+# The Postgres table for Fluxer's key-value data, a plain identifier of
+# letters, digits and underscores that starts with a letter or an underscore.
+# When it's empty, Fluxer uses fluxer_kv.
+# rexctl: rexctl config set FLUXER_POSTGRES_KV_TABLE
+# FLUXER_POSTGRES_KV_TABLE=
+
+
+# ============================================================================
+# CACHE, QUEUE AND SEARCH
+#
+# Leave these unset to use the bundled Valkey, NATS and Meilisearch.
+# ============================================================================
+
+# The Valkey or Redis URL Fluxer uses for its cache, rate limits and other
+# short-lived data.
+# default: redis://valkey:6379/0
+# rexctl: rexctl config set FLUXER_KV_URL
+# FLUXER_KV_URL=
+
+# How Fluxer connects to the key-value store. Use standalone for a single
+# Valkey or Redis node or cluster for a Redis-compatible cluster. When it's
+# empty, Fluxer uses standalone.
+# rexctl: rexctl config set FLUXER_KV_MODE
+# FLUXER_KV_MODE=
+
+# The core NATS address the api, worker and gateway services use, including
+# for requests to the internal services and the push service. The internal
+# services and JetStream follow it unless FLUXER_SVC_NATS_URL or
+# FLUXER_NATS_JETSTREAM_URL is set.
+# default: nats://nats:4222
+# rexctl: rexctl config set FLUXER_NATS_URL
+# FLUXER_NATS_URL=
+
+# The NATS address the api and worker services use for JetStream. When it's
+# empty, they use FLUXER_NATS_URL.
+# rexctl: rexctl config set FLUXER_NATS_JETSTREAM_URL
+# FLUXER_NATS_JETSTREAM_URL=
+
+# The token every service sends when it connects to NATS. When it's empty,
+# services connect without a token. The bundled NATS needs none. Keep it
+# secret.
+# rexctl: rexctl config set FLUXER_NATS_AUTH_TOKEN
+# FLUXER_NATS_AUTH_TOKEN=
+
+# The NATS address the internal services and the push service listen on. When
+# it's empty, they use FLUXER_NATS_URL. The api and worker send their requests
+# to these services over FLUXER_NATS_URL, and both addresses must lead to the
+# same NATS cluster.
+# rexctl: rexctl config set FLUXER_SVC_NATS_URL
+# FLUXER_SVC_NATS_URL=
+
+# How many requests each internal service handles at once before it turns new
+# ones away. When it's empty, the messages service uses 192, the snowflakes
+# service 320 and the others 64. One value you set applies to all of them.
+# rexctl takeover and rexctl upgrade remove a value under 320.
+# rexctl: rexctl config set FLUXER_SVC_MAX_CONCURRENT_REQUESTS
+# FLUXER_SVC_MAX_CONCURRENT_REQUESTS=
+
+# The most entries each internal service process keeps in its cache. When it's
+# empty, the internal services use 100000.
+# rexctl: rexctl config set FLUXER_SVC_CACHE_MAX_ENTRIES
+# FLUXER_SVC_CACHE_MAX_ENTRIES=
+
+# How long the internal services keep cached entries, in milliseconds. When
+# it's empty, they use 30000.
+# rexctl: rexctl config set FLUXER_SVC_CACHE_TTL_MS
+# FLUXER_SVC_CACHE_TTL_MS=
+
+# The client name the API gives its NATS connection to the gifs service, which
+# shows in NATS monitoring. When it's empty, the API uses fluxer-api-gifs.
+# rexctl: rexctl config set FLUXER_GIF_SERVICE_NATS_CLIENT_NAME
+# FLUXER_GIF_SERVICE_NATS_CLIENT_NAME=
+
+# How long the API waits for gifs service requests such as searches, in
+# milliseconds. When it's empty, the API uses 12000. Recording a share uses
+# FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS.
+# rexctl: rexctl config set FLUXER_GIF_SERVICE_TIMEOUT_MS
+# FLUXER_GIF_SERVICE_TIMEOUT_MS=
+
+# How long the API waits for the gifs service to record that someone shared a
+# GIF, in milliseconds. When it's empty, the API uses 3000.
+# rexctl: rexctl config set FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS
+# FLUXER_GIF_SERVICE_REGISTER_SHARE_TIMEOUT_MS=
+
+# The client name the API gives its NATS connection to the users service,
+# which shows in NATS monitoring. When it's empty, the API uses
+# fluxer-api-users.
+# rexctl: rexctl config set FLUXER_USERS_SERVICE_NATS_CLIENT_NAME
+# FLUXER_USERS_SERVICE_NATS_CLIENT_NAME=
+
+# How long the API waits for the users service, in milliseconds. When it's
+# empty, the API uses 6000.
+# rexctl: rexctl config set FLUXER_USERS_SERVICE_TIMEOUT_MS
+# FLUXER_USERS_SERVICE_TIMEOUT_MS=
+
+# How many user lookups the API tracks in flight, which lets requests for the
+# same user share one call to the users service. Lookups past this limit go to
+# the service on their own. When it's empty, the API uses 10000.
+# rexctl: rexctl config set FLUXER_USERS_SERVICE_INFLIGHT_MAX_ENTRIES
+# FLUXER_USERS_SERVICE_INFLIGHT_MAX_ENTRIES=
+
+# The client name the API gives its NATS connection to the snowflakes service,
+# which shows in NATS monitoring. When it's empty, the API uses
+# fluxer-api-snowflakes.
+# rexctl: rexctl config set FLUXER_SNOWFLAKE_SERVICE_NATS_CLIENT_NAME
+# FLUXER_SNOWFLAKE_SERVICE_NATS_CLIENT_NAME=
+
+# How many IDs the API fetches from the snowflakes service at a time, from 1
+# to 512. When it's empty, the API uses 128.
+# rexctl: rexctl config set FLUXER_SNOWFLAKE_SERVICE_BATCH_SIZE
+# FLUXER_SNOWFLAKE_SERVICE_BATCH_SIZE=
+
+# The number of unused IDs at which the API fetches a new batch, from 0 to one
+# less than the batch size. When it's empty, the API uses 32, or one less than
+# the batch size if that's smaller.
+# rexctl: rexctl config set FLUXER_SNOWFLAKE_SERVICE_LOW_WATERMARK
+# FLUXER_SNOWFLAKE_SERVICE_LOW_WATERMARK=
+
+# How long the API keeps a fetched batch of IDs before it throws the rest
+# away, in milliseconds from 1 to 60000. When it's empty, the API uses 5000.
+# rexctl: rexctl config set FLUXER_SNOWFLAKE_SERVICE_MAX_BUFFER_AGE_MS
+# FLUXER_SNOWFLAKE_SERVICE_MAX_BUFFER_AGE_MS=
+
+# How long the API waits for the snowflakes service, in milliseconds from 1 to
+# 60000. When it's empty, the API uses 6000.
+# rexctl: rexctl config set FLUXER_SNOWFLAKE_SERVICE_REQUEST_TIMEOUT_MS
+# FLUXER_SNOWFLAKE_SERVICE_REQUEST_TIMEOUT_MS=
+
+# Which search engine Fluxer uses. Use meilisearch or elasticsearch, or none
+# to turn search off. With elasticsearch, set MEILI_MASTER_KEY to your
+# Elasticsearch API key. Docker Compose passes it to Fluxer as
+# FLUXER_SEARCH_API_KEY.
+# default: meilisearch
+# rexctl: rexctl config set FLUXER_SEARCH_ENGINE
+# FLUXER_SEARCH_ENGINE=
+
+# The address of the search engine.
+# default: http://meilisearch:7700
+# rexctl: rexctl config set FLUXER_SEARCH_URL
+# FLUXER_SEARCH_URL=
+
+# The basic auth username for Elasticsearch. Fluxer uses it only when
+# FLUXER_SEARCH_API_KEY is empty. Docker Compose always sets that key from
+# MEILI_MASTER_KEY. To use basic auth, set FLUXER_SEARCH_API_KEY to an empty
+# value for the api and worker in a compose file of your own.
+# rexctl: rexctl config set FLUXER_SEARCH_USERNAME
+# FLUXER_SEARCH_USERNAME=
+
+# The basic auth password for Elasticsearch. Fluxer uses it only when
+# FLUXER_SEARCH_API_KEY is empty, the same as FLUXER_SEARCH_USERNAME. Keep it
+# secret.
+# rexctl: rexctl config set FLUXER_SEARCH_PASSWORD
+# FLUXER_SEARCH_PASSWORD=
+
+# Whether Fluxer checks the Elasticsearch TLS certificate. Use true or false.
+# When it's empty, Fluxer checks it. Meilisearch connections don't use it.
+# rexctl: rexctl config set FLUXER_SEARCH_TLS_REJECT_UNAUTHORIZED
+# FLUXER_SEARCH_TLS_REJECT_UNAUTHORIZED=
+
+
+# ============================================================================
+# OUTGOING PROXY
+#
+# These settings are for Fluxer's services. rexctl and the Linux and macOS
+# install script take HTTPS_PROXY, HTTP_PROXY and NO_PROXY from the shell you
+# run them from.
+# ============================================================================
+
+# The proxy the Rust services other than the app-proxy use for outgoing HTTP
+# requests. The api, worker and gateway don't use it.
+# rexctl: rexctl config set network.http_proxy
+# HTTP_PROXY=
+
+# The proxy the Rust services other than the app-proxy use for outgoing HTTPS
+# requests. The api, worker and gateway don't use it.
+# rexctl: rexctl config set network.https_proxy
+# HTTPS_PROXY=
+
+# Hosts the Rust services other than the app-proxy connect to without the
+# proxy, separated by commas.
+# rexctl: rexctl config set network.no_proxy
+# NO_PROXY=
+
+# The path of a PEM file of CA certificates that the api and worker trust for
+# outgoing TLS on top of Node's built-in ones. The path is inside their
+# containers. A file you set replaces the system bundle. Add your CA to a copy
+# of that bundle. The Rust services don't use it and take their CA
+# certificates from SSL_CERT_FILE.
+# default: /etc/ssl/certs/ca-certificates.crt
+# rexctl: rexctl config set FLUXER_NODE_EXTRA_CA_CERTS
+# FLUXER_NODE_EXTRA_CA_CERTS=
+
+
+# ============================================================================
+# SIGN-IN
+# ============================================================================
+
+# Whether single sign-on can use a provider on a private or local network
+# address. Use true or false. When it's empty, Fluxer uses false.
+# rexctl: rexctl config set sso.allow_private_addresses
+# FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES=
+
+# The relying party ID that passkeys are tied to, a domain such as
+# chat.example.com. When it's empty, Fluxer uses FLUXER_DOMAIN. Changing it
+# makes every passkey registered against the old value stop working.
+# rexctl: rexctl config set FLUXER_PASSKEY_RP_ID
+# FLUXER_PASSKEY_RP_ID=
+
+# The title browsers show for Fluxer when someone creates or uses a passkey.
+# When it's empty, browsers show Fluxer.
+# rexctl: rexctl config set FLUXER_PASSKEY_RP_NAME
+# FLUXER_PASSKEY_RP_NAME=
+
+# Every origin where passkeys work, separated by commas. When it's empty,
+# Docker Compose uses FLUXER_PUBLIC_ORIGIN, or FLUXER_PUBLIC_SCHEME followed
+# by :// and FLUXER_DOMAIN. A list you set replaces it and must include the
+# web app origin. Set a list when FLUXER_APP_ENDPOINT is on another origin.
+# Each entry is an http or https origin or an Android app, written as
+# android:apk-key-hash: followed by its signing certificate's SHA-256 hash in
+# unpadded base64url.
+# rexctl: rexctl config set FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS
+# FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS=
+
+
+# ============================================================================
+# EMAIL
+#
+# The admin panel can also save the delivery mode, the sender and the SMTP
+# server. A value saved there is used first.
+# ============================================================================
+
+# The older way to turn email on. Use FLUXER_EMAIL_DELIVERY.
+# rexctl: rexctl config set integrations.email.delivery
+# FLUXER_EMAIL_ENABLED=
+
+# The older way to pick the email transport, which takes smtp or none. Use
+# FLUXER_EMAIL_DELIVERY.
+# rexctl: rexctl config set integrations.email.delivery
+# FLUXER_EMAIL_PROVIDER=
+
+# How Fluxer sends email. Use smtp or off. When it's empty,
+# FLUXER_EMAIL_ENABLED and FLUXER_EMAIL_PROVIDER decide, and email is off when
+# those are empty too.
+# rexctl: rexctl config set integrations.email.delivery
+# FLUXER_EMAIL_DELIVERY=
+
+# The address Fluxer sends email from. When it's empty, Fluxer uses noreply@
+# followed by FLUXER_DOMAIN.
+# rexctl: rexctl config set integrations.email.from_email
+# FLUXER_EMAIL_FROM_EMAIL=
+
+# The sender name on email from Fluxer. When it's empty, Fluxer uses the
+# product name of the instance.
+# rexctl: rexctl config set integrations.email.from_name
+# FLUXER_EMAIL_FROM_NAME=
+
+# The address replies go to, sent as the Reply-To header on every email, such
+# as [email protected]. When it's empty, Fluxer sends no Reply-To header.
+# rexctl: rexctl config set FLUXER_EMAIL_REPLY_TO_EMAIL
+# FLUXER_EMAIL_REPLY_TO_EMAIL=
+
+# The base URL Fluxer uses for links in emails, an http or https URL with no
+# credentials, query or fragment. When it's empty, Fluxer uses
+# FLUXER_APP_ENDPOINT.
+# rexctl: rexctl config set FLUXER_EMAIL_APP_BASE_URL
+# FLUXER_EMAIL_APP_BASE_URL=
+
+# The base64 secret Fluxer uses to check the signature on bounce and complaint
+# webhooks from the Sweego email service. When it's empty, Fluxer turns those
+# webhooks away. Keep it secret.
+# rexctl: rexctl config set FLUXER_EMAIL_WEBHOOK_SECRET
+# FLUXER_EMAIL_WEBHOOK_SECRET=
+
+# The hostname of your SMTP server.
+# rexctl: rexctl config set integrations.email.smtp.host
+# FLUXER_EMAIL_SMTP_HOST=
+
+# The port of your SMTP server. When it's empty, Fluxer uses 587.
+# rexctl: rexctl config set integrations.email.smtp.port
+# FLUXER_EMAIL_SMTP_PORT=
+
+# The username Fluxer signs in to your SMTP server with.
+# rexctl: rexctl config set integrations.email.smtp.username
+# FLUXER_EMAIL_SMTP_USERNAME=
+
+# The password Fluxer signs in to your SMTP server with. Keep it secret.
+# rexctl: rexctl config set integrations.email.smtp.password
+# FLUXER_EMAIL_SMTP_PASSWORD=
+
+# How the SMTP connection is encrypted. Use implicit for TLS from the start,
+# usually on port 465, starttls to upgrade before signing in, usually on port
+# 587, opportunistic to upgrade when the server offers it, or none. When it's
+# empty, FLUXER_EMAIL_SMTP_SECURE decides. When both are empty, Fluxer uses
+# implicit on port 465 and starttls on any other port.
+# rexctl: rexctl config set integrations.email.smtp.tls_mode
+# FLUXER_EMAIL_SMTP_TLS_MODE=
+
+# The older way to set FLUXER_EMAIL_SMTP_TLS_MODE, used only while that is
+# empty. Use true for implicit on port 465 and starttls on any other port, or
+# false for opportunistic.
+# rexctl: rexctl config set integrations.email.smtp.tls_mode
+# FLUXER_EMAIL_SMTP_SECURE=
+
+# Recipient domains, separated by commas, whose mail goes through the fallback
+# SMTP provider, such as gmail.com,googlemail.com. Only exact domain matches
+# count, and * alone sends all mail through the fallback provider.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_DOMAINS
+# FLUXER_EMAIL_FALLBACK_DOMAINS=
+
+# The hostname of the fallback SMTP provider.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_HOST
+# FLUXER_EMAIL_FALLBACK_SMTP_HOST=
+
+# The port of the fallback SMTP provider, from 1 to 65535. When it's empty,
+# Fluxer uses 587.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_PORT
+# FLUXER_EMAIL_FALLBACK_SMTP_PORT=
+
+# The username Fluxer signs in to the fallback SMTP provider with. Fluxer
+# doesn't start when a fallback provider is set without it.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_USERNAME
+# FLUXER_EMAIL_FALLBACK_SMTP_USERNAME=
+
+# The password Fluxer signs in to the fallback SMTP provider with. Fluxer
+# doesn't start when a fallback provider is set without it. Keep it secret.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_PASSWORD
+# FLUXER_EMAIL_FALLBACK_SMTP_PASSWORD=
+
+# How Fluxer encrypts the connection to the fallback provider. Use implicit,
+# starttls, opportunistic or none. When it's empty, Fluxer uses implicit on
+# port 465 and starttls on any other port.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_TLS_MODE
+# FLUXER_EMAIL_FALLBACK_SMTP_TLS_MODE=
+
+# Extra headers added to every message sent through the fallback provider, as
+# a JSON object that maps header names to string values. Core headers such as
+# From, To, Subject and Reply-To can't be set here.
+# rexctl: rexctl config set FLUXER_EMAIL_FALLBACK_SMTP_HEADERS
+# FLUXER_EMAIL_FALLBACK_SMTP_HEADERS=
+
+
+# ============================================================================
+# PUSH NOTIFICATIONS
+# ============================================================================
+
+# Whether the push service sends mobile notifications through Apple Push
+# Notification service with your own credentials. Use true or false. When it's
+# empty, APNs is off.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_ENABLED
+# FLUXER_PUSH_APNS_ENABLED=
+
+# Your Apple developer team ID.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_TEAM_ID
+# FLUXER_PUSH_APNS_TEAM_ID=
+
+# The ID of your APNs signing key, from your Apple developer account.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_KEY_ID
+# FLUXER_PUSH_APNS_KEY_ID=
+
+# Your APNs signing key as PEM text. Set this or
+# FLUXER_PUSH_APNS_PRIVATE_KEY_PATH, and this one wins when both are set. Keep
+# it secret.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_PRIVATE_KEY
+# FLUXER_PUSH_APNS_PRIVATE_KEY=
+
+# The path to your APNs signing key file inside the push container.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_PRIVATE_KEY_PATH
+# FLUXER_PUSH_APNS_PRIVATE_KEY_PATH=
+
+# The apps the push service sends to through APNs, as a JSON array of objects.
+# Each object has an app_id and a topic with the app's bundle ID, and can have
+# an environment of production or development. APNs sends fail for an app that
+# isn't listed or has no topic. A push relay with APNs on doesn't start until
+# this lists at least one app.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_APPS
+# FLUXER_PUSH_APNS_APPS=
+
+# The APNs environment the push service uses for a device that registered
+# without one. Use production or development. When it's empty, it uses
+# production.
+# rexctl: rexctl config set FLUXER_PUSH_APNS_DEFAULT_ENVIRONMENT
+# FLUXER_PUSH_APNS_DEFAULT_ENVIRONMENT=
+
+# Whether the push service sends mobile notifications through Firebase Cloud
+# Messaging with your own credentials. Use true or false. When it's empty, FCM
+# is off.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_ENABLED
+# FLUXER_PUSH_FCM_ENABLED=
+
+# Your Firebase project ID. When it's empty, the push service uses the one in
+# FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_PROJECT_ID
+# FLUXER_PUSH_FCM_PROJECT_ID=
+
+# The client email of your Firebase service account. When it's empty, the push
+# service uses the one in FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_CLIENT_EMAIL
+# FLUXER_PUSH_FCM_CLIENT_EMAIL=
+
+# The private key of your Firebase service account as PEM text. When it's
+# empty, the push service uses FLUXER_PUSH_FCM_PRIVATE_KEY_PATH or the key in
+# the service account JSON. Keep it secret.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_PRIVATE_KEY
+# FLUXER_PUSH_FCM_PRIVATE_KEY=
+
+# The path to your Firebase service account private key inside the push
+# container. The push service uses it when FLUXER_PUSH_FCM_PRIVATE_KEY is
+# empty.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_PRIVATE_KEY_PATH
+# FLUXER_PUSH_FCM_PRIVATE_KEY_PATH=
+
+# The path to your Firebase service account JSON file inside the push
+# container. The push service loads the project ID, client email and private
+# key from it when those settings are empty.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH
+# FLUXER_PUSH_FCM_SERVICE_ACCOUNT_JSON_PATH=
+
+# The OAuth token URL the push service uses for FCM. When it's empty, it uses
+# https://oauth2.googleapis.com/token. Change it only for a proxy or a test
+# double.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_TOKEN_URI
+# FLUXER_PUSH_FCM_TOKEN_URI=
+
+# The apps the push service sends to through FCM, as a JSON array of objects
+# that each have an app_id and can have a project_id. An app with no entry or
+# no project_id uses FLUXER_PUSH_FCM_PROJECT_ID. A push relay with FCM on
+# doesn't start until this lists at least one app.
+# rexctl: rexctl config set FLUXER_PUSH_FCM_APPS
+# FLUXER_PUSH_FCM_APPS=
+
+# The contact email Fluxer sends to browser push services with its VAPID key.
+# When it's empty, Fluxer uses admin@ followed by FLUXER_DOMAIN. Set it if
+# that mailbox doesn't exist.
+# rexctl: rexctl config set FLUXER_VAPID_EMAIL
+# FLUXER_VAPID_EMAIL=
+
+# How many notification jobs the push service queues at once, from 1 to
+# 1000000. When it's empty, it uses 10000.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_QUEUE_CAPACITY
+# FLUXER_PUSH_SERVICE_QUEUE_CAPACITY=
+
+# How many provider requests the push service sends at once across all jobs,
+# from 1 to 65536. When it's empty, it uses 256.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_SEND_CONCURRENCY
+# FLUXER_PUSH_SERVICE_SEND_CONCURRENCY=
+
+# A URL that replaces the APNs host in both environments, for a test double
+# only. When it's empty, the push service uses Apple's own hosts.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_APNS_BASE_URL
+# FLUXER_PUSH_SERVICE_APNS_BASE_URL=
+
+# The FCM host the push service sends to. When it's empty, it uses
+# https://fcm.googleapis.com. Change it only for a proxy or a test double.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_FCM_BASE_URL
+# FLUXER_PUSH_SERVICE_FCM_BASE_URL=
+
+# Hostnames, separated by commas, of the push relay that Fluxer runs. When
+# it's empty, the push service uses push.fluxer.com. It sends to these hosts
+# only once relay consent is accepted.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_MANAGED_RELAY_HOSTS
+# FLUXER_PUSH_SERVICE_MANAGED_RELAY_HOSTS=
+
+# Hostnames, separated by commas, of a push relay your instance runs itself.
+# The push service sends mobile app notifications addressed to these hosts
+# straight to APNs or FCM with its own credentials.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_OWN_RELAY_HOSTS
+# FLUXER_PUSH_SERVICE_OWN_RELAY_HOSTS=
+
+# Hostnames, separated by commas, that push endpoints may use even when they
+# resolve to private or loopback addresses, such as a ntfy service on your own
+# network. The push service refuses every other such endpoint.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_PRIVATE_HOSTS
+# FLUXER_PUSH_SERVICE_PRIVATE_HOSTS=
+
+# Whether this push service accepts the push relay privacy notice, which lets
+# it send through the relay Fluxer runs. Use true, 1 or yes to accept. With
+# false, 0, no or an empty value, the push relay setting of the instance
+# decides.
+# rexctl: rexctl config set FLUXER_PUSH_SERVICE_RELAY_CONSENT_ACCEPTED
+# FLUXER_PUSH_SERVICE_RELAY_CONSENT_ACCEPTED=
+
+
+# ============================================================================
+# MEDIA
+# ============================================================================
+
+# Whether Fluxer scans uploads for viruses with ClamAV. Use true or false.
+# When it's empty, Fluxer uses false. No ClamAV container ships with the
+# stack. Point FLUXER_CLAMAV_HOST at your own.
+# rexctl: rexctl config set FLUXER_CLAMAV_ENABLED
+# FLUXER_CLAMAV_ENABLED=
+
+# The hostname or address of your ClamAV scanner. When it's empty, Fluxer uses
+# 127.0.0.1.
+# rexctl: rexctl config set FLUXER_CLAMAV_HOST
+# FLUXER_CLAMAV_HOST=
+
+# The port of your ClamAV scanner. When it's empty, Fluxer uses 3310.
+# rexctl: rexctl config set FLUXER_CLAMAV_PORT
+# FLUXER_CLAMAV_PORT=
+
+# Whether uploads go through when a ClamAV scan fails, such as when Fluxer
+# can't connect to the scanner or gets no usable answer. Use true or false.
+# When it's empty, Fluxer rejects the upload.
+# rexctl: rexctl config set FLUXER_CLAMAV_FAIL_OPEN
+# FLUXER_CLAMAV_FAIL_OPEN=
+
+# Keys that sign attachment URLs, separated by commas. Each is standard base64
+# that decodes to at least 32 bytes. The first entry signs and every entry
+# verifies. To rotate keys, put the new key first. When it's empty, Fluxer
+# returns unsigned attachment URLs. Keep it secret.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64
+# FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64=
+
+# The upload relay URL the API hands to clients. When it's empty, the API uses
+# the public origin followed by /media.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT=
+
+# The largest upload the relay accepts, in bytes from 1 to 5 GiB. It can't be
+# more than FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES. When it's
+# empty, the relay uses 524288000, which is 500 MiB.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES=
+
+# How long an upload relay token stays valid, in seconds. When it's empty, the
+# API uses 900.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS=
+
+# Two-letter country codes, separated by commas, whose clients upload to the
+# object store directly and skip the relay. It needs the GeoIP database in
+# FLUXER_GEOIP_DB_PATH, and browsers can only upload directly when
+# FLUXER_S3_PUBLIC_ENDPOINT is set. When it's empty or there's no GeoIP
+# database, every client uses the relay and browsers never see the internal
+# store address.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_KEEP_DIRECT_COUNTRIES
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_KEEP_DIRECT_COUNTRIES=
+
+# Whether the media proxy checks the Origin of media requests. Use off, report
+# or enforce. When it's empty, it's off. With report, the media proxy logs
+# requests it would refuse, and with enforce it refuses them. A request with
+# no Origin header is always served.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_CORS_MODE
+# FLUXER_MEDIA_PROXY_CORS_MODE=
+
+# The web origins, separated by commas, that may load media through CORS when
+# FLUXER_MEDIA_PROXY_CORS_MODE is report or enforce. When it's empty, the
+# media proxy uses the public origin. The desktop app is always allowed.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_CORS_ALLOWED_ORIGINS
+# FLUXER_MEDIA_PROXY_CORS_ALLOWED_ORIGINS=
+
+# Whether attachment downloads need a signed URL. Use off, report or enforce.
+# When it's empty, it's off. With report, the media proxy logs downloads it
+# would refuse, and with enforce it refuses them. Both need
+# FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_SIGNATURE_MODE
+# FLUXER_MEDIA_PROXY_ATTACHMENT_SIGNATURE_MODE=
+
+# Whether the media proxy refuses to write to storage. Use true or false. When
+# it's empty, it writes as usual.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_READ_ONLY
+# FLUXER_MEDIA_PROXY_READ_ONLY=
+
+# The NSFW classifier score, from 0.0 to 1.0, that the media proxy uses as its
+# cutoff. When it's empty, it uses 0.85.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_NSFW_THRESHOLD
+# FLUXER_MEDIA_PROXY_NSFW_THRESHOLD=
+
+# The URL of an outside NSFW classifier the media proxy calls. No such service
+# ships with the stack. When it's empty, the media proxy calls none.
+# rexctl: rexctl config set FLUXER_NSFW_SERVICE_ENDPOINT
+# FLUXER_NSFW_SERVICE_ENDPOINT=
+
+# How many image transforms the media proxy runs at once, from 1 to 128. When
+# it's empty, it uses the number of CPU cores, kept between 2 and 8.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS
+# FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS=
+
+# How many transforms may wait in the media proxy's queue, from 1 to 8192.
+# When it's empty, it uses eight times
+# FLUXER_MEDIA_PROXY_MAX_NATIVE_TRANSFORMS.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_WORKER_QUEUE_CAPACITY
+# FLUXER_MEDIA_PROXY_WORKER_QUEUE_CAPACITY=
+
+# The longest animation the media proxy encodes, in milliseconds from 100 to
+# 600000. When it's empty, it uses 30000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_MAX_ENCODE_DURATION_MS
+# FLUXER_MEDIA_PROXY_MAX_ENCODE_DURATION_MS=
+
+# The most frames the media proxy encodes in one animation, from 1 to 100000.
+# When it's empty, it uses 20000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_MAX_ENCODE_FRAMES
+# FLUXER_MEDIA_PROXY_MAX_ENCODE_FRAMES=
+
+# How long one media transform may take, in milliseconds from 1000 to 120000.
+# When it's empty, the media proxy uses 15000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_TIMEOUT_MS
+# FLUXER_MEDIA_PROXY_TRANSFORM_TIMEOUT_MS=
+
+# How much memory the media proxy's transform cache may use, in bytes from 0
+# to 4 GiB. When it's empty, it uses 268435456, which is 256 MiB. rexctl sizes
+# this.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_BYTES
+# FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_BYTES=
+
+# The largest transform result the media proxy caches, in bytes from 0 to 512
+# MiB. When it's empty, it uses 67108864, which is 64 MiB.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_MAX_ENTRY_BYTES
+# FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_MAX_ENTRY_BYTES=
+
+# How long the media proxy keeps a transform result in its cache, in
+# milliseconds from 0 to 3600000. When it's empty, it uses 120000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_TTL_MS
+# FLUXER_MEDIA_PROXY_TRANSFORM_CACHE_TTL_MS=
+
+# How long the media proxy waits on socket input and output, in milliseconds
+# from 0 to 300000. When it's empty, it uses 30000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_SOCKET_IO_TIMEOUT_MS
+# FLUXER_MEDIA_PROXY_SOCKET_IO_TIMEOUT_MS=
+
+# How long the media proxy waits for open requests and transforms to finish
+# when it stops, in milliseconds from 0 to 300000. When it's empty, it uses
+# 30000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_SHUTDOWN_GRACE_MS
+# FLUXER_MEDIA_PROXY_SHUTDOWN_GRACE_MS=
+
+# How long the relay waits for an upload's write to the object store, in
+# milliseconds from 1000 to 3600000. When it's empty, it uses 900000.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_S3_TIMEOUT_MS
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_S3_TIMEOUT_MS=
+
+# The largest upload the relay keeps in memory so it can retry the object
+# store write, in bytes from 0 to 256 MiB. Larger uploads stream to the store
+# without a retry. When it's empty, the relay uses 33554432, which is 32 MiB.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_BYTES
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_BYTES=
+
+# How much memory all buffered relay uploads may use together, in bytes from 0
+# to 8 GiB. An upload that would go past it streams without a retry. When it's
+# empty, the relay uses 536870912, which is 512 MiB. rexctl sizes this.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_TOTAL_BYTES
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_BUFFERED_RETRY_TOTAL_BYTES=
+
+# The directory where the relay spools upload bodies and the media proxy keeps
+# copies of large audio and video files it inspects. It must be writable. When
+# it's empty, the media proxy uses the system temporary directory.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_DIR
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_DIR=
+
+# The chunk size the relay uses when it writes upload bodies to its spool on
+# disk, in bytes from 64 KiB to 64 MiB. When it's empty, it uses 1048576,
+# which is 1 MiB.
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_CHUNK_BYTES
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_CHUNK_BYTES=
+
+# The most disk space the spool may use at once, in bytes from 0 to 256 GiB,
+# shared by relay uploads and copies of large audio and video files. It must
+# be at least FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES. rexctl sizes
+# this.
+# default: 2147483648
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES
+# FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES=
+
+# How Fluxer purges cached copies of deleted or replaced media from your CDN
+# or caching proxy. Use none, http or controller. When it's empty, Fluxer uses
+# none and sends no purges.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_ADAPTER
+# FLUXER_CACHE_PURGE_ADAPTER=
+
+# The URL the worker posts purge requests to when FLUXER_CACHE_PURGE_ADAPTER
+# is http, as an absolute http or https URL without credentials. Your endpoint
+# then purges the listed media URL prefixes from every cache in front of the
+# media.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_HTTP_ENDPOINT
+# FLUXER_CACHE_PURGE_HTTP_ENDPOINT=
+
+# The bearer token Fluxer sends in the Authorization header of each purge
+# request to FLUXER_CACHE_PURGE_HTTP_ENDPOINT, in visible ASCII characters
+# with no spaces. Keep it secret.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_HTTP_TOKEN
+# FLUXER_CACHE_PURGE_HTTP_TOKEN=
+
+# How long each purge request to FLUXER_CACHE_PURGE_HTTP_ENDPOINT may take, in
+# milliseconds from 1000 to 10000. When it's empty, Fluxer uses 10000.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_HTTP_TIMEOUT_MS
+# FLUXER_CACHE_PURGE_HTTP_TIMEOUT_MS=
+
+# The purge URL of the Controller edge site that serves your media, as an
+# absolute https URL without credentials. Fluxer uses it when
+# FLUXER_CACHE_PURGE_ADAPTER is controller.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_CONTROLLER_ENDPOINT
+# FLUXER_CACHE_PURGE_CONTROLLER_ENDPOINT=
+
+# The Controller API key Fluxer sends as a bearer token with each purge
+# request, in visible ASCII characters with no spaces. Keep it secret.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_CONTROLLER_TOKEN
+# FLUXER_CACHE_PURGE_CONTROLLER_TOKEN=
+
+# How long each Controller purge request may take, in milliseconds from 1000
+# to 10000. When it's empty, Fluxer uses 10000.
+# rexctl: rexctl config set FLUXER_CACHE_PURGE_CONTROLLER_TIMEOUT_MS
+# FLUXER_CACHE_PURGE_CONTROLLER_TIMEOUT_MS=
+
+
+# ============================================================================
+# GATEWAY
+# ============================================================================
+
+# The public media URL the gateway uses to build avatar links in push
+# notifications. When it's empty, the gateway uses FLUXER_MEDIA_ENDPOINT, or
+# the public origin followed by /media.
+# rexctl: rexctl config set FLUXER_GATEWAY_MEDIA_PROXY_ENDPOINT
+# FLUXER_GATEWAY_MEDIA_PROXY_ENDPOINT=
+
+# The public static file URL the gateway uses to build default avatar links in
+# push notifications. When it's empty, the gateway uses
+# FLUXER_STATIC_CDN_ENDPOINT, or the public origin.
+# rexctl: rexctl config set FLUXER_GATEWAY_STATIC_CDN_ENDPOINT
+# FLUXER_GATEWAY_STATIC_CDN_ENDPOINT=
+
+# Whether the gateway sends push notifications through the push service. Use
+# true or false. When it's empty, the gateway uses true.
+# rexctl: rexctl config set FLUXER_GATEWAY_PUSH_ENABLED
+# FLUXER_GATEWAY_PUSH_ENABLED=
+
+# Whether the gateway asks the push service to clear a channel's push
+# notifications once the user has caught up on that channel. Use true or
+# false. When it's empty, the gateway uses true.
+# rexctl: rexctl config set FLUXER_GATEWAY_PUSH_ENROLLED_CLEAR_NOTIFICATIONS_ENABLED
+# FLUXER_GATEWAY_PUSH_ENROLLED_CLEAR_NOTIFICATIONS_ENABLED=
+
+# How long the gateway waits for the push service to answer one push request,
+# in milliseconds. When it's empty, the gateway uses 100000.
+# rexctl: rexctl config set FLUXER_GATEWAY_PUSH_OUTBOX_REQUEST_TIMEOUT_MS
+# FLUXER_GATEWAY_PUSH_OUTBOX_REQUEST_TIMEOUT_MS=
+
+# The most push notifications the gateway keeps back for one user while one of
+# their sessions is active, dropping the oldest first. A value of 0 keeps
+# none. When it's empty, the gateway uses 128.
+# rexctl: rexctl config set FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_ENTRIES
+# FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_ENTRIES=
+
+# The most bytes of push notifications the gateway keeps back for one user
+# while one of their sessions is active. A value of 0 turns off this limit.
+# When it's empty, the gateway uses 1048576, which is 1 MiB.
+# rexctl: rexctl config set FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_BYTES
+# FLUXER_GATEWAY_PRESENCE_PUSH_BUFFER_MAX_BYTES=
+
+# How many HTTP requests the gateway can have open to the API at once. When
+# it's empty, the gateway uses 512.
+# rexctl: rexctl config set FLUXER_GATEWAY_HTTP_RPC_MAX_CONCURRENCY
+# FLUXER_GATEWAY_HTTP_RPC_MAX_CONCURRENCY=
+
+# How many NATS RPC requests the gateway works on at once. When it's empty,
+# the gateway uses 512.
+# rexctl: rexctl config set FLUXER_GATEWAY_NATS_RPC_MAX_HANDLERS
+# FLUXER_GATEWAY_NATS_RPC_MAX_HANDLERS=
+
+# The base 2 logarithm of the zstd window the gateway compresses websocket
+# traffic with, from 10 to 21. Values outside that range count as the nearest
+# end. Larger values compress better and use more memory per connection. When
+# it's empty, the gateway uses 17.
+# rexctl: rexctl config set FLUXER_GATEWAY_ZSTD_WINDOW_LOG
+# FLUXER_GATEWAY_ZSTD_WINDOW_LOG=
+
+# How many failed requests from the gateway to the API in 10 seconds open its
+# circuit breaker, when at least 80 percent of the requests in that time
+# failed. The breaker then stops further requests for a while. When it's
+# empty, the gateway uses 6.
+# rexctl: rexctl config set FLUXER_GATEWAY_HTTP_FAILURE_THRESHOLD
+# FLUXER_GATEWAY_HTTP_FAILURE_THRESHOLD=
+
+# How long the circuit breaker for gateway requests to the API stays open
+# before it tries again, in milliseconds. When it's empty, the gateway uses
+# 15000.
+# rexctl: rexctl config set FLUXER_GATEWAY_HTTP_RECOVERY_TIMEOUT_MS
+# FLUXER_GATEWAY_HTTP_RECOVERY_TIMEOUT_MS=
+
+# The most visitor sessions one community allows, however many members it has.
+# A visitor views a community without joining it. When it's empty, the gateway
+# uses 10000.
+# rexctl: rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_MAX
+# FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_MAX=
+
+# The fewest visitor sessions one community allows, however few members it
+# has. When it's empty, the gateway uses 500.
+# rexctl: rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_FLOOR
+# FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_FLOOR=
+
+# How many visitor sessions a community allows for each of its members, kept
+# between the floor and the maximum. When it's empty, the gateway uses 2.
+# rexctl: rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_MEMBER
+# FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_MEMBER=
+
+# How many visitor sessions one account can have in a single community at
+# once. When it's empty, the gateway uses 5.
+# rexctl: rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_USER
+# FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_USER=
+
+# How many visitor sessions one IPv4 address or one IPv6 /64 network can have
+# in a single community at once. When it's empty, the gateway uses 20.
+# rexctl: rexctl config set FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_IP
+# FLUXER_GATEWAY_GUILD_VISITOR_SESSIONS_PER_IP=
+
+
+# ============================================================================
+# WEB APP
+# ============================================================================
+
+# How often the app-proxy service fetches the discovery document, in
+# milliseconds. The document has the branding saved in the admin panel, such
+# as the product name, icons and custom CSS. Values under 1 second count as 1
+# second. A failed fetch is retried with a growing delay of up to five
+# minutes.
+# default: 5000
+# rexctl: rexctl config set DISCOVERY_REFRESH_INTERVAL_MS
+# DISCOVERY_REFRESH_INTERVAL_MS=
+
+# An http or https URL that the app-proxy service fetches the web app's
+# index.html from. When it's empty, the app-proxy service serves the
+# index.html built into its image.
+# rexctl: rexctl config set FLUXER_APP_PROXY_INDEX_UPSTREAM_URL
+# FLUXER_APP_PROXY_INDEX_UPSTREAM_URL=
+
+# Extra hostnames that serve the web app, separated by commas or spaces, with
+# no scheme, port or path. On these hostnames, the web app uses the same
+# hostname for the API and for the gateway and media endpoints that share the
+# API's host. Each one must route /api, /gateway and /media like the main one.
+# rexctl: rexctl config set FLUXER_APP_PROXY_SAME_ORIGIN_HOSTS
+# FLUXER_APP_PROXY_SAME_ORIGIN_HOSTS=
+
+# HTTPS origins with no path, separated by commas or spaces, that the
+# app-proxy service adds to the scope_extensions list of the web app manifest.
+# An installed web app keeps them inside its window. Each origin must serve
+# /.well-known/web-app-origin-association for this web app. Invalid entries
+# are logged and dropped.
+# rexctl: rexctl config set FLUXER_APP_PROXY_MANIFEST_SCOPE_EXTENSIONS
+# FLUXER_APP_PROXY_MANIFEST_SCOPE_EXTENSIONS=
+
+# Extra sources the app-proxy service adds to the default-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces. Set one
+# only when a browser must connect to an origin the built-in policy doesn't
+# cover.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_DEFAULT_SRC
+# FLUXER_CSP_EXTRA_DEFAULT_SRC=
+
+# Extra sources the app-proxy service adds to the connect-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces, such as
+# wss://livekit.example.com. A ws or wss source also allows the matching http
+# or https source.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_CONNECT_SRC
+# FLUXER_CSP_EXTRA_CONNECT_SRC=
+
+# Extra sources the app-proxy service adds to the img-src directive of the web
+# app's Content-Security-Policy, separated by commas or spaces, such as
+# https://cdn.example.com.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_IMG_SRC
+# FLUXER_CSP_EXTRA_IMG_SRC=
+
+# Extra sources the app-proxy service adds to the media-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_MEDIA_SRC
+# FLUXER_CSP_EXTRA_MEDIA_SRC=
+
+# Extra sources the app-proxy service adds to the font-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_FONT_SRC
+# FLUXER_CSP_EXTRA_FONT_SRC=
+
+# Extra sources the app-proxy service adds to the script-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces, such as
+# https://analytics.example.com.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_SCRIPT_SRC
+# FLUXER_CSP_EXTRA_SCRIPT_SRC=
+
+# Extra sources the app-proxy service adds to the style-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_STYLE_SRC
+# FLUXER_CSP_EXTRA_STYLE_SRC=
+
+# Extra sources the app-proxy service adds to the frame-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_FRAME_SRC
+# FLUXER_CSP_EXTRA_FRAME_SRC=
+
+# Extra sources the app-proxy service adds to the worker-src directive of the
+# web app's Content-Security-Policy, separated by commas or spaces.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_WORKER_SRC
+# FLUXER_CSP_EXTRA_WORKER_SRC=
+
+# Extra sources the app-proxy service adds to the manifest-src directive of
+# the web app's Content-Security-Policy, separated by commas or spaces.
+# rexctl: rexctl config set FLUXER_CSP_EXTRA_MANIFEST_SRC
+# FLUXER_CSP_EXTRA_MANIFEST_SRC=
+
+# One http or https URL that browsers send Content-Security-Policy violation
+# reports to. When it's empty, the policy has no report-uri.
+# rexctl: rexctl config set FLUXER_CSP_REPORT_URI
+# FLUXER_CSP_REPORT_URI=
+
+
+# ============================================================================
+# API AND WORKER
+# ============================================================================
+
+# How long a client may take to send the request line and headers to the API,
+# in milliseconds from 1000 to 3600000. It is capped at
+# FLUXER_API_REQUEST_TIMEOUT_MS. When it's empty, the API uses 30000.
+# rexctl: rexctl config set FLUXER_API_HEADERS_TIMEOUT_MS
+# FLUXER_API_HEADERS_TIMEOUT_MS=
+
+# How long a client may take over a whole request to the API, in milliseconds
+# from 1000 to 3600000. Raise it for large uploads or slow links. When it's
+# empty, the API uses 120000.
+# rexctl: rexctl config set FLUXER_API_REQUEST_TIMEOUT_MS
+# FLUXER_API_REQUEST_TIMEOUT_MS=
+
+# How many requests the API handles at once before it answers new ones with
+# 503 and a Retry-After header, from 1 to 100000. When it's empty, the API
+# uses 512.
+# rexctl: rexctl config set FLUXER_API_MAX_INFLIGHT_REQUESTS
+# FLUXER_API_MAX_INFLIGHT_REQUESTS=
+
+# Whether Fluxer trusts the client address in the FLUXER_CLIENT_IP_HEADER_NAME
+# header. Use true or false. The api, worker, admin and gateway services and
+# the push relay use it. With false, they use the address of the connection,
+# which behind the edge is the edge itself. Outside Docker Compose, the
+# services use false when it's empty.
+# default: true
+# rexctl: rexctl config set FLUXER_TRUST_CLIENT_IP_HEADER
+# FLUXER_TRUST_CLIENT_IP_HEADER=
+
+# The request header that has the client's IP address. When it's empty, the
+# api, worker, admin and gateway services and the push relay use
+# x-forwarded-for, the header the edge sets.
+# rexctl: rexctl config set FLUXER_CLIENT_IP_HEADER_NAME
+# FLUXER_CLIENT_IP_HEADER_NAME=
+
+# IP addresses and CIDR ranges, separated by commas, that IP bans never apply
+# to, such as 203.0.113.7,2001:db8::/56. The API refuses to start when an
+# entry doesn't parse.
+# rexctl: rexctl config set FLUXER_API_IP_BAN_EXEMPT_IPS
+# FLUXER_API_IP_BAN_EXEMPT_IPS=
+
+# How often the API reloads its IP ban list, in milliseconds. When it's empty,
+# the API uses 300000. A value of 0 turns the periodic reload off.
+# rexctl: rexctl config set FLUXER_IP_BAN_REFRESH_INTERVAL_MS
+# FLUXER_IP_BAN_REFRESH_INTERVAL_MS=
+
+# An older way to add one trusted caller that may pass the client address for
+# the donation and Operator Pass rate limits. Fluxer's marketing site uses it.
+# It must be at least 32 characters. Your own instance can leave it empty.
+# Keep it secret.
+# rexctl: rexctl config set FLUXER_API_DONATION_PROXY_KEY
+# FLUXER_API_DONATION_PROXY_KEY=
+
+# A JSON array of trusted callers, such as a front end that calls the API for
+# its own visitors. Each entry is an object with a name, a key of at least 32
+# characters and buckets, a non-empty list of the rate limit buckets the
+# caller may pass a client address for. The caller sends its key in the
+# X-Fluxer-Internal-Key header and the client address in the
+# X-Fluxer-Client-IP header. Keep it secret.
+# rexctl: rexctl config set FLUXER_API_TRUSTED_CALLERS
+# FLUXER_API_TRUSTED_CALLERS=
+
+# How many jobs each worker lane runs at once, as a JSON object that maps each
+# lane to a whole number of at least 1. The lanes are realtime, unfurl,
+# lifecycle, batch and crosspost. Lanes left out use 10, 20, 8, 12 and 8 in
+# that order, scaled down on machines with fewer than 4 CPU cores.
+# rexctl: rexctl config set FLUXER_API_WORKER_LANE_CONCURRENCY_OVERRIDES
+# FLUXER_API_WORKER_LANE_CONCURRENCY_OVERRIDES=
+
+
+# ============================================================================
+# INSTANCE AND BRANDING
+#
+# Fluxer uses the product name, images, theme colour and status page links
+# set here only until the setup wizard finishes or someone saves branding in
+# the admin panel. After that it uses the saved values and ignores these.
+# Make later changes in the admin panel or with rexctl config set.
+# ============================================================================
+
+# The product name the apps show and Fluxer uses in emails and system
+# messages. When it's empty or set to Fluxer on a self-hosted instance, Fluxer
+# uses the hostname of the web app.
+# rexctl: rexctl config set app_public.branding.product_name
+# FLUXER_APP_PRODUCT_NAME=
+
+# The URL of the app icon.
+# rexctl: rexctl config set app_public.branding.icon_url
+# FLUXER_APP_ICON_URL=
+
+# The URL of the symbol mark.
+# rexctl: rexctl config set app_public.branding.symbol_url
+# FLUXER_APP_SYMBOL_URL=
+
+# The URL of the logo.
+# rexctl: rexctl config set app_public.branding.logo_url
+# FLUXER_APP_LOGO_URL=
+
+# The URL of the wordmark.
+# rexctl: rexctl config set app_public.branding.wordmark_url
+# FLUXER_APP_WORDMARK_URL=
+
+# The URL of the favicon.
+# rexctl: rexctl config set app_public.branding.favicon_url
+# FLUXER_APP_FAVICON_URL=
+
+# The URL of the favicon for browsers in dark mode.
+# rexctl: rexctl config set app_public.branding.favicon_dark_url
+# FLUXER_APP_FAVICON_DARK_URL=
+
+# The URL of the image behind the sign-in screen.
+# rexctl: rexctl config set app_public.branding.sign_in_backdrop_url
+# FLUXER_APP_SIGN_IN_BACKDROP_URL=
+
+# The brand colour of the web app and the browser theme colour, as a hex value
+# such as #4641d9.
+# rexctl: rexctl config set app_public.branding.theme_color
+# FLUXER_APP_THEME_COLOR=
+
+# The URL of your public status page. The web app links to it when loading
+# takes a long time. On an Instatus page, the web app also shows its current
+# incidents and maintenance.
+# rexctl: rexctl config set app_public.branding.status_page_url
+# FLUXER_APP_STATUS_PAGE_URL=
+
+# The URL of the incident history on your status page. The apps don't use it
+# yet.
+# rexctl: rexctl config set app_public.branding.status_page_incident_history_url
+# FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL=
+
+# Whether a new instance starts as already set up. Use true or false. With
+# true, the setup wizard is skipped and registration opens without making the
+# first account an admin. Once a setup state is saved, this has no effect.
+# When it's empty, Fluxer uses false.
+# rexctl: rexctl config set FLUXER_INSTANCE_SETUP_CONFIGURED
+# FLUXER_INSTANCE_SETUP_CONFIGURED=
+
+# How people sign in on a new instance. Use username or email. Fluxer uses it
+# only on the first start with no saved sign-in method. When it's empty,
+# Fluxer uses email if email delivery is set up and username otherwise. When
+# FLUXER_INSTANCE_SETUP_CONFIGURED is true or any account exists, Fluxer uses
+# email sign-in with random tags and ignores this. Otherwise the setup wizard
+# asks again, and its answer replaces this value.
+# rexctl: rexctl config set FLUXER_ACCOUNT_IDENTITY
+# FLUXER_ACCOUNT_IDENTITY=
+
+# How usernames are tagged on a new instance that signs in by email. Use none
+# for unique usernames with no tag or random for a random tag on every
+# account. Username sign-in always uses none. Fluxer reads this setting only
+# on the first start. When it's empty, Fluxer uses none. When
+# FLUXER_INSTANCE_SETUP_CONFIGURED is true or any account exists, Fluxer uses
+# random tags and ignores this. Otherwise the setup wizard asks again, and its
+# answer replaces this value.
+# rexctl: rexctl config set FLUXER_TAG_STYLE
+# FLUXER_TAG_STYLE=
+
+# One or more invite codes, separated by commas or spaces. A new account that
+# signs up without an invite of its own joins the communities these invites
+# lead to.
+# rexctl: rexctl config set FLUXER_AUTO_JOIN_INVITE_CODE
+# FLUXER_AUTO_JOIN_INVITE_CODE=
+
+# Whether community discovery is on. Use true or false. With false, discovery
+# search, joining from discovery and discovery applications are turned off.
+# When it's empty, Fluxer uses true.
+# rexctl: rexctl config set FLUXER_DISCOVERY_ENABLED
+# FLUXER_DISCOVERY_ENABLED=
+
+# How many members a community needs before it can be listed in discovery.
+# When it's empty, Fluxer uses 1.
+# rexctl: rexctl config set FLUXER_DISCOVERY_MIN_MEMBER_COUNT
+# FLUXER_DISCOVERY_MIN_MEMBER_COUNT=
+
+# How many hours a deleted account can still be recovered before Fluxer
+# removes it. When it's empty, Fluxer uses 336, which is 14 days.
+# rexctl: rexctl config set FLUXER_DELETION_GRACE_PERIOD_HOURS
+# FLUXER_DELETION_GRACE_PERIOD_HOURS=
+
+# How many days the daily retention job keeps a resolved report, from 1 to
+# 36500. It then deletes the report, its evidence copies and its search entry.
+# A child safety report is kept for at least 365 days after it's resolved, and
+# a report with an enforcement decision for at least 365 days after the
+# decision. The job never deletes a pending report or a report under a legal
+# hold. When it's empty, the worker uses 365.
+# rexctl: rexctl config set FLUXER_REPORT_RETENTION_DAYS
+# FLUXER_REPORT_RETENTION_DAYS=
+
+# Whether the report retention job only counts what it would delete and
+# changes nothing. Use true or false. When it's empty, the worker uses false.
+# rexctl: rexctl config set FLUXER_REPORT_RETENTION_DRY_RUN
+# FLUXER_REPORT_RETENTION_DRY_RUN=
+
+
+# ============================================================================
+# BILLING
+#
+# The admin panel can also save whether billing is on, the Stripe keys and
+# the prices. A value saved there is used first, and a saved price list
+# replaces all of FLUXER_STRIPE_PRICES.
+# ============================================================================
+
+# Whether Fluxer sells subscriptions through Stripe. Use true or false. When
+# it's empty, Fluxer uses false.
+# rexctl: rexctl config set billing.enabled
+# FLUXER_STRIPE_ENABLED=
+
+# Your Stripe secret API key. Keep it secret.
+# rexctl: rexctl config set billing.stripe_secret_key
+# FLUXER_STRIPE_SECRET_KEY=
+
+# The signing secret of your Stripe webhook. Keep it secret.
+# rexctl: rexctl config set billing.stripe_webhook_secret
+# FLUXER_STRIPE_WEBHOOK_SECRET=
+
+# Your Stripe price IDs as one JSON object, keyed by plan and currency such as
+# monthly_usd.
+# rexctl: rexctl config set billing.prices
+# FLUXER_STRIPE_PRICES=
+
+# Stripe price IDs you have retired, as a JSON object with the same keys as
+# FLUXER_STRIPE_PRICES and a list of IDs for each. Subscriptions on these
+# prices keep renewing.
+# rexctl: rexctl config set billing.legacy_prices
+# FLUXER_STRIPE_LEGACY_PRICES=
+
+# The ID of the community that people who buy Visionary are added to. When
+# it's empty on a self-hosted instance, nobody is added.
+# rexctl: rexctl config set FLUXER_VISIONARIES_GUILD_ID
+# FLUXER_VISIONARIES_GUILD_ID=
+
+# The ID of the role Fluxer gives Visionary buyers in the community set by
+# FLUXER_VISIONARIES_GUILD_ID. Set it whenever FLUXER_VISIONARIES_GUILD_ID is
+# set.
+# rexctl: rexctl config set FLUXER_VISIONARIES_GUILD_VISIONARY_ROLE_ID
+# FLUXER_VISIONARIES_GUILD_VISIONARY_ROLE_ID=
+
+
+# ============================================================================
+# INTEGRATIONS
+#
+# The admin panel can also save the Bluesky settings and keys. A value saved
+# there is used first.
+# ============================================================================
+
+# Whether Fluxer rejects passwords found in known data breaches, by sending
+# the first five characters of the password's SHA-1 hash to
+# api.pwnedpasswords.com. Use true or false. When it's empty, this is off on a
+# self-hosted instance.
+# rexctl: rexctl config set FLUXER_BREACHED_PASSWORD_CHECK_ENABLED
+# FLUXER_BREACHED_PASSWORD_CHECK_ENABLED=
+
+# Whether the worker downloads the URLhaus and PhishTank link lists every six
+# hours and the MalwareBazaar file hashes every twelve hours, and checks
+# posted links and uploads against them. Use true or false. When it's empty,
+# this is off on a self-hosted instance.
+# rexctl: rexctl config set FLUXER_BLOCKLIST_FEEDS_ENABLED
+# FLUXER_BLOCKLIST_FEEDS_ENABLED=
+
+# Where the api and worker load the MaxMind GeoIP database from, as a file
+# path or an s3://bucket/key URL. An s3 URL needs a download_path query
+# parameter with an absolute path.
+# rexctl: rexctl config set FLUXER_GEOIP_DB_PATH
+# FLUXER_GEOIP_DB_PATH=
+
+# The Klipy API key for GIF search and Klipy link previews. A key saved in the
+# admin panel is used first. GIF search is off when neither is set. Keep it
+# secret.
+# rexctl: rexctl config set integrations.gif.klipy_api_key
+# FLUXER_KLIPY_API_KEY=
+
+# The YouTube Data API key Fluxer uses for YouTube link previews. A key saved
+# in the admin panel is used first. Keep it secret.
+# rexctl: rexctl config set integrations.youtube.api_key
+# FLUXER_YOUTUBE_API_KEY=
+
+# Hostnames, separated by commas, that Fluxer never makes link previews for. A
+# link matches only when its host is exactly one of these.
+# rexctl: rexctl config set FLUXER_API_UNFURL_IGNORED_HOSTS
+# FLUXER_API_UNFURL_IGNORED_HOSTS=
+
+# Whether people can link a Bluesky account to their profile. Use true or
+# false. It needs FLUXER_AUTH_BLUESKY_KEYS. When it's empty, Fluxer uses
+# false.
+# rexctl: rexctl config set integrations.bluesky.enabled
+# FLUXER_AUTH_BLUESKY_ENABLED=
+
+# The app name Bluesky shows when someone links their account. When it's
+# empty, Bluesky shows Fluxer, even when FLUXER_APP_PRODUCT_NAME is set.
+# rexctl: rexctl config set integrations.bluesky.client_name
+# FLUXER_AUTH_BLUESKY_CLIENT_NAME=
+
+# Fluxer doesn't use this value. Bluesky shows the API address as the home
+# page of your instance.
+# FLUXER_AUTH_BLUESKY_CLIENT_URI=
+
+# The logo URL Bluesky shows for your instance.
+# rexctl: rexctl config set integrations.bluesky.logo_uri
+# FLUXER_AUTH_BLUESKY_LOGO_URI=
+
+# The terms of service URL Bluesky shows for your instance.
+# rexctl: rexctl config set integrations.bluesky.tos_uri
+# FLUXER_AUTH_BLUESKY_TOS_URI=
+
+# The privacy policy URL Bluesky shows for your instance.
+# rexctl: rexctl config set integrations.bluesky.policy_uri
+# FLUXER_AUTH_BLUESKY_POLICY_URI=
+
+# The keys Fluxer signs Bluesky account linking requests with, as a JSON array
+# of objects with a kid and a private_key or a private_key_path, which is an
+# absolute path inside the api and worker containers. Keys saved in the admin
+# panel replace these. Keep it secret.
+# rexctl: rexctl config set integrations.bluesky.keys
+# FLUXER_AUTH_BLUESKY_KEYS=
+
+
+# ============================================================================
+# MEMORY AND PERFORMANCE
+#
+# rexctl sets some of these from the machine's memory and CPU on every start.
+# A value you set wins.
+# ============================================================================
+
+# How many worker threads the async runtime uses in the app-proxy, push,
+# admin, snowflakes, users, gifs, messages and unfurl containers, set as their
+# TOKIO_WORKER_THREADS. rexctl sizes this.
+# default: 2
+# rexctl: rexctl config set FLUXER_TOKIO_WORKER_THREADS
+# FLUXER_TOKIO_WORKER_THREADS=
+
+# How many memory arenas the glibc allocator may create in the push, admin,
+# snowflakes, users, gifs, messages and unfurl containers, set as their
+# MALLOC_ARENA_MAX. Lower values use less memory. rexctl sizes this.
+# default: 2
+# rexctl: rexctl config set FLUXER_MALLOC_ARENA_MAX
+# FLUXER_MALLOC_ARENA_MAX=
+
+# The memory limit for the edge container, which runs Caddy. rexctl sizes
+# this.
+# default: 384mb
+# rexctl: rexctl config set FLUXER_CADDY_MEMORY_LIMIT
+# FLUXER_CADDY_MEMORY_LIMIT=
+
+# The memory limit for the postgres container. Keep it at or above
+# FLUXER_POSTGRES_MEMORY_RESERVATION. rexctl sizes this.
+# default: 5gb
+# rexctl: rexctl config set FLUXER_POSTGRES_MEMORY_LIMIT
+# FLUXER_POSTGRES_MEMORY_LIMIT=
+
+# The memory reservation for the postgres container, the amount Docker tries
+# to keep for it when the machine runs low. Keep it at or below
+# FLUXER_POSTGRES_MEMORY_LIMIT. rexctl sizes this.
+# default: 3gb
+# rexctl: rexctl config set FLUXER_POSTGRES_MEMORY_RESERVATION
+# FLUXER_POSTGRES_MEMORY_RESERVATION=
+
+# Postgres max_connections, how many connections the database accepts in
+# total. Keep it above the sum of all pool sizes, counting each worker
+# replica. rexctl sizes this.
+# default: 150
+# rexctl: rexctl config set FLUXER_POSTGRES_SERVER_MAX_CONNECTIONS
+# FLUXER_POSTGRES_SERVER_MAX_CONNECTIONS=
+
+# Postgres shared_buffers, the memory Postgres uses for its own cache. rexctl
+# sizes this.
+# default: 512MB
+# rexctl: rexctl config set FLUXER_POSTGRES_SHARED_BUFFERS
+# FLUXER_POSTGRES_SHARED_BUFFERS=
+
+# Postgres effective_cache_size, how much disk cache the query planner assumes
+# there is. It allocates no memory. rexctl sizes this.
+# default: 2GB
+# rexctl: rexctl config set FLUXER_POSTGRES_EFFECTIVE_CACHE_SIZE
+# FLUXER_POSTGRES_EFFECTIVE_CACHE_SIZE=
+
+# Postgres work_mem, the memory each sort or hash step in a query can use
+# before it spills to disk. rexctl sizes this.
+# default: 8MB
+# rexctl: rexctl config set FLUXER_POSTGRES_WORK_MEM
+# FLUXER_POSTGRES_WORK_MEM=
+
+# Postgres maintenance_work_mem, the memory one VACUUM, CREATE INDEX or ALTER
+# TABLE can use. rexctl sizes this.
+# default: 256MB
+# rexctl: rexctl config set FLUXER_POSTGRES_MAINTENANCE_WORK_MEM
+# FLUXER_POSTGRES_MAINTENANCE_WORK_MEM=
+
+# Postgres autovacuum_work_mem, the memory each autovacuum worker can use.
+# rexctl sizes this.
+# default: 128MB
+# rexctl: rexctl config set FLUXER_POSTGRES_AUTOVACUUM_WORK_MEM
+# FLUXER_POSTGRES_AUTOVACUUM_WORK_MEM=
+
+# Postgres random_page_cost, how costly the query planner thinks fetching a
+# random disk page is next to a sequential one. Values near 1 suit SSDs.
+# default: 1.1
+# rexctl: rexctl config set FLUXER_POSTGRES_RANDOM_PAGE_COST
+# FLUXER_POSTGRES_RANDOM_PAGE_COST=
+
+# Postgres effective_io_concurrency, how many disk requests Postgres may have
+# in flight at once. High values suit SSDs.
+# default: 200
+# rexctl: rexctl config set FLUXER_POSTGRES_EFFECTIVE_IO_CONCURRENCY
+# FLUXER_POSTGRES_EFFECTIVE_IO_CONCURRENCY=
+
+# Postgres default_statistics_target, how much detail the query planner's
+# table statistics have. Higher values give better plans and a slower ANALYZE.
+# default: 200
+# rexctl: rexctl config set FLUXER_POSTGRES_DEFAULT_STATISTICS_TARGET
+# FLUXER_POSTGRES_DEFAULT_STATISTICS_TARGET=
+
+# Postgres jit, whether Postgres compiles parts of queries with JIT. Use on or
+# off.
+# default: off
+# rexctl: rexctl config set FLUXER_POSTGRES_JIT
+# FLUXER_POSTGRES_JIT=
+
+# Postgres min_wal_size, the write-ahead log space Postgres keeps for reuse
+# after a checkpoint.
+# default: 80MB
+# rexctl: rexctl config set FLUXER_POSTGRES_MIN_WAL_SIZE
+# FLUXER_POSTGRES_MIN_WAL_SIZE=
+
+# Postgres max_wal_size, how large the write-ahead log may grow before
+# Postgres starts a checkpoint.
+# default: 2GB
+# rexctl: rexctl config set FLUXER_POSTGRES_MAX_WAL_SIZE
+# FLUXER_POSTGRES_MAX_WAL_SIZE=
+
+# Postgres checkpoint_completion_target, how much of the time between
+# checkpoints a checkpoint spreads its writes over, as a fraction.
+# default: 0.9
+# rexctl: rexctl config set FLUXER_POSTGRES_CHECKPOINT_COMPLETION_TARGET
+# FLUXER_POSTGRES_CHECKPOINT_COMPLETION_TARGET=
+
+# Postgres wal_buffers, the memory for write-ahead log data not yet written to
+# disk.
+# default: 16MB
+# rexctl: rexctl config set FLUXER_POSTGRES_WAL_BUFFERS
+# FLUXER_POSTGRES_WAL_BUFFERS=
+
+# Postgres wal_compression, how full-page images in the write-ahead log are
+# compressed, such as lz4, pglz or off.
+# default: zstd
+# rexctl: rexctl config set FLUXER_POSTGRES_WAL_COMPRESSION
+# FLUXER_POSTGRES_WAL_COMPRESSION=
+
+# Postgres bgwriter_delay, how long the background writer sleeps between
+# rounds, such as 200ms. rexctl sizes this.
+# default: 50ms
+# rexctl: rexctl config set FLUXER_POSTGRES_BGWRITER_DELAY
+# FLUXER_POSTGRES_BGWRITER_DELAY=
+
+# Postgres bgwriter_lru_maxpages, the most buffers the background writer
+# writes to disk in one round. rexctl sizes this.
+# default: 1000
+# rexctl: rexctl config set FLUXER_POSTGRES_BGWRITER_LRU_MAXPAGES
+# FLUXER_POSTGRES_BGWRITER_LRU_MAXPAGES=
+
+# Postgres autovacuum_vacuum_scale_factor, the share of a table's rows that
+# must be updated or deleted before autovacuum vacuums it, as a fraction such
+# as 0.1.
+# default: 0.05
+# rexctl: rexctl config set FLUXER_POSTGRES_AUTOVACUUM_VACUUM_SCALE_FACTOR
+# FLUXER_POSTGRES_AUTOVACUUM_VACUUM_SCALE_FACTOR=
+
+# Postgres autovacuum_analyze_scale_factor, the share of a table's rows that
+# must change before autovacuum analyses it again, as a fraction such as 0.05.
+# default: 0.02
+# rexctl: rexctl config set FLUXER_POSTGRES_AUTOVACUUM_ANALYZE_SCALE_FACTOR
+# FLUXER_POSTGRES_AUTOVACUUM_ANALYZE_SCALE_FACTOR=
+
+# Postgres autovacuum_vacuum_cost_limit, how much disk work autovacuum may do
+# before it pauses. Higher values let it finish sooner.
+# default: 2000
+# rexctl: rexctl config set FLUXER_POSTGRES_AUTOVACUUM_VACUUM_COST_LIMIT
+# FLUXER_POSTGRES_AUTOVACUUM_VACUUM_COST_LIMIT=
+
+# Postgres autovacuum_max_workers, how many autovacuum processes can run at
+# once. rexctl sizes this.
+# default: 3
+# rexctl: rexctl config set FLUXER_POSTGRES_AUTOVACUUM_MAX_WORKERS
+# FLUXER_POSTGRES_AUTOVACUUM_MAX_WORKERS=
+
+# Postgres max_parallel_workers_per_gather, how many parallel workers one step
+# of a query can use. rexctl sizes this.
+# default: 2
+# rexctl: rexctl config set FLUXER_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER
+# FLUXER_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER=
+
+# Postgres max_parallel_workers, how many parallel query workers can run at
+# once across the database. Postgres caps it at max_worker_processes, and the
+# stack leaves that at 8. rexctl sizes this.
+# default: 8
+# rexctl: rexctl config set FLUXER_POSTGRES_MAX_PARALLEL_WORKERS
+# FLUXER_POSTGRES_MAX_PARALLEL_WORKERS=
+
+# Postgres track_io_timing, whether Postgres times its disk I/O for its
+# statistics. Use on or off.
+# default: on
+# rexctl: rexctl config set FLUXER_POSTGRES_TRACK_IO_TIMING
+# FLUXER_POSTGRES_TRACK_IO_TIMING=
+
+# Postgres shared_preload_libraries, the extensions Postgres loads at start,
+# separated by commas. Keep pg_stat_statements in the list. The api turns it
+# on at start.
+# default: pg_stat_statements
+# rexctl: rexctl config set FLUXER_POSTGRES_SHARED_PRELOAD_LIBRARIES
+# FLUXER_POSTGRES_SHARED_PRELOAD_LIBRARIES=
+
+# The shared memory size of the postgres container, used by parallel queries
+# and parallel maintenance. Keep it well above
+# FLUXER_POSTGRES_MAINTENANCE_WORK_MEM. rexctl sizes this.
+# default: 1gb
+# rexctl: rexctl config set FLUXER_POSTGRES_SHM_SIZE
+# FLUXER_POSTGRES_SHM_SIZE=
+
+# The memory limit for the valkey container. Keep it above
+# FLUXER_VALKEY_MAXMEMORY. rexctl sizes this.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_VALKEY_MEMORY_LIMIT
+# FLUXER_VALKEY_MEMORY_LIMIT=
+
+# Valkey maxmemory, the most memory Valkey may use for stored data. The
+# append-only file buffer and memory fragmentation come on top. Keep it below
+# FLUXER_VALKEY_MEMORY_LIMIT. rexctl sizes this.
+# default: 192mb
+# rexctl: rexctl config set FLUXER_VALKEY_MAXMEMORY
+# FLUXER_VALKEY_MAXMEMORY=
+
+# Valkey maxmemory-policy, what Valkey does when its data grows to
+# FLUXER_VALKEY_MAXMEMORY. With noeviction, writes fail when Valkey is full
+# and no data is dropped.
+# default: noeviction
+# rexctl: rexctl config set FLUXER_VALKEY_MAXMEMORY_POLICY
+# FLUXER_VALKEY_MAXMEMORY_POLICY=
+
+# The memory limit for the nats container. rexctl sizes this.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_NATS_MEMORY_LIMIT
+# FLUXER_NATS_MEMORY_LIMIT=
+
+# The soft memory limit of the Go runtime in NATS, set as its GOMEMLIMIT. Keep
+# it below FLUXER_NATS_MEMORY_LIMIT. rexctl sizes this.
+# default: 200MiB
+# rexctl: rexctl config set FLUXER_NATS_GOMEMLIMIT
+# FLUXER_NATS_GOMEMLIMIT=
+
+# NATS JetStream max_memory_store, the most memory JetStream may use for
+# streams kept in memory, such as 128MB.
+# default: 64MB
+# rexctl: rexctl config set FLUXER_NATS_MAX_MEMORY_STORE
+# FLUXER_NATS_MAX_MEMORY_STORE=
+
+# NATS JetStream max_file_store, the most disk space JetStream may use for its
+# streams, such as 20GB.
+# default: 10GB
+# rexctl: rexctl config set FLUXER_NATS_MAX_FILE_STORE
+# FLUXER_NATS_MAX_FILE_STORE=
+
+# The memory limit for the meilisearch container. rexctl sizes this.
+# default: 1536mb
+# rexctl: rexctl config set FLUXER_MEILISEARCH_MEMORY_LIMIT
+# FLUXER_MEILISEARCH_MEMORY_LIMIT=
+
+# The memory Meilisearch aims to stay under while indexing, set as its
+# MEILI_MAX_INDEXING_MEMORY, such as 512mb. Meilisearch can go a little over
+# it. Keep it well below FLUXER_MEILISEARCH_MEMORY_LIMIT. rexctl sizes this.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY
+# FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=
+
+# The most threads Meilisearch may use for indexing, set as its
+# MEILI_MAX_INDEXING_THREADS. rexctl sizes this.
+# default: 2
+# rexctl: rexctl config set FLUXER_MEILISEARCH_MAX_INDEXING_THREADS
+# FLUXER_MEILISEARCH_MAX_INDEXING_THREADS=
+
+# The memory limit for the seaweedfs container. rexctl sizes this.
+# default: 2gb
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_MEMORY_LIMIT
+# FLUXER_SEAWEEDFS_MEMORY_LIMIT=
+
+# The soft memory limit of the Go runtime in SeaweedFS, set as its GOMEMLIMIT.
+# Go can't see the container limit. Keep this at 75 to 85 percent of
+# FLUXER_SEAWEEDFS_MEMORY_LIMIT and raise both together. rexctl sizes this.
+# default: 1536MiB
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_GOMEMLIMIT
+# FLUXER_SEAWEEDFS_GOMEMLIMIT=
+
+# How many volumes SeaweedFS creates at once when a bucket has no writable
+# volume left, set as its WEED_MASTER_VOLUME_GROWTH_COPY_1.
+# default: 1
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_VOLUME_GROWTH
+# FLUXER_SEAWEEDFS_VOLUME_GROWTH=
+
+# The size in MB a volume can grow to before SeaweedFS stops writing to it,
+# set as its -master.volumeSizeLimitMB.
+# default: 1024
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_VOLUME_SIZE_LIMIT_MB
+# FLUXER_SEAWEEDFS_VOLUME_SIZE_LIMIT_MB=
+
+# The share of deleted space in a volume that makes SeaweedFS compact it, as a
+# fraction, set as its -master.garbageThreshold.
+# default: 0.1
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_GARBAGE_THRESHOLD
+# FLUXER_SEAWEEDFS_GARBAGE_THRESHOLD=
+
+# The most volumes the SeaweedFS volume store may have, set as its
+# -volume.max.
+# default: 10000
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_VOLUME_MAX
+# FLUXER_SEAWEEDFS_VOLUME_MAX=
+
+# The memory limit for the seaweedfs-init container, which creates the
+# buckets, sets up the S3 key and the expiry of the uploads bucket, and then
+# exits.
+# default: 128mb
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT
+# FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT=
+
+# The memory limit for the livekit container. rexctl sizes this.
+# default: 512mb
+# rexctl: rexctl config set FLUXER_LIVEKIT_MEMORY_LIMIT
+# FLUXER_LIVEKIT_MEMORY_LIMIT=
+
+# The soft memory limit of the Go runtime in LiveKit, set as its GOMEMLIMIT.
+# Keep it below FLUXER_LIVEKIT_MEMORY_LIMIT. rexctl sizes this.
+# default: 435MiB
+# rexctl: rexctl config set FLUXER_LIVEKIT_GOMEMLIMIT
+# FLUXER_LIVEKIT_GOMEMLIMIT=
+
+# The memory limit for the api container. rexctl sizes this.
+# default: 2560mb
+# rexctl: rexctl config set FLUXER_API_MEMORY_LIMIT
+# FLUXER_API_MEMORY_LIMIT=
+
+# The memory reservation for the api container, the amount Docker tries to
+# keep for it when the machine runs low. Keep it at or below
+# FLUXER_API_MEMORY_LIMIT. rexctl sizes this.
+# default: 1gb
+# rexctl: rexctl config set FLUXER_API_MEMORY_RESERVATION
+# FLUXER_API_MEMORY_RESERVATION=
+
+# The Node heap limit of the api container, in MB, set as
+# --max-old-space-size. When it's empty, Node uses 60 percent of the memory
+# available to the container. A value above FLUXER_API_MEMORY_LIMIT lets the
+# heap grow until Docker kills the container for running out of memory.
+# rexctl: rexctl config set FLUXER_API_NODE_HEAP_MB
+# FLUXER_API_NODE_HEAP_MB=
+
+# Extra Node flags for the api container, added to the end of NODE_OPTIONS,
+# such as --dns-result-order=ipv4first. Set the heap with
+# FLUXER_API_NODE_HEAP_MB. While that is empty, a --max-old-space-size flag
+# here has no effect.
+# rexctl: rexctl config set FLUXER_API_NODE_OPTIONS
+# FLUXER_API_NODE_OPTIONS=
+
+# The size of the Postgres connection pool of the api container, from 1 to
+# 1000. rexctl sizes this.
+# default: 25
+# rexctl: rexctl config set FLUXER_API_POSTGRES_MAX_CONNECTIONS
+# FLUXER_API_POSTGRES_MAX_CONNECTIONS=
+
+# Whether the api container also runs the background worker jobs inside the
+# api process. Use true or false. With true, rexctl sets
+# FLUXER_WORKER_REPLICAS to 0 and gives the api container more memory. Without
+# rexctl, set FLUXER_WORKER_REPLICAS to 0 yourself.
+# default: false
+# rexctl: rexctl config set FLUXER_API_EMBEDDED_WORKER
+# FLUXER_API_EMBEDDED_WORKER=
+
+# How many worker containers Docker runs. With FLUXER_API_EMBEDDED_WORKER set
+# to true, rexctl sets it to 0. Without rexctl, set it to 0 yourself.
+# default: 1
+# rexctl: rexctl config set FLUXER_WORKER_REPLICAS
+# FLUXER_WORKER_REPLICAS=
+
+# The memory limit for each worker container. rexctl sizes this.
+# default: 2560mb
+# rexctl: rexctl config set FLUXER_WORKER_MEMORY_LIMIT
+# FLUXER_WORKER_MEMORY_LIMIT=
+
+# The memory reservation for each worker container, the amount Docker tries to
+# keep for it when the machine runs low. Keep it at or below
+# FLUXER_WORKER_MEMORY_LIMIT. rexctl sizes this.
+# default: 1gb
+# rexctl: rexctl config set FLUXER_WORKER_MEMORY_RESERVATION
+# FLUXER_WORKER_MEMORY_RESERVATION=
+
+# The Node heap limit of each worker container, in MB, set as
+# --max-old-space-size. When it's empty, Node uses 55 percent of the memory
+# available to the container. A value above FLUXER_WORKER_MEMORY_LIMIT lets
+# the heap grow until Docker kills the container for running out of memory.
+# rexctl: rexctl config set FLUXER_WORKER_NODE_HEAP_MB
+# FLUXER_WORKER_NODE_HEAP_MB=
+
+# Extra Node flags for each worker container, added to the end of
+# NODE_OPTIONS, such as --dns-result-order=ipv4first. Set the heap with
+# FLUXER_WORKER_NODE_HEAP_MB. While that is empty, a --max-old-space-size flag
+# here has no effect.
+# rexctl: rexctl config set FLUXER_WORKER_NODE_OPTIONS
+# FLUXER_WORKER_NODE_OPTIONS=
+
+# The size of the Postgres connection pool of each worker container, from 1 to
+# 1000. It has no effect when FLUXER_API_EMBEDDED_WORKER is true. rexctl sizes
+# this.
+# default: 25
+# rexctl: rexctl config set FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS
+# FLUXER_WORKER_POSTGRES_MAX_CONNECTIONS=
+
+# Postgres synchronous_commit for the database connections of each worker
+# container. Use on, off, local, remote_write or remote_apply. When it's
+# empty, the worker uses off, and a Postgres crash can lose the worker's most
+# recent writes. It has no effect when FLUXER_API_EMBEDDED_WORKER is true.
+# rexctl: rexctl config set FLUXER_WORKER_POSTGRES_SYNCHRONOUS_COMMIT
+# FLUXER_WORKER_POSTGRES_SYNCHRONOUS_COMMIT=
+
+# The memory limit for the gateway container. rexctl sizes this.
+# default: 1gb
+# rexctl: rexctl config set FLUXER_GATEWAY_MEMORY_LIMIT
+# FLUXER_GATEWAY_MEMORY_LIMIT=
+
+# The memory reservation for the gateway container, the amount Docker tries to
+# keep for it when the machine runs low. Keep it at or below
+# FLUXER_GATEWAY_MEMORY_LIMIT. rexctl sizes this.
+# default: 384mb
+# rexctl: rexctl config set FLUXER_GATEWAY_MEMORY_RESERVATION
+# FLUXER_GATEWAY_MEMORY_RESERVATION=
+
+# How many normal schedulers the Erlang VM of the gateway runs, a positive
+# whole number. When it's empty, the gateway uses the container's CPU count
+# kept between FLUXER_ERLANG_SCHEDULERS_MIN and FLUXER_ERLANG_SCHEDULERS_MAX.
+# rexctl: rexctl config set FLUXER_ERLANG_SCHEDULERS
+# FLUXER_ERLANG_SCHEDULERS=
+
+# The lowest scheduler count the gateway picks from the CPU count when
+# FLUXER_ERLANG_SCHEDULERS is empty. When it's empty, the gateway uses 2.
+# rexctl: rexctl config set FLUXER_ERLANG_SCHEDULERS_MIN
+# FLUXER_ERLANG_SCHEDULERS_MIN=
+
+# The highest scheduler count the gateway picks from the CPU count when
+# FLUXER_ERLANG_SCHEDULERS is empty. When it's empty, the gateway uses 16.
+# rexctl: rexctl config set FLUXER_ERLANG_SCHEDULERS_MAX
+# FLUXER_ERLANG_SCHEDULERS_MAX=
+
+# How many dirty CPU schedulers the Erlang VM of the gateway runs, a positive
+# whole number. When it's empty, the gateway uses half the normal scheduler
+# count, and at least 1.
+# rexctl: rexctl config set FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS
+# FLUXER_ERLANG_DIRTY_CPU_SCHEDULERS=
+
+# How many dirty I/O schedulers the Erlang VM of the gateway runs, a positive
+# whole number. When it's empty, the gateway uses the normal scheduler count
+# kept between 2 and 4.
+# rexctl: rexctl config set FLUXER_ERLANG_DIRTY_IO_SCHEDULERS
+# FLUXER_ERLANG_DIRTY_IO_SCHEDULERS=
+
+# The memory limit for the media-proxy container. rexctl sizes this.
+# default: 1gb
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_MEMORY_LIMIT
+# FLUXER_MEDIA_PROXY_MEMORY_LIMIT=
+
+# How many worker threads the async runtime of the media proxy uses, set as
+# its TOKIO_WORKER_THREADS. rexctl sizes this.
+# default: 4
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS
+# FLUXER_MEDIA_PROXY_TOKIO_WORKER_THREADS=
+
+# The memory limit for the push container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_PUSH_MEMORY_LIMIT
+# FLUXER_PUSH_MEMORY_LIMIT=
+
+# The memory limit for the static-proxy container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_STATIC_PROXY_MEMORY_LIMIT
+# FLUXER_STATIC_PROXY_MEMORY_LIMIT=
+
+# The memory limit for the app-proxy container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_APP_PROXY_MEMORY_LIMIT
+# FLUXER_APP_PROXY_MEMORY_LIMIT=
+
+# The memory limit for the snowflakes container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_SNOWFLAKES_MEMORY_LIMIT
+# FLUXER_SNOWFLAKES_MEMORY_LIMIT=
+
+# The memory limit for the users container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_USERS_MEMORY_LIMIT
+# FLUXER_USERS_MEMORY_LIMIT=
+
+# The size of the Postgres connection pool of the users container. rexctl
+# sizes this.
+# default: 20
+# rexctl: rexctl config set FLUXER_USERS_POSTGRES_MAX_CONNECTIONS
+# FLUXER_USERS_POSTGRES_MAX_CONNECTIONS=
+
+# The memory limit for the gifs container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_GIFS_MEMORY_LIMIT
+# FLUXER_GIFS_MEMORY_LIMIT=
+
+# How many bytes the gifs service may use for its cache, at least 16777216,
+# which is 16 MiB. Keep it below FLUXER_GIFS_MEMORY_LIMIT. rexctl sizes this.
+# default: 134217728
+# rexctl: rexctl config set FLUXER_GIFS_SHARD_CACHE_MAX_BYTES
+# FLUXER_GIFS_SHARD_CACHE_MAX_BYTES=
+
+# The memory limit for the messages container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_MESSAGES_MEMORY_LIMIT
+# FLUXER_MESSAGES_MEMORY_LIMIT=
+
+# The size of the Postgres connection pool of the messages container. rexctl
+# sizes this.
+# default: 20
+# rexctl: rexctl config set FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS
+# FLUXER_MESSAGES_POSTGRES_MAX_CONNECTIONS=
+
+# The memory limit for the unfurl container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_UNFURL_MEMORY_LIMIT
+# FLUXER_UNFURL_MEMORY_LIMIT=
+
+# The memory limit for the admin container.
+# default: 256mb
+# rexctl: rexctl config set FLUXER_ADMIN_MEMORY_LIMIT
+# FLUXER_ADMIN_MEMORY_LIMIT=
+
+
+# ============================================================================
+# BUNDLED SERVICES
+#
+# These change how the bundled Valkey, Meilisearch and SeaweedFS run.
+# ============================================================================
+
+# Valkey appendfsync, how often Valkey flushes its append-only file to disk.
+# Use always, everysec or no. With everysec, a crash can lose the last second
+# of writes.
+# default: everysec
+# rexctl: rexctl config set FLUXER_VALKEY_APPENDFSYNC
+# FLUXER_VALKEY_APPENDFSYNC=
+
+# Valkey save, when Valkey writes RDB snapshots, as pairs of seconds and
+# changes such as 3600 1 300 100. When it's empty, snapshots are off and
+# Valkey keeps its data in the append-only file alone.
+# rexctl: rexctl config set FLUXER_VALKEY_SAVE
+# FLUXER_VALKEY_SAVE=
+
+# The Meilisearch environment, set as its MEILI_ENV. Use production or
+# development. With production, Meilisearch refuses to start without a master
+# key of at least 16 bytes and turns off its search preview.
+# default: production
+# rexctl: rexctl config set FLUXER_MEILISEARCH_ENV
+# FLUXER_MEILISEARCH_ENV=
+
+# Whether Meilisearch stops sending usage data to the Meilisearch team, set as
+# its MEILI_NO_ANALYTICS. Use true or false.
+# default: true
+# rexctl: rexctl config set FLUXER_MEILISEARCH_NO_ANALYTICS
+# FLUXER_MEILISEARCH_NO_ANALYTICS=
+
+# Whether SeaweedFS sends usage data to the SeaweedFS project, set as its
+# -master.telemetry. Use true or false.
+# default: false
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_TELEMETRY
+# FLUXER_SEAWEEDFS_TELEMETRY=
+
+
+# ============================================================================
+# LOGS AND HEALTH CHECKS
+# ============================================================================
+
+# How much the api and worker log. Use trace, debug, info, warn, error or
+# fatal. An empty or unknown value gives info.
+# rexctl: rexctl config set LOG_LEVEL
+# LOG_LEVEL=
+
+# The log filter of media-proxy, app-proxy, admin, push, snowflakes, users,
+# gifs, messages and unfurl, in tracing EnvFilter format such as debug or off.
+# An empty or invalid filter gives info.
+# rexctl: rexctl config set RUST_LOG
+# RUST_LOG=
+
+# The gateway log level. Use debug, info, notice, warning, error, critical,
+# alert or emergency. An empty or unknown value gives info. LOGGER_LEVEL wins
+# over this one.
+# rexctl: rexctl config set FLUXER_GATEWAY_LOGGER_LEVEL
+# FLUXER_GATEWAY_LOGGER_LEVEL=
+
+# The gateway log level, which wins over FLUXER_GATEWAY_LOGGER_LEVEL and takes
+# the same levels. An empty or unknown value falls back to
+# FLUXER_GATEWAY_LOGGER_LEVEL.
+# rexctl: rexctl config set LOGGER_LEVEL
+# LOGGER_LEVEL=
+
+# How much Meilisearch logs, set as its MEILI_LOG_LEVEL. Use OFF, ERROR, WARN,
+# INFO, DEBUG or TRACE.
+# default: WARN
+# rexctl: rexctl config set FLUXER_MEILISEARCH_LOG_LEVEL
+# FLUXER_MEILISEARCH_LOG_LEVEL=
+
+# How much LiveKit logs. Use debug, info, warn or error.
+# default: info
+# rexctl: rexctl config set FLUXER_LIVEKIT_LOG_LEVEL
+# FLUXER_LIVEKIT_LOG_LEVEL=
+
+# How large the log file of a container grows before Docker rotates it, such
+# as 50m.
+# default: 10m
+# rexctl: rexctl config set FLUXER_LOG_MAX_SIZE
+# FLUXER_LOG_MAX_SIZE=
+
+# How many log files Docker keeps for each container when it rotates logs.
+# default: 3
+# rexctl: rexctl config set FLUXER_LOG_MAX_FILE
+# FLUXER_LOG_MAX_FILE=
+
+# The Docker restart policy of every long-running service, such as always,
+# on-failure or no.
+# default: unless-stopped
+# rexctl: rexctl config set FLUXER_RESTART_POLICY
+# FLUXER_RESTART_POLICY=
+
+# How often Docker runs the health check of each service, such as 30s. The
+# media-proxy and app-proxy containers have their own interval settings.
+# default: 10s
+# rexctl: rexctl config set FLUXER_HEALTHCHECK_INTERVAL
+# FLUXER_HEALTHCHECK_INTERVAL=
+
+# How often Docker runs the health check of the media-proxy container.
+# default: 30s
+# rexctl: rexctl config set FLUXER_MEDIA_PROXY_HEALTHCHECK_INTERVAL
+# FLUXER_MEDIA_PROXY_HEALTHCHECK_INTERVAL=
+
+# How often Docker runs the health check of the app-proxy container.
+# default: 30s
+# rexctl: rexctl config set FLUXER_APP_PROXY_HEALTHCHECK_INTERVAL
+# FLUXER_APP_PROXY_HEALTHCHECK_INTERVAL=
+
+# How long one health check may run before Docker counts it as failed.
+# default: 5s
+# rexctl: rexctl config set FLUXER_HEALTHCHECK_TIMEOUT
+# FLUXER_HEALTHCHECK_TIMEOUT=
+
+# How many failed health checks in a row mark the edge, postgres, valkey,
+# nats, meilisearch, livekit, media-proxy, static-proxy and app-proxy
+# containers as unhealthy.
+# default: 10
+# rexctl: rexctl config set FLUXER_HEALTHCHECK_RETRIES
+# FLUXER_HEALTHCHECK_RETRIES=
+
+# How long the edge, postgres, valkey, nats, meilisearch, livekit,
+# media-proxy, static-proxy and app-proxy containers get to start before
+# failed health checks count.
+# default: 60s
+# rexctl: rexctl config set FLUXER_HEALTHCHECK_START_PERIOD
+# FLUXER_HEALTHCHECK_START_PERIOD=
+
+# How often Docker runs each health check while a service is still in its
+# start period.
+# default: 1s
+# rexctl: rexctl config set FLUXER_HEALTHCHECK_START_INTERVAL
+# FLUXER_HEALTHCHECK_START_INTERVAL=
+
+# How many failed health checks in a row mark the api, gateway, push, admin,
+# snowflakes, users, gifs, messages and unfurl containers as unhealthy.
+# default: 30
+# rexctl: rexctl config set FLUXER_APP_HEALTHCHECK_RETRIES
+# FLUXER_APP_HEALTHCHECK_RETRIES=
+
+# How long the api, worker and gateway containers get to start before failed
+# health checks count, such as 120s.
+# default: 90s
+# rexctl: rexctl config set FLUXER_APP_HEALTHCHECK_START_PERIOD
+# FLUXER_APP_HEALTHCHECK_START_PERIOD=
+
+# How long the push, admin, snowflakes, users, gifs, messages and unfurl
+# containers get to start before failed health checks count.
+# default: 60s
+# rexctl: rexctl config set FLUXER_SVC_HEALTHCHECK_START_PERIOD
+# FLUXER_SVC_HEALTHCHECK_START_PERIOD=
+
+# How many failed health checks in a row mark the seaweedfs container as
+# unhealthy.
+# default: 20
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_HEALTHCHECK_RETRIES
+# FLUXER_SEAWEEDFS_HEALTHCHECK_RETRIES=
+
+# How long the seaweedfs container gets to start before failed health checks
+# count.
+# default: 60s
+# rexctl: rexctl config set FLUXER_SEAWEEDFS_HEALTHCHECK_START_PERIOD
+# FLUXER_SEAWEEDFS_HEALTHCHECK_START_PERIOD=
+
+# How many failed health checks in a row mark a worker container as unhealthy.
+# The check passes while the worker has updated its heartbeat file in the last
+# 30 seconds.
+# default: 3
+# rexctl: rexctl config set FLUXER_WORKER_HEALTHCHECK_RETRIES
+# FLUXER_WORKER_HEALTHCHECK_RETRIES=
+
+
+# ============================================================================
+# IMAGES
+#
+# Set one to use your own mirror or another version. Fluxer's own images are
+# pinned to the release in docker-compose.yml.
+# ============================================================================
+
+# The image the edge container runs.
+# default: caddy:2.11-alpine
+# rexctl: rexctl config set images.edge
+# FLUXER_CADDY_IMAGE=
+
+# The image the postgres container runs.
+# default: postgres:16-alpine
+# rexctl: rexctl config set images.postgres
+# FLUXER_POSTGRES_IMAGE=
+
+# The image the valkey container runs.
+# default: valkey/valkey:9.1-alpine
+# rexctl: rexctl config set images.valkey
+# FLUXER_VALKEY_IMAGE=
+
+# The image the nats container runs.
+# default: nats:2.14-alpine
+# rexctl: rexctl config set images.nats
+# FLUXER_NATS_IMAGE=
+
+# The image the meilisearch container runs.
+# default: getmeili/meilisearch:v1.53
+# rexctl: rexctl config set images.meilisearch
+# FLUXER_MEILISEARCH_IMAGE=
+
+# The image the seaweedfs and seaweedfs-init containers run.
+# default: chrislusf/seaweedfs:4.47
+# rexctl: rexctl config set images.seaweedfs
+# FLUXER_SEAWEEDFS_IMAGE=
+
+# The image the livekit container runs.
+# default: livekit/livekit-server:v1.12.0
+# rexctl: rexctl config set images.livekit
+# FLUXER_LIVEKIT_IMAGE=
diff --git a/fluxer_rexctl/internal/stack/files/docker-compose.yml b/fluxer_rexctl/internal/stack/files/docker-compose.yml
index be0d0f913..2470d7828 100644
--- a/fluxer_rexctl/internal/stack/files/docker-compose.yml
+++ b/fluxer_rexctl/internal/stack/files/docker-compose.yml
@@ -732,7 +732,7 @@ services:
TOKIO_WORKER_THREADS: ${FLUXER_TOKIO_WORKER_THREADS:-2}
FLUXER_APP_PROXY_PORT: "8080"
FLUXER_S3_PUBLIC_ENDPOINT: ${FLUXER_S3_PUBLIC_ENDPOINT:-}
- FLUXER_S3_BUCKET_UPLOADS: ${FLUXER_S3_BUCKET_UPLOADS:-}
+ FLUXER_S3_BUCKET_UPLOADS: ${FLUXER_S3_BUCKET_UPLOADS:-fluxer-uploads}
FLUXER_STATIC_CDN_ENDPOINT: ${FLUXER_STATIC_CDN_ENDPOINT:-}
FLUXER_MEDIA_ENDPOINT: ${FLUXER_MEDIA_ENDPOINT:-}
FLUXER_APP_PRODUCT_NAME: ${FLUXER_APP_PRODUCT_NAME:-}
@@ -744,6 +744,7 @@ services:
FLUXER_APP_FAVICON_DARK_URL: ${FLUXER_APP_FAVICON_DARK_URL:-}
FLUXER_APP_SIGN_IN_BACKDROP_URL: ${FLUXER_APP_SIGN_IN_BACKDROP_URL:-}
FLUXER_APP_THEME_COLOR: ${FLUXER_APP_THEME_COLOR:-}
+ FLUXER_APP_STATUS_PAGE_URL: ${FLUXER_APP_STATUS_PAGE_URL:-}
DISCOVERY_UPSTREAM_URL: http://edge:8088/.well-known/fluxer
DISCOVERY_REFRESH_INTERVAL_MS: ${DISCOVERY_REFRESH_INTERVAL_MS:-5000}
FLUXER_APP_PROXY_INDEX_UPSTREAM_URL: ${FLUXER_APP_PROXY_INDEX_UPSTREAM_URL:-}
diff --git a/fluxer_rexctl/internal/stack/set.go b/fluxer_rexctl/internal/stack/set.go
index b0752f6a9..a5ec1773e 100644
--- a/fluxer_rexctl/internal/stack/set.go
+++ b/fluxer_rexctl/internal/stack/set.go
@@ -32,7 +32,7 @@ type Set struct {
Vars []string
}
-//go:embed all:files
+//go:embed files
var releaseFiles embed.FS
var embeddedSet = sync.OnceValue(func() *Set {
diff --git a/fluxer_rexctl/scripts/check-references.sh b/fluxer_rexctl/scripts/check-references.sh
new file mode 100755
index 000000000..da4454fe0
--- /dev/null
+++ b/fluxer_rexctl/scripts/check-references.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-or-later
+set -eu
+cd "$(dirname "$0")/.."
+set -- ../fluxer_docs/src/content/docs/operator/rexctl.mdx \
+ ../fluxer_docs/src/content/docs/operator/environment.mdx \
+ internal/stack/files/.env.example
+go run . docs --out "$1" --env-page "$2" --env-example "$3"
+changed="$(git status --porcelain -- "$@")"
+if [ -n "${changed}" ]; then
+ echo "${changed}" >&2
+ git diff -- "$@" >&2
+ exit 1
+fi
diff --git a/packages/config/scripts/CheckSelfHostEnv.ts b/packages/config/scripts/CheckSelfHostEnv.ts
index 64026c720..8de43db43 100644
--- a/packages/config/scripts/CheckSelfHostEnv.ts
+++ b/packages/config/scripts/CheckSelfHostEnv.ts
@@ -4,71 +4,12 @@ import {readFileSync} from 'node:fs';
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import {type ConfigObject, isConfigObject} from '@fluxer/config/src/config_loader/ConfigObject';
-import {NAMED_FLUXER_ENV_NAMES} from '@fluxer/config/src/config_loader/EnvironmentOverrides';
import {parse} from 'yaml';
const REPO_ROOT = fileURLToPath(new URL('../../../', import.meta.url));
const SELF_HOSTING = path.join(REPO_ROOT, 'fluxer_rexctl/internal/stack/files');
const CHART = path.join(REPO_ROOT, 'deploy/helm/fluxer');
-const HOSTED_ONLY_OPERATOR_PASS = 'the Operator Pass is sold only by the hosted service';
-
-const API_SETTINGS_NOT_FORWARDED: Record<string, string> = {
- FLUXER_CASSANDRA_HOSTS: 'the stack runs Postgres only',
- FLUXER_CASSANDRA_PORT: 'the stack runs Postgres only',
- FLUXER_CASSANDRA_KEYSPACE: 'the stack runs Postgres only',
- FLUXER_CASSANDRA_LOCAL_DC: 'the stack runs Postgres only',
- FLUXER_CASSANDRA_USERNAME: 'the stack runs Postgres only',
- FLUXER_CASSANDRA_PASSWORD: 'the stack runs Postgres only',
- FLUXER_API_WORKER_MODE: 'the one worker container runs every lane',
- FLUXER_API_WORKER_LANE: 'the one worker container runs every lane',
- FLUXER_API_WORKER_TASK: 'the one worker container runs every lane',
- FLUXER_API_WORKER_ENABLE_CRON_SCHEDULER: 'the one worker container hosts cron',
- FLUXER_API_WORKER_METRICS_PORT: 'the stack scrapes no worker metrics',
- FLUXER_RELAX_REGISTRATION_RATE_LIMITS: 'test and development only',
- FLUXER_DISABLE_RATE_LIMITS: 'test and development only',
- FLUXER_TEST_MODE_ENABLED: 'test and development only',
- FLUXER_TEST_HARNESS_TOKEN: 'test and development only',
- FLUXER_VALIDATE_RESPONSES: 'test and development only',
- FLUXER_API_AUTOMATED_MESSAGE_DELETION_DELAY_DAYS: 'automated account actions run only on the hosted service',
- FLUXER_LABS_GUILD_ID: HOSTED_ONLY_OPERATOR_PASS,
- FLUXER_LABS_OPERATOR_ROLE_ID: HOSTED_ONLY_OPERATOR_PASS,
- FLUXER_PAYMENT_DISPUTE_CLOSURE_EFFECTIVE_AT: 'payment dispute closures run only on the hosted service',
- FLUXER_OPERATOR_PASS_SALE_OPENS_AT: HOSTED_ONLY_OPERATOR_PASS,
- FLUXER_OPERATOR_PASS_PRICE_RISES_AT: HOSTED_ONLY_OPERATOR_PASS,
- FLUXER_OPERATOR_PASS_GRACE_MINUTES: HOSTED_ONLY_OPERATOR_PASS,
- FLUXER_OPERATOR_PASS_NOW: 'test and development only',
- ...Object.fromEntries(
- [
- 'FLUXER_OPERATOR_PASS_RELEASE_LISTS',
- 'FLUXER_OPERATOR_PASS_TRANSFER_LOCK_HOURS',
- 'FLUXER_OPERATOR_PASS_WITHDRAWAL_COUNTRIES',
- 'FLUXER_OPERATOR_PASS_STOPPED_COUNTRIES',
- 'FLUXER_OPERATOR_PASS_WALL_TIERS',
- 'FLUXER_OPERATOR_PASS_MAX_QUANTITY',
- ...['BRL', 'DKK', 'INR', 'NOK', 'PLN', 'SEK', 'TRY'].map(
- (currency) => `FLUXER_OPERATOR_PASS_PRICE_${currency}_ENABLED`,
- ),
- ...['USD', 'EUR', 'BRL', 'DKK', 'INR', 'NOK', 'PLN', 'SEK', 'TRY'].map(
- (currency) => `FLUXER_OPERATOR_PASS_STANDARD_PRICE_${currency}`,
- ),
- ].map((name) => [name, HOSTED_ONLY_OPERATOR_PASS]),
- ),
- ...Object.fromEntries(
- ['MONTHLY', 'YEARLY', 'GIFT_1_MONTH', 'GIFT_1_YEAR'].flatMap((slot) =>
- ['USD', 'EUR', 'BRL', 'DKK', 'INR', 'ISK', 'NOK', 'PLN', 'SEK', 'TRY'].map((currency) => [
- `FLUXER_STRIPE_PRICE_${slot}_${currency}`,
- 'FLUXER_STRIPE_PRICES or the dashboard sets prices',
- ]),
- ),
- ),
- ...Object.fromEntries(
- NAMED_FLUXER_ENV_NAMES.filter((name) =>
- ['FLUXER_APP_STORE_', 'FLUXER_GOOGLE_PLAY_', 'FLUXER_STORE_BILLING_'].some((prefix) => name.startsWith(prefix)),
- ).map((name) => [name, 'in-app purchases are sold only by the hosted service']),
- ),
-};
-
const INPUT_NAMES: Record<string, string> = {
FLUXER_BASE_DOMAIN: 'FLUXER_DOMAIN',
FLUXER_POSTGRES_PASSWORD: 'POSTGRES_PASSWORD',
@@ -136,18 +77,6 @@ function checkComposeForwarding(): void {
const environment = (name: string): Record<string, string> =>
Object.fromEntries(Object.entries(mapping(service(name).environment)).map(([key, value]) => [key, String(value)]));
- const api = environment('api');
- for (const name of NAMED_FLUXER_ENV_NAMES) {
- if (!(name in api) && !(name in API_SETTINGS_NOT_FORWARDED)) {
- problems.push(`the api service does not forward ${name}, which its config loader reads`);
- }
- }
- for (const name of Object.keys(API_SETTINGS_NOT_FORWARDED)) {
- if (!NAMED_FLUXER_ENV_NAMES.includes(name)) {
- problems.push(`${name} is listed as not forwarded but the config loader no longer reads it`);
- }
- }
-
for (const serviceName of Object.keys(services)) {
for (const [key, value] of Object.entries(environment(serviceName))) {
const match = /^\$\{([A-Z][A-Z0-9_]*)/u.exec(value.trim());
diff --git a/packages/config/src/config_loader/EnvironmentOverrides.ts b/packages/config/src/config_loader/EnvironmentOverrides.ts
index 30245fa1f..ae0a1e05e 100644
--- a/packages/config/src/config_loader/EnvironmentOverrides.ts
+++ b/packages/config/src/config_loader/EnvironmentOverrides.ts
@@ -528,8 +528,6 @@ const NAMED_FLUXER_ENV_ALIASES: Record<string, string | undefined> = {
FLUXER_NATS_URL: 'FLUXER_NATS_CORE_URL',
};
-export const NAMED_FLUXER_ENV_NAMES = Object.keys(NAMED_FLUXER_ENV_OVERRIDES);
-
function nonBlank(value: string | undefined): string | undefined {
return value === undefined || value.trim().length === 0 ? undefined : value;
}