Commit graph

44 commits

Author SHA1 Message Date
4cf0da7b60 Clippy fixes. 2022-03-30 10:58:03 -04:00
dfb0938738
GNU social compatibility (#2100)
* Use SourceCompat everywhere (better compat with other software)

* Name field should not be mandatory in Group

* also check page.cc field for community id

* add gnu social tests

* better to use option<sourcecompat>

* update gnu social tests, marked vote as "unlisted"
2022-03-24 16:33:42 +00:00
8112816e99
If viewed actor isnt in db, fetch it from other instance (#2145) 2022-03-23 21:27:51 +00:00
ef1e164cc5
Make activity queue worker count configurable, log stats (#2113) 2022-03-03 18:54:33 +00:00
a5433ebf77 Fixing unit tests. 2022-03-03 12:51:55 -05:00
762b85b27e
Reorganize federation tests (#2092)
* Reorganize apub protocol tests

* Reorder apub protocol struct members to clarify mandatory/optional fields
2022-02-17 22:04:01 +00:00
dd865c5af5
Implement instance actor (#1798)
* Implement instance actor

* wip: make site bans federate

* finish implementation and unit tests for federated bans

* start adding api tests

* fix api test

* remve site from GetCommunityResponse

* only federate site bans originating from user's home instance

* dont expose site.private_key in api
2022-02-07 19:23:12 +00:00
eea3308906
Add tests for lotide federation, make lotide groups fetchable (#2035)
* Add tests for lotide federation, make lotide groups fetchable

* Accept posts using Note type (and better error messages for tests)
2022-01-17 09:40:47 -05:00
97ebf2f6f3 Consolidate reqwest clients, use reqwest-middleware for tracing 2021-12-06 16:54:34 -06:00
35cbae61bc
Don't drop error context when adding a message to errors (#1958)
* Respond directly with LemmyError

Instrument Perform implementations for more precise traces
Use ApiError to format JSON errors when messages are present
Keep SpanTrace output in LemmyError Display impl

* Hide SpanTrace debug output from LemmyError

* Don't log when entering spans, only when leaving

* Update actix-web

* Update actix-rt

* Add newline after error info in LemmyError Display impl

* Propogate span information to blocking operations

* Instrument apub functions

* Use skip_all for more instrument attributes, don't skip 'self' in some api actions

* Make message a static string

* Send proper JSON over websocket

* Add 'message' to LemmyError display if present

* Use a quieter root span builder, don't pretty-print logs

* Keep passwords and emails out of logs

* Re-enable logging Login

* Instrument feeds

* Emit our own errors

* Move error log after status code recording

* Make Sensitive generic over the inner type

* Remove line that logged secrets
2021-12-06 09:54:47 -05:00
1579ee566f
background-jobs 0.11 (#1943) 2021-11-23 12:20:01 +00:00
a5a674a270 Add method ApubObject.verify() 2021-11-06 18:35:14 +01:00
c725514841 Change to_apub and from_apub to take by value and avoid cloning 2021-11-06 14:47:58 +01:00
2edf8ba157 Move ObjectId to library 2021-11-05 21:37:46 +01:00
969a7f2d1b Refactoring apub code 2021-11-05 21:12:10 +01:00
1c6f74cad5 Convert note.content and chat_message.content to html (fixes #1871) 2021-11-02 21:39:02 +01:00
aaaf039779 Move apub test files into tree structure 2021-10-29 16:54:19 +02:00
5ff044346f Move object and collection structs to protocol folder 2021-10-29 12:50:32 +02:00
d89156810d Move @context out of object/activity definitions 2021-10-29 12:50:32 +02:00
271785b7fb When receiving activity, dont read community from cc (for pleroma compat and better verification) 2021-10-29 12:50:30 +02:00
61189efe72
Rewrite collections to use new fetcher (#1861)
* Merge traits ToApub and FromApub into ApubObject

* Rewrite community outbox to use new fetcher

* Rewrite community moderators collection

* Rewrite tombstone
2021-10-27 12:03:07 -04:00
149a4e0de8
Breaking apub changes (#1859)
* Remove CommentInReplyToMigration

* Remove compat for RemovePostCommentOrCommunity

* Remove PublicUrlMigration

* Change type of pm to ChatMessage from Pleroma, make pm.to array

* Use person.summary instead of person.content for pleroma compat

* Also change group.content to summary

* Rewrite apub object test json to serve as nice examples

* Also add test case for parsing pleroma private message
2021-10-22 12:21:26 -04:00
dd0ba10b44
Pleroma federation2 (#1855)
* Allow fetching person from Pleroma, including test case (ref #1461)

* Added test case for parsing community from apub json

- fixed a bug with objectid (de)serialization
- fixed a bug with outbox fetching (ref #1582)

* Added apub test for post

* Ignore errors when reading community outbox (fixes #1582)

* Dont fetch community outbox/moderators during tests

* added test for lemmy comment

* Added federation test for pleroma comment

* Added html2md crate to parse comment html from pleroma (fixes #1461)

* some fixes for update_apub_test_files.sh

* Add tests for ToApub, private message, remove update script

* Delete objects from db at the end of each test
2021-10-21 13:25:35 -04:00
1aa0e1997b Major refactor, adding newtypes for apub crate
- this allows moving FromApub/ToApub traits into apub lib
2021-10-20 12:28:09 +02:00
f24999027e Merge crates db_schema and db_queries 2021-10-20 12:28:08 +02:00
b96ce81f89
Move code to apub library (#1795)
* Remove dependency of apub_lib on LemmyContext

* Move ApubObject trait to library

* Reorganize files in apub lib

* Move ActorType, signatures, activity_queue to apub library
2021-10-06 16:20:05 -04:00
527eefbe92
Rewrite fetcher (#1792)
* Use new fetcher implementation for post/comment

* rewrite person fetch to use new fetcher

* rewrite community to use new fetcher

* rename new_fetcher to dereference_object_id

* make ObjectId a newtype

* handle deletion in new fetcher

* rewrite apub object search to be generic

* move upsert() method out of ApubObject trait

* simplify ObjectId::new (and fix clippy)
2021-09-25 11:44:52 -04:00
353a1fe0a0
Rewrite activitypub following, person, community, pm (#1692)
* Rewrite following activities

* Rewrite person apub

* Rewrite community apub

* Rewrite private message activity sending
2021-08-12 08:48:09 -04:00
6b57d716e1 Rewrite private message apub and merge create/update 2021-07-31 22:58:11 +02:00
57b6ecaf40 Simplify lemmy_context() function (dont return errors) 2021-07-30 23:16:33 +02:00
8bb3ba4a16
Add option to disable strict allowlist (fixes #1486) (#1581)
* Add option to disable strict allowlist (fixes #1486)

* adjust docs
2021-04-21 09:36:07 -04:00
4c8f2e976e Merge remote-tracking branch 'yerba/split-api-crate' into test_merge_api_crates_reorg 2021-03-29 16:24:50 -04:00
249fcc5066 Split api crate into api_structs and api 2021-03-25 20:19:40 +01:00
3ca2453fc6 Merge branch 'main' into move_matrix_and_admin_to_person 2021-03-24 11:51:34 -04:00
c884510173 Creating default DB forms. Fixes #1511 2021-03-20 16:59:07 -04:00
4f54108a9c Merge branch 'main' into federated-moderation 2021-03-19 17:11:34 +01:00
4f7dca7c2b Fix three federation test cases 2021-03-18 17:02:15 +01:00
71067a8cb5 For FromApub trait, use is_mod_action: bool instead 2021-03-16 18:26:19 +01:00
de14636e10 Fix code to allow sticky/lock from remote moderators 2021-03-12 16:46:36 +01:00
9cb4dad4b4 A first pass. 2021-03-10 23:43:11 -05:00
ddf4a667b1 ~80% done 2021-03-10 17:33:55 -05:00
3bdd78f341 Rename lemmy_structs to lemmy_api_structs 2021-03-01 14:08:41 +01:00
3d578f9df2
Use Url type for ap_id fields in database (fixes #1364) (#1371) 2021-01-27 11:42:23 -05:00
3b64c58198 Move most code into crates/ subfolder 2021-01-20 16:21:27 +01:00
Renamed from lemmy_apub/src/objects/private_message.rs (Browse further)