This commit is contained in:
Maurus Decimus
2026-08-24 15:44:51 +02:00
parent 8cab61a9c5
commit af11f5119c
11 changed files with 110 additions and 24 deletions
+11 -2
View File
@@ -71,7 +71,6 @@ Configuration is done through Vite environment variables. Copy or edit `.env.dev
```
VITE_API_BASE_URL=http://localhost:443
VITE_OAUTH_CLIENT_ID=stalwart-webui
VITE_ACCESS_TOKEN=
VITE_OAUTH_SCOPES=
```
@@ -79,10 +78,20 @@ VITE_OAUTH_SCOPES=
| Variable | Description |
|---|---|
| `VITE_API_BASE_URL` | URL of the Stalwart server. Used for all API requests during development. In production builds (when empty or unset) requests are relative to the current origin. |
| `VITE_OAUTH_CLIENT_ID` | OAuth 2.0 client ID. Defaults to `stalwart-webui`. |
| `VITE_ACCESS_TOKEN` | When set, skips the OAuth flow entirely and uses this token for all requests. Useful for local development and testing. |
| `VITE_OAUTH_SCOPES` | Optional OAuth scopes. Omitted from the authorization request when empty. |
### OAuth client ID
The OAuth 2.0 client ID is not a build-time setting. It is read at runtime from a meta tag in `index.html`:
```html
<meta name="oauth-client-id" content="" />
```
The server rewrites the `content` attribute when it serves the page, so a single build works for any deployment. When no
client ID is configured the attribute is left empty and the panel falls back to `stalwart-webui`.
### Bypassing OAuth for development
Set `VITE_ACCESS_TOKEN` to a valid bearer token to skip the login page and go straight to the admin panel. You can obtain a token from the Stalwart server's token endpoint or use an API key: