Find Stalwart's administration instead of asking for it
The dashboard's link to Stalwart's own administration needed
STALWART_ADMIN_URL, which an operator had to know to set. Everything it
holds can be read from the server:
- the origin is the host Stalwart advertises in its own session URLs, the
one people reach it at even when ihasmail talks to it on a private
address;
- the prefix is where its web interface application is installed. The
production server's x:Application reads "Stalwart Web Interface",
enabled, urlPrefix {"/admin", "/account"}, and /admin is also what
Stalwart writes at first boot.
So, for an account that administers, the account info fetch now asks the
account's own server for its applications and links to origin + /admin/.
An installation whose web interface is disabled or moved gets no link; an
administrator who may not read applications gets Stalwart's default
/admin. It is cached with the rest of the account info.
STALWART_ADMIN_URL and a servers file entry's adminUrl still win, for an
administration that lives somewhere else. A routed domain without one now
takes what its own server said, never the default server's.
This commit is contained in:
@@ -215,11 +215,12 @@ installation that sets nothing else behaves exactly as it always has.
|
||||
```
|
||||
|
||||
[`stalwart-servers.example.json`](stalwart-servers.example.json) is that file
|
||||
with the rules written in it. A domain's value may also be an object that names
|
||||
where that server's own administration is, for the Administration dashboard's
|
||||
link — `{"url": "https://jmap.customer-b.test", "adminUrl": "https://admin.customer-b.test"}`.
|
||||
`STALWART_ADMIN_URL` is the same for the default server. A listed domain with no
|
||||
`adminUrl` gets no link rather than the default server's.
|
||||
with the rules written in it. The Administration dashboard links each administrator to
|
||||
their own server's administration, found from that server; a domain's value may
|
||||
also be an object that overrides it, for an administration that lives elsewhere —
|
||||
`{"url": "https://jmap.customer-b.test", "adminUrl": "https://admin.customer-b.test"}`.
|
||||
`STALWART_ADMIN_URL` is the same for the default server. A listed domain is never
|
||||
pointed at the default server's administration.
|
||||
|
||||
A domain nobody listed — and a bare username, which Stalwart accepts and which
|
||||
has no domain at all — goes to `STALWART_URL`. **A listed domain never falls
|
||||
|
||||
Reference in New Issue
Block a user