about summary refs log tree commit diff
path: root/app/services/fetch_remote_status_service.rb
AgeCommit message (Collapse)Author
2023-02-10Fix unbounded recursion in post discovery (#23506)Claire
* Add a limit to how many posts can get fetched as a result of a single request * Add tests * Always pass `request_id` when processing `Announce` activities --------- Co-authored-by: nametoolong <nametoolong@users.noreply.github.com>
2019-12-18Fix an error when ActivityPub::FetchRemoteStatusService url is called with ↵Takeshi Umeda
nil (#12652)
2019-12-17Clean up OStatus-related codepaths (#12173)ThibG
* Remove “protocol” argument and return value, as only ActivityPub is supported * Remove FetchRemoteAccountService, only use ActivityPub::FetchRemoteAccountService * Fix tests
2019-07-10Refactor fetching of remote resources (#11251)Eugen Rochko
2019-07-06Remove Salmon and PubSubHubbub (#11205)Eugen Rochko
* Remove Salmon and PubSubHubbub endpoints * Add error when trying to follow OStatus accounts * Fix new accounts not being created in ResolveAccountService
2017-12-12Change conditional to avoid nil into string error in sidekiq (#5987)Renato "Lond" Cerqueira
* Change conditional to avoid nil into string error in sidekiq When obtaining information about users with mastodon in a different subdomain, sidekiq was giving out a 'no implicit conversion of nil into String' * Use presence instead of blank? with ternary. Following suggestion on PR
2017-10-13Fix remote status fetching for “pure” ActivityPub WEB_ACCOUNT users (#5372)ThibG
Remote ActivityPub users that have never been known as OStatus users (whether or not they support it) will not have a “remote_url” attribute set. In case they reside on an instance with WEB_DOMAIN ≠ LOCAL_DOMAIN, the current check did rely on “remote_url” to verify the user's domain.
2017-10-04Validate id of ActivityPub representations (#5114)Akihiko Odaki
Additionally, ActivityPub::FetchRemoteStatusService no longer parses activities. OStatus::Activity::Creation no longer delegates to ActivityPub because the provided ActivityPub representations are not signed while OStatus representations are.
2017-09-19Introduce OStatus::TagManager (#5008)Akihiko Odaki
2017-08-14Add support for searching AP users (#4599)Yamagishi Kazutoshi
* Add support for searching AP users * use JsonLdHelper
2017-08-14Hook up URL-based resource look-up to ActivityPub (#4589)Eugen Rochko
2017-07-20Fix webfinger retries (#4275)Eugen Rochko
* Do not raise unretryable exceptions in ResolveRemoteAccountService * Removed fatal exceptions from ResolveRemoteAccountService Exceptions that cannot be retried should not be raised. New exception class for those that can be retried (Mastodon::UnexpectedResponseError)
2017-07-15Optimize uri normalization (#4212)ThibG
* Add dependency on idn-ruby to speed up URI normalization * Use normalized_host instead of normalize.host when applicable When we are only interested in the normalized host, calling normalized_host avoids normalizing the other components of the URI as well as creating a new object
2017-07-10Rescue exceptions related to Goldfinger at FetchRemoteStatusService (#4138)abcang
2017-05-03Fix #2706 - Always respond with 200 to PuSH payloads (#2733)Eugen Rochko
Fix #2196 - Respond with 201 when Salmon accepted, 400 when unverified Fix #2629 - Correctly handle confirm_domain? for local accounts Unify rules for extracting author acct from XML, prefer <email>, fall back to <name> + <uri> (see also #2017, #2172)
2017-04-27Improve shared status verification (#2525)Eugen Rochko
* Instead of parsing shared status contents verbatim, make roundtrip to purported original URL. Confirm that the "original" URL is from the same domain as the author it claims to be from. * Fix obvious typo, add comment * Use URI look-up first * Add test, update Goldfinger dependency to make less useless HTTP requests per Webfinger lookup
2017-04-25Punycode URI normalization (#2370)Eugen
* Fix #2119 - Whenever about to send a HTTP request, normalize the URI * Add test for IDN request in FetchLinkCardService * Perform IDN normalization on domains before they are stored in the DB
2017-03-22Fix full-text search query quotation, improve tag search performance with an ↵Eugen Rochko
index, add ability to open status by URL from search (fix #53)
2016-11-15Fix rubocop issues, introduce usage of frozen literal to improve performanceEugen Rochko
2016-11-13Force utf-8 encoding when processing XMLEugen Rochko
2016-11-06Add test for FanOutOnWriteServiceEugen Rochko
2016-10-20Fix method return when rescuingEugen Rochko
2016-10-05Fix typoEugen Rochko
2016-10-05Catching more exceptions that slipped through, removing AR logging fromEugen Rochko
production as it's very verbose and not very useful
2016-09-29Improve code styleEugen Rochko
2016-09-26Fix #54 - Fetch remote accounts by URL from mentionsEugen Rochko
Fetching atom extracted from FetchRemoteAccountService and FetchRemoteStatusService into FetchAtomService. Mentions of the constant "http://activityschema.org/collection/public" skipped as it's not a real URL/user.
2016-09-21Fix #24 - Thread resolving for remote statusesEugen Rochko
This is a big one, so let me enumerate: Accounts as well as stream entry pages now contain Link headers that reference the Atom feed and Webfinger URL for the former and Atom entry for the latter. So you only need to HEAD those resources to get that information, no need to download and parse HTML <link>s. ProcessFeedService will now queue ThreadResolveWorker for each remote status that it cannot find otherwise. Furthermore, entries are now processed in reverse order (from bottom to top) in case a newer entry references a chronologically previous one. ThreadResolveWorker uses FetchRemoteStatusService to obtain a status and attach the child status it was queued for to it. FetchRemoteStatusService looks up the URL, first with a HEAD, tests if it's an Atom feed, in which case it processes it directly. Next for Link headers to the Atom feed, in which case that is fetched and processed. Lastly if it's HTML, it is checked for <link>s to the Atom feed, and if such is found, that is fetched and processed. The account for the status is derived from author/name attribute in the XML and the hostname in the URL (domain). FollowRemoteAccountService and ProcessFeedService are used. This means that potentially threads are resolved recursively until a dead-end is encountered, however it is performed asynchronously over background jobs, so it should be ok.