Wykres commitów

805 Commity (master)

Autor SHA1 Wiadomość Data
jaywink bbaac0383b Merge branch 'cross-protocol' into 'master'
Cross protocol improvements

See merge request jaywink/federation!161
2020-05-01 22:53:20 +00:00
Jason Robinson a29ab19166 Extract ActivityPub ID from Diaspora paylaods
Extract ActivityPub ID from Diaspora payloads if found as the `activitypub_id` property.
2020-04-25 03:18:21 +03:00
Jason Robinson e1af61794b Add AP ID to outbound Diaspora payloads
Add ActivityPub ID to outbound Diaspora payloads of types comment, post and profile,
      if an URL given as `id`.
2020-04-25 03:04:55 +03:00
Jason Robinson be89ae5453 Add Diaspora guid/handle to post/profile outbound ActivityPub
Add Diaspora extension and guid to outbound ActivityPub payloads, if available. For
      profiles, also add handle.
2020-04-25 02:44:02 +03:00
Jason Robinson 9972b9d3fb Extract Diaspora guid
Diaspora entity guid will now be extracted from ActivityPub payloads implementing the Diaspora extension.
2020-04-25 00:32:33 +03:00
jaywink b4cc7071f4 Merge branch 'inbound-ap-html' into 'master'
Stop markdownifying received ActivityPub content

Closes socialhome/socialhome#198 and socialhome/socialhome#222

See merge request jaywink/federation!160
2020-04-13 18:33:18 +00:00
Jason Robinson 9469101549 Fix tag recognition if at start of HTML paragraph 2020-04-13 21:28:22 +03:00
Jason Robinson dfaa692ea4 Add test ensuring mention classes are not stripped
By process_text_links text util.
2020-04-13 13:22:12 +03:00
Jason Robinson 7c1f1670b1 Fix tags separated by slashes not being identified
Fixes socialhome/socialhome#198
2020-04-13 12:40:35 +03:00
Jason Robinson a2653239d6 Fix some characters stopping tags being identified
Closes socialhome/socialhome#222
2020-04-13 11:46:10 +03:00
Jason Robinson f704175a21 Ensure tags are found also if wrapped within HTML blocks 2020-04-13 11:35:54 +03:00
Jason Robinson 13f0cf0db6 Stop markdownifying received ActivityPub content
It was causing more trouble than benefits. Just accept
HTML content into entities raw_content attribute and
let apps deal with it.
2020-04-12 23:32:42 +03:00
Jason Robinson 8200725e72 Add changelog for the relay fixes 2020-04-07 23:16:55 +03:00
Jason Robinson aa0ecfb680 Tune debug logging context when reporting failed AP payloads 2020-04-07 23:12:54 +03:00
Jason Robinson 898ffffff0 Skip entities in handle_send if they are of other protocol
Currently we don't support relaying entities from another
protocol to another protocol. Skip them for now to avoid
lots of errors popping up.
2020-04-07 23:07:01 +03:00
Jason Robinson bbeb9df9e7 Attempt to fix some handle_send issues
It seems sometimes AP deliveries are failing due to
an odd exception where assigning a "to" to the
payload fails with lxml related things. This seems
to indicate that some payload variable is leaking from
the diaspora payload generating to the activitypub code.

Try to ensure this wouldn't be possible to happen and
add some error context for Sentry to better identify
why this would happen, if this commit doesn't fix it.
2020-04-05 23:11:28 +03:00
Jason Robinson bdc44ac59c Don't always crash generating payloads if Django is installed but not configured 2020-02-22 01:32:19 +02:00
Jason Robinson fd63767263 Fix sharedInbox from remote ActivityPub profiles
Fix reading `sharedInbox` from remote ActivityPub profiles. This caused public payloads not
to be deduplicated when sending public payloads to remote ActivityPub servers. Refetching
profiles should now fix this.

Closes #124
2020-02-22 01:31:46 +02:00
Jason Robinson 58d092d5f3 Expand payload_logger to log also protocol and sender 2020-02-20 22:13:26 +02:00
Jason Robinson cb36a143d4 Add payload logger for handle_send and handle_create_payload
Outbound functions `handle_send` and `handle_create_payload` now accept an optional `payload_logger`
parameter. If given it should be a function that takes a `str` or `dict` payload as the only
parameter. This will be called for each generated payload.
2020-02-20 21:55:21 +02:00
jaywink b2a214ec81 Merge branch 'find-tags' into 'master'
Various improvements to outbound HTML payload rendering for ActivityPub networks

Closes socialhome/socialhome#571 and #70

See merge request jaywink/federation!159
2020-02-17 22:10:16 +00:00
Jason Robinson 529a3bc5cc Dont' crash get_name_for_profile in any situation
Because it will crash the whole payload creation.
2020-02-17 23:56:15 +02:00
Jason Robinson 26872a87c3 More stacktrace in logs when failing to generate a payload 2020-02-17 23:54:56 +02:00
Jason Robinson 721a775704 Fix debug 🤯 2020-02-17 23:40:35 +02:00
Jason Robinson 70ae9a3322 Add some debug 2020-02-17 23:31:51 +02:00
Jason Robinson 3745d72bcd Wrap outbound HTML tags in link tags
If Django configured, otherwise just keep the
text as is. Django configuration must have the
base url and tags path for making the link.

Closes https://git.feneas.org/socialhome/socialhome/issues/571
Refs https://git.feneas.org/socialhome/socialhome/issues/572
2020-02-17 22:45:23 +02:00
Jason Robinson 1e3de327c3 Wrap outbound HTML mention links in span
This is Mastodon specific, but what can we do than copy the
biggest for greater compatibility.
2020-02-17 22:16:59 +02:00
Jason Robinson 9cb2509ab6 Add replacer functionality to the find_tags utility 2020-02-17 21:58:00 +02:00
Jason Robinson b72ce5b870 Use find_tags when calculating tags from RawContentMixin.raw_content
Closes #70
2020-02-17 21:10:03 +02:00
Jason Robinson 712c6d2c46 Add `find_tags` text utility to find hashtags from text
Refs: https://git.feneas.org/socialhome/socialhome/issues/572
2020-02-17 21:05:36 +02:00
Jason Robinson 3678c520dd Add mention class to outgoing ActivityPub HTML payload mentions
This seems to be a community convention to stop mentions rendering as
links, possibly?
2020-02-16 23:20:10 +02:00
Jason Robinson 50a3e376dd Don't include OStatus for Mastodon 3.0+ protocols list
Refs: https://github.com/thefederationinfo/the-federation.info/issues/217
2020-02-16 16:35:30 +02:00
Jason Robinson 52eb8fc6cd Linkify URL's in outgoing ActivityPub payloads
Refs: #572
2020-01-26 01:21:41 +02:00
Jason Robinson 47d3d53a18 Add `process_text_links` text utility to linkify URL's in text
Moved from Socialhome.
2020-01-26 01:08:54 +02:00
Jason Robinson 5ab541440d Clarify usage of the configuration `get_profile_function`
Must be keyword arguments.
2020-01-18 02:17:35 +02:00
Jason Robinson c479a42d47 Entities with a `raw_content` field now have URL syntax mentions rendered into a link
If Django is configured, a profile will be retrieved using the configured profile
getter function and the profile name or username will be used for the link.

Refs: https://git.feneas.org/socialhome/socialhome/issues/572
2020-01-18 01:39:44 +02:00
Jason Robinson 4c665e8743 Fix some edge case crashes of `handle_send` when there are Diaspora protocol receivers 2020-01-12 23:33:49 +02:00
Jason Robinson 6bc85a3bfa Loosen validation of `TargetIDMixin`
It now requires one of the target attributes
to be set, not just `target_id`. This fixes
follows over the Diaspora protocol which broke
with stricter send validation added in 0.19.0.
2020-01-12 00:56:46 +02:00
Jason Robinson dd55916978 Fix changelog 2019-12-29 23:46:37 +02:00
Jason Robinson 71ccfb9148 Rollback Matrix port removal from hostmeta results
Change requires full support for the server discovery flow.
2019-12-29 23:46:04 +02:00
Jason Robinson 557146055c Matrix and NodeInfo2 hostmeta parsers now clean the port out of the host name 2019-12-29 23:08:05 +02:00
Jason Robinson 8c4e4a2197 Correctly identify some platforms that emulate the Mastodon API
Ensure Pixelfed, Kroeg and Kibou instances that emulate the Mastodon API don't get identified as Mastodon instances.
2019-12-29 22:57:02 +02:00
Jason Robinson 9700af7bee Don't crash on malformed NodeInfo doc
Don't crash when parsing an invalid NodeInfo document where the
usage dictionary is not following specification. Some Pleroma
instances have started writing an object there.
2019-12-29 22:28:25 +02:00
Jason Robinson 91dc3ca312 Add missing `response.raise_for_status()` call to the `fetch_document` network helper
when fetching with given URL. Error status was already being raised correctly when
fetching by domain and path.
2019-12-29 20:44:32 +02:00
Jason Robinson f6b2bb6d05 Don't crash loudly when fetching webfinger for Diaspora that does not contain XML 2019-12-15 22:55:21 +02:00
Jason Robinson 1f2fdf3459 Start new development cycle 2019-12-15 22:42:10 +02:00
Jason Robinson 3b31668a4d Release v0.19.0 2019-12-15 01:46:25 +02:00
Jason Robinson 33f1e4c707 Fix regression in outbound shares
Should never ship any code without a unit test...
2019-11-29 11:18:22 +02:00
Jason Robinson 56eeb6d371 Fix typo in handle_send fail early code 2019-11-28 22:22:39 +02:00
Jason Robinson d84a990510 Fail early in outbound `handle_send` if a payload cannot be generated
For a payload which doesn't depend on recipient attributes, no point
in looping all recipients trying.
2019-11-28 21:11:12 +02:00