Configuration¶
Nexus reads its settings from environment variables. For convenience it also loads a .env file
from the folder it starts in (or any parent folder). Real environment variables win over .env.
Restart Nexus after any change.
Reference¶
| Variable | Required | Default | What it does |
|---|---|---|---|
DATABASE_URL |
yes | — | PostgreSQL connection string for the API role: postgres://nexus_app:password@host:port/database. Secret (contains the password). This role should not own the tables. |
DATABASE_MIGRATE_URL |
no | unset | Connection string for the schema owner. When set, migrations run as this role and DATABASE_URL is only used afterwards. Leave unset to migrate and serve with one role. Secret. |
VAULT_MASTER_KEYS |
yes | — | Encryption key(s) for stored ESI tokens, 1:<64 hex chars>. Several keys are comma-separated: 1:<hex>,2:<hex>. The highest version encrypts; all listed versions can decrypt. Also derives the key for sign-in cookies. Secret. Back it up. |
EVE_CLIENT_ID |
yes | empty | Client ID of your EVE application. Sign-in fails while it's empty (System Health warns). |
EVE_CLIENT_SECRET |
recommended | not set | Secret Key of your EVE application. Without it Nexus signs in as a "public" client (PKCE only); CCP web applications need it. Secret. |
PUBLIC_URL |
recommended | http://localhost:8080 |
The exact address pilots use, without a trailing slash. Drives the SSO callback (PUBLIC_URL/sso/callback), the OIDC issuer, secure cookies (on when it starts with https://) and the cross-site check on sign-out and consent. |
SOURCE_URL |
no | https://github.com/Thrainkrilleve/Eve-Nexus |
Repository linked from the web UI so people using this install can get its source (AGPL section 13). Must be an http or https URL with no username or password. A value that isn't is ignored. |
BIND_ADDR |
no | 0.0.0.0:8080 |
Address and port Nexus listens on. Use 127.0.0.1:8080 when a proxy or tunnel runs on the same machine, so Nexus isn't reachable directly. |
TRUSTED_PROXIES |
recommended | 127.0.0.1/32,::1/128 |
Comma-separated IP ranges (CIDR) of your proxies. Only connections from these addresses may set X-Forwarded-For / X-Forwarded-Proto. The default trusts only this machine; a proxy or tunnel in Docker or on another host must be listed explicitly (Nexus logs a warning at startup while it is unset). |
TRUST_CLOUDFLARE_IPS |
no | false |
true when traffic arrives through Cloudflare. Nexus then trusts CF-Connecting-IP for the real client IP, and keeps Cloudflare's published ranges updated daily. |
CLOUDFLARE_TUNNEL_TOKEN |
no | not set | Connector token for a tunnel you made in the Cloudflare dashboard: the long eyJ... string from the install command, not the tunnel id. Compose passes it only to the cloudflared service, a separate container. The public hostname's service must be http://nexus:8080. There is no compose profile for the tunnel. Admin → Tunnel becomes read only. Leave it unset to create the tunnel on Admin → Tunnel, then paste the token that page shows once into this setting. Secret. The API process does not keep this value. |
CONSENT_POLICY_VERSION |
no | 2 |
Version label of the consent text pilots agree to before granting mail, wallet, assets or contracts access. The default text includes background checks. Raise it when you change that text; pilots then re-confirm. |
DISCORD_CLIENT_ID |
for Discord | not set | Application ID of your Discord app (Developer Portal → General Information). Discord sync is on only when all four DISCORD_* settings below are set. |
DISCORD_CLIENT_SECRET |
for Discord | not set | OAuth2 client secret of that app. Secret. |
DISCORD_BOT_TOKEN |
for Discord | not set | The app's bot token (Bot → Reset Token). Secret. |
DISCORD_GUILD_ID |
for Discord | not set | ID of your Discord server (Developer Mode on, right-click the server → Copy Server ID). |
DISCORD_SET_NICKNAMES |
no | true |
false stops Nexus setting members' server nicknames to their main character's name. |
AFFILIATION_INTERVAL_MINUTES |
no | 60 |
How often each character's corporation and alliance are re-checked, 60 to 1440. CCP caches this data for an hour, so lower values wouldn't help. A pilot who leaves the corporation loses access within this interval plus up to an hour (System Health shows the worst case). Raise it only for very large installs. |
OIDC_AUTHORIZE_PER_MINUTE |
no | 30 |
How many /oauth/authorize requests one client IP may make in a minute. Separate from the EVE sign-in limit. |
OIDC_TOKEN_PER_MINUTE |
no | 120 |
How many /oauth/token and /oauth/revoke requests one client id from one IP may make in a minute. |
OIDC_TOKEN_IP_PER_MINUTE |
no | 60 |
How many of those requests one IP may make in a minute, whatever client id it sends. Stops a caller from rotating ids to force a password hash on every try. |
OIDC_JWKS_PER_MINUTE |
no | 60 |
How many /oauth/jwks requests one client IP may make in a minute. |
RUST_LOG |
no | core_api=debug,esi_engine=info,tower_http=info,sqlx=warn |
Log detail. See Operations → Logs. |
Common setups¶
Local testing on your own PC
PUBLIC_URL=http://localhost:8080
BIND_ADDR=127.0.0.1:8080
TRUSTED_PROXIES=127.0.0.1/32
Always browse to http://localhost:8080, not http://127.0.0.1:8080. Browsers treat them as
different sites, so sign-in breaks if you mix them.
Behind Caddy or nginx on the same server
PUBLIC_URL=https://auth.example.com
BIND_ADDR=127.0.0.1:8080
TRUSTED_PROXIES=127.0.0.1/32
TRUST_CLOUDFLARE_IPS=false
Behind Cloudflare Tunnel (the compose connector, or cloudflared on the same server)
PUBLIC_URL=https://auth.example.com
BIND_ADDR=127.0.0.1:8080
TRUSTED_PROXIES=127.0.0.1/32
TRUST_CLOUDFLARE_IPS=true
Proxy on another machine or in Docker: set TRUSTED_PROXIES to that machine's IP, for example
10.0.0.5/32, or to the Docker network, for example 172.18.0.0/16.
Discord¶
- In the Discord Developer Portal, create an
application. Under OAuth2 → Redirects, add
PUBLIC_URL/discord/callback(for examplehttps://auth.example.com/discord/callback). - Under Bot, reset and copy the token. No privileged intents are needed.
- Put the four
DISCORD_*settings in.envand restart. - Open Admin → Access Control. If the bot isn't in your server yet, the banner there has an Invite the bot link with the right permissions (Manage Roles, Manage Nicknames, Create Instant Invite).
- In Discord, Server Settings → Roles: drag the bot's role above every role Nexus should hand out. Roles above it show as "(above the bot's role)" in Nexus and can't be picked.
- In Access Control, pick a Discord role on a State or Group. Pilots link their account on Connected Services.
Nexus only adds or removes the roles you've mapped to a State or Group; other roles members have are left alone. A bot can never change the server owner's nickname, so the owner sees "Nickname not set"; that's harmless.
Sign in with Nexus (OIDC)¶
There is no extra setting for this. The issuer other apps use is PUBLIC_URL. Signing keys are
created by Nexus and sealed with VAULT_MASTER_KEYS; losing that key means Nexus can no longer
sign ID tokens until you rotate the signing key on Admin → OIDC Clients (which needs the
vault key that is running now).
Register each app on Admin → OIDC Clients. The steps and an example client are in Operations → OIDC clients.
Checking your settings¶
Sign in as a superadmin and open Admin → System Health. It shows the public URL, the callback Nexus expects, the imported static data release, and how it sees your connection: client IP, protocol, and whether your proxy is trusted. It also warns about common mistakes. Every warning is explained in Troubleshooting → System Health warnings.
The server log never prints secrets. At startup it only says whether the EVE secret is set.