Commit graph

18 commits

Author SHA1 Message Date
c98fe735ad feat: add -dev flag for local HTTP testing
All checks were successful
continuous-integration/drone/push Build is passing
In development mode (-dev):
- HSTS header is omitted (prevents browser caching HTTPS-only requirement)
- CSRF cookie Secure flag is cleared (allows cookies over plain HTTP)
- A warning is logged on startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
1e1888625d feat(security): add altcha proof-of-work CAPTCHA to all sensitive forms
Integrate go-altcha to protect login, change password, lost password,
and reset password forms against automated submissions. Serves the
altcha widget JS from the embedded library, exposes a challenge
endpoint, validates responses server-side with replay prevention, and
updates the CSP to allow self-hosted scripts and WebAssembly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
78c4e9c3b0 fix(security): enforce domain allowlist for email alias creation
Add ALIAS_ALLOWED_DOMAINS env var (comma-separated) that restricts which
domains users may create aliases under. Alias creation is disabled when
the env var is not set. Prevents users from creating aliases with arbitrary
domains (e.g. for phishing/spoofing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
5451ec3918 fix(security): add HTTP security headers middleware
Set X-Frame-Options, X-Content-Type-Options, Referrer-Policy, CSP,
and Strict-Transport-Security on all responses to mitigate clickjacking,
MIME sniffing, XSS, and downgrade attacks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
7b568607a6 fix(security): require configurable secret for X-Special-Auth docker registry bypass
Replace hardcoded "docker-registry" check with a configurable secret via
DOCKER_REGISTRY_SECRET env var. When the env var is unset, the anonymous
docker registry bypass is disabled entirely, closing the unauthenticated
access path if the service is accidentally exposed directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
57775bbf89 fix(security): redesign password reset tokens using crypto/rand with server-side storage
- Replace SHA512-based deterministic token with 32-byte crypto/rand token
- Store tokens server-side with 1-hour expiry and single-use semantics
- Remove genToken (previously broken due to time.Add immutability bug)
- Add CSRF double-submit cookie protection to change/lost/reset forms
- Remove token from form action URL (use hidden fields only, POST body)
- Add MailFrom field and SMTP_FROM env var for configurable sender address
- Add SMTP_PASSWORD_FILE env var for secure SMTP password loading
- Add PUBLIC_URL env var and --public-url flag for configurable reset link domain
- Use generic error messages in handlers to avoid information disclosure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
6836e70e83 Can launch the executable with arguments to get reset token 2026-03-06 15:30:48 +07:00
65d0d4a53e Can delete own aliases 2026-03-06 15:30:48 +07:00
e6a4271a75 Add an API compatibly with addy.io to generate aliases
All checks were successful
continuous-integration/drone/push Build is passing
2024-05-31 16:19:53 +02:00
b014c3fb3c Can send mail through a smtp relay
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 10:03:32 +02:00
0d0438135c Add route for Basic HTTP auth
All checks were successful
continuous-integration/drone/push Build is passing
2020-09-05 12:20:19 +02:00
ee30a37c41 Also use config from environment
Some checks reported errors
continuous-integration/drone/push Build was killed
2020-09-04 23:28:38 +02:00
cd8d7388a6 Use go-bindata instead of esc 2020-09-04 21:56:09 +02:00
b8d9118b56 go fmt 2020-09-02 15:09:14 +02:00
7226e9f1e2 Use esc to embed static assets 2018-12-31 01:00:24 +01:00
1d3ad672cb Theming 2018-12-31 01:00:24 +01:00
a375c6d2b1 Configuration filename is now an option 2018-11-13 01:17:09 +01:00
b99a321ded Initial commit 2018-11-13 01:14:42 +01:00