Stage 1, step 3 (plan § Routes). BREAKING: every panel URL changes and the
old paths are removed without redirects.
Routes (web.go)
- /status -> /overview; /domains -> /outbound/domains with the domain's
settings actions under .../settings/ (reports, ratelimit, export);
/deliveries -> /outbound/log; /mail-queue -> /outbound/queue; /dmarc ->
/outbound/dmarc; /inbound -> /inbound/domains; /system-log ->
/server/log; /backup -> /server/backup (import under it); /users ->
/server/users; recheck and reload under /server/health/.
- One fragment name: <page>/fragment everywhere.
- Everything under /server/ is registered through server(), which wraps
the handler in globalOnly: the subtree is guarded once, where a new
route cannot forget it. Handlers keep their own requireGlobal.
- GET / leads to /overview, /outbound/domains or /inbound/domains.
- The /account -> /settings redirect is gone with /settings.
Account and Server > Settings
- handlers_account.go: GET /account and three POSTs - profile (username,
e-mail; no password asked, as designed), password (current password,
rate-limited like a sign-in, signs out other sessions), dmarc (the
user's default: hosted / account / custom / none, each validated).
This replaces step 1's bridge through the old Settings form.
- handlers_settings.go is the instance's page only: log retention and the
read-only rate limits, global role.
- One legacy template serves both pages by a flag until stage 2 gives each
its own: a new legacy page cannot be added to the ratchet.
Still to come inside stage 1, and why @routes stays on the ratchet:
- step 4: the application routes (one POST, under the domain);
- step 5: GET /server/health.
With @routes removed by hand TestRoutesFollowNavigation reports exactly
those and nothing else - no template links to a path the router lacks.
Old templates, tests and the e2e client are retargeted. The e2e module was
edited but not run here (no Docker, and its dependency could not be
downloaded on this machine).
Tests: Account (page, profile, password, DMARC default in every mode, a
domain administrator's own row only), Server settings (saved without a
password, range, global only), the /server/ subtree answered 404 by the
router for a domain administrator with All on both lists and for no
principal.
go test ./... green except the two Windows-only failures in internal/domain
and internal/logtail.
Roadmap 13/27.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
2.2 KiB
HTML
44 lines
2.2 KiB
HTML
{{define "content"}}
|
|
<h1>Backup & migration</h1>
|
|
|
|
<div class="card">
|
|
<h2>Full backup</h2>
|
|
<p class="muted">Download a self-contained backup of the whole instance —
|
|
<code>data/</code> (database, DKIM keys, application credentials, and the
|
|
Postfix queue), <code>docker-compose.yml</code>, <code>.env</code>, and
|
|
<code>certs/</code>. Extract it into an empty project directory on a new
|
|
machine, adjust hostname or proxy settings if needed, and start a container of
|
|
the <strong>same SelfPost version</strong> before first boot. The reverse-proxy
|
|
vhost is not included — set that up separately on the new host.</p>
|
|
<p class="muted"><strong>The backup file is a secret</strong> (it contains
|
|
private keys, TLS material, and credentials). Store and transfer it securely and delete it
|
|
once the restore succeeds. Encrypting it below is the simplest way to do that:
|
|
the download is then a <code>.spbk</code> file (SelfPost backup) that only
|
|
the password opens.</p>
|
|
{{if .BackupErr}}<p class="error">{{.BackupErr}}</p>{{end}}
|
|
<form method="post" action="/server/backup">
|
|
{{template "encryptfields" .}}
|
|
<button type="submit">Download full backup</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2>Import a domain</h2>
|
|
<p class="muted">Move a single domain here from another SelfPost instance using
|
|
a domain export file (from that domain's page) — plain <code>.json</code> or
|
|
encrypted <code>.spde</code> (SelfPost domain export). Its DKIM key and
|
|
application passwords come across, so the published DNS record needs no
|
|
change. The export file is a secret, like a full backup.</p>
|
|
{{if .ImportErr}}<p class="error">{{.ImportErr}}</p>{{end}}
|
|
<form method="post" action="/server/backup/import" enctype="multipart/form-data">
|
|
<label for="importfile">Domain export file</label>
|
|
<input id="importfile" name="file" type="file" accept=".json,.spde,application/json" required data-import-file>
|
|
<div class="encrypt-fields" data-import-password-fields>
|
|
<label for="importpw">Password</label>
|
|
<input id="importpw" name="import_password" type="password" autocomplete="off">
|
|
</div>
|
|
<button type="submit">Import domain</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|