Manual tunnel test: two real bugs found and fixed, docs marked done
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 11s
CI / federation-interop (push) Successful in 1m38s
CI / test (push) Successful in 4m10s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 11s
CI / federation-interop (push) Successful in 1m38s
CI / test (push) Successful in 4m10s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
Ran the manual pass with a real Mastodon account through a cloudflared tunnel - the one gap every phase doc had flagged as outstanding before merging. WebFinger, actor resolution, follow/unfollow/approve/block, a forced weekly summary posting and deleting, and the now-playing profile field appearing/clearing all worked correctly against mastodon.social and activitypub.academy. Two real bugs found along the way, both fixed here: - docker-compose.yml hardcoded the api/worker services' CORS_ORIGINS to UI_BASE_URL. Pointing UI_BASE_URL at the tunnel host (needed for federation's own identity) silently changed which browser origins the API accepted, blocking the operator's own localhost:8080 UI - .env's own CORS_ORIGINS setting had no effect, since the compose file never referenced it. Now its own variable, same default. - TestConfig wasn't isolating UI_BASE_URL/CORS_ORIGINS from a developer's .env, so the same local change broke six tests that assert on http://localhost:8080 URLs - the same class of gap an earlier session found and fixed for FEDERATION_ENABLED/ LASTFM_API_KEY. Pinned alongside them. Marked the manual pass done in each phase doc (1-4) and the overview. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
9f7ada682c
commit
9ca2ace854
7 files changed
+14
-8
No files matched your search
+1
-1
@@ -29,7 +29,7 @@ services:
|
||||
environment:
|
||||
DATABASE_URL: postgresql+psycopg://scrobbler:${POSTGRES_PASSWORD:-scrobbler}@db:5432/scrobbler
|
||||
SECRET_KEY: ${SECRET_KEY:-change-me}
|
||||
CORS_ORIGINS: ${UI_BASE_URL:-http://localhost:8080}
|
||||
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:8080}
|
||||
UI_BASE_URL: ${UI_BASE_URL:-http://localhost:8080}
|
||||
WEB_CONCURRENCY: ${WEB_CONCURRENCY:-2}
|
||||
FORWARDED_ALLOW_IPS: "*"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ActivityPub phase 1: discoverable profile
|
||||
|
||||
**Status: done** on `feature/activitypub` (`98c6554` … `913ef67`). The one gap is the manual check with a real Mastodon account through a tunnel: it's still to do, and needs a public HTTPS address.
|
||||
**Status: done** on `feature/activitypub` (`98c6554` … `913ef67`). The manual check with a real Mastodon account through a tunnel (`cloudflared`) is also done: WebFinger, the actor and the key all resolved correctly from mastodon.social and activitypub.academy.
|
||||
|
||||
This implements phase 1 of [activitypub.md](activitypub.md). Handles and actor URLs are on the **UI's domain**, and posts are **followers only by default** (a per-user setting).
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ActivityPub phase 2: followers
|
||||
|
||||
**Status: done** on `feature/activitypub` (`a6d3fb6` … `fe95f59`). The GoToSocial interop test passes locally and in CI. Before merging, the plan still calls for a manual pass with a real Mastodon account through a tunnel.
|
||||
**Status: done** on `feature/activitypub` (`a6d3fb6` … `fe95f59`). The GoToSocial interop test passes locally and in CI. The manual pass with a real Mastodon account through a tunnel is also done: follow, unfollow, manual approval, and block/unblock all worked correctly.
|
||||
|
||||
Where this differed from the plan:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ActivityPub phase 3: posts
|
||||
|
||||
**Status: done** on `feature/activitypub` (`bc717c2` … `860d4d0`). The GoToSocial interop test now covers posts too: a weekly summary reaches a follower's home timeline as `private` with the expected content, and disappears from it when deleted. As with phases 1-2, a manual pass with a real Mastodon account through a tunnel is still to do before merging.
|
||||
**Status: done** on `feature/activitypub` (`bc717c2` … `860d4d0`). The GoToSocial interop test now covers posts too: a weekly summary reaches a follower's home timeline as `private` with the expected content, and disappears from it when deleted. The manual pass with a real Mastodon account through a tunnel (done alongside phase 4's, see its notes) confirmed a forced weekly summary posted and deleted correctly there too.
|
||||
|
||||
Where this differed from the plan:
|
||||
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
# ActivityPub phase 4: now playing
|
||||
|
||||
**Status: done** on `feature/activitypub` (`7d86bad` … `9883111`). The GoToSocial interop test now covers now playing too: turning it on updates the "Now playing" field GoToSocial has cached for the profile, via the periodic `Update(Person)` push - not just a fresh fetch showing the live truth, which was already covered by the actor route's own tests. As with phases 1-3, a manual pass with a real Mastodon account through a tunnel is still to do before merging.
|
||||
**Status: done** on `feature/activitypub` (`7d86bad` … `9883111`, plus a `docker-compose.yml` fix from the manual pass below). The GoToSocial interop test now covers now playing too: turning it on updates the "Now playing" field GoToSocial has cached for the profile, via the periodic `Update(Person)` push - not just a fresh fetch showing the live truth, which was already covered by the actor route's own tests.
|
||||
|
||||
The manual pass with a real Mastodon account through a tunnel (the last standing gap after every phase) is also done now, covering phases 1-4 together: WebFinger, actor and follow/unfollow/approve/block against mastodon.social and activitypub.academy over a `cloudflared` tunnel, a forced weekly summary posting and deleting correctly, and the now-playing profile field appearing, clearing, and respecting the 5-minute push throttle.
|
||||
|
||||
Where this differed from the plan:
|
||||
|
||||
- **The now-playing key had to be hashed, not raw.** `artist\x1ftrack\x1fstarted_at` was going straight into `federation_posts.key` (`VARCHAR(64)`), which real track and artist names routinely overflow. Caught by the first Postgres-backed test that used a real track name, not by anything in the plan itself.
|
||||
- **`now_playing_field()` needed its own privacy gate.** It read core's `now_playing` table (populated for every user regardless of federation settings) without checking `now_playing_mode` itself, so a user who'd never turned the feature on at all would still leak what they were listening to if a caller forgot to gate it externally. Found while designing the periodic push task, not by a test written against the plan - the existing tests happened to never combine "something playing" with "mode off". Fixed by moving the gate inside `now_playing_field()` itself, so there's exactly one place that can get this wrong.
|
||||
- **`docker-compose.yml` hardcoded the API's `CORS_ORIGINS` to `UI_BASE_URL`.** Found during the manual pass: pointing `UI_BASE_URL` at the tunnel host (needed for federation's own identity) silently changed which browser origins the API accepted, blocking the operator's own `localhost:8080` UI from calling it at all - an `.env` `CORS_ORIGINS` setting had no effect, since the compose file never referenced it. Fixed by making `CORS_ORIGINS` its own variable, defaulting the same as before.
|
||||
- **`TestConfig` wasn't isolating `UI_BASE_URL`/`CORS_ORIGINS` either.** The same local `.env` change broke six tests that assert on `http://localhost:8080` URLs, the same way an earlier session found `FEDERATION_ENABLED`/`LASTFM_API_KEY` leaking from a developer's `.env` into the test run. Pinned alongside them.
|
||||
|
||||
This implements phase 4 of [activitypub.md](activitypub.md): **now playing**, the last of the "still open" decisions there. It builds on [phase 3](activitypub-phase3.md): publishing, delivery and the web UI for posts.
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ Everything goes on the existing Prometheus and Grafana setup:
|
||||
- visibility addressing
|
||||
- **In-process federation**: two Scrobbler instances in one test process following each other.
|
||||
- **A real peer in CI**: a [GoToSocial](https://gotosocial.org) container, which is a single binary with SQLite. It follows a Scrobbler user and we assert that it receives the `Accept` and the posts. That's much lighter than running Mastodon in CI.
|
||||
- **Manual pass before release**:
|
||||
- **Manual pass before release** (done, over a `cloudflared` tunnel - see [phase 4](activitypub-phase4.md)):
|
||||
- follow from a real Mastodon account
|
||||
- check the profile, posts, profile-field updates and unfollowing
|
||||
- check with [verify.funfedi.dev](https://verify.funfedi.dev/) or the [ActivityPub Academy](https://activitypub.academy/)
|
||||
|
||||
@@ -76,7 +76,9 @@ class TestConfig(Config):
|
||||
"postgresql+psycopg://scrobbler:scrobbler@localhost:5432/scrobbler_test",
|
||||
)
|
||||
START_METRICS_SERVER = False
|
||||
# Tests never inherit optional features from a developer's .env or environment;
|
||||
# tests that need them turn them on explicitly.
|
||||
# Tests never inherit optional features or URLs from a developer's .env or
|
||||
# environment; tests that need them turn them on, or override them, explicitly.
|
||||
LASTFM_API_KEY = ""
|
||||
FEDERATION_ENABLED = "0"
|
||||
UI_BASE_URL = "http://localhost:8080"
|
||||
CORS_ORIGINS = ["http://localhost:8080"]
|
||||
Reference in new issue
Block a user