Wykres commitów

281 Commity (master)

Autor SHA1 Wiadomość Data
Alain St-Denis 8a4863fcd3 Merge branch 'fix-CVE-2024-23832' into todos-and-issues 2024-02-16 11:50:42 -05:00
Alain St-Denis e476a0b8e0 catch potential payload forgery (CVE-2024-23832). 2024-02-16 11:47:57 -05:00
Alain St-Denis 3f98f1e04e Select the img tag title property over the alt property for embedded images. Adjust the corresponding test. 2024-02-11 08:33:32 -05:00
Alain St-Denis d7e6a56eb6 AP mention finding and marking now also relying on the url property which is expected to be set as the remote_url property of the client app profiles.
Add the url property to some tests.
The get_profile function now expected to OR the query fields.
2023-07-23 08:50:40 -04:00
Alain St-Denis b1bc8e7295 Improve URL pattern.
Make find_elements more robust.
Move process_text_links tests to the client app.
2023-07-18 07:16:33 -04:00
Alain St-Denis 33366802c4 Move process_text_links back to the client app. Skip related tests. Convert it to BeautifulSoup. Remove unused imports. 2023-07-16 07:13:56 -04:00
Alain St-Denis 24f5bb21a9 Fix some tests and fix code that was failing tests. Catch HTML signatures with invalid padding. 2023-07-10 14:39:55 -04:00
Alain St-Denis e0993a7f7f Switch to BeautifulSoup for content processing. Outbound rendered content is now provided by the client app. Mark inbound AP HTML content hashtags and mentions. Fix missing href attribute crashing process_text_links. 2023-07-08 07:34:44 -04:00
Alain St-Denis 41785c2fdc Refactor jsonld context management. Move LD signing to entities/activitypub. Move jsonld document_loader caching to __init__.py. Fix tests. 2023-03-24 18:34:15 -04:00
Alain St-Denis 52c96532dc Update http signatures processing 2023-01-21 15:35:48 +00:00
Alain St-Denis 9df803dafe Render Activitypub outbound payloads with calamus. 2023-01-07 15:59:38 +00:00
Alain St-Denis 58c8f95e54 Add audio and video media objects and much more. 2022-08-19 17:01:44 +00:00
Jason Robinson f512d8a9dc Make IDE linter happier in some touched files 2020-12-27 23:04:55 +02:00
Jason Robinson 0bfadd059e Additional test while hunting for the image delivery bug 2020-12-27 22:59:40 +02:00
Jason Robinson 33c6edac7f Fix wrongly linkified image urls with markdown AP content
When we get a Markdown source in AP, we prefer that over HTML. Our linkifying of urls however should not be run in this case, we want the markdown to be as it was sent.

Fixes broken images between Socialhome instances.
2020-12-27 22:59:21 +02:00
Jason Robinson e55f13a117 Fix tests 2020-12-27 17:24:27 +02:00
Jason Robinson c469f74e29 Fix tests 2020-12-24 22:21:20 +02:00
Jason Robinson d52c21e8bc Identify Matrix AS payloads 2020-12-24 00:06:27 +02:00
Jason Robinson 524e5efbfd Add Django views for the Matrix appservice transactions 2020-12-23 23:30:05 +02:00
Jason Robinson 01dac38921 Add configuration for Matrix appservice registration file
Includes a function to print it out in YAML.

Currently requires Django configured.
2020-12-21 23:09:29 +02:00
Jason Robinson 6b93e325a9 Fix some tests for newer Python version 2020-12-20 03:10:29 +02:00
Jason Robinson 836e19b40d Remove the network utils `fetch_host_ip_and_country` and `fetch_country_by_ip`
The library that was used starting to require an API key.
2020-12-20 02:59:17 +02: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
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 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 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 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 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 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 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 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 55a3d7c3fc Implement fetching of ActivityPub profiles by handle
Using webfinger.

Refs: https://git.feneas.org/socialhome/socialhome/issues/522
2019-11-03 01:03:45 +02:00
Jason Robinson b69a35b597 Refactoring of webfinger fetching into a more central location 2019-11-03 00:37:10 +02:00