Commit Graph

19 Commits

Author SHA1 Message Date
78daca0377 chore: upgrade k-ap to 0.4.0
Some checks failed
test / unit (push) Has been cancelled
lint / lint (push) Has been cancelled
Map new fetched_at field in RemoteActor, read last_fetched_at from DB.
2026-05-30 03:00:43 +02:00
be27fe04e2 docs: sync README with actual features, fix default port to 8000
Some checks failed
lint / lint (push) Failing after 9m25s
test / unit (push) Successful in 16m42s
- Add missing features: profile fields, custom CSS, visibility
  levels, CW/sensitive, feed sort/filter, popular tags, account
  migration
- Fix top friends limit: 5→8
- Default PORT 3000→8000 in code, README, and .env.example
- Deduplicate frontend env docs, update contributing section
2026-05-29 14:31:17 +02:00
9798a1d829 refactor: type safety + dedup cleanup across 13 code smells
Some checks failed
test / unit (push) Has been cancelled
lint / lint (push) Has been cancelled
- typed PagedResponse/CreatedApiKeyResponse/NotificationSummaryResponse replace json! blocks
- extract TagRow/ApiKeyRow/OutboxRow to module level, top_friend uses sqlx flatten
- add should_broadcast() helper, inline dead let bindings in federation_event
- add UploadContext struct, extract_upload_field, wants_activity_json helpers
- rename PostgresFederationRepository→PgFederationRepository, PostgresApUserRepository→PgApUserRepository
- add IntoAnyhow trait replacing ~30 .map_err(|e| anyhow!(e)) calls
- extract build_ap_service shared between bootstrap and worker factories
- add postgres/constants.rs, PartialEq+Eq on PasswordHash
2026-05-29 12:02:03 +02:00
84edf58de6 fix(federation): fix 27 AP bugs, gaps, and inconsistencies
Some checks failed
lint / lint (push) Failing after 9m26s
test / unit (push) Successful in 16m3s
Round 1 — 18 bug fixes:
- remote likes/boosts now persist in engagement tables
- intern_remote_actor uses name@domain, expanded username to VARCHAR(255)
- PgRemoteActorRepository upsert/find now handles all fields
- update_following_status no longer a no-op, count_followers counts all
- accept/reject follow publishes event before DB mark (atomicity)
- fetch_outbox_page follows pagination via next links
- actor URL canonicalized to /users/{uuid}
- content_to_html escapes single quotes
- WebFinger accepts application/ld+json type
- try_from_ap accepts Article and Page object types
- feed SQL uses parameterized viewer UUID instead of format!
- content cap raised from 500 to 5000 chars
- also_known_as changed from Option<String> to Vec<String>
- connections fetch always triggers from page 1

Round 2 — 9 gap fixes:
- on_announce_removed handler deletes boost row on Undo(Announce)
- on_update handles Person/Service/Group actor profile updates
- sync_remote_actor_to_user syncs remote_actors → users on create/update
- FederationBlockPort: block_by_username sends Block activity to remote
- domain RemoteActor gains inbox_url, shared_inbox_url fields
- remote_actors attachment column (JSONB) with read/write
- .well-known/host-meta endpoint
- 256KB body limit on AP inbox routes
- outbox cleanup job (7-day retention, hourly sweep)
2026-05-29 11:28:40 +02:00
5b4b747dd7 feat(federation): enrich RemoteActor with bio, banner, followers/following URLs
Some checks failed
lint / lint (push) Failing after 9m25s
test / unit (push) Has been cancelled
Bumps k-ap to 0.3.1 which adds bio, banner_url, followers_url,
following_url, and also_known_as to RemoteActor. These are populated
from fetched actor JSON at follow/ingest time so followers and following
listings no longer return null profile fields.

Adds migration 015 for the new remote_actors columns, updates all JOIN
queries in postgres-federation to select and return the new fields, and
maps them through k_ap_actor_to_domain.

Also fixes clippy: remove empty line after doc comment in port.rs.
2026-05-29 04:07:52 +02:00
bd370776fe refactor: simplify function signatures and improve code readability
Some checks failed
lint / lint (push) Failing after 9m6s
test / unit (push) Has been cancelled
2026-05-29 03:47:29 +02:00
ecb61f9b8f feat: add federation processed activities table and update dependencies
Some checks failed
test / unit (push) Has been cancelled
lint / lint (push) Has been cancelled
- Created a new SQL migration to add the `federation_processed_activities` table with an index on `processed_at`.
- Updated dependencies in `Cargo.toml` files across `bootstrap` and `worker` crates, including version updates for `k-ap`.
- Enhanced the event publishing mechanism in the `factory.rs` file to include a new `KapPublisher` for handling federation events.
- Refactored the `build` function in `factory.rs` to accommodate the new event publisher and improve ActivityPub service initialization.
- Modified the worker's main loop to handle new federation event types and improved error handling for event processing.

Co-authored-by: Copilot <copilot@github.com>
2026-05-29 03:47:06 +02:00
d68c628335 refactor: delegate mark_follower_accepted/rejected through k-ap service, remove federation_repo from ApFederationAdapter 2026-05-28 02:45:59 +02:00
9c93baaa39 fix(bootstrap,worker): pass shared federation_repo to ApFederationAdapter 2026-05-28 02:26:57 +02:00
ff75361eb1 feat: bump k-ap to v0.1.9 and implement migrate_follower_actor 2026-05-28 01:43:06 +02:00
5ca5ad9561 feat: update k-ap dependency to v0.1.8 and enhance middleware for ActivityPub requests 2026-05-28 01:08:45 +02:00
f6893b19dc feat: update dependencies to k-ap v0.1.7 and add profileHref utility for user links 2026-05-27 23:38:14 +02:00
01932cf337 feat: add image upload for avatar and banner 2026-05-24 02:06:47 +02:00
1874954ad7 fix: resolve thoughts compile errors after k-ap migration 2026-05-17 23:02:49 +02:00
6936b7ce62 chore: switch activitypub-base to k-ap git dep 2026-05-17 22:47:32 +02:00
d56d34cc27 refactor: replace long arg lists with input/config structs and builder
- Thought::new_local → NewThought struct (7 args → 1)
- UserWriter::update_profile → UpdateProfileInput struct (6 args → 2)
- update_profile use case → UpdateProfileInput (8 args → 3)
- ActivityPubService::new → builder pattern (9 args → 5 required + 4 optional setters)
- accept_note → AcceptNoteInput struct (8 args → 1)
- ThoughtNote::new_public → ThoughtNoteInput struct (8 args → 1)

Remove all #[allow(clippy::too_many_arguments)] annotations.
2026-05-17 12:25:53 +02:00
d813e59b5c fmt 2026-05-17 12:04:51 +02:00
bb48819cad feat: implement federation post/connections backfill schedulers
schedule_actor_posts_fetch now spawns backfill_outbox in background,
fetching all pages of a remote outbox and persisting via accept_note.
schedule_connections_fetch follows AP collection next-links, resolves
profiles, and caches them in the DB. Both were no-ops ("deferred").

Add connections_repo field to ActivityPubService; wire both factories.
2026-05-17 11:49:53 +02:00
9aee4ceb6d feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready (#1)
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
2026-05-16 09:42:40 +00:00