Configuration Reference¶
All configuration can be provided via environment variables or appsettings.json. The same .env file works for both Docker and standalone mode.
Short env var names
The .env file uses friendly short names (WEB_DB_HOST, JWT_SECRET, DISCORD_CLIENT_ID, etc.). The app automatically translates these to .NET's configuration format at startup. You can use either the short names or the __-delimited names shown in the table below.
Server¶
| Setting | Env Variable | Default | Description |
|---|---|---|---|
| Port | PORT |
8082 |
HTTP port the app listens on. In Docker, this is the host port. Standalone, this is the port the app binds to. |
Server:Port |
Server__Port |
8082 |
Alternative to PORT for the .NET config convention. PORT takes precedence. Ignored when ASPNETCORE_URLS is set. |
Required settings¶
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| Database | WEB_DB_HOST, WEB_DB_PORT, WEB_DB_NAME, WEB_DB_USER, WEB_DB_PASSWORD |
ConnectionStrings__PoracleWebDb |
MySQL connection to PoracleWeb.NET's own database. See Databases. |
| JWT Secret | JWT_SECRET |
Jwt__Secret |
JWT signing key (minimum 32 characters) |
| Poracle API Address | PORACLE_API_ADDRESS |
Poracle__ApiAddress |
PoracleNG API base URL. Critical -- all alarm tracking, human/profile management, location, and area operations are proxied through this endpoint. |
| Poracle API Secret | PORACLE_API_SECRET |
Poracle__ApiSecret |
PoracleNG API shared secret. Sent as the X-Poracle-Secret header on every request. |
| Admin IDs | PORACLE_ADMIN_IDS |
Poracle__AdminIds |
Comma-separated admin user IDs, Discord or Telegram. Admins listed in Poracle's own config are recognised too. |
| A sign-in method | see Sign-in methods | At least one of Discord, Telegram or an OIDC provider |
Sign-in methods¶
PoracleWeb.NET needs at least one way for people to sign in, and any one is enough: Discord is optional, so a site can run on Telegram alone or on an OIDC provider alone. It refuses to start in two cases, each with a message naming the variables involved:
- Discord half configured.
DISCORD_CLIENT_IDwithoutDISCORD_CLIENT_SECRET, or the other way round. Set both to offer Discord sign-in, or neither to run without it. - No sign-in method at all. No Discord client id and secret, Telegram not enabled with a bot token, and no OIDC provider: nobody could sign in.
| Method | Configured when |
|---|---|
| Discord | DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET are both set. See Discord OAuth2. |
| Telegram | TELEGRAM_ENABLED is true (inferred when TELEGRAM_BOT_TOKEN and TELEGRAM_BOT_USERNAME are both set) and TELEGRAM_BOT_TOKEN is set. |
| OIDC | OIDC_CLIENT_ID, OIDC_AUTHORIZATION_URL, OIDC_TOKEN_URL and OIDC_USERINFO_URL are set. See External SSO / OIDC. |
A method that isn't configured gets no button on the login page. Without Discord, the Discord section of Admin > Server settings says so, and its switch does nothing. The Discord bot token, guild id and forum channel are separate from sign-in and stay optional either way.
Optional settings¶
Authentication¶
| Setting | .env name |
.NET env variable |
Default | Description |
|---|---|---|---|---|
| JWT Expiration | — | Jwt__ExpirationMinutes |
1440 |
Token expiry (24 hours) |
| JWT Issuer | JWT_ISSUER |
Jwt__Issuer |
PoracleWeb |
Issuer claim (iss) baked into signed tokens. Override only if validating tokens externally. |
| JWT Audience | JWT_AUDIENCE |
Jwt__Audience |
PoracleWeb.App |
Audience claim (aud) baked into signed tokens. Override only if validating tokens externally. |
| Discord Client ID | DISCORD_CLIENT_ID |
Discord__ClientId |
— | Discord OAuth2 application client ID. Set together with the secret, or not at all. |
| Discord Client Secret | DISCORD_CLIENT_SECRET |
Discord__ClientSecret |
— | Discord OAuth2 application client secret |
| Discord Bot Token | DISCORD_BOT_TOKEN |
Discord__BotToken |
— | Posts geofence submissions to the forum channel and checks guild roles for role-gated Discord sign-in. Not needed for sign-in itself. |
| Discord Guild ID | DISCORD_GUILD_ID |
Discord__GuildId |
— | Discord server ID used for role checks. Comma-separate several to accept an allowed role from any of them |
| Discord Geofence Forum | DISCORD_GEOFENCE_FORUM_CHANNEL_ID |
Discord__GeofenceForumChannelId |
— | Forum channel for geofence submission threads |
| Discord Frontend URL | — | Discord__FrontendUrl |
http://localhost:4200 |
Unused. The setting class still declares it, but sign-in redirects come from PUBLIC_URL or the request; setting it changes nothing. |
| Telegram Enabled | TELEGRAM_ENABLED |
Telegram__Enabled |
false |
Enable Telegram authentication. Inferred true when the bot token and username are both set and this is left unset. |
| Telegram Bot Token | TELEGRAM_BOT_TOKEN |
Telegram__BotToken |
— | Telegram bot token |
| Telegram Bot Username | TELEGRAM_BOT_USERNAME |
Telegram__BotUsername |
— | Telegram bot username |
External SSO / OIDC¶
Optional. Delegates PoracleWeb.NET login to your own OAuth2/OIDC provider (e.g. PogoAlerts) for single sign-on. See External SSO setup for the full setup guide.
The provider is enabled automatically when OIDC_CLIENT_ID plus all three of OIDC_AUTHORIZATION_URL, OIDC_TOKEN_URL, and OIDC_USERINFO_URL are set. Set OIDC_ENABLED explicitly to override the inference.
| Setting | .env name |
.NET env variable |
Default | Description |
|---|---|---|---|---|
| Enabled | OIDC_ENABLED |
Oidc__Enabled |
— | Master switch. Auto-inferred true when OIDC_CLIENT_ID and the three endpoint URLs are all set. When false, the provider is hidden regardless of other values. |
| Provider Name | OIDC_PROVIDER_NAME |
Oidc__ProviderName |
"" |
Display name shown on the login button (e.g. PogoAlerts). |
| Authorization URL | OIDC_AUTHORIZATION_URL |
Oidc__AuthorizationUrl |
"" |
Browser-facing authorize endpoint. Any existing query string is preserved. |
| Token URL | OIDC_TOKEN_URL |
Oidc__TokenUrl |
"" |
Token endpoint that exchanges the authorization code for an access token. |
| UserInfo URL | OIDC_USERINFO_URL |
Oidc__UserInfoUrl |
"" |
UserInfo endpoint returning the user's claims. |
| End Session URL | OIDC_END_SESSION_URL |
Oidc__EndSessionUrl |
"" |
Optional RP-initiated logout (end-session) endpoint. When set, enables single logout (the provider's session is also ended). When empty, logout is local-only. |
| Client ID | OIDC_CLIENT_ID |
Oidc__ClientId |
"" |
OAuth2 client ID. |
| Client Secret | OIDC_CLIENT_SECRET |
Oidc__ClientSecret |
"" |
OAuth2 client secret. Read from config only — never stored in the database. |
| Scopes | OIDC_SCOPES |
Oidc__Scopes |
openid profile email |
Space-delimited OAuth scopes requested at authorization time. |
| Identity Claim | OIDC_IDENTITY_CLAIM |
Oidc__IdentityClaim |
discord_id |
UserInfo claim whose value maps to the Poracle human id (a Discord/Telegram id). Falls back to sub when neither identity claim is present. |
| Secondary Identity Claim | OIDC_SECONDARY_IDENTITY_CLAIM |
Oidc__SecondaryIdentityClaim |
"" |
Optional second claim holding a Poracle human id (e.g. telegram_id), tried when the first is absent or names nobody registered. |
| Username Claim | OIDC_USERNAME_CLAIM |
Oidc__UsernameClaim |
preferred_username |
UserInfo claim used as the display username. |
| Avatar Claim | OIDC_AVATAR_CLAIM |
Oidc__AvatarClaim |
picture |
UserInfo claim used as the avatar URL. |
| Identity Type | OIDC_IDENTITY_TYPE |
Oidc__IdentityType |
discord:user |
JWT type claim for an SSO login whose Poracle row has no discord:user/telegram:user type of its own. |
| Use PKCE | OIDC_USE_PKCE |
Oidc__UsePkce |
true |
Use PKCE (Proof Key for Code Exchange) for the authorization-code flow. |
| Force Local Login | AUTH_FORCE_LOCAL |
Auth__ForceLocal |
false |
Break-glass override forcing the local login page regardless of the SSO mode. Recovery path when an admin switches to OIDC against a broken/unreachable provider and gets locked out. |
OIDC refresh tokens¶
Optional, opt-in. Enables silent server-side session renewal and provider-side revocation propagation. See OIDC Refresh Tokens for full detail.
| Setting | .env name |
.NET env variable |
Default | Description |
|---|---|---|---|---|
| Use Refresh Tokens | OIDC_USE_REFRESH_TOKENS |
Oidc__UseRefreshTokens |
false |
Master opt-in for brokering the provider's refresh token (silent renewal + revocation propagation). Requires the provider to issue a refresh token. |
| Access Token Minutes | OIDC_ACCESS_TOKEN_MINUTES |
Oidc__AccessTokenMinutes |
30 |
Internal JWT lifetime (minutes) for refresh-backed OIDC sessions only. Other logins keep Jwt__ExpirationMinutes. |
| Refresh Token Lifetime (days) | OIDC_REFRESH_TOKEN_LIFETIME_DAYS |
Oidc__RefreshTokenLifetimeDays |
30 |
PoracleWeb.NET-side absolute cap (days) on a refresh session before a real re-login is forced. |
| Revoked Retention (days) | OIDC_SESSION_REVOKED_RETENTION_DAYS |
Oidc__RevokedRetentionDays |
2 |
How long (days) revoked/rotated session rows are retained for replay detection before cleanup deletes them. |
| Offline Access Scope | OIDC_OFFLINE_ACCESS_SCOPE |
Oidc__OfflineAccessScope |
offline_access |
Scope appended to the authorize request so a compliant provider issues a refresh token. Set empty for providers that issue refresh tokens unconditionally or use a non-standard mechanism (e.g. Google's access_type=offline). |
| Token Auth Method | OIDC_TOKEN_AUTH_METHOD |
Oidc__TokenEndpointAuthMethod |
client_secret_post |
How client credentials are presented at the token endpoint: client_secret_post (form body) or client_secret_basic (HTTP Basic header). |
Databases¶
PoracleWeb.NET connects to one database of its own. It doesn't connect to Poracle's database at all; everything Poracle owns goes through PoracleNG's API. Older installs can delete DB_HOST, DB_PORT, DB_NAME, DB_USER and DB_PASSWORD from .env: they're ignored, and the app logs a one-line notice at startup while any of them is set.
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| PoracleWeb.NET DB | WEB_DB_HOST, WEB_DB_PORT, WEB_DB_NAME, WEB_DB_USER, WEB_DB_PASSWORD |
ConnectionStrings__PoracleWebDb |
MySQL connection to PoracleWeb.NET database (site settings, webhook delegates, quick picks, user geofences). Short vars are auto-composed into a connection string. |
| Scanner DB | SCANNER_DB_CONNECTION |
ConnectionStrings__ScannerDb |
Scanner database connection (Golbat). Optional. Used by the gym picker search in raid/gym/egg add dialogs. Provide a full connection string. |
Golbat API¶
Optional. Enables "currently spawning" Pokemon availability indicators in the Pokemon selector.
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| Golbat API Address | GOLBAT_API_ADDRESS |
Golbat__ApiAddress |
Golbat scanner API URL (e.g., http://localhost:9001). When set, the Pokemon selector shows which species are actively spawning. |
| Golbat API Secret | GOLBAT_API_SECRET |
Golbat__ApiSecret |
Golbat API secret. Sent as the X-Golbat-Secret header on every request. Must match Golbat's api_secret config value. |
Koji geofence API¶
Required for the custom geofences feature.
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| Koji API Address | KOJI_API_ADDRESS |
Koji__ApiAddress |
Koji geofence server URL (e.g., http://localhost:8080) |
| Koji Bearer Token | KOJI_BEARER_TOKEN |
Koji__BearerToken |
Koji API bearer token for authentication |
| Koji Project ID | KOJI_PROJECT_ID |
Koji__ProjectId |
Koji project ID for admin-promoted geofences (default: 0) |
| Koji Project Name | KOJI_PROJECT_NAME |
Koji__ProjectName |
Koji project name for /geofence/poracle/{name} endpoint |
CORS¶
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| CORS Origin | CORS_ORIGIN |
Cors__AllowedOrigins__0 |
Allowed CORS origin. Required in production (empty = crash). Not required in development mode. |
Public URL¶
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| Public URL | PUBLIC_URL |
PublicUrl and Site__PublicUrl |
The origin users reach this instance on (e.g. https://poracle.example.com). Optional; unset follows the incoming request. |
One PUBLIC_URL sets both .NET keys. PublicUrl sets the Discord and OIDC callback URLs directly instead of deriving them from each request; a path, query or invalid URL stops the app at startup. Site:PublicUrl makes the title of a geofence review card in Discord link to the admin review page; without it the card has no link. If you set the __-delimited names yourself, set both to the same value.
Paths¶
These three skip the short-name bridge, so there is no __-delimited alias. DTS_SOURCE_DIR and most
DATA_DIR reads go through Environment.GetEnvironmentVariable, which appsettings.json never
reaches. Set them in .env (the loader copies every line into the process environment) or in the
compose file, which is what the shipped example does.
| Setting | .env name |
Default | Description |
|---|---|---|---|
| Data directory | DATA_DIR |
see note (Docker image sets /app/data) |
Where the app keeps state that must survive a restart: DataProtection keys, the Discord avatar cache, and the DTS cache fallback file. Mount it as a volume in Docker or OAuth sessions break on every recreate. |
| DTS source directory | DTS_SOURCE_DIR |
— | Container path where the PoracleNG config/ directory is mounted. DtsCacheService reads the DTS files from here for template previews; without it, the service falls back to a dts-cache.json placed under DATA_DIR by hand. |
| Poracle config directory | PORACLE_CONFIG_DIR |
./data |
Host path that the shipped compose file mounts read-only at /poracle-config, which is what DTS_SOURCE_DIR points at. Standalone deployments do not use it. |
With DATA_DIR unset the three consumers disagree: DataProtection falls back to ./data, while AvatarCacheService and DtsCacheService fall back to the working directory itself, so avatar-cache.json and dts-cache.json land beside the binary and the keys land a directory deeper. Set it explicitly for any standalone run you intend to keep.
Build information¶
The Docker image bakes these in at build time from docker-publish.yml; the Versions card and GET /api/version report them. A standalone build has none, and shows unknown.
| Setting | Env variable | Default | Description |
|---|---|---|---|
| Version | BUILD_VERSION |
unknown |
The release or beta tag the image was built as |
| Revision | BUILD_REVISION |
unknown |
The git commit |
| Build date | BUILD_DATE |
unknown |
When the image was built |
Reverse proxy¶
Required if anything terminates TLS in front of PoracleWeb.NET. See Behind a reverse proxy.
| Setting | .env name |
.NET env variable |
Description |
|---|---|---|---|
| Known proxies | PROXY_KNOWN_PROXIES |
Proxy__KnownProxies |
Comma-separated proxy addresses whose X-Forwarded-For / X-Forwarded-Proto are believed |
| Known networks | PROXY_KNOWN_NETWORKS |
Proxy__KnownNetworks |
Comma-separated CIDR ranges, same effect (e.g. 172.18.0.0/16,10.0.0.0/8) |
Configuration sources¶
| Source | Use case |
|---|---|
.env file (project root) |
Both Docker and standalone — the primary config file. Docker Compose reads it natively; standalone mode loads it on startup. Short env var names are auto-translated to .NET format. |
appsettings.json |
Default values. You rarely need to edit this. |
appsettings.Development.json |
Local development overrides (gitignored) |
docker-compose.yml |
Local copy of docker-compose.yml.example (gitignored). Uses env_file: .env to load all configuration — no per-key environment: entries are needed. Edit only to change ports, volumes, or image tags. |
poracle_web.site_settings table |
Runtime admin-configurable settings (PoracleWeb.NET's own settings store) |
PoracleNG must be reachable
Poracle:ApiAddress must point to a running PoracleNG instance that is reachable from the PoracleWeb.NET container. All alarm tracking, human/profile management, location, area operations, and active hours management are proxied through this API. If PoracleNG is unreachable, alarm operations fail entirely and user management (registration, login, location, areas, profile switch, active hours) also fails. The Poracle:ApiSecret must match the server.apiSecret value in PoracleNG's config.
Minimum PoracleNG is 5.4.0
Against anything older the app still starts, but logs an error at startup and flags the version on Admin → Server settings, and calls that need a 5.4.0 route fail with a message naming the version. Upgrade PoracleNG before upgrading PoracleWeb.NET. A leftover PORACLE_TRACKING_API_VERSION is ignored. See Version compatibility.
Secrets
appsettings.Development.json is gitignored and holds all connection strings, JWT secret, Discord/Telegram credentials, and Poracle API address/secret. Never commit secrets to the repository.
Runtime settings
Looking for settings you can change without restarting? See Site Settings for admin-configurable runtime settings like branding, feature toggles, alarm types, and more.