Fork Stalwart WebUI v1.0.11 as INBUXA Admin
- One edition: whatever edition the server reports, nothing is hidden or disabled as Enterprise-only (accountStore.setAccountInfo). - INBUXA branding: name, logo (mark plus a text-colored wordmark), favicon, page titles, setup wizard text, and ihasmail's palette in light and dark. - Two-factor setup names INBUXA as the issuer and drops the image parameter that made authenticator apps fetch a logo from a third-party site. - Runs apart from the server: the server address can be set at deploy time with <meta name="api-base-url">, and OAuth endpoints the server returns as relative paths are resolved against the server's address, not the page's. Verified end to end against a separate inbuxa-server. - Upstream's release workflow moved to .github-upstream so it never runs. Upstream's history contains no Enterprise-only code, so this is an ordinary fork. upstream is a fetch-only remote.
@@ -1,158 +1,55 @@
|
||||
<p align="center">
|
||||
<a href="https://stalw.art">
|
||||
<img src="./img/logo-red.svg" height="150">
|
||||
</a>
|
||||
<img src="./img/brand/inbuxa-lockup-light.svg" alt="inbuxa" height="120">
|
||||
</p>
|
||||
|
||||
<h3 align="center">
|
||||
Web-based User Interface for Stalwart 🛡️
|
||||
</h3>
|
||||
<h3 align="center">INBUXA Admin</h3>
|
||||
|
||||
<br>
|
||||
The administration interface for the INBUXA mail server: every server setting,
|
||||
first-boot setup, and recovery, in the browser.
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/stalwartlabs/webui/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/stalwartlabs/webui/build.yml?style=flat-square" alt="continuous integration"></a>
|
||||
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0"><img src="https://img.shields.io/badge/License-AGPL_v3-blue.svg?label=license&style=flat-square" alt="License: AGPL v3"></a>
|
||||
|
||||
<a href="https://stalw.art/docs/get-started/"><img src="https://img.shields.io/badge/read_the-docs-red?style=flat-square" alt="Documentation"></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://mastodon.social/@stalwartlabs"><img src="https://img.shields.io/mastodon/follow/109929667531941122?style=flat-square&logo=mastodon&color=%236364ff&label=Follow%20on%20Mastodon" alt="Mastodon"></a>
|
||||
|
||||
<a href="https://twitter.com/stalwartlabs"><img src="https://img.shields.io/twitter/follow/stalwartlabs?style=flat-square&logo=x&label=Follow%20on%20Twitter" alt="Twitter"></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/jtgtCNj66U"><img src="https://img.shields.io/discord/923615863037390889?label=Join%20Discord&logo=discord&style=flat-square" alt="Discord"></a>
|
||||
|
||||
<a href="https://matrix.to/#/#stalwart:matrix.org"><img src="https://img.shields.io/matrix/stalwartmail%3Amatrix.org?label=Join%20Matrix&logo=matrix&style=flat-square" alt="Matrix"></a>
|
||||
</p>
|
||||
It is a fork of [Stalwart WebUI](https://github.com/stalwartlabs/webui). Like
|
||||
upstream it is schema-driven. After signing in it fetches the server's schema
|
||||
and builds every form, list and menu from it, so it covers every setting the
|
||||
server has without hardcoding any of them.
|
||||
|
||||
## Features
|
||||
> **Status: in development, not released.**
|
||||
|
||||
**Stalwart WebUI** is schema-driven single-page application for administering [Stalwart](https://stalw.art). After authentication the panel fetches a JSON schema from the server and dynamically generates all forms, lists, navigation, and layouts from that schema. Nothing is hardcoded.
|
||||
## What's different from upstream
|
||||
|
||||
Key features:
|
||||
- **One edition.** Nothing is hidden or marked as Enterprise-only. INBUXA
|
||||
ships every feature to everybody. See the INBUXA server's `docs/spec/`.
|
||||
- **Runs anywhere, not on the mail server.** Upstream is installed onto the
|
||||
mail server itself. INBUXA Admin is its own deployment, pointed at the server
|
||||
either at build time (`VITE_API_BASE_URL`) or at deploy time:
|
||||
`<meta name="api-base-url" content="https://mail.example.com">` in
|
||||
`index.html`.
|
||||
- **INBUXA's look:** the logo and ihasmail's palette.
|
||||
- **Two-factor setup** names INBUXA as the issuer, and no longer makes
|
||||
authenticator apps fetch a logo from a third-party site.
|
||||
|
||||
- **Schema-driven UI**: All forms, lists, and navigation are generated from a JSON schema fetched from `/api/schema` after login. No object types, field names, or layouts are hardcoded.
|
||||
- **JMAP protocol**: All data operations (queries, creates, updates, deletes, blob uploads) use JMAP (RFC 8620) with method chaining and result references.
|
||||
- **Permission-aware**: Every button, link, field, and section respects the user's permissions. Elements the user cannot access are hidden.
|
||||
## Developing
|
||||
|
||||
## Screenshots
|
||||
|
||||
<img src="./img/demo.gif">
|
||||
|
||||
## Get Started
|
||||
|
||||
Stalwart WebUI is included with Stalwart Mail Server, to install Stalwart Mail Server on your server by following the instructions for your platform:
|
||||
|
||||
- [Linux / MacOS](https://stalw.art/docs/install/linux)
|
||||
- [Windows](https://stalw.art/docs/install/windows)
|
||||
- [Docker](https://stalw.art/docs/install/docker)
|
||||
|
||||
All documentation is available at [stalw.art/docs/get-started](https://stalw.art/docs/get-started).
|
||||
|
||||
## Getting started
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- Node.js 18 or later
|
||||
- A running Stalwart instance (for JMAP API calls)
|
||||
|
||||
Install dependencies:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Environment variables
|
||||
|
||||
Configuration is done through Vite environment variables. Copy or edit `.env.development` in the project root:
|
||||
|
||||
```
|
||||
VITE_API_BASE_URL=http://localhost:443
|
||||
VITE_ACCESS_TOKEN=
|
||||
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_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:
|
||||
|
||||
```
|
||||
VITE_ACCESS_TOKEN=your-bearer-token-here
|
||||
```
|
||||
|
||||
### Running the dev server
|
||||
|
||||
```
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This starts Vite's development server with hot module replacement, typically at `http://localhost:5173`.
|
||||
|
||||
## Testing
|
||||
|
||||
Run the unit tests (Vitest):
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
|
||||
Run tests in watch mode:
|
||||
|
||||
```
|
||||
npm run test:watch
|
||||
```
|
||||
|
||||
## Building for production
|
||||
|
||||
```
|
||||
```bash
|
||||
npm ci
|
||||
npm run dev # http://localhost:5173, against VITE_API_BASE_URL in .env.development
|
||||
npm run typecheck && npx eslint src/ && npx vitest run
|
||||
npm run build
|
||||
```
|
||||
|
||||
This runs the TypeScript compiler followed by Vite's production build. Output
|
||||
goes to the `dist/` directory.
|
||||
## Keeping up with upstream
|
||||
|
||||
To preview the production build locally:
|
||||
Upstream's history contains no Enterprise-only code, so this is an ordinary
|
||||
git fork. `upstream` is a fetch-only remote:
|
||||
|
||||
```
|
||||
npm run preview
|
||||
```bash
|
||||
git fetch upstream --tags
|
||||
git merge v1.0.12 # the next release tag
|
||||
```
|
||||
|
||||
## Support
|
||||
## License and credits
|
||||
|
||||
If you are having problems running Stalwart Mail Server, you found a bug or just have a question,
|
||||
do not hesitate to reach us on [Github Discussions](https://github.com/stalwartlabs/mail-server/discussions),
|
||||
[Reddit](https://www.reddit.com/r/stalwartlabs), [Discord](https://discord.gg/aVQr3jF8jd) or [Matrix](https://matrix.to/#/#stalwart:matrix.org).
|
||||
Additionally you may purchase a subscription to obtain priority support from Stalwart Labs LLC
|
||||
|
||||
## License
|
||||
|
||||
This project is dual-licensed under the **GNU Affero General Public License v3.0** (AGPL-3.0; as published by the Free Software Foundation) and the **Stalwart Enterprise License v1 (SELv1)**:
|
||||
|
||||
- The [GNU Affero General Public License v3.0](./LICENSES/AGPL-3.0-only.txt) is a free software license that ensures your freedom to use, modify, and distribute the software, with the condition that any modified versions of the software must also be distributed under the same license.
|
||||
- The [Stalwart Enterprise License v1 (SELv1)](./LICENSES/LicenseRef-SEL.txt) is a proprietary license designed for commercial use. It offers additional features and greater flexibility for businesses that do not wish to comply with the AGPL-3.0 license requirements.
|
||||
|
||||
Each file in this project contains a license notice at the top, indicating the applicable license(s). The license notice follows the [REUSE guidelines](https://reuse.software/) to ensure clarity and consistency. The full text of each license is available in the [LICENSES](./LICENSES/) directory.
|
||||
|
||||
## Copyright
|
||||
|
||||
Copyright (C) 2024, Stalwart Labs LLC
|
||||
Free software under the [GNU Affero General Public License, version 3](./LICENSES/AGPL-3.0-only.txt).
|
||||
A fork of Stalwart WebUI, copyright © Stalwart Labs LLC. Upstream's files are
|
||||
dual-licensed AGPL-3.0-only or Stalwart's Enterprise License, and INBUXA takes
|
||||
them under the AGPL-3.0 only. Upstream's copyright notices are kept on every
|
||||
file. INBUXA isn't affiliated with or endorsed by Stalwart Labs.
|
||||
|
||||
|
After Width: | Height: | Size: 204 KiB |
|
After Width: | Height: | Size: 204 KiB |
|
Before Width: | Height: | Size: 446 KiB |
@@ -1,25 +0,0 @@
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" style="enable-background:new 0 0 680.5 252.1;" xml:space="preserve" viewBox="99.5 84.68 481.62 82.75">
|
||||
<style type="text/css">
|
||||
.st0{fill:#100E42;}
|
||||
.st1{fill:#DB2D54;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st1" d="M227.8,143.6c0.3,4.2,2.1,7.6,5.1,10.1c3.1,2.5,7.1,3.8,12.1,3.8c4.3,0,7.9-0.9,10.5-2.8c2.7-1.9,4-4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.2,8.8-9.4c3.7-2.2,7.9-3.3,12.6-3.3 c3.9,0,7.2,0.7,10.1,2.2c2.9,1.5,5.2,3.5,6.9,6.1l1.3-7.6H356.8z M341.7,153.3c2.8-3.2,4.2-7.3,4.2-12.4c0-5.2-1.4-9.4-4.2-12.6 c-2.8-3.3-6.5-4.9-11-4.9c-4.6,0-8.2,1.6-11,4.8c-2.8,3.2-4.2,7.4-4.2,12.5c0,5.2,1.4,9.4,4.2,12.6c2.8,3.2,6.5,4.8,11,4.8 C335.2,158.1,338.9,156.5,341.7,153.3z"/>
|
||||
<path class="st1" d="M365.5,97.5l11-2.1v71.3h-11V97.5z"/>
|
||||
<path class="st1" d="M380.3,114.6h11.6l11.9,39.9l11.9-39.9h10.1l11.4,39.9l12.3-39.9h11.2l-17.3,52.2h-11.8l-11-35.5l-11.4,35.5 l-11.9,0.1L380.3,114.6z"/>
|
||||
<path class="st1" d="M513.7,114.6v52.2H504l-1.2-7.9c-1.8,2.6-4.2,4.7-7,6.2c-2.9,1.6-6.2,2.3-10,2.3c-4.8,0-9-1.1-12.7-3.2 c-3.7-2.1-6.7-5.2-8.8-9.3c-2.1-4-3.2-8.8-3.2-14.2c0-5.3,1.1-10,3.2-14c2.1-4,5.1-7.2,8.8-9.4c3.7-2.2,7.9-3.3,12.6-3.3 c3.9,0,7.2,0.7,10.1,2.2c2.9,1.5,5.2,3.5,6.9,6.1l1.3-7.6H513.7z M498.6,153.3c2.8-3.2,4.2-7.3,4.2-12.4c0-5.2-1.4-9.4-4.2-12.6 c-2.8-3.3-6.5-4.9-11-4.9c-4.6,0-8.2,1.6-11,4.8c-2.8,3.2-4.2,7.4-4.2,12.5c0,5.2,1.4,9.4,4.2,12.6c2.8,3.2,6.5,4.8,11,4.8 C492.2,158.1,495.8,156.5,498.6,153.3z"/>
|
||||
<path class="st1" d="M551.3,114.6v10.3h-4.9c-4.6,0-7.8,1.5-9.9,4.4c-2,3-3.1,6.7-3.1,11.3v26.2h-11v-52.2h9.8l1.2,7.8 c1.5-2.4,3.4-4.4,5.8-5.8c2.4-1.4,5.6-2.1,9.6-2.1H551.3z"/>
|
||||
<path class="st1" d="M556.3,102.1l11-2.1v14.6h12.6v9.7h-12.6v27.2c0,2,0.4,3.5,1.2,4.3c0.8,0.9,2.2,1.3,4.2,1.3h8.4v9.7h-10.6 c-5,0-8.6-1.2-10.8-3.5s-3.4-5.9-3.4-10.7V102.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M149.1,84.7h-4.8l-44.8,25.9v8.3l44.8,25.9h4.8l44.8-25.9v-8.3L149.1,84.7z M182,114.7h-35.3V94.4L182,114.7z M146.7,135.1l-35.3-20.4l27-15.6v15.6v4.1v0.5l6.3,3.6h22.9L146.7,135.1z"/>
|
||||
<polygon class="st1" points="99.5,129.9 99.5,140.9 144.3,166.8 149.1,166.8 193.9,140.9 193.9,129.9 146.7,157.2 "/>
|
||||
<polygon class="st1" points="187.3,166.8 193.9,163 193.9,152 168.2,166.8 "/>
|
||||
<polygon class="st1" points="99.5,163 106.1,166.8 125.2,166.8 99.5,152 "/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
@@ -5,9 +5,10 @@
|
||||
<meta charset="UTF-8" />
|
||||
<base href="/" />
|
||||
<meta name="oauth-client-id" content="" />
|
||||
<meta name="api-base-url" content="" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Portal</title>
|
||||
<title>INBUXA Admin</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "stalwart-webui",
|
||||
"name": "inbuxa-admin",
|
||||
"version": "1.0.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "stalwart-webui",
|
||||
"name": "inbuxa-admin",
|
||||
"version": "1.0.7",
|
||||
"dependencies": {
|
||||
"@daypicker/react": "^10.0.1",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "stalwart-webui",
|
||||
"name": "inbuxa-admin",
|
||||
"private": true,
|
||||
"version": "1.0.11",
|
||||
"description": "Stalwart WebUI",
|
||||
"description": "INBUXA Admin, a fork of Stalwart WebUI",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 24 KiB |
@@ -333,7 +333,7 @@ export function BootstrapWizard() {
|
||||
<WizardShell>
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h2 className="text-2xl font-semibold tracking-tight">{t('bootstrap.welcome', 'Welcome to Stalwart')}</h2>
|
||||
<h2 className="text-2xl font-semibold tracking-tight">{t('bootstrap.welcome', 'Welcome to INBUXA')}</h2>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
{t('bootstrap.welcomeSubtitle', "Let's get your server set up.")}
|
||||
</p>
|
||||
@@ -468,7 +468,7 @@ function SuccessScreen({
|
||||
'bootstrap.credentialsCreated',
|
||||
'Your administrator account has been created. Write these down now: the password will not be shown again.',
|
||||
)
|
||||
: t('bootstrap.configuredSuccessfully', 'Stalwart has been configured successfully.')}
|
||||
: t('bootstrap.configuredSuccessfully', 'INBUXA has been configured successfully.')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -500,7 +500,7 @@ function SuccessScreen({
|
||||
<span className="font-medium">{t('bootstrap.nextStepLabel', 'Next step:')}</span>{' '}
|
||||
{t(
|
||||
'bootstrap.nextStepBody',
|
||||
'restart Stalwart for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.',
|
||||
'restart INBUXA for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.',
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -7,24 +7,26 @@
|
||||
import { useEffect, useSyncExternalStore } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getLogoState, loadLogoOnce, subscribeToLogo } from '@/lib/logoCache';
|
||||
import inbuxaMark from '@/assets/inbuxa-mark.png';
|
||||
|
||||
export function DefaultLogo() {
|
||||
const { t } = useTranslation();
|
||||
// The INBUXA compact lockup: the mark as an image, the wordmark as vector
|
||||
// paths in the current text color, so it reads on light and dark themes.
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="95 84 500 90"
|
||||
aria-label={t('logo.stalwartAlt', 'Stalwart Logo')}
|
||||
viewBox="165 35 616 130"
|
||||
aria-label={t('logo.stalwartAlt', 'INBUXA')}
|
||||
className="h-7 w-auto max-w-[320px]"
|
||||
>
|
||||
<path
|
||||
className="fill-current"
|
||||
d="M227.8 143.6c.3 4.2 2.1 7.6 5.1 10.1 3.1 2.5 7.1 3.8 12.1 3.8 4.3 0 7.9-.9 10.5-2.8 2.7-1.9 4-4.5 4-7.8 0-2.4-.7-4.3-2.2-5.7-1.5-1.4-3.4-2.5-6-3.2-2.5-.7-6-1.5-10.6-2.3-4.6-.8-8.6-1.9-11.9-3.2-3.3-1.3-6-3.3-8.1-6.1-2.1-2.7-3.1-6.3-3.1-10.7 0-4.1 1.1-7.7 3.2-10.9s5.1-5.7 9-7.4c3.8-1.8 8.2-2.6 13.2-2.6 5.1 0 9.6 1 13.7 2.9 4 1.9 7.2 4.5 9.5 7.8s3.6 7.1 3.8 11.4h-11.5c-.4-3.7-2-6.6-4.8-8.9-2.8-2.2-6.3-3.4-10.6-3.4-4.1 0-7.5.9-9.9 2.7-2.5 1.8-3.7 4.3-3.7 7.6 0 2.3.7 4.1 2.2 5.5 1.5 1.4 3.4 2.4 5.9 3.1 2.4.7 5.9 1.4 10.5 2.2 4.6.8 8.6 1.9 11.9 3.3 3.3 1.4 6 3.4 8.2 6 2.1 2.6 3.2 6.1 3.2 10.5 0 4.2-1.1 8-3.4 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.9 1.5 5.2 3.5 6.9 6.1l1.3-7.6h9.7zm-15.1 38.7c2.8-3.2 4.2-7.3 4.2-12.4 0-5.2-1.4-9.4-4.2-12.6-2.8-3.3-6.5-4.9-11-4.9-4.6 0-8.2 1.6-11 4.8-2.8 3.2-4.2 7.4-4.2 12.5 0 5.2 1.4 9.4 4.2 12.6 2.8 3.2 6.5 4.8 11 4.8 4.6 0 8.2-1.6 11-4.8zM551.3 114.6v10.3h-4.9c-4.6 0-7.8 1.5-9.9 4.4-2 3-3.1 6.7-3.1 11.3v26.2h-11v-52.2h9.8l1.2 7.8c1.5-2.4 3.4-4.4 5.8-5.8 2.4-1.4 5.6-2.1 9.6-2.1h2.5zM556.3 102.1l11-2.1v14.6h12.6v9.7h-12.6v27.2c0 2 .4 3.5 1.2 4.3.8.9 2.2 1.3 4.2 1.3h8.4v9.7h-10.6c-5 0-8.6-1.2-10.8-3.5s-3.4-5.9-3.4-10.7v-50.5z"
|
||||
/>
|
||||
<path
|
||||
fill="#db2d54"
|
||||
d="M149.1 84.7h-4.8l-44.8 25.9v8.3l44.8 25.9h4.8l44.8-25.9v-8.3l-44.8-25.9zm32.9 30h-35.3V94.4l35.3 20.3zm-35.3 20.4-35.3-20.4 27-15.6v20.2l6.3 3.6h22.9l-20.9 12.2zM99.5 129.9v11l44.8 25.9h4.8l44.8-25.9v-11l-47.2 27.3zM187.3 166.8l6.6-3.8v-11l-25.7 14.8zM99.5 163l6.6 3.8h19.1L99.5 152z"
|
||||
/>
|
||||
<image x="165.85" y="35.00" width="109.39" height="130.00" href={inbuxaMark} />
|
||||
<path className="fill-current" d="M70 0V496H196V0ZM133 554Q99 554 75.5 576.0Q52 598 52 634Q52 670 75.5 692.0Q99 714 133 714Q168 714 191.0 692.0Q214 670 214 634Q214 598 191.0 576.0Q168 554 133 554Z" transform="translate(303.25,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M70 0V496H194V431H212Q224 457 257.0 480.5Q290 504 357 504Q415 504 458.5 477.5Q502 451 526.0 404.5Q550 358 550 296V0H424V286Q424 342 396.5 370.0Q369 398 318 398Q260 398 228.0 359.5Q196 321 196 252V0Z" transform="translate(340.15,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M368 -14Q301 -14 265.0 9.0Q229 32 212 60H194V0H70V700H196V439H214Q225 457 243.5 473.0Q262 489 292.5 499.5Q323 510 368 510Q428 510 479.0 480.5Q530 451 561.0 394.0Q592 337 592 256V240Q592 159 561.0 102.0Q530 45 479.0 15.5Q428 -14 368 -14ZM330 96Q388 96 427.0 133.5Q466 171 466 243V253Q466 325 427.5 362.5Q389 400 330 400Q272 400 233.0 362.5Q194 325 194 253V243Q194 171 233.0 133.5Q272 96 330 96Z" transform="translate(429.55,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M259 -8Q201 -8 157.5 18.5Q114 45 90.0 92.0Q66 139 66 200V496H192V210Q192 154 219.5 126.0Q247 98 298 98Q356 98 388.0 136.5Q420 175 420 244V496H546V0H422V65H404Q392 40 359.0 16.0Q326 -8 259 -8Z" transform="translate(522.25,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M26 0 206 250 28 496H174L287 331H305L418 496H564L386 250L566 0H418L305 167H287L174 0Z" transform="translate(611.65,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M224 -14Q171 -14 129.0 4.5Q87 23 62.5 58.5Q38 94 38 145Q38 196 62.5 230.5Q87 265 130.5 282.5Q174 300 230 300H366V328Q366 363 344.0 385.5Q322 408 274 408Q227 408 204.0 386.5Q181 365 174 331L58 370Q70 408 96.5 439.5Q123 471 167.5 490.5Q212 510 276 510Q374 510 431.0 461.0Q488 412 488 319V134Q488 104 516 104H556V0H472Q435 0 411.0 18.0Q387 36 387 66V67H368Q364 55 350.0 35.5Q336 16 306.0 1.0Q276 -14 224 -14ZM246 88Q299 88 332.5 117.5Q366 147 366 196V206H239Q204 206 184.0 191.0Q164 176 164 149Q164 122 185.0 105.0Q206 88 246 88Z" transform="translate(697.45,151.90) scale(0.150000,-0.150000)" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,17 +27,15 @@ interface OtpAuthFieldProps {
|
||||
readOnly: boolean;
|
||||
}
|
||||
|
||||
const STALWART_IMAGE_URL = 'https://stalw.art/img/favicon-32x32.png';
|
||||
|
||||
function buildOtpAuthUrl(totp: OTPAuth.TOTP): string {
|
||||
const base = totp.toString();
|
||||
const sep = base.includes('?') ? '&' : '?';
|
||||
return `${base}${sep}image=${encodeURIComponent(STALWART_IMAGE_URL)}`;
|
||||
// No `image` parameter: it made authenticator apps fetch a logo from a
|
||||
// third-party site each time someone set up two-factor.
|
||||
return totp.toString();
|
||||
}
|
||||
|
||||
function generateTotp(): { totp: OTPAuth.TOTP; url: string } {
|
||||
const totp = new OTPAuth.TOTP({
|
||||
issuer: 'Stalwart',
|
||||
issuer: 'INBUXA',
|
||||
label: 'account',
|
||||
algorithm: 'SHA1',
|
||||
digits: 6,
|
||||
|
||||
@@ -88,7 +88,7 @@ export function TopBar() {
|
||||
</Link>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
{t('version.label', 'Stalwart WebUI v{{version}}', { version: __APP_VERSION__ })}
|
||||
{t('version.label', 'INBUXA Admin v{{version}}', { version: __APP_VERSION__ })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const APP_NAME = 'Stalwart WebUI';
|
||||
const APP_NAME = 'INBUXA Admin';
|
||||
|
||||
export function useDocumentTitle(title?: string | null) {
|
||||
useEffect(() => {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"bootstrap": {
|
||||
"clipboardBlocked": "Your browser blocked clipboard access.",
|
||||
"complete": "Setup complete",
|
||||
"configuredSuccessfully": "Stalwart has been configured successfully.",
|
||||
"configuredSuccessfully": "INBUXA has been configured successfully.",
|
||||
"copyFailed": "Copy failed",
|
||||
"credentialsCreated": "Your administrator account has been created. Write these down now: the password will not be shown again.",
|
||||
"emptyForm": "Setup form is empty. The server did not return any bootstrap fields.",
|
||||
@@ -23,11 +23,11 @@
|
||||
"failedToLoad": "Failed to load bootstrap state.",
|
||||
"finishSetup": "Finish setup",
|
||||
"loadingSetup": "Loading setup...",
|
||||
"nextStepBody": "restart Stalwart for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.",
|
||||
"nextStepBody": "restart INBUXA for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.",
|
||||
"nextStepLabel": "Next step:",
|
||||
"noConfirm": "The server did not confirm the update.",
|
||||
"stepOf": "Step {{current}} of {{total}}",
|
||||
"welcome": "Welcome to Stalwart",
|
||||
"welcome": "Welcome to INBUXA",
|
||||
"welcomeSubtitle": "Let's get your server set up."
|
||||
},
|
||||
"common": {
|
||||
@@ -299,11 +299,11 @@
|
||||
},
|
||||
"logo": {
|
||||
"alt": "Logo",
|
||||
"stalwartAlt": "Stalwart Logo"
|
||||
"stalwartAlt": "INBUXA"
|
||||
},
|
||||
"logout": "Logout",
|
||||
"version": {
|
||||
"label": "Stalwart WebUI v{{version}}"
|
||||
"label": "INBUXA Admin v{{version}}"
|
||||
},
|
||||
"oauth": {
|
||||
"backToLogin": "Back to login",
|
||||
|
||||
@@ -7,81 +7,81 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
:root {
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0.017 285.823);
|
||||
--background: #ffffff;
|
||||
--foreground: #111827;
|
||||
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0.017 285.823);
|
||||
--card: #ffffff;
|
||||
--card-foreground: #111827;
|
||||
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0.017 285.823);
|
||||
--popover: #ffffff;
|
||||
--popover-foreground: #111827;
|
||||
|
||||
--content-background: oklch(0.97 0.003 285.823);
|
||||
--content-background: #f6f8fa;
|
||||
|
||||
--primary: oklch(0.205 0.017 285.823);
|
||||
--primary-foreground: oklch(0.985 0.002 285.823);
|
||||
--primary: #0f766e;
|
||||
--primary-foreground: #ffffff;
|
||||
|
||||
--secondary: oklch(0.965 0.005 285.823);
|
||||
--secondary-foreground: oklch(0.205 0.017 285.823);
|
||||
--secondary: #eef1f4;
|
||||
--secondary-foreground: #111827;
|
||||
|
||||
--muted: oklch(0.93 0.005 285.823);
|
||||
--muted-foreground: oklch(0.556 0.015 285.823);
|
||||
--muted: #eef1f4;
|
||||
--muted-foreground: #5b6472;
|
||||
|
||||
--accent: oklch(0.965 0.005 285.823);
|
||||
--accent-foreground: oklch(0.205 0.017 285.823);
|
||||
--accent: #d9f1ee;
|
||||
--accent-foreground: #0b5750;
|
||||
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(0.985 0.002 285.823);
|
||||
--destructive: #dc2626;
|
||||
--destructive-foreground: #ffffff;
|
||||
|
||||
--border: oklch(0.922 0.007 285.823);
|
||||
--input: oklch(0.922 0.007 285.823);
|
||||
--ring: oklch(0.708 0.015 285.823);
|
||||
--border: #e3e7ec;
|
||||
--input: #e3e7ec;
|
||||
--ring: #0f766e;
|
||||
|
||||
--radius: 0.5rem;
|
||||
|
||||
--chart-1: 220 70% 50%;
|
||||
--chart-2: 160 60% 45%;
|
||||
--chart-3: 30 80% 55%;
|
||||
--chart-4: 280 65% 60%;
|
||||
--chart-5: 340 75% 55%;
|
||||
--chart-1: #0f766e;
|
||||
--chart-2: #f9a34c;
|
||||
--chart-3: #1c4053;
|
||||
--chart-4: #0e7490;
|
||||
--chart-5: #b45309;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.141 0.005 285.823);
|
||||
--foreground: oklch(0.985 0.002 285.823);
|
||||
--background: #111a2b;
|
||||
--foreground: #e5e9f0;
|
||||
|
||||
--card: oklch(0.205 0.007 285.823);
|
||||
--card-foreground: oklch(0.985 0.002 285.823);
|
||||
--card: #111a2b;
|
||||
--card-foreground: #e5e9f0;
|
||||
|
||||
--popover: oklch(0.205 0.007 285.823);
|
||||
--popover-foreground: oklch(0.985 0.002 285.823);
|
||||
--popover: #111a2b;
|
||||
--popover-foreground: #e5e9f0;
|
||||
|
||||
--content-background: oklch(0.115 0.005 285.823);
|
||||
--content-background: #0b1220;
|
||||
|
||||
--primary: oklch(0.985 0.002 285.823);
|
||||
--primary-foreground: oklch(0.205 0.017 285.823);
|
||||
--primary: #2dd4bf;
|
||||
--primary-foreground: #052e2b;
|
||||
|
||||
--secondary: oklch(0.274 0.009 285.823);
|
||||
--secondary-foreground: oklch(0.985 0.002 285.823);
|
||||
--secondary: #1f2a3d;
|
||||
--secondary-foreground: #e5e9f0;
|
||||
|
||||
--muted: oklch(0.274 0.009 285.823);
|
||||
--muted-foreground: oklch(0.708 0.015 285.823);
|
||||
--muted: #1f2a3d;
|
||||
--muted-foreground: #9aa5b8;
|
||||
|
||||
--accent: oklch(0.274 0.009 285.823);
|
||||
--accent-foreground: oklch(0.985 0.002 285.823);
|
||||
--accent: #12343a;
|
||||
--accent-foreground: #99f6e4;
|
||||
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(0.985 0.002 285.823);
|
||||
--destructive: #f87171;
|
||||
--destructive-foreground: #0b1220;
|
||||
|
||||
--border: oklch(0.274 0.009 285.823);
|
||||
--input: oklch(0.274 0.009 285.823);
|
||||
--ring: oklch(0.553 0.013 285.823);
|
||||
--border: #1f2a3d;
|
||||
--input: #1f2a3d;
|
||||
--ring: #2dd4bf;
|
||||
|
||||
--chart-1: 220 70% 60%;
|
||||
--chart-2: 160 60% 55%;
|
||||
--chart-3: 30 80% 60%;
|
||||
--chart-4: 280 65% 65%;
|
||||
--chart-5: 340 75% 60%;
|
||||
--chart-1: #2dd4bf;
|
||||
--chart-2: #f9a34c;
|
||||
--chart-3: #9fc2d6;
|
||||
--chart-4: #67e8f9;
|
||||
--chart-5: #fbbf24;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
|
||||
@@ -13,6 +13,12 @@ export function getApiBaseUrl(): string {
|
||||
if (envUrl && envUrl.length > 0) {
|
||||
return envUrl.replace(/\/+$/, '');
|
||||
}
|
||||
// Set at deploy time rather than build time, so one build can point at any
|
||||
// server: <meta name="api-base-url" content="https://mail.example.com">.
|
||||
const injected = document.querySelector('meta[name="api-base-url"]')?.getAttribute('content')?.trim();
|
||||
if (injected) {
|
||||
return injected.replace(/\/+$/, '');
|
||||
}
|
||||
return window.location.origin;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,19 @@ export async function discover(username: string): Promise<DiscoveryResponse> {
|
||||
}),
|
||||
);
|
||||
}
|
||||
return response.json() as Promise<DiscoveryResponse>;
|
||||
const discovered = (await response.json()) as DiscoveryResponse;
|
||||
// A server that doesn't know its public URL yet (bootstrap mode, or no
|
||||
// public URL configured) returns relative endpoints such as "/login". They
|
||||
// belong to the server, so resolve them against the server's address, not
|
||||
// this page's: INBUXA Admin is usually served from somewhere else.
|
||||
const base = `${getApiBaseUrl()}/`;
|
||||
const absolute = (endpoint: string | undefined) => (endpoint ? new URL(endpoint, base).toString() : endpoint);
|
||||
return {
|
||||
...discovered,
|
||||
authorization_endpoint: absolute(discovered.authorization_endpoint) as string,
|
||||
token_endpoint: absolute(discovered.token_endpoint) as string,
|
||||
end_session_endpoint: absolute(discovered.end_session_endpoint),
|
||||
};
|
||||
}
|
||||
|
||||
const UNRESERVED = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';
|
||||
|
||||
@@ -33,7 +33,8 @@ describe('accountStore', () => {
|
||||
|
||||
const state = useAccountStore.getState();
|
||||
expect(state.permissions).toEqual(['b', 'c']);
|
||||
expect(state.edition).toBe('oss');
|
||||
// INBUXA: one edition. A server reporting 'oss' still unlocks everything.
|
||||
expect(state.edition).toBe('enterprise');
|
||||
expect(state.locale).toBe('ja');
|
||||
});
|
||||
|
||||
@@ -101,9 +102,11 @@ describe('accountStore', () => {
|
||||
expect(useAccountStore.getState().edition).toBe('enterprise');
|
||||
});
|
||||
|
||||
it('can be changed to oss', () => {
|
||||
it('is never oss or community, whatever the server reports (INBUXA: one edition)', () => {
|
||||
useAccountStore.getState().setAccountInfo([], 'oss', 'en');
|
||||
expect(useAccountStore.getState().edition).toBe('oss');
|
||||
expect(useAccountStore.getState().edition).toBe('enterprise');
|
||||
useAccountStore.getState().setAccountInfo([], 'community', 'en');
|
||||
expect(useAccountStore.getState().edition).toBe('enterprise');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,8 +23,11 @@ export const useAccountStore = create<AccountState>()((set, get) => ({
|
||||
edition: 'community',
|
||||
locale: 'en',
|
||||
|
||||
setAccountInfo: (permissions, edition, locale) => {
|
||||
set({ permissions, edition, locale });
|
||||
setAccountInfo: (permissions, _edition, locale) => {
|
||||
// INBUXA has one edition, with every feature. Whatever the server reports,
|
||||
// nothing is hidden or disabled as Enterprise-only. Features the server
|
||||
// hasn't rebuilt yet answer that for themselves.
|
||||
set({ permissions, edition: 'enterprise', locale });
|
||||
},
|
||||
|
||||
hasPermission: (perm) => {
|
||||
|
||||