Add a 'test' stage to the Containerfile (production base image plus pytest)
and build it in the release workflow before the push step, so a failing test
stops the release.
Fix the eight tests that were failing: media validation returns a PIL Image
since v1.5.0, and the migration test needs TESTING to skip production config
checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sending: RFC 8288 Link header parsing, rel token matching and document
order for <link>/<a>, endpoint re-discovery on every send, re-send to
previous targets on update/delete/undelete, 410 Gone for deleted notes,
no redirect following on the POST, 429 retried.
Receiving: exact target match per media type, Accept header, final URL
for relative links, only published notes accepted, fragments ignored,
moderation kept on updates, transient errors keep valid mentions.
Security: every redirect hop SSRF-checked, all resolved addresses
checked, broader blocklist, total time and size limits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Normalise mf2 author values: u-photo with alt text is a dict in mf2py and
broke the database update for most real senders
- Pass str(response.url) to urljoin during endpoint discovery; the TypeError
marked every target as having no endpoint. Retry on discovery errors
- Hold a cross-process flock so only one gunicorn process runs the worker
- Keep author URL/photo only if http(s) (XSS via javascript: URLs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The worker thread called the SSRF checks, which read current_app.config,
without an app context, so every incoming and outgoing webmention failed with
'Working outside of application context'. A teardown_appcontext hook also
stopped the worker whenever a request ended.
Pass the app to WebmentionWorker and run each poll in app.app_context(), like
SyndicationWorker, and drop the teardown hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every page sat in the 40rem reading column, so the admin wrapper's 60rem
never applied and the notes table, which can't shrink that far, ran past
the header's right edge. Admin pages now set a 60rem frame for header,
content and footer; post previews wrap, and tables scroll sideways on
narrow screens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some Micropub clients (OutPost) upload a photo to the media endpoint and
then embed it in content instead of sending it as `photo`. Those posts
have no attached media, so crossposts went out without the image.
Images in the text that are in this site's media library are now sent
like attached photos, with their alt text, and GoToSocial's text no
longer carries the image Markdown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Uncaptioned photos rendered alt="Image", which mf2 parsers report as
the photo's alt text. They now take the post's text (excerpt, up to 150
characters), falling back to "Image" only for text-free posts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked rendered pages with mf2py against W3C Post Type Discovery:
- Note pages put u-in-reply-to inside a bare h-cite, making it the
h-cite's property, so replies parsed as notes (or photo posts). The
reply context is now the entry's u-in-reply-to h-cite.
- Home page previews had no reply markup; they now show "In reply to"
with u-in-reply-to.
- Previews always emit e-content, so a text-free photo post can't get
an implied name.
- Text-free page titles follow PTD order (Repost, Like, Reply, Photo).
tests/test_post_types.py runs PTD on parsed note pages and the home page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A create that failed after the note was written (e.g. the same photo
twice) answered 500 but left the post published without photos.
Photos are now resolved first, and a failed note is removed.
- Pooled connections roll back unfinished writes, so one failure no
longer locks the database for the next ~10 s.
- The same photo twice in one post is shown once.
- Photo posts no longer need text (Micropub doesn't require content,
and q=config already advertised a photo-only post type). Updates may
clear the text while photos remain. Crossposts start with the link;
the page is titled "Photo".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
add_tags_to_note() rewrites note_tags in entry order on every save, so
note_tags.id already records it; get_note_tags(entered_order=True) reads
it back. Crossposts (Threads topic, which hashtags fit on Bluesky), the
editor and Micropub q=source/update use it, so saving no longer
reorders tags alphabetically. Public pages stay alphabetical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a note links somewhere (an article, say), the first link gets the
preview card instead of the note (ADR-070). Bluesky cards are built from
the page's OG/Twitter/HTML title, description and image (thumb shrunk
under 1 MB); Threads previews the first link in the text. Markdown links
no longer lose their URL on Bluesky (link text becomes a facet) or Threads
("text (url)"); Threads keeps to Meta's 5-link limit. Page fetches are
public-address only, checked at every redirect, size-capped, and never
fail the post.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An explicit link_attachment for a URL Meta hasn't fetched yet fails at
threads_publish with "Invalid Link Attachment" (subcode 4279047), which
is every new note; it only went out on the retry. Tested live with fresh
URLs: with link_attachment it fails, without it it publishes first time
and Threads still sets link_attachment_url from the first link in the
text. Reposts likewise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Meta's threads_publish returned a one-off HTTP 400 "Fatal" for a plain
text post; the same post published fine on retry. Publish-step errors
are now retryable unless they are auth/permission errors (codes 10, 190,
200); the retry's existing-post check prevents doubles. Errors carry the
Graph code, subcode, user message and fbtrace id. A short pause before
the first container status poll.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Third crossposting target on the ADR-065 loop (ADR-069). Text posts get a
link preview, 1 image posts as IMAGE and 2-4 as a CAROUSEL (Meta fetches
them from /media/), with alt text and the first tag as topic_tag. Posts are
shortened to 500 characters, counting non-ASCII as UTF-8 bytes. Edits don't
follow (the API has no edit); unpublish and delete remove the post. Retried
creates check for an existing post first.
The 60-day token is refreshed daily from the worker loop and kept in
DATA_PATH/threads_token.json under a file lock; a new configured token
replaces it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Micropub like-of/repost-of with optional comment; likes on /likes, off the
home page and feeds; reposts in the stream. Native favourites/boosts on
GoToSocial and likes/reposts/quotes on Bluesky when the target is on that
network, link posts for other reposts. Fix double slash in outgoing
webmention source URLs. ADR-068.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update (replace/add/delete) for content, name, category, photo,
in-reply-to, post-status; soft delete with undelete; post-status drafts;
in-reply-to; multipart and remote photos; q=source lists and properties[];
q=category; media scope. Fix media endpoint 404 at the advertised
/micropub/media path. ADR-067.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Micropub `name` was dropped; store it as the note's '# Heading' first
line, which is how StarPunk titles work. q=source returned /notes/<slug>
(a 404) and a name for every note; it now returns the real permalink and
name only for titled notes, without the heading in content. Titled notes
no longer show their title twice (Note.body_html, excerpt).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Public pages never checked the session, so they always showed Log in.
Set g.me in before_request when a session cookie is present.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix note metadata inheriting page-footer styles, show full notes instead of
HTML cut at 300 chars, auto-link bare URLs, one-line meta, SITE_NAME in the
header and titles, serif reading font, dark mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BlueskyClient behind the ADR-065 reconcile loop: plain text with link and
hashtag facets, images under 1 MB with alt text, link cards, app-password
sessions with refresh. Deletes follow; edits don't (ADR-066).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published notes are copied to a GoToSocial (Mastodon-API) account and
edits, unpublishing and deletes follow them (ADR-065). On by default for
new notes, untickable in the editor and selectable from Micropub via
mp-syndicate-to. A background worker reconciles each (note, target)
row with atomic claims, an idempotency key and a version so edits during
a send are not lost. Synced copies are linked with u-syndication.
Also fixes the Micropub Location header and search result links, which
pointed at /notes/<slug> (404), and the nested delete form on the edit
page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The automatic Actions token is refused by the container registry
(run 107: unauthorized). Use the REGISTRY_TOKEN repository secret.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behind Caddy the app is reached over plain HTTP, so url_for(_external=True)
produced http:// links on the https site: the RSS/OPML <link>s and the
microformats u-url/u-uid permalinks that IndieWeb parsers treat as
canonical. Templates now use absolute_url_for(), shared with the
IndieAuth metadata.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runner no longer has a Docker daemon (it gave every workflow root on
the server), and this workflow never worked anyway: it logged in to
gitea:3000, which the daemon couldn't resolve. Log in to
git.thesatelliteoflove.com and build through the BuildKit socket instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admin login now uses OpenID Connect (PKCE, nonce, ID token verified
against the provider JWKS) and only OIDC_ADMIN_SUB may log in. Micropub
tokens are issued and verified by StarPunk itself, with a consent screen
behind the OIDC session and a Connected Apps page to revoke them, so an
external IndieAuth server (Gondulf) is no longer needed.
Existing notes, media, tags, webmentions, author profile and sessions
are unchanged. Migration 011 adds new tables only.
BREAKING CHANGE: production requires OIDC_ISSUER, OIDC_CLIENT_ID,
OIDC_CLIENT_SECRET and OIDC_ADMIN_SUB. The ADMIN_ME page must point
Micropub apps at StarPunk's IndieAuth endpoints. See ADR-064.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v1.6.0 work (webmentions, reply contexts, rate limiter, migration
010) was built and deployed as git.thesatelliteoflove.com/phil/starpunk:v1.6.0-rc.2
but never committed. This restores the application code from /app in
the running container so later work builds on what production runs.
Tests and docs for v1.6.0 were not in the image and are not recovered.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IndieAuth Authentication:
- Corrected W3C IndieAuth specification compliance
- Uses response_type=id for authentication-only flow per spec
- Discovers endpoints from user profile URL
- Removed hardcoded indielogin.com service
- DEPRECATED: INDIELOGIN_URL config (now auto-discovered)
Timestamp-Based Slugs (ADR-062):
- Default slugs now use YYYYMMDDHHMMSS format
- Unique collision handling with numeric suffix
Debug File Management:
- Controlled by DEBUG_SAVE_FAILED_UPLOADS config
- Auto-cleanup of files older than 7 days
- 100MB disk space protection
- Filename sanitization for security
Performance:
- N+1 query fix in feed generation
- Batch media loading for feed notes
Data Integrity:
- Atomic variant generation with temp files
- Database/filesystem consistency on failure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
BREAKING: Removes INDIELOGIN_URL config - endpoints are now properly
discovered from user's profile URL as required by W3C IndieAuth spec.
- auth.py: Uses discover_endpoints() to find authorization_endpoint
- config.py: Deprecation warning for obsolete INDIELOGIN_URL setting
- auth_external.py: Relaxed validation (allows auth-only flows)
- tests: Updated to mock endpoint discovery
This fixes a regression where admin login was hardcoded to use
indielogin.com instead of respecting the user's declared endpoints.
Version: 1.5.0-hotfix.1
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>