Add SITE_BASE_URL to config #456
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web#456
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://tgfp.usis hardcoded in five places and derived from proxy headers inseveral more. It belongs in
Configonce, asSITE_BASE_URL.Hardcoded today
The two in
mailer.pyarrived with #209.Built from the request today
app/mailer.pybuilds absolute URLs fromrequest.url_for, which is whysend_welcome_emailandsend_picks_page_ready_emailboth take aRequestthey otherwise have no use for:
send_picks_page_ready_emailalready dropped itsRequestin #209 byhardcoding instead;
send_welcome_emailis the one still holding one.Two problems with that. A job has no request, so anything sent outside the
request cycle cannot use it -- which is the whole reason #453 happened. And
inside a request it derives scheme and host from proxy headers, so a link
someone clicks a week later is only correct if Pangolin is forwarding them
right. A link in an email should come from configuration, not from whatever
host header happened to arrive.
Switching those four to
SITE_BASE_URLlets both mailer functions drop theirRequestparameter entirely.Leave alone
request.url_forfor redirects inside the app is correct and should stay:Those are same-request navigation, not links handed to someone else.
Note
Pairs with #452, which strips the vestigial
API_BASE_URL(https://tgfp.us/api,consumed by nothing). One variable out, one in -- no net change for #199.
forgejo-actions referenced this issue2026-09-02 21:02:13 +02:00