Skip to content

F.7: Mastodon bundle — flagship federated microblog#16

Open
kh0pper wants to merge 1 commit intof6-lemmy-bundlefrom
f7-mastodon-bundle
Open

F.7: Mastodon bundle — flagship federated microblog#16
kh0pper wants to merge 1 commit intof6-lemmy-bundlefrom
f7-mastodon-bundle

Conversation

@kh0pper
Copy link
Copy Markdown
Owner

@kh0pper kh0pper commented Apr 12, 2026

Summary

Stacked on F.6 (Lemmy). Heaviest small-AP bundle in the roll-out. Third consumer of F.0's storage-translators (Mastodon's S3_* envelope). Validates that F.1/F.5's Mastodon-API verb taxonomy scales against the reference implementation — same verbs, full admin surface (severity-tunable defederate, report review, remote reporting with attached status_ids).

  • ghcr.io/mastodon/mastodon:v4.3.0 (web + sidekiq) + mastodon-streaming:v4.3.0 (Node streaming split out in 4.3+) + postgres:15 + redis:7 = 5 containers. Web command runs db:migrate + assets:precompile on first boot; healthcheck start_period=180s.
  • 15 MCP tools per the federated-social verb taxonomy — all the usual suspects plus Mastodon-specific admin verbs (mastodon_defederate with severity silence/suspend/noop, mastodon_mute_user with temporary duration + notification-only scope, mastodon_report_remote with status_ids attachment + category).
  • Storage: on-disk default; set MASTODON_S3_* and scripts/configure-storage.mjs routes through F.0's storage-translators.mastodon() (S3_ENABLED + S3_BUCKET + S3_PROTOCOL + S3_HOSTNAME + AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY).
  • Hardware gate: min_ram_mb=3000, recommended=6000. This bundle is refused on hosts that can't meet 3 GB effective RAM after committed bundles — meaning on <8 GB hosts the gate will typically say no once any other bundle is co-installed.
  • Consent text (EN/ES) emphasizes LOCAL_DOMAIN immutability: once federation occurs, the domain cannot be changed without abandoning every federated identity.

Test plan

  • node --check on all JS files
  • bash -n on shell scripts
  • MCP server boots via createMastodonServer() with no env set
  • docker compose config parses with required env set
  • JSON parse on manifest, package, registry
  • npm run check passes
  • End-to-end install on a test host (deferred)
  • Async media upload round-trip (pass through the 202→polling branch)
  • Storage translation end-to-end (MinIO → Mastodon photo upload → verify in bucket)
  • Queued admin defederate + blocklist import (needs F.11 panel UI)

Integration notes

  • Third Mastodon-API consumer. resolveAccount() + queueModerationAction() are deliberately duplicated across F.1/F.5/F.7 rather than extracted. File-top comment documents the hoist threshold: when a fourth Mastodon-compatible bundle lands (Akkoma / Iceshrimp), move the shared code to servers/shared/mastodon-api.js. Three copies is acceptable; four is the trigger.
  • F.12 unblocked. With F.3 (Matrix-Dendrite) and F.7 (Mastodon) both shipped, F.12 cross-app bridging now has the two federated endpoints it needs for meaningful bridges + crossposting.
  • Image tags v4.3.0 pinned at implementation time. 4.3 is the active release line. Next-major bumps follow the image-tag policy (separate PR, CVE-feed-gated).

Rollout position

  • F.0 → F.6 shipped
  • F.7 (this PR)
  • Next: F.8 PeerTube (video — heaviest bundle, needs S3 + aggressive transcoding policy)
  • Then F.11 identity attestation (independent), F.12 cross-app bridging (now unblocked)

🤖 Generated with Claude Code

Stacked on F.6 (Lemmy). Heaviest small-AP bundle in the roll-out; third
consumer of F.0's storage-translators (storage-translators.mastodon()).
Validates that F.1/F.5's Mastodon-API verb taxonomy scales to the real
reference implementation.

Bundle (bundles/mastodon/):

- manifest.json  consent_required with EN/ES covering federation reach,
                 LOCAL_DOMAIN immutability (once federated, the domain
                 cannot be changed without abandoning every identity),
                 remote-media cache growth (10-100 GB without S3),
                 hardware gate (min 3 GB effective RAM, warn <8 GB total).
- docker-compose.yml  ghcr.io/mastodon/mastodon:v4.3.0 (web + sidekiq) +
                 mastodon-streaming:v4.3.0 (Node streaming split out in
                 4.3+) + postgres:15-alpine + redis:7-alpine. 5 containers.
                 Web entrypoint runs db:migrate + assets:precompile +
                 puma. Blank-default S3_* passthrough for
                 configure-storage.mjs. mem_limits: web=2g, sidekiq=1.5g,
                 streaming=512m, postgres=512m, redis=256m.
                 start_period=180s on web (first-boot migrations +
                 asset precompile).
- server/server.js  15 MCP tools matching the federated-social verb
                 taxonomy: mastodon_status, mastodon_post,
                 mastodon_post_with_media (async /api/v2/media upload
                 with processing-poll), mastodon_feed
                 (home/public/local/notifications), mastodon_search,
                 mastodon_follow/unfollow, mastodon_block_user,
                 mastodon_mute_user (supports duration + notification-only),
                 mastodon_block_domain (user-scope inline),
                 mastodon_defederate (admin, QUEUED, severity selector),
                 mastodon_import_blocklist (QUEUED), mastodon_review_reports,
                 mastodon_report_remote (status_ids + category),
                 mastodon_media_prune (surfaces tootctl recipe — Mastodon
                 keeps media prune as CLI to prevent accidental
                 mass-deletion). resolveAccount() +
                 queueModerationAction() duplicated from F.1/F.5 by
                 design; file-top comment documents the hoist threshold
                 (fourth Mastodon-compatible bundle).
- server/index.js  stdio transport.
- panel/mastodon.js + panel/routes.js  Nest panel: instance status +
                 home timeline. XSS-safe. /api/mastodon/{status,feed}.
- skills/mastodon.md  secret-generation via rake secret + VAPID keypair,
                 first-run bootstrap (tootctl accounts create with Admin
                 role), Caddy activitypub-mastodon profile (wires
                 /api/v1/streaming to mastodon-streaming:4000), moderation
                 ladder, troubleshooting (auth scopes, sidekiq queue,
                 federation delivery retries, media cache).
- scripts/post-install.sh  240s web health wait (migrations + asset
                 precompile), configure-storage.mjs invocation when
                 MASTODON_S3_ENDPOINT set, federation-network
                 verification, next-step guidance.
- scripts/configure-storage.mjs  wraps storage-translators.mastodon().
                 Inline fallback if shared helper unresolvable
                 (installed-mode).
- scripts/backup.sh  pg_dump + system/ tar. Loud warning: .env holds
                 SECRET_KEY_BASE + OTP_SECRET + VAPID keys — back up
                 SEPARATELY and encrypted; LOSS invalidates 2FA + sessions.
- package.json  MCP + zod deps.

Integrations with shipped F-series:

- F.0 storage-translators.mastodon()  third consumer (after F.4, F.5).
- F.0 rate limiter  content + moderation verbs. Read-only uncapped.
- F.0 hardware gate  manifest-declared minimums.
- F.1 GoToSocial + F.5 Pixelfed  same Mastodon API; verb taxonomy
  transfers cleanly across all three.

Human-in-the-loop moderation:

- Inline (rate-limited): mastodon_block_user, mastodon_mute_user,
  mastodon_block_domain (user-scoped), mastodon_report_remote.
- Queued (operator confirms in Nest within 72h): mastodon_defederate
  (admin /api/v1/admin/domain_blocks with severity silence/suspend/noop),
  mastodon_import_blocklist.
- Media prune surfaced as tootctl recipe rather than HTTP invocation
  (Mastodon's deliberate API omission).

Image tag policy:

- ghcr.io/mastodon/mastodon:v4.3.0 + mastodon-streaming:v4.3.0 pinned
  at implementation time; 4.3 is the active release line.

Registry / discovery surface:

- registry/add-ons.json  entry before developer-kit.
- skills/superpowers.md  trigger row (EN+ES).
- CLAUDE.md  Skills Reference entry after lemmy.md.

Verified:

- node --check on all JS files
- bash -n on shell scripts
- MCP server boots via createMastodonServer() with no env set
- docker compose config parses with required env set
- JSON parse on manifest, package, registry
- npm run check passes

Next:

- F.8 PeerTube (video, needs S3 + transcoding policy — heaviest bundle)
- F.11 identity attestation (independent)
- F.12 cross-app bridging (F.3 Matrix + F.7 Mastodon both now present — unblocked)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant