Delete unused login links each day, keep those URLs out of logs, and write the privacy-policy numbers #103

Merged
an.di merged 3 commits from adilallo/fix/CR-251-link-hygiene into main 2026-11-11 01:02:26 +00:00
Member

Overview

Unused login, save-progress, and email-change links now stop working after 60 minutes and are deleted by a daily job, so those rows are gone within a day of expiry. App logs no longer store the query string on those URLs. The numbers the new privacy policy still has in brackets are written down for counsel. Live /privacy is unchanged until that review.

Changes

  • Login sent. The sent screen and the login email both say the link works for 60 minutes.
  • Daily delete. A Cloudron job at 07:20 UTC deletes expired sessions, unused login / save-progress / email-change tokens (and any draft they still carry), and workshop inquiries older than 12 months. You can also run scripts/prune-sessions.ts locally, or POST /api/ops/prune if OPS_PRUNE_TOKEN is set.
  • Invites. An expired invitation still cannot be used to join. The hash stays on the row so the expired page can send a new 60-minute link, and so the organizer can send it again.
  • Logs. Page timing logs store origin + path only. Sign-in and invite mail failures log a request id, not an email. Cloudron’s reverse-proxy logs can still include the query string; the platform deletes them after 14 days, which is as short as it allows.
  • Facts for counsel. docs/privacy-policy-facts.md records the periods and hosting: 60-minute links, unused rows gone within a day, workshop inquiries 12 months, unused accounts kept until the person deletes them, logs 14 days, backups 30 days on MEDLab Cloudron in the United States. Ask-an-organizer mail is not stored in the app.

Screenshots

01-login-sent-60-minutes.png

How to Test

  1. Open /login, send a link, and confirm Check your email plus We sent a login link that works for 60 minutes. Open the message and confirm the same 60-minute line.
  2. With Postgres up, run node --env-file=.env --import tsx scripts/prune-sessions.ts and confirm it reports counts without error. Expired login tokens should disappear; an expired invitation row should still be there so a new-link request can send mail.
  3. POST a web-vitals sample whose page URL has a query string. Confirm the stored page is origin + path only.
  4. Open /privacy and confirm it is still the current page, not the new policy text.

Needs local Postgres for the prune script. Mailhog (or the server log) for the login-sent screen.

Notes

  • Do not switch /privacy until university counsel has read docs/privacy-policy-facts.md.
  • Confirm Cloudron backups are set to 30 daily on staging and production. That is an operator setting, not an app change.
  • An email to every account holder before a change to who can read Rules is after launch and is not in this PR.
## Overview Unused login, save-progress, and email-change links now stop working after 60 minutes and are deleted by a daily job, so those rows are gone within a day of expiry. App logs no longer store the query string on those URLs. The numbers the new privacy policy still has in brackets are written down for counsel. Live `/privacy` is unchanged until that review. ## Changes - **Login sent.** The sent screen and the login email both say the link works for 60 minutes. - **Daily delete.** A Cloudron job at 07:20 UTC deletes expired sessions, unused login / save-progress / email-change tokens (and any draft they still carry), and workshop inquiries older than 12 months. You can also run `scripts/prune-sessions.ts` locally, or `POST /api/ops/prune` if `OPS_PRUNE_TOKEN` is set. - **Invites.** An expired invitation still cannot be used to join. The hash stays on the row so the expired page can send a new 60-minute link, and so the organizer can send it again. - **Logs.** Page timing logs store origin + path only. Sign-in and invite mail failures log a request id, not an email. Cloudron’s reverse-proxy logs can still include the query string; the platform deletes them after 14 days, which is as short as it allows. - **Facts for counsel.** `docs/privacy-policy-facts.md` records the periods and hosting: 60-minute links, unused rows gone within a day, workshop inquiries 12 months, unused accounts kept until the person deletes them, logs 14 days, backups 30 days on MEDLab Cloudron in the United States. Ask-an-organizer mail is not stored in the app. ## Screenshots ![01-login-sent-60-minutes.png](attachments/47940823-3952-4712-be4f-4407fca0e7b1) ## How to Test 1. Open `/login`, send a link, and confirm **Check your email** plus **We sent a login link that works for 60 minutes.** Open the message and confirm the same 60-minute line. 2. With Postgres up, run `node --env-file=.env --import tsx scripts/prune-sessions.ts` and confirm it reports counts without error. Expired login tokens should disappear; an expired invitation row should still be there so a new-link request can send mail. 3. POST a web-vitals sample whose page URL has a query string. Confirm the stored page is origin + path only. 4. Open `/privacy` and confirm it is still the current page, not the new policy text. Needs local Postgres for the prune script. Mailhog (or the server log) for the login-sent screen. ## Notes - Do not switch `/privacy` until university counsel has read `docs/privacy-policy-facts.md`. - Confirm Cloudron backups are set to **30 daily** on staging and production. That is an operator setting, not an app change. - An email to every account holder before a change to who can read Rules is after launch and is not in this PR.
an.di added 3 commits 2026-11-11 01:01:57 +00:00
Expired sign-in, save-progress, email-change, and invitation tokens (and any draft they carry) are cleared by a Cloudron scheduler task. Page timing logs record the path without the query string, and mail failures log a request id instead of an address.
Login links work for 60 minutes, unused rows are gone within a day, logs last 14 days, and backups are 30 days on MEDLab Cloudron in the United States. Live /privacy stays on the current page until counsel reads this text.
Clearing the hash made the expired page report success without sending, and made the invite look accepted.
an.di merged commit 0efc907633 into main 2026-11-11 01:02:26 +00:00
an.di deleted branch adilallo/fix/CR-251-link-hygiene 2026-11-11 01:02:26 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CommunityRule/community-rule#103