Data and mail

Your account and the mail server

Each user can change their own name, password and email in Settings → Account. Admins still manage roles and access in Settings → Users, and set up the mail server that email changes need.

Name and password

  • PATCH /api/account { name } renames you, up to 100 characters.
  • POST /api/account/password { current_password, new_password } takes the current password (a wrong one is a 403 and counts towards the login limiter, like other account changes). The new one needs 8 characters. Every session is signed out, sign-ins halfway through included; the one that asked gets a new cookie. API tokens keep working.

Email

A new email takes only once the link sent to it is opened, so nobody can move an account to an address they don't control, and a typo can't lock anyone out. That needs a mail server (below).

  1. POST /api/account/email { email, password } checks the password and that no other account has the email, then mails a link to it and answers 202. Asking again replaces the link sent before; DELETE /api/account/email cancels it. GET /api/account/email shows the change waiting, if any, and whether a mail server is set up.
  2. The link, <panel>/confirm-email/<token>, works for 24 hours, once, from any browser, signed in or not. The old address then gets a notice that the email changed.

Links point at STACKD_PUBLIC_URL, or without it, the address the browser asking was on.

The mail server

An admin sets it up in Settings → System → Mail server: host, port, encryption (implicit TLS, usually 465; STARTTLS, usually 587; or none, for a relay on the same network), an optional username and password, and the address and name messages come from. Send test email sends one to the admin's own address with the saved settings and shows the server's reason if it refuses.

The password is sealed with STACKD_MASTER_KEY and never sent back; saving without typing a new one keeps it.

API: GET, PUT and DELETE /api/system/smtp, POST /api/system/smtp/test. Admin only.