Commit Graph

127 Commits (cb753b045fe90294051cc7a09855418f917dcc34)

Author SHA1 Message Date
Dessalines cb753b045f
Group imports dess (#2526)
* Group imports with rustfmt

* Running cargo fmt again.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2 years ago
Nutomic b0c3185663
Make verify apub url function async (#2514)
* Make verify apub url function async

* cleanup

* use dep from crates.io

* dont use unwrap
2 years ago
Dessalines 235cc8b228
Moving settings to Database. (#2492)
* Moving settings to Database.

- Moves many settings into the database. Fixes #2285
- Adds a local_site and instance table. Fixes #2365 . Fixes #2368
- Separates SQL update an insert forms, to avoid runtime errors.
- Adds TypedBuilder to all the SQL forms, instead of default.

* Fix weird clippy issue.

* Removing extra lines.

* Some fixes from suggestions.

* Fixing apub tests.

* Using instance creation helper function.

* Move forms to their own line.

* Trying to fix local_site_data, still broken.

* Fixing federation tests.

* Trying to fix check features 1.

* Addressing PR comments.

* Adding check_apub to all verify functions.
2 years ago
Nutomic aaaea2006c
Federate votes as private (#2501) 2 years ago
Nutomic 74bc1198ce
Dont try to send activities if federation is disabled (fixes #2499) (#2500) 2 years ago
Nutomic ec5e63b5a9
Fix check for federated mod actions (#2489) 2 years ago
Nutomic 2ef0f8f5f8
implement language tags for site/community in db and api (#2434)
* implement language tags for site/community in db and api

* add api checks for valid languages

* during db migration, update existing users, sites, communities to have all languages enabled

* init new users/communities with site languages (not all languages)

* federate site/community languages

* fix tests

* when updating site languages, limit community languages to this subset

also, when making a new post and subset of user lang, community lang
contains only one item, use that as post lang

* add tests for actor_language db functions

* include language list in siteview/communityview

* Fix some of the review comments

* Some more review changes

* Add todo about boxed query

* Add default_post_language to GetCommunityResponse
2 years ago
Dessalines c9f1407429
Diesel 2.0.0 upgrade (#2452)
* Initial commit to bump diesel to 2.0.0-rc.0 and see what happens

* Add chrono feature from diesel

* db_schema crate is close to building?

* Upgrade diesel-derive-newtype

* Mostly modifying references to connections to be mutable ones; also used
new way to do migrations as suggested by the migration guide; a lot more
compiles now, though I can't figure out this tricky ToSql issue at the
moment

* Running clippy --fix

* Trying to fix drone clippy 1

* Fix clippy

* Upgrade clux-musl

* Trying to fix drone clippy 2

* Trying to fix drone clippy 3

* Trying to fix drone clippy 5

* Adding diesel table aliases, removing sql view hack. Fixes #2101

Co-authored-by: Steven Chu <stevenc1@gmail.com>
Co-authored-by: Nutomic <me@nutomic.com>
2 years ago
Nutomic a85334c675
Handle Like, Undo/Like activities from Mastodon, add tests (fixes #2378) (#2380) 2 years ago
Dessalines c62671116c
Send websocket message on accepted follow. Fixes #2369 (#2375) 2 years ago
Dessalines a745fa6f43
Remove update and read site config. Fixes #2306 (#2329)
* Remove update and read site config. Fixes #2306

* Removing lazy_static, removing Settings::get()
2 years ago
Dessalines 4e12e25c59
Adding admin purging of DB items and pictures. #904 #1331 (#1809)
* First pass at adding admin purge. #904 #1331

* Breaking out purge into 4 tables for the 4 purgeable types.

* Using CommunitySafe instead in view

* Fix db_schema features flags.

* Attempting to pass API key.

* Adding pictrs image purging

- Added pictrs_config block, for API_KEY
- Clear out image columns after purging

* Remove the remove_images field from a few of the purge API calls.

* Fix some suggestions by @nutomic.

* Add separate pictrs reqwest client.

* Update defaults.hjson

Co-authored-by: Nutomic <me@nutomic.com>
2 years ago
Nutomic fcaf7a084c
Upgrade activitypub_federation to 0.2.0, add setting federation.debug (#2300) 2 years ago
Nutomic 7804a9d893
Accept private like (#1968) (#2301) 2 years ago
Nutomic 13ca1111c4
Remove 0.15 federation compat code (#2131) 2 years ago
Nutomic a2a594b763
Extract Activitypub logic into separate library (#2288)
* Create example for apub lib

* some rewriting of apub lib

* Add LocalInstance struct for apub lib to avoid using Lemmy Settings

* Move ActorType trait to lemmy_apub, because its not needed in library

* Use reqwest_retry instead of custom impl, dont specify timeout on every send()

* Some improvements to example

* Moved inbox handling to library

* bug fixes

* Move context and serde helpers into library

* wip: example changes

* Add lemmy_utils feature to build only LemmyError

* Rename to activitypub_federation

* Remove lemmy_utils dep from activitypub_federation using generic error type

* Finish activitypub example

* Cleanup and fix tests

* Reorganize library files

* Remove ApubObject.to_tombstone()

* Extract activitypub library into separate git repository
2 years ago
Nutomic 7b86441bab
Federate with Peertube (#2244) 2 years ago
Nutomic 3aa3d75a1e
Add cargo feature for building lemmy_api_common with mininum deps (#2243) 2 years ago
Nutomic c718882479
Accept comments with hashtags from Friendica (#2236) 2 years ago
Nutomic 8337eaefdd
Federate user account deletion (fixes #1284) (#2199) 2 years ago
Nutomic 9ac1f46a2b
Dont federate initial upvote (#2196) 2 years ago
Nutomic f9d563d80a
Add missing mod log entries for federated actions (fixes #1489) (#2198) 2 years ago
Nutomic 65cac21713
Fix verify_mod_action check for remote admin actions (#2190)
* Fix verify_mod_action check for remote admin actions

* fix federation test
2 years ago
Nutomic bfae246734
Migrate towards using page.attachment field for url (ref #2144) (#2182) 2 years ago
Nutomic 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"
2 years ago
Nutomic b406342a14
Dont log error if duplicate activity is received (fixes #2146) (#2148) 2 years ago
Nutomic 8112816e99
If viewed actor isnt in db, fetch it from other instance (#2145) 2 years ago
Nutomic 166ec196b0
Rework error handling (fixes #1714) (#2135) 2 years ago
Nutomic 7d61616dff
Revert "Add logging to debug federation issues (ref #2096) (#2099)" (#2130)
This reverts commit e094989a4c.
2 years ago
Nutomic f8fb3b41f0
Reject federated downvotes if downvotes are disabled (fixes #2124) (#2128) 2 years ago
Nutomic df757f28b4
Make delete activities backwards compatible with 0.15 (#2114) 2 years ago
Nutomic e094989a4c
Add logging to debug federation issues (ref #2096) (#2099) 2 years ago
Nutomic 788924d7ff
Merge different delete activities for better compatibility (fixes #2066) (#2073) 2 years ago
Nutomic 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
2 years ago
Dessalines e65c45f152
Adding temporary bans. Fixes #1423 (#1999)
* Adding temporary bans. Fixes #1423

* Adding ban_expires to person

* Fix clippy

* Removing ban_expires from federated fields.

* Trying to add expires to blockcommunity apub.
2 years ago
Aode (lion) 97ebf2f6f3 Consolidate reqwest clients, use reqwest-middleware for tracing 2 years ago
Riley 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
2 years ago
Felix Ableitner 27a687bcd0 Dont send email notifications for edited comments (fixes #1925) 3 years ago
Riley 3fea5645f8
Add tracing (#1942) 3 years ago
Dessalines 3d08e6c1fc
Adding unique constraint for activity ap_id. Fixes #1878 (#1935)
* Adding unique constraint for activity ap_id. Fixes #1878

* Removing is_activity_already_known
3 years ago
Felix Ableitner afccd5cf69 Replace activitystreams crate with activitystreams-kinds 3 years ago
Felix Ableitner 3e4fe89a45 Fix build error in #1914 3 years ago
Dessalines 6d35508f08
Merge pull request #1914 from LemmyNet/dont-announce-note
Dont announce comments, edited posts to Pleroma/Mastodon followers
3 years ago
Felix Ableitner aeb34199f5 Dont announce comments, edited posts to Pleroma/Mastodon followers 3 years ago
Felix Ableitner a2707e1c56 Community outbox should only contain activities sent by community (fixes #1916) 3 years ago
Felix Ableitner db631005d3 Fix error due to same activity being inserted in database twice 3 years ago
Felix Ableitner 3249060f67 Remove to field from follow activities 3 years ago
Aode (lion) 20cddf5e81 Support mastodon deletes 3 years ago
Felix Ableitner 7f4a773b88 Create and Note always need to tag parent creator, for mastodon notifications 3 years ago
Felix Ableitner c1f1b8aa0f Activities in community should also be sent to actors in cc 3 years ago