Commit Graph

384 Commits

Author SHA1 Message Date
dcc9244d4e refactor: group use cases into DDD bounded contexts
Flat use_cases/ (44 files) + monolithic commands.rs/queries.rs
split into diary/, movies/, watchlist/, import/, auth/, users/,
integrations/, search/, person/, federation/ — each with own
commands.rs, queries.rs, and use case modules.

Inline tests extracted to sibling tests/ dirs.
2026-06-02 19:49:09 +02:00
aadad3cfb0 feat: Jellyfin/Plex auto-import via watch queue
Some checks failed
CI / Check / Test (push) Failing after 6m5s
Webhook ingestion from media servers — movies land in a pending
watch queue, user rates and confirms to create diary entries.

- domain: WatchEvent, WebhookToken models, MediaServerParser port
- adapters: jellyfin + plex parser crates, SQLite + Postgres repos
- application: ingest/confirm/dismiss/cleanup use cases, token mgmt
- presentation: webhook endpoints (bearer + query param auth),
  watch queue + integrations settings HTML pages, OpenAPI docs
- worker: WatchEventCleanupJob (daily, 30d retention)

Movie resolution deferred to confirm — single canonical path
through log_review for enrichment, poster fetch, federation.
2026-06-02 17:34:16 +02:00
6bd728fd50 feat: replace instance actor decorator with real DB row
Some checks failed
CI / Check / Test (push) Failing after 52s
Migrations (postgres + sqlite) insert a service actor with a well-known
UUID. Removes the InstanceActorUserRepo wrapper.
2026-05-30 03:16:03 +02:00
1b9a6617f3 feat: add instance actor for signed fetch (Secure Mode support)
Some checks failed
CI / Check / Test (push) Has been cancelled
2026-05-30 03:11:16 +02:00
14066ea469 chore: upgrade k-ap to 0.4.0
Some checks failed
CI / Check / Test (push) Has been cancelled
Map new fetched_at field in RemoteActor for postgres and sqlite adapters.
2026-05-30 03:00:44 +02:00
7456a18fc9 ci: add clippy component to toolchain
Some checks failed
CI / Check / Test (push) Failing after 6m14s
2026-05-30 02:29:14 +02:00
c2985dd579 ci: drop release-build, add clippy
Some checks failed
CI / Check / Test (push) Failing after 42s
2026-05-30 02:24:05 +02:00
84ddf04d28 harden federation: sanitize incoming AP content, fix error handling, tighten rate limits
Some checks failed
CI / Check / Test (push) Successful in 10m54s
CI / Release build (push) Failing after 1m20s
2026-05-29 12:23:29 +02:00
d1f9f55d4f fix: wire DeliveryRequested federation events — outbound AP delivery was broken
FederationEventBridge silently dropped DeliveryRequested events from k-ap,
so no Create/Delete/Accept activities were pushed to follower inboxes.
Reviews only reached remote instances via outbox backfill (pull), and
deletes never propagated.

Bridge now publishes FederationDeliveryRequested domain events through the
event bus; worker calls ap_service.deliver_to_inbox() to send them.
2026-05-29 12:09:02 +02:00
62ddb014d2 feat: add Gitea registry configuration to Cargo
Some checks failed
CI / Check / Test (push) Successful in 11m14s
CI / Release build (push) Has been cancelled
2026-05-29 11:49:57 +02:00
5b8f255607 docs: update README — add watchlist/profiles, fix architecture, add make targets
Some checks failed
CI / Check / Test (push) Has been cancelled
CI / Release build (push) Has been cancelled
2026-05-29 11:48:05 +02:00
c3b89f6dc6 refactor: extract business logic from handlers to application layer
Some checks failed
CI / Check / Test (push) Has been cancelled
CI / Release build (push) Has been cancelled
Move domain logic out of 7 handlers into use cases:
- activity feed: FollowingFilter construction
- user profile: social counts + pending followers
- users list: parallel local+remote actor loading
- watchlist page: local-vs-remote branching
- sync_poster: movie lookup + validation
- get_profile: avatar URL construction
- post_register: register+login orchestration

Add SocialQueryPort.{count_following,count_accepted_followers,
get_pending_followers} to AppContext behind federation feature gate.
2026-05-29 11:41:16 +02:00
2355f89bed refactor: fix all clippy warnings properly
- UserProfile struct groups display_name/bio/avatar/banner/also_known_as/profile_fields
- User::from_persistence takes UserProfile (6 args, was 11)
- PersistedReview struct for Review::from_persistence (1 arg, was 8)
- WatchlistApInput struct for watchlist_to_ap_object (1 arg, was 8)
- ActivityPubDeps struct for activitypub::wire (1 arg, was 11)
- FederationRepos type alias for wire() return types
- FeedSortBy: impl std::str::FromStr instead of inherent from_str
- postgres users.rs: row_to_user takes &PgRow like sqlite
- collapse nested ifs in multipart handlers
- type alias for complex return types (image-converter, worker)
- tui: allow large_enum_variant at crate level (pre-existing, unrelated)
2026-05-29 11:19:02 +02:00
68a939f6c4 Refactor code for improved readability and consistency
- Simplified error handling in `PostgresApContentQuery` and `SqliteApContentQuery` by aligning the formatting of `try_get` calls.
- Removed unnecessary line breaks and improved formatting in various repository implementations for better readability.
- Consolidated imports in `lib.rs` and `factory.rs` to maintain a cleaner structure.
- Enhanced consistency in async function signatures across multiple files.
- Updated test helpers and use cases to streamline code and improve clarity.
- Refactored `InMemory` repositories to enhance readability by aligning method implementations.
2026-05-29 10:58:44 +02:00
412ab12695 feat: add Makefile for local development checks and formatting 2026-05-29 10:58:20 +02:00
36d15e1344 fix: AP bugs — backfill mapping, review activity type, also_known_as parse
- BackfillRequested now maps to BackfillFollower domain event (not FollowAccepted);
  worker calls run_backfill_for_follower to send LOCAL content to new follower inbox,
  instead of incorrectly trying to import from an inbox URL as if it were an outbox
- reviews broadcast as Create activity instead of Add (semantically correct)
- also_known_as JSON parse failure logs warning + preserves raw string as single-element
  vec instead of silently returning empty
2026-05-29 10:54:11 +02:00
624cfe5799 feat: migrate k-ap 0.1.10→0.3.1, fix AP gaps
- split FederationRepository into FollowRepository, ActorRepository, BlocklistRepository, ActivityRepository
- RemoteActor: 5 new fields (bio, banner_url, followers_url, following_url, also_known_as)
- ApObjectHandler split: get_local_objects_page/count_local_posts → ApContentReader trait
- builder API: positional args → named setters
- broadcast_create_note/update_note: add ApVisibility + mentioned_inboxes params
- backfill_outbox → import_remote_outbox
- ApUser: also_known_as Option<String> → Vec<String>, new fields

AP gaps fixed:
- add GET /users/{id}/followers + /following with content negotiation
- wire EventPublisher into builder via FederationEventBridge adapter
- add display_name field full stack (domain→DB→API→AP)
- DB-side outbox pagination (get_local_reviews_page)
- set featured_url on ApUser
2026-05-29 10:42:53 +02:00
bace54c552 fix
Some checks failed
CI / Check / Test (push) Failing after 49s
CI / Release build (push) Has been skipped
2026-05-28 17:06:26 +02:00
4ebd593293 feat: add OpenAPI doc for update_profile_fields endpoint
Some checks failed
CI / Check / Test (push) Failing after 43s
CI / Release build (push) Has been skipped
Add ProfileFieldDto and UpdateProfileFieldsRequest to api-types,
annotate update_profile_fields_handler with utoipa::path, register
in UsersDoc. Coverage now 100%.
2026-05-28 04:03:41 +02:00
51bd580a04 watchlist backfill
Some checks failed
CI / Check / Test (push) Failing after 57s
CI / Release build (push) Has been skipped
2026-05-28 03:52:38 +02:00
b3e7a42d2f fix: remove stale activitypub-base COPY from Dockerfile
Some checks failed
CI / Check / Test (push) Failing after 44s
CI / Release build (push) Has been skipped
2026-05-25 09:46:36 +02:00
410e25a562 chore: bump k-ap to v0.1.3, drop direct activitypub_federation dep
Some checks failed
CI / Release build (push) Has been cancelled
CI / Check / Test (push) Has been cancelled
2026-05-25 09:45:47 +02:00
ca8fdb33ba fix: resolve movies-diary compile errors after k-ap migration
Some checks failed
CI / Check / Test (push) Failing after 44s
CI / Release build (push) Has been skipped
2026-05-17 23:12:03 +02:00
6efc47a891 chore: replace local activitypub-base with k-ap git dep 2026-05-17 23:06:20 +02:00
f80d3b5983 docs/ci: note unit tests in README, gate release build to master
Some checks failed
CI / Check / Test (push) Failing after 43s
CI / Release build (push) Has been skipped
2026-05-14 00:43:07 +02:00
edc1f6c850 feat: domain mocks, TestContextBuilder, use case tests, factory pattern
- Add test-helpers feature to domain crate with in-memory mocks and panic stubs for all ports
- Add TestContextBuilder to application crate for zero-database test setup
- Add unit tests for log_review, register, login, add_to_watchlist, delete_review use cases
- Extract DatabaseAdapters factory and build_* helpers into presentation/src/factory.rs
- Refactor wire_dependencies() in main.rs to use factory module
2026-05-14 00:41:25 +02:00
e41d85bd7e feat: show user avatars on /users page
All checks were successful
CI / Check / Test / Build (push) Successful in 24m46s
2026-05-13 23:45:19 +02:00
19171806b9 fmt
Some checks failed
CI / Check / Test / Build (push) Has been cancelled
2026-05-13 23:38:57 +02:00
7415b91e23 ci: add GitHub/Gitea Actions workflow
Some checks failed
CI / Check / Test / Build (push) Failing after 2m6s
2026-05-13 23:35:05 +02:00
25cd6c9294 fix: handle absolute poster URLs from federated instances in templates 2026-05-13 23:32:08 +02:00
c420826474 fix: update tests for expanded User profile signature 2026-05-13 23:27:36 +02:00
5edac78add fix: redirect to user-specific following list after follow action 2026-05-13 23:23:47 +02:00
fdd61ae701 feat: refactor user profile handling and integrate ApProfileField structure 2026-05-13 22:59:38 +02:00
815178e6a4 feat(ap): ActivityPub spec compliance and profile completeness
Phase 1 — spec compliance:
- Add AS_PUBLIC constant; add to/cc fields to CreateActivity, DeleteActivity,
  UpdateActivity, AddActivity; populate on all broadcast call sites
- Add @context to outbox CreateActivity items
- Set manuallyApprovesFollowers: true to match actual Pending follow flow
- Gate PermissiveVerifier behind FEDERATION_DEBUG env var
- Add updated timestamp to Person actor JSON
- Improve actor update delivery logging

Phase 2a Batch 1 — AP layer:
- Add /inbox shared inbox route; add endpoints.sharedInbox to Person
- Paginate followers and following collections (20/page, OrderedCollectionPage)

Phase 2a Batch 2 — profile completeness:
- DB migrations: banner_path, also_known_as columns; user_profile_fields table
- ProfileField value object; UserProfileFieldsRepository port
- Banner image upload (stored via image-converter, surfaced as image in Person)
- alsoKnownAs field in Person (account migration support)
- Custom profile fields (up to 4 PropertyValue attachments in Person)
- Profile settings UI: banner preview/upload, alsoKnownAs input, fields form
- PUT /api/v1/profile/fields API endpoint
2026-05-13 22:21:41 +02:00
0a97fe5544 feat: update calamine dependency version to 0.35 in importer 2026-05-13 11:17:13 +02:00
7d4c1454f0 feat: add watchlist entry events and update NATS subject mapping 2026-05-13 01:55:12 +02:00
10fcc27339 feat: update dependencies and improve code formatting in worker tests
Co-authored-by: Copilot <copilot@github.com>
2026-05-13 01:38:33 +02:00
bc6c767c29 feat: follow-by-handle form on following and users pages 2026-05-13 01:35:54 +02:00
20e70325c6 feat: add FollowBackfillHandler to worker 2026-05-13 01:34:04 +02:00
e92c6789d9 feat: add backfill_outbox to ActivityPubService and ActivityPubPort 2026-05-13 01:32:14 +02:00
ca9a504632 feat: wire event_publisher through activitypub::wire() 2026-05-13 01:30:30 +02:00
2567103587 feat: publish FollowAccepted event when remote accepts follow 2026-05-13 01:28:03 +02:00
b1d4b4de2d feat(sqlite): persist outbox_url, implement get_following_outbox_url 2026-05-13 01:24:57 +02:00
5cd7409491 feat(postgres): persist outbox_url, implement get_following_outbox_url 2026-05-13 01:24:34 +02:00
1b41e7c1f5 fix: handle FollowAccepted in NATS subject router 2026-05-13 01:23:08 +02:00
faeac18126 feat: add outbox_url to RemoteActor, get_following_outbox_url to FederationRepository 2026-05-13 01:20:48 +02:00
80983f1ff2 feat: add FollowAccepted domain event 2026-05-13 01:17:26 +02:00
7c08e4a942 feat: enhance watchlist handling with entry discriminator and update broadcast methods 2026-05-13 00:45:44 +02:00
31fbb79451 refactor: remove watchlist repository references and add get_remote_watchlist use case 2026-05-13 00:34:23 +02:00
53df90ab1f feat: MovieDto enrichment, movie detail page, PWA, watchlist, watchlist federation 2026-05-13 00:23:45 +02:00