You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 473e73d
Browse filesBrowse the repository at this point in the historyBrowse files
feat: capture demo mail in Mailpit so the Docker stacks show email verification (#87)
* feat: capture demo mail in Mailpit so the Docker stacks show email verification
Both stacks ran docker-mailserver with SMTP_ONLY=1, a relay with no route to
real inboxes, so #85 had to set USER_REGISTRATION_SENDVERIFICATIONEMAIL=false
and the demo could never show registration verification or password reset.
Replace it with axllent/mailpit, which captures outbound mail and serves it as
a web inbox on 8025. The app now talks plain SMTP to mailpit:1025 with auth and
STARTTLS off, and neither stack overrides sendVerificationEmail, so the base
default of true applies and the two-hop registration flow works end to end.
The healthcheck is `mailpit readyz` rather than an HTTP probe: the image is
built from scratch and has no curl, wget, or nc.
Drops mailserver.env, the ./config/ bind mount, the maildata/mailstate/maillogs
volumes, the NET_ADMIN/SYS_PTRACE capabilities, and the published ports 25/587.
SELINUX_LABEL went with the bind mount, so compose no longer warns about it.
Closes#86
* fix: correct the pending-verification page title message key
messages.properties spelled the key page.title.registration-ending-verification
while registration-pending-verification.html asks for
page.title.registration-pending-verification, so the page rendered
??page.title.registration-pending-verification_en?? as its title.
The page is only reachable when verification email is on, which is why the typo
survived: no documented run path reached it until the Docker stacks switched to
Mailpit.
* docs: document the Mailpit web inbox as the demo's mail path
Rewrites the Docker quick start, the CONFIGURATION mail section, the
AUTHENTICATION registration and Keycloak walkthroughs, the DEVELOPMENT stack
descriptions, and keycloak/README.md around reading mail at localhost:8025.
Drops the SELINUX_LABEL environment row, which no longer exists, and corrects a
stale compose.yaml:86-90 healthcheck citation to 72-76.
Notes a framework-side limitation found while verifying this: the
resend-verification page fails against ds-spring-user-framework 5.3.0, whose
UserAPI.resendRegistrationToken binds the full registration UserDto with
@notblank on firstName, lastName, password, and matchingPassword, so the
email-only payload resend-verification.js posts is rejected with HTTP 400.
* fix(review): correct Mailpit healthcheck comment and CHANGELOG claim
- compose.yaml, docker-compose-keycloak.yml: the "built from scratch: no
curl, no wget, no nc" comment was wrong. Verified against
axllent/mailpit:v1.30: it's Alpine-based with busybox providing wget
and nc; only curl is absent. `mailpit readyz` is still the right
choice — it's the image's own baked-in default HEALTHCHECK.
- CHANGELOG.md: dropped resend-verification from the list of flows the
demo "exercises for real" — it's documented elsewhere in this same
change (docs/CONFIGURATION.md, docs/AUTHENTICATION.md) as broken
against ds-spring-user-framework 5.3.0, so the two entries
contradicted each other.
* fix: pin Mailpit to the exact patch version that was verified
The stacks pinned axllent/mailpit:v1.30, a floating minor tag, while the
flows were verified against v1.30.7. A patch bump could change the web UI
or the readyz probe and silently break the documented demo path.
Matches how keycloak:25.0.6 is pinned; raised in review on #87.
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,20 +63,19 @@ Recognized elsewhere (fall back to a demo default when unset):
63
63
|`DATABASE_URL`, `DATABASE_USERNAME`, `DATABASE_PASSWORD`| Production datasource (`application-prd.yml:10-12`). |
64
64
|`WEBAUTHN_RP_ID`, `WEBAUTHN_RP_NAME`, `WEBAUTHN_ALLOWED_ORIGINS`| WebAuthn relying-party identity in `prd` (`application-prd.yml:41-43`). |
65
65
|`DS_SPRING_USER_KEYCLOAK_CLIENT_ID`, `_CLIENT_SECRET`, `_PROVIDER_AUTHORIZATION_URI`, `_PROVIDER_TOKEN_URI`, `_PROVIDER_USER_INFO_URI`, `_PROVIDER_JWK_SET_URI`| Keycloak OAuth2 client and provider endpoints for `docker-keycloak`, consumed in `application-docker-keycloak.yml:19-20,35,48-50`; supplied by [`keycloak.env`](../keycloak.env) when you run `docker-compose-keycloak.yml`. There is no `_PROVIDER_ISSUER_URI`: `issuer-uri` is deliberately left unset, see [`keycloak/README.md`](../keycloak/README.md). |
66
-
|`SELINUX_LABEL`| Suffix on the mailserver's bind-mounted config path in `compose.yaml`/`docker-compose-keycloak.yml`. Unset by default; Docker Compose prints a harmless warning about it. |
67
66
68
67
Any framework property can also be set through Spring's relaxed binding (`SCREAMING_SNAKE_CASE` of
69
68
the dotted key). The Docker demo stack (`compose.yaml`) does this for the app container:
`SPRING_MAIL_HOST`/`_PORT`and the `SPRING_MAIL_PROPERTIES_MAIL_SMTP_*` keys (→ `spring.mail.*`), and
72
-
`USER_REGISTRATION_SENDVERIFICATIONEMAIL` (→`user.registration.sendVerificationEmail`). The same
73
-
pattern works for any other key, e.g. `USER_SECURITY_BCRYPTSTRENGTH` for `user.security.bcryptStrength`.
69
+
`SPRING_DATASOURCE_URL`/`_USERNAME`/`_PASSWORD` (→ `spring.datasource.*`), `SPRING_PROFILES_ACTIVE`, and
70
+
`SPRING_MAIL_HOST`/`_PORT`plus the `SPRING_MAIL_PROPERTIES_MAIL_SMTP_*` keys (→ `spring.mail.*`). The same
71
+
pattern works for any other key, e.g. `USER_SECURITY_BCRYPTSTRENGTH` for`user.security.bcryptStrength` or
72
+
`USER_REGISTRATION_SENDVERIFICATIONEMAIL` for `user.registration.sendVerificationEmail`.
74
73
75
74
## Mail
76
75
77
76
-`spring.mail.username`, `spring.mail.password`, `spring.mail.host`, `spring.mail.port` (`application.yml:2-6`) configure the SMTP transport used for verification, password-reset, and notification email. The base file's `host` is a placeholder SES endpoint; set real credentials in your profile.
78
77
-`user.registration.sendVerificationEmail` (`application.yml:113`) controls whether a new account must click a verification link before it can log in. `false` enables the account immediately at registration.
79
-
- The Docker demo stack's `mailserver` service (`compose.yaml`) is a relay only: `SMTP_ONLY: 1` (`compose.yaml:48`) with no route to real inboxes. That stack sets `USER_REGISTRATION_SENDVERIFICATIONEMAIL: "false"` (`compose.yaml:85`) so registered accounts activate immediately instead of waiting on mail nothing will deliver.
78
+
- Both Docker stacks (`compose.yaml` and `docker-compose-keycloak.yml`) run a `mailpit` service ([Mailpit](https://mailpit.axllent.org/)) that captures outbound mail instead of delivering it, and serves it as a web inbox on <http://localhost:8025>. The app container reaches it over plain SMTP with `SPRING_MAIL_HOST: mailpit` and `SPRING_MAIL_PORT: 1025`, auth and STARTTLS off. Neither stack overrides `user.registration.sendVerificationEmail`, so registration verification and password reset run their real email flows: read the message in the web inbox and click the link. Nothing leaves the machine, and Mailpit keeps no volume, so `docker compose down` discards the captured mail. The resend-verification page does not work against `ds-spring-user-framework:5.3.0`: `UserAPI.resendRegistrationToken` binds the full registration `UserDto`, whose `firstName`, `lastName`, `password`, and `matchingPassword` are `@NotBlank`, so the email-only payload that `resend-verification.js` posts is rejected with HTTP 400 and no mail is sent. That is a framework-side bug, not a stack setting.
80
79
-`user.mail.fromAddress` sets the `From` address on outbound mail; it is set per profile (e.g. `application-local.yml-example:144`), not in the base file.
0 commit comments