Commit Graph

601 Commits (cb753b045fe90294051cc7a09855418f917dcc34)

Author SHA1 Message Date
Nutomic 3053e14be7
Derive default for api request structs, move type enums (#2245)
* Derive default for api request structs, move type enums

* Simplify api by using enum types directly, instead of string

* Add default and clone for most api structs
2 years ago
Nutomic 3aa3d75a1e
Add cargo feature for building lemmy_api_common with mininum deps (#2243) 2 years ago
Nutomic dd5835fb6e
Add restricted community field to CreateCommunity, UpdateCommunity (ref #2235) (#2242) 2 years ago
Nutomic 7058cfa1cf
Implement restricted community (only mods can post) (fixes #187) (#2235)
* Implement restricted community (only mods can post) (fixes #187)

* review fixes

* fix tests
2 years ago
Nutomic c718882479
Accept comments with hashtags from Friendica (#2236) 2 years ago
Nutomic 2e01e8e42c
Remove unused dependencies (#2239) 2 years ago
Nutomic 56b7030901
Fix link metadata unit test (#2237) 2 years ago
Nutomic 3488b9aeb5
Dont return "admin" for GET user when no id/name is provided (fixes #1546) (#2233) 2 years ago
Nutomic ae84258c41
Federation: dont overwrite local object from Announce activity (#2232)
* Federation: dont overwrite local object from Announce activity (fixes #2143)

* add missing form fields

* refactoring

* add ap_id, updated fields

* fix
2 years ago
Nutomic 00b0b26dfa
Add default post listing type (fixes #2195) (#2209)
* Add default post listing type (fixes #2195)

* review fixes

* change column type
2 years ago
Dessalines 24be9f2cd5
Show deny reason to users after a failed login. Fixes #2191 (#2206)
* Show deny reason to users after a failed login. Fixes #2191

* Updating translations.

* Adding registration_denied translated string.
2 years ago
Dessalines 0a36b16e29
Fix allowlist / blocklist description location. Fixes #2214 (#2215)
* Fix allowlist / blocklist description location. Fixes #2214

* Fix allowlist check
2 years ago
Nutomic 3951a16447
Split apart api files (#2216) 2 years ago
Nutomic e0381df88a
Expose remote site info in GetCommunity API (fixes #2208) (#2210)
* Expose remote site info in GetCommunity API (fixes #2208)

* use instance_actor_id_from_url()
2 years ago
Dessalines 3d8709780a
Fixing unstable post sorts. Fixes #2188 (#2204) 2 years ago
Nutomic bbd739af9b
Change Person, Instance types (#2200) 2 years ago
Nutomic b47a474863
Merge branch 'main' into clippy_fix_2 2 years ago
Nutomic fed73a72c1
Write mod log for federated sticky/lock post actions (#2203) 2 years ago
Dessalines 0bcdfa8be4 Clippy fixes. 2 years ago
Dessalines c232564fda Version 0.16.3 2 years ago
Dessalines 4878848955 Version 0.16.3-rc.1 2 years ago
Dessalines 4052900d30 Updating translations 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
Dessalines 37c834725c Make sure application questionaire is required. Fixes #2189
Also fix local image domain check. Was failing for blank strings /
replaces.
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 c7f5337099
Run cargo upgrade (#2176)
* Run cargo upgrade and cargo update

* Fixing validation (#2179)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2 years ago
Nutomic bfae246734
Migrate towards using page.attachment field for url (ref #2144) (#2182) 2 years ago
Nutomic 56b275acd4
Exclude removed/deleted posts from community outbox (#2184) 2 years ago
Nutomic 589d952a95
Fetch community outbox in parallel (fixes #2180) (#2181) 2 years ago
Dessalines 4cf0da7b60 Clippy fixes. 2 years ago
Nutomic ad7e6d99ed
Add email translations (#2175) 2 years ago
Dessalines d5a213760d Version 0.16.2 2 years ago
Dessalines f7fa1f10f9 Updating translations. 2 years ago
Dessalines 7bb8069224 Version 0.16.2-rc.3 2 years ago
Nutomic 610120067c
Add test files for Friendica federation (fixes #2144) (#2167) 2 years ago
Dessalines e16821116e
Lowering search rate limit. Fixes #2153 (#2154)
* Lowering search rate limit. Fixes #2153

* Adding a search rate limit.

* Forgot to add the websocket search rate limit

* Fix wrong op
2 years ago
Dessalines d49565e030
Rate limit ws joins (#2171)
* Removing async on mutex lock fn.

* Removing redundant ip

* Don't check rate limit twice.
2 years ago
Dessalines a11b5b107d Version 0.16.2-rc.2 2 years ago
Dessalines f2a0841586
Rate limit websocket joins. (#2165)
* Rate limit websocket joins.

* Removing async on mutex lock fn.

* Removing redundant ip

* Return early if check fails.
2 years ago
Nutomic a5ff629b24
Dont log errors when rate limit is hit (fixes #2157) (#2161)
* Dont log errors when rate limit is hit (fixes #2157)

* Clone service rather than http request

* some cleanup/refactoring

Co-authored-by: Aode (Lion) <asonix@asonix.dog>
2 years ago
Dessalines c681bb79b1 Version 0.16.2-rc.1 2 years ago
Dessalines 2da0684e95 Removing check_only 2 years ago
Dessalines ed9f70276d Fix rate limit check for register. Fixes #2159 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
Dessalines 1e9f609cdb
Consolidate and lower reqwest timeouts. Fixes #2150 (#2151) 2 years ago
Nutomic 83e996111e
Check that config is valid before saving (#2152) 2 years ago
Nutomic b406342a14
Dont log error if duplicate activity is received (fixes #2146) (#2148) 2 years ago
Nutomic cb44b14717
WIP: Email localization (fixes #500) (#2053)
* Allow email localization (fixes #500)

* add PersonAggregates::default()

* add lemmy-translations submodule

* fix gitmodules
2 years ago
Nutomic 8112816e99
If viewed actor isnt in db, fetch it from other instance (#2145) 2 years ago
Dessalines 4e6d901649 Show rate limit algorithm. Fixes #2136 2 years ago
Nutomic a10bf7d410
Adjust retry interval for sending activities (#2141) 2 years ago
Nutomic bcf7ec6109
Forbid remote URLs for avatars/banners (fixes #1618) (#2132) 2 years ago
Nutomic 166ec196b0
Rework error handling (fixes #1714) (#2135) 2 years ago
Dessalines 514e2301b5 Version 0.16.1 2 years ago
Dessalines 9fd6a48e3c Version 0.16.1-rc.1 2 years ago
Nutomic 7d61616dff
Revert "Add logging to debug federation issues (ref #2096) (#2099)" (#2130)
This reverts commit e094989a4c.
2 years ago
Nutomic 550a93aed9
Dont allow admin to add mod to remote community (#2129) 2 years ago
Nutomic f8fb3b41f0
Reject federated downvotes if downvotes are disabled (fixes #2124) (#2128) 2 years ago
Dessalines 05f20da51f Version 0.16.0 2 years ago
Dessalines 82dec1911f Version 0.16.0-rc.4 2 years ago
Nutomic 660efd1549
Correctly read local SiteView (#2122) 2 years ago
Dessalines 15ff832c4a Version 0.16.0-rc.3 2 years ago
Nutomic 3c5275638f
Increase default worker count (#2120) 2 years ago
Dessalines ffd2ba5d90
Fix community rss. Fixes #2116 (#2119)
Co-authored-by: Nutomic <me@nutomic.com>
2 years ago
Nutomic fbadb2d7bd
Try to fix federation test on ci (#2121) 2 years ago
Dessalines aef2abb962 Version 0.16.0-rc.2 2 years ago
Nutomic df757f28b4
Make delete activities backwards compatible with 0.15 (#2114) 2 years ago
Nutomic ef1e164cc5
Make activity queue worker count configurable, log stats (#2113) 2 years ago
Nutomic fa29ffade1
Add timeout for sending activities (#2112)
* Add timeout for sending activities

* Also set request timeouts in utils/src/request.rs
2 years ago
Dessalines a5433ebf77 Fixing unit tests. 2 years ago
Rob Ede e3153df74d
Remove direct `actix-http` dependency 2 years ago
Rob Ede b06f3eb32e
Update `actix-*` dependencies to stable v4. 2 years ago
Dessalines 1b5037e92d Version 0.16.0-rc.1 2 years ago
dayinjing bc3927a9bd
Show nsfw communities if you are logged in and searching communities (#2105)
* Show nsfw communities in logged in and you've enabled nsfw in your profile atleast

* Reuse existing user check

Co-authored-by: Sun Wukong <monkey@king.com>
2 years ago
Nutomic 63565712ad
Fix resending activities (fixes #1282) (#2109) 2 years ago
Nutomic fb4c47d602
Dont hardcode site id in Site::update (#2110) 2 years ago
RedLobster999 348077c3de
send plain-text in email along with html (#2107)
* send plain text in email along with html

* format the code using "cargo +nightly fmt"

Co-authored-by: kittiphat-kang <kittiphat.nu@easysunday.com>
2 years ago
Nutomic 9f5183fe98
Add site option for default theme (#2104) 2 years ago
dayinjing 7f9b55e793
Hide community v2 (#2055)
* Initial working of hiding communities and adding a db entry for mod log

* Return mod log for hidden communities

* Clean up hidding communities PR

* use lower case like other migration files

* Formatting fix

* pass in admin id to list, make match logic the same in post_view as community_view. Dont force non null for reason

* Clean PR review stuff

* Change person_id to mod_person_id on hide community table

* Make bools optional, add a space for formating

Co-authored-by: Thor Odinson <odinson@asgard.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2 years ago
Nutomic 762b85b27e
Reorganize federation tests (#2092)
* Reorganize apub protocol tests

* Reorder apub protocol struct members to clarify mandatory/optional fields
2 years ago
Nutomic e094989a4c
Add logging to debug federation issues (ref #2096) (#2099) 2 years ago
Nutomic 5a8c894359
Upgrade to Rust 2021 edition (#2093)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
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
Nutomic f1aef63149
Use doku(skip) for opentelemetry_url config value (ref #2085) (#2091) 2 years ago
Aode (Lion) 1546e5fd0d Merge remote-tracking branch 'lemmynet/fix_sitemetadata_test' into asonix/document-opentelemetry-url 2 years ago
Dessalines 609d2b99f7 Fix site metadata test. 2 years ago
Aode (lion) 6058b11f6e Add comment about opentelemetry_url 2 years ago
Dessalines 6b1894faf0
Alpha-ordering community follows. Fixes #2062 (#2079) 2 years ago
Nutomic 545fe8d0dd
Add federation tests for Friendica, improve parsing of source field (fixes #2057) (#2070) 2 years ago
Nutomic 4a23ee4d8b
Dont make webfinger request when viewing community/user profile (fixes #1896) (#2049) 2 years ago
Dessalines d83a53e905
Fixing private instance check. Fixes #2064 (#2065) 2 years ago
Kradyz 1c5c02e1bf
Case-insensitive username at login (#2010)
* Case-insensitive username at login

* formatting

Co-authored-by: Kradyz <k@radiz.nl>
2 years ago
Dessalines e36ad9d984
Removing the site creator, adding leave_admin. Fixes #1808 (#2052)
* Removing the site creator, adding leave_admin. Fixes #1808

* Making sure there's at least one admin. Fixing unit tests
2 years ago
Dessalines 1372827b41
Adding starttls support. Fixes #1997 (#2051)
* Adding starttls support. Fixes #1997

* Change name to tls_type, make a string
2 years ago
Nutomic 2544341e47
Put community last in webfinger response (fixes #2037) (#2047) 2 years ago
Nutomic 16f98261f8
Dont check for ban in MarkCommentAsRead (fixes #2045) (#2054) 2 years ago
Dessalines 16271b0a4c
Empty post bodies (#2050)
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.

* Revert "Using .map() instead."

This reverts commit a2f4907209.
2 years ago
Nutomic f23fed70bc
Add tombstone tests, better test errors (#2046) 2 years ago
vpzomtrrfrt 272dc3e7a6
Accept single object as to for arrays too (#2048) 2 years ago
Dessalines 19ccaf767c
Cleaning optional post bodies. Fixes #2039 (#2043)
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.
2 years ago
Dessalines a212f6b780
Fixing liking comment on blocked person. Fixes #2033 (#2042) 2 years ago
Nutomic 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)
2 years ago
Riley bc8ed1e6da
Remove unneeded dependency on activitystreams (#2034) 2 years ago
Dessalines f53902ecff Version 0.15.1 2 years ago
Dessalines bccb4f068d Version 0.15.0 2 years ago
Dessalines a24676e629 Version 0.15.0-rc.7 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
Riley 41b90bb162
Add console-subscriber (#2003)
* Add console-subscriber

* Add larg event buffer capacity

* Add console port to lemmy prod container

* Expose pict-rs console port

* Update pictrs
2 years ago
Riley 3032a2745b
Opentelemetry (#1992)
* Add otlp export

* Add jaeger to dev docker

* More instrument

* Update deps

* Merge from main.

* Add comment about viewing traces

* Fixing reqwest-tracing dep.

* Update pre-commit regex

* Move imports to top

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2 years ago
Rens Groothuijsen 661f97a073
Use correct encoding when fetching non-UTF-8 site metadata (#2015)
* Use correct encoding when fetching non-UTF-8 site metadata

* Style fixes
2 years ago
Dessalines bd31475dba Adding a banned endpoint for admins. Removing it from GetSite. Fixes #1806 2 years ago
Rob Ede 1943bcd7f5
Prevent panic on InboxRequestGuard 2 years ago
Rob Ede f6c13cf313
Updated actix-web dependency to `4.0.0-beta.18` 2 years ago
Dessalines 3065154f4e
Merge pull request #2007 from LemmyNet/another_tokenizer_fix
Trying another tokenizer fix. #1964
2 years ago
Kradyz 9f64872d5a
Case-insensitive webfinger response. Fixes #1955 & #1986 (#2005)
* Make webfinger case insensitive

* Make webfinger case insensitive

* Case insensitive domain name

* Case-insensitive webfinger

* formatting

Co-authored-by: Kradyz <k@radiz.nl>
2 years ago
Dessalines ad4715c2a3 Trying another tokenizer fix. #1964 2 years ago
Dessalines c883a49a40
First pass at invite-only migration. (#1949)
* First pass at invite-only migration.

* Implement email verification (fixes #219)

* remove unwrap

* Adding views and functionality to registration application. #209

* Add private instance site column, and back end checks.

* Adding some message fields to LoginResponse

* Adding private instance to site setup.

* A few additions:

- Add a DeleteAccount response.
- RegistrationApplicationView now has the safe LocalUserSettings.
- Adding VerifyEmail to websocket API, added a proper response type.

* Adding and reorganizing some email helpers.

* A few fixes for private sites:

- Added a check_registration_application function.
- Only send a verification email if its been changed.
- VerifyEmail now returns LoginResponse.
- Deleting the old tokens after a successful email verify.
- If port is missing on email config, display a better error message.

* Version 0.15.0-rc.3

* Adding published to email_verification table.

* Adding fixes from comments.

* Version 0.15.0-rc.4

* Adding modlog private site check.

* Version 0.15.0-rc.6

Co-authored-by: Felix Ableitner <me@nutomic.com>
3 years ago
Dessalines 1410c5659c
Upgrading deps (#1995) 3 years ago
Dessalines 4a46dc805f
Trying out an upgraded version of html5ever. #1964 (#1991)
* Trying out an upgraded version of html5ever. #1964

* New release of webpage.
3 years ago
Dessalines 161d41999d
Adding min setup password length to the docs. Fixes #1989 (#1990) 3 years ago
Nutomic c6ac606f60
Test pleroma follow (#1988)
* Add test case for Pleroma follow activity (ref #1984)

* Use WithContext in apub tests where possible
3 years ago
Riley 0ed3856ef1
Remove awc (#1979)
* Remove unused awc dep

* Replace awc pict-rs client with reqwest

* Reinstate 30 second pict-rs timeout
3 years ago
Aode (lion) 5b3d707d8f Use from_message for static error string 3 years ago
Aode (lion) 97ebf2f6f3 Consolidate reqwest clients, use reqwest-middleware for tracing 3 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
3 years ago
Dessalines 4e9ecb2632
Allow comment replies from blocked users. Fixes #1793 (#1969)
* Allow comment replies from blocked users. Fixes #1793

* Clearer check block.
3 years ago
Dessalines 040770d7ba
Fix retry infinite loops. Fixes #1964 (#1967)
* Fix retry infinite loops. Fixes #1964

* Moving retry_limit to settings
3 years ago
Colin Reeder e2baed9a6d
Add lotide activities to tests 3 years ago
Colin Reeder a91c0c8feb
Allow single item for to, cc, and @context 3 years ago
Dessalines ad76c75821
Trying to add docker:latest. Fixes #1959 (#1960)
* Trying to add docker:latest. Fixes #1959

* Version 0.14.4-rc.3

* Trying to fix clippy on crate build

* Version 0.14.4-rc.4
3 years ago
Dessalines be65b6869f
Merge pull request #1937 from LemmyNet/disable-edit-email-notifications
Dont send email notifications for edited comments (fixes #1925)
3 years ago
Dessalines e765b42d46
Adding a captcha rate limit. Fixes #1755 (#1941)
* Adding a captcha rate limit. Fixes #1755

* Changing to post rate limit.
3 years ago
Felix Ableitner 27a687bcd0 Dont send email notifications for edited comments (fixes #1925) 3 years ago
Dessalines 97b8b9c255 Version 0.14.3 3 years ago
Dessalines 7f01d8cde6 Version 0.14.2 3 years ago
Dessalines b1f7bad0a3 Version 0.14.2-rc.1 3 years ago
Dessalines 46c7429429
Fixing duped report view for admins. Fixes #1933 (#1945)
* Fixing duped report view for admins. Fixes #1933

* Fixing tests.
3 years ago
Dessalines d2e28e5f38
Adding a GetComment endpoint. Fixes #1919 (#1944) 3 years ago
Dessalines 451818749b
Fix min title char count for post titles. Fixes #1854 (#1940)
* Fix min title char count for post titles. Fixes #1854

* Adding more newline checks for actors.

* Adding helper function
3 years ago
Dessalines 86b2901e8c
Adding MarkPostAsRead to API. Fixes #1784 (#1946)
* Adding MarkPostAsRead to API. Fixes #1784

* Adding error
3 years ago
Riley 1579ee566f
background-jobs 0.11 (#1943) 3 years ago
Riley 3fea5645f8
Add tracing (#1942) 3 years ago
Dessalines 88c7b95d03
Remove pointless community follower sort. (#1939) 3 years ago
Dessalines 3e062a9959
Merge pull request #1938 from LemmyNet/once_cell
Use once_cell instead of lazy_static
3 years ago
Felix Ableitner e88106cef4 Use once_cell instead of lazy_static 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
Dessalines 05d43150bc Making public key required. Fixes #1934 3 years ago