diff --git a/CHANGELOG.md b/CHANGELOG.md index ec7276a..590434a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.17.1] - 2026-11-12 + +### Fixed + +- Crossposting failed in 2.17.0 (never deployed): post URLs were built with Flask's `url_for`, which needs a web request, and crossposts run in a background worker. URLs are now built from `SITE_URL` + ## [2.17.0] - 2026-11-12 Articles get URLs of their own (ADR-077). diff --git a/docs/design/v2.17.0/2026-11-12-article-urls.md b/docs/design/v2.17.0/2026-11-12-article-urls.md index 5d5ad3d..9ffb498 100644 --- a/docs/design/v2.17.0/2026-11-12-article-urls.md +++ b/docs/design/v2.17.0/2026-11-12-article-urls.md @@ -21,3 +21,9 @@ slugs for notes, redirects both ways, updates via the old URL, slug rules (accents, duplicates, reserved, `mp-slug`, emoji, long titles), 201 on adding/removing a title, 410 for a deleted article, webmention targets and homepage links, search result URLs. + +## v2.17.1 + +`post_url` first used `url_for`, which fails outside a request (the +crosspost and backfeed workers); CI caught it in `test_likes_reposts.py` +before 2.17.0 was built. It now joins `SITE_URL` and `post_path`. diff --git a/starpunk/__init__.py b/starpunk/__init__.py index f6180fc..bfefebc 100644 --- a/starpunk/__init__.py +++ b/starpunk/__init__.py @@ -468,5 +468,5 @@ def create_app(config=None): # Package version (Semantic Versioning 2.0.0) # See docs/standards/versioning-strategy.md for details -__version__ = "2.17.0" -__version_info__ = (2, 17, 0) +__version__ = "2.17.1" +__version_info__ = (2, 17, 1) diff --git a/starpunk/utils.py b/starpunk/utils.py index 38173b7..e9f1c0a 100644 --- a/starpunk/utils.py +++ b/starpunk/utils.py @@ -722,8 +722,15 @@ def post_path(slug: str, title: Optional[str] = None) -> str: def post_url(slug: str, title: Optional[str] = None) -> str: - """A post's absolute URL (see post_path)""" - return absolute_url_for("public.article" if title else "public.note", slug=slug) + """ + A post's absolute URL (see post_path) + + Built from SITE_URL without url_for, so it works outside a request: + crossposting and backfeed run in background workers (v2.17.0). + """ + from flask import current_app + + return current_app.config["SITE_URL"].rstrip("/") + post_path(slug, title) def iso_utc(value) -> str: