Commit Graph

35 Commits (29ceaac84068c85c9fe404dac921364a9d210dff)

Author SHA1 Message Date
Eugen Rochko 5d8398c8b8
Add E2EE API ()
Eugen Rochko 988b0493fe
Add more tests for ActivityPub controllers ()
Eugen Rochko 5edff32733
Change delivery failure tracking to work with hostnames instead of URLs ()
ThibG bd684e25d9 Fix incoming federation in whitelist mode ()
… posting to the AP inbox required a logged-in local user…
abcang 059945c97c Improve status pin query ()
ThibG 53071389ee Fix multiple issues with replies collection for pages further than self-replies ()
* Fix the replies collection returning snowflakes ids rather than URIs

Fixes 

* Fix min_id in replies queries once self-replies are exhausted

* Fix `next` attribute of replies collection being nil when there are no self-replies

* Rename other_accounts param to only_other_accounts
Eugen Rochko 24552b5160
Add whitelist mode ()
Eugen Rochko c669bb42ba
Add (back) rails-level JSON caching ()
ThibG 15ddabf95a Fix caching headers in ActivityPub endpoints ()
* Fix reverse-proxy caching in public fetch mode

* Fix caching in ActivityPub-specific controllers
Eugen Rochko 5bf67ca913
Add ActivityPub secure mode ()
* Add HTTP signature requirement for served ActivityPub resources

* Change `SECURE_MODE` to `AUTHORIZED_FETCH`

* Add 'Signature' to 'Vary' header and improve code style

* Improve code style by adding `public_fetch_mode?` method
Eugen Rochko 63c7fe8e48
Refactor controllers for statuses, accounts, and more ()
Eugen Rochko 23aeef52cc
Remove Salmon and PubSubHubbub ()
* Remove Salmon and PubSubHubbub endpoints

* Add error when trying to follow OStatus accounts

* Fix new accounts not being created in ResolveAccountService
ThibG cac9110533 Cleanup various controllers ()
* Remove skip_session! as it is not supported in Rails 5

* Minor cleanup in StreamEntriesController

* Remove redundant mark_cacheable! calls
ThibG cc6e3c3900 Cache featured collections, as well as outbox, followers and following ()
ThibG 68c797bece Ensure request.body isn't emptied out before signature verification ()
Fixes 
ThibG 66d9452092 Do not try fetching keys of unknown accounts on a Delete from them ()
ysksn ed24bb2c3e Add specs for activitypub collections controller ()
* Add specs for ActivityPub::CollectionsController#show

* Raise ActiveRecord::RecordNotFound

Raising ActiveRecord::NotFound raises NameError: uninitialized constant
ActiveRecord::NotFound.
Eugen Rochko d4cf963749
Allow inbox owner to view implicitly targeted ActivityPub payload ()
Fix 
Eugen Rochko 2c1f7b2ece
Better pagination for ActivityPub outbox ()
Eugen Rochko 9110db41c5
Federate pinned statuses over ActivityPub ()
* Federate pinned statuses over ActivityPub

* Display pinned toots in web UI

Fix 

* Fix migration

* Fix tests

* Update outbox_serializer.rb

* Update remove_serializer.rb

* Update add_serializer.rb

* Update fetch_featured_collection_service.rb
abcang cf32f7da5c Fix response of signature_verification_failure_reason ()
puckipedia 8e4cf6282b Allow retrieval of private statuses (single or in outbox) using HTTP signatures ()
Akihiko Odaki 613e7c7521 Rename ResolveRemoteAccountService to ResolveAccountService ()
The service used to be named ResolveRemoteAccountService resolves local
accounts as well.
Eugen Rochko dbda87c31f
Revert ()
Eugen Rochko c10f4bdb03
Cache JSON of immutable ActivityPub representations ()
Akihiko Odaki 161c72d66d Allow to dereference Follow object for ActivityPub ()
* Allow to dereference Follow object for ActivityPub

* Accept IRI as object representation for Accept activity
ThibG dfaa219f88 Fix HTTP responses for salmon and ActivityPub inbox processing ()
* Return sensible HTTP status for ActivityPub inbox processing

* Return sensible HTTP status for salmon slap processing

* Return additional information to debug signature verification failures
Eugen Rochko f4ca116ea8 After 7 days of repeated delivery failures, give up on inbox ()
- A successful delivery cancels it out
- An incoming delivery from account of the inbox cancels it out
Eugen Rochko a187dcefa1 Instantly upgrade account to ActivityPub if we receive ActivityPub payload ()
Eugen Rochko 2db9ccaf3e Add sharedInbox to actors ()
Eugen Rochko 6e9eda5331 ActivityPub migration procedure ()
* ActivityPub migration procedure

Once one account is detected as going from OStatus to ActivityPub,
invalidate WebFinger cache for other accounts from the same domain

* Unsubscribe from PuSH updates once we receive an ActivityPub payload

* Re-subscribe to PuSH unless already unsubscribed, regardless of protocol
Eugen Rochko 6df8bd277b Set correct content-type for ActivityPub JSON ()
Eugen Rochko dd7ef0dc41 Add ActivityPub inbox ()
* Add ActivityPub inbox

* Handle ActivityPub deletes

* Handle ActivityPub creates

* Handle ActivityPub announces

* Stubs for handling all activities that need to be handled

* Add ActivityPub actor resolving

* Handle conversation URI passing in ActivityPub

* Handle content language in ActivityPub

* Send accept header when fetching actor, handle JSON parse errors

* Test for ActivityPub::FetchRemoteAccountService

* Handle public key and icon/image when embedded/as array/as resolvable URI

* Implement ActivityPub::FetchRemoteStatusService

* Add stubs for more interactions

* Undo activities implemented

* Handle out of order activities

* Hook up ActivityPub to ResolveRemoteAccountService, handle
Update Account activities

* Add fragment IDs to all transient activity serializers

* Add tests and fixes

* Add stubs for missing tests

* Add more tests

* Add more tests
Eugen Rochko a6328fc1b1 Minor ActivityPub JSON fixes ()
- Objects must have attributedTo instead of actor
- The current attribute belongs to CollectionPage, not Collection
Eugen Rochko 8c45cd0e36 Improve ActivityPub representations ()
* Improve webfinger templates and make tests more flexible

* Clean up AS2 representation of actor

* Refactor outbox

* Create activities representation

* Add representations of followers/following collections, do not redirect /users/:username route if format is empty

* Remove unused translations

* ActivityPub endpoint for single statuses, add ActivityPub::TagManager for better
URL/URI generation

* Add ActivityPub::TagManager#to

* Represent all attachments as Document instead of Image/Video specifically
(Because for remote ones we may not know for sure)

Add mentions and hashtags representation to AP notes

* Add AP-resolvable hashtag URIs

* Use ActiveModelSerializers for ActivityPub

* Clean up unused translations

* Separate route for object and activity

* Adjust cc/to matrices

* Add to/cc to activities, ensure announce activity embeds target status and
not the wrapper status, add "id" to all collections