mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Transactional mail, crawler metadata, and asset measurement (#179)
* Send transactional email from no-reply@mail.innersquare.app Centralise the sender identity, reply-to address and SES configuration set in Chesstrainer.Mail so no notifier can drift. Add MAIL_REDIRECT_TO for smoke tests and a mix mail.check task that exercises the SES mailbox simulators, and document the setup in the deploy guide and .env.example. * Tighten crawler metadata and keep play pages out of search Canonical URLs no longer carry query strings, public pages get an OG image, WebSite JSON-LD and a per-page language, and the sitemap dates the landing page only. Play and guest-training routes are marked noindex so tens of thousands of near-identical pages stay out of the index. * Measure built asset sizes with mix assets.sizes Report raw, gzip and brotli sizes for built JS and CSS, and record the current numbers plus the board-code split recommendation in docs/assets.md.
This commit is contained in:
@@ -141,6 +141,7 @@ MAILING_LIST_ENABLED=false
|
||||
SES_REGION=eu-north-1
|
||||
SES_ACCESS_KEY_ID=AKIA...
|
||||
SES_SECRET_ACCESS_KEY=...
|
||||
SES_CONFIGURATION_SET=my-first-configuration-set
|
||||
|
||||
MATOMO_URL=https://analytics.owenrees.eu/
|
||||
MATOMO_SITE_ID=6
|
||||
@@ -162,6 +163,47 @@ pages and the guest trainer. Signed-in account and admin pages are excluded.
|
||||
The privacy controls, Matomo server settings, retention, and opt-out behaviour
|
||||
are documented in `docs/analytics.md`.
|
||||
|
||||
## Transactional email
|
||||
|
||||
Every outgoing email goes through `Chesstrainer.Mail`, which applies the same
|
||||
house rules everywhere:
|
||||
|
||||
- **From**: `Inner Square Chess <no-reply@mail.innersquare.app>`. The address
|
||||
lives on the `mail.` subdomain; SES verifies the parent domain, and subdomains
|
||||
inherit that verification, so the subdomain does not need its own identity.
|
||||
- **Reply-To**: `support@innersquare.app`. Replies reach a monitored inbox even
|
||||
though the sender says `no-reply`.
|
||||
- **SES configuration set**: `SES_CONFIGURATION_SET`, default
|
||||
`my-first-configuration-set`. The set is what links a message to its SNS
|
||||
bounce and complaint notifications. It must exist in `SES_REGION`.
|
||||
|
||||
Optional overrides:
|
||||
|
||||
```sh
|
||||
MAIL_FROM=no-reply@mail.innersquare.app # try another sender without a rebuild
|
||||
MAIL_REDIRECT_TO=you@example.com # rewrite every recipient (staging/smoke tests)
|
||||
```
|
||||
|
||||
`MAIL_REDIRECT_TO` rewrites `to`, `cc` and `bcc` to one address, prefixes the
|
||||
subject with the original recipients and adds an `X-Original-To` header, so a
|
||||
redirected message explains itself. Leave it unset in normal operation.
|
||||
|
||||
Check delivery from the release environment:
|
||||
|
||||
```sh
|
||||
bin/chesstrainer eval 'Mix.Task.run("mail.check", ["--to", "you@example.com"])'
|
||||
```
|
||||
|
||||
or, in a checkout configured with the production SES variables,
|
||||
`mix mail.check --to you@example.com`. The task sends to the given address plus
|
||||
the SES mailbox simulators (`success@`, `bounce@`, `complaint@simulator...
|
||||
amazonses.com`) so the configuration set's bounce and complaint path can be
|
||||
exercised without touching a real inbox. Use `--no-simulators` to skip them.
|
||||
|
||||
DNS: the apex publishes DMARC (`p=quarantine`) with aggregate reports sent to
|
||||
`dmarc@innersquare.app`, and `mail.innersquare.app` carries the custom MAIL FROM
|
||||
SPF record and the SES feedback MX.
|
||||
|
||||
Generate the two secrets:
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user