Email test button and sign-in by emailed link

- Admin -> About: Email card (delivery, server, encryption, login name,
  From; never the password) and a "Send test email" button that sends
  immediately and shows the SMTP error if it fails
- SMTP: implicit TLS on port 465 (or SMTP_TLS=true), auth only with a
  username, 10-15 s timeouts
- "Email me a sign-in link": single-use (spent by any later sign-in via a
  monotonic users.last_signed_in_at), 15-minute expiry, confirm step so
  mail scanners can't use it up, same answer for unknown addresses, rate
  limited, off when PASSWORD_LOGIN=false
- Admin -> Users shows last sign-in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 09:27:57 -05:00
1 parent 2b0a2f1949
commit 4f548f3874
23 files changed
+275 -12

No files matched your search

+3 -2
View File
@@ -54,7 +54,8 @@ The app is a standard Rails app. Run `bin/rails db:prepare && bin/thrust bin/rai
| `SECRET_KEY_BASE` | Required in production (`bin/rails secret`). Alternatively provide `RAILS_MASTER_KEY`. |
| `FORCE_SSL` | `true` (default) redirects to HTTPS and sets secure cookies. Use `false` for plain HTTP. |
| `APP_HOST` | Host used in password-reset email links. |
| `SMTP_ADDRESS`, `SMTP_PORT`, `SMTP_USERNAME`, `SMTP_PASSWORD`, `MAIL_FROM` | Optional. They enable password-reset emails. Without them an admin resets passwords from **Users**. |
| `SMTP_ADDRESS`, `SMTP_PORT`, `SMTP_USERNAME`, `SMTP_PASSWORD`, `MAIL_FROM` | Optional. They enable email: password resets and **Email me a sign-in link**. Without them an admin resets passwords from **Users**. Check the setup with **Admin → About → Send test email**. |
| `SMTP_TLS` | `true` for servers that use TLS from the start. That's the default on port 465; other ports upgrade with STARTTLS. |
| `ANTHROPIC_API_KEY` | Optional. Lets Claude transcribe scanned logbook pages into entries (**Logbook → Import scans**). Without it, scans are only uploaded. |
| `LOGBOOK_AI_MODEL`, `LOGBOOK_AI_EFFORT` | Optional. The Claude model and effort used for transcription (default `claude-opus-5-5`, `high`). |
| `APP_URL` | Optional public base URL, e.g. `https://aircraft.example.com` (default `https://APP_HOST`). Used for the SSO callback. |
@@ -63,7 +64,7 @@ The app is a standard Rails app. Run `bin/rails db:prepare && bin/thrust bin/rai
| `OIDC_AUTO_CREATE_USERS` | `true` creates an account for anyone the provider lets in. New accounts start with no aircraft. Default off: an admin adds users first. |
| `OIDC_TRUST_EMAIL` | `true` links existing accounts by email even if the provider doesn't mark it verified. Only use it if users can't edit their own email at the provider. |
| `OIDC_ADMIN_GROUP` | Optional. Members of this provider group become admins and others lose admin, synced at each sign-in. |
| `PASSWORD_LOGIN` | `false` hides email/password sign-in and password resets once SSO works. It's ignored while SSO isn't configured, so you can't lock yourself out. |
| `PASSWORD_LOGIN` | `false` hides email/password sign-in, emailed sign-in links and password resets once SSO works. It's ignored while SSO isn't configured, so you can't lock yourself out. |
### Single sign-on (Authentik example)