Commit Graph

5002 Commits (b79e871de817e352dadc5ff1ebf0f5e6a6ae5d55)
 

Author SHA1 Message Date
renovate[bot] b79e871de8
Update dependency typescript to v5.6.2 (#5098)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] d925a7611b
Update dependency ts-jest to v29.2.5 (#5089)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] 435b207105
Update Rust crate serde_with to v3.11.0 (#5095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] 5008aa7c76
Update Rust crate serde_with to v3.10.0 (#5094)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] f17cd0a6f9
Update Rust crate regex to v1.11.0 (#5093)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] cfe2d1b18d
Update Rust crate actix-web-prom to 0.9.0 (#5091)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] 6e5130378d
Update rust-futures monorepo to v0.3.31 (#5090)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] 4012e35081
Update Rust crate rustls to v0.23.14 (#5083)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] 2fed70f692
Update Rust crate html2text to v0.12.6 (#5081)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] f39b0992c5
Update Rust crate clap to v4.5.19 (#5080)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
Nutomic 7c2445efe7
Resolve links to remote posts into local URL (#5057)
* move code to new file

* rewrite markdown links (fixes #2987)

* add missing file

* add helper fn

* also convert post.url

* simplify search.rs

* clippy

* also rewrite user/community links in markdown

* Call from apub handlers, cleanup

* no network requests in test

* clippy

* fix tests

* serial

* test

* no mut

* add api test

* fix api test
2 weeks ago
Dessalines 432d46c1aa
Adding a get_random_community endpoint. (#5042)
* Adding a get_random_community endpoint.

- Fixes #4698

* Fixing issue from main.

* Adding ListingType to the query.

* More concise query filter.
2 weeks ago
netbrum 483bdd592e
Replace `clippy::unwrap_used` in tests (#5064)
* Add LemmyResult to session_middleware tests

* Add LemmyResult to inboxes tests

* Add LemmyResult to slurs tests

* Add LemmyResult to markdown tests

* Add LemmyResult to rate_limiter tests

* Add LemmyResult to error tests

* Add LemmyResult to api_common utils tests

* Add LemmyResult to request tests

* Add LemmyResult to claims tests

* Propagate registration_applications errors

* Remove clippy::unwrap_used from community tests

* Add LemmyResult to community_view tests

* Add LemmyResult to db_schema post tests

* Add LemmyResult to site_aggregates tests

* Add LemmyResult to private_message tests

* Add LemmyResult to activity tests

* Add LemmyResult to federation_allowlist tests

* Add LemmyResult to comment_aggregates tests

* Add LemmyResult to post_report tests

* Add LemmyResult to moderator tests

* Add LemmyResult to community_aggregates tests

* Add LemmyResult to person_aggregates tests

* Add LemmyResult to language tests

* Add LemmyResult to post_aggregates tests

* Add LemmyResult to db_schema comment tests

* Add LemmyResult to actor_language tests

* Add LemmyResult to vote_view tests

* Add LemmyResult to registration_application_view tests

* Add LemmyResult to private_message_view tests

* Add LemmyResult to private_message_report_view tests

* Add LemmyResult to post_report_view tests

* Add LemmyResult to comment_report_view tests

* Add LemmyResult to sitemap tests

* Replace .expect() with .unwrap()

* Format code

* Remove clippy::unwrap_used from activity tests

* Add diesel result in db_schema tests

* Format code

* Map to_bytes() error to LemmyErrorType

* Remove clippy::unwrap_used from error tests

* Removing a few more unwraps, and cleaning up language code.

* Replace map_err with unwrap_or_default

* Replace ok_or with and_then

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
2 weeks ago
Dessalines ffb94fde85
Adding local site settings to reject federated upvotes or downvotes. (#5038)
* Adding local site settings to reject federated upvotes or downvotes.

- Should help defend against downvote spamming instances.
- Fixes #4086

* Adding new vote mode types.

* Simpler activitypub vote check.

* Adding undo vote for failed vote mode check.

* Update crates/api_common/src/utils.rs

---------

Co-authored-by: Nutomic <me@nutomic.com>
2 weeks ago
Dessalines e3edc317be
Add modlog entries for bulk removals. (#5050)
* Add modlog entries for bulk removals.

- Added unit tests for removal / restore to api_common/utils.
- Fixes #4699

* Address PR comments.

* Combining remove and restore functions.

* Trigger build.

* Trigger build 2.

* Changing allow to expect.
2 weeks ago
Nutomic 338344dbc5
Attempt to fix test for fetching deeply nested comment (#5072)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2 weeks ago
renovate[bot] 0bc548cd5f
Update dependency @types/jest to v29.5.13 (#5071)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
renovate[bot] 1518aed929
Update Rust crate async-trait to v0.1.83 (#5065)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2 weeks ago
Dessalines c3f0a216bd
Changing renovate to run on the weekends. (#5067)
- Lemmy builds take a long time, and the current schedule only runs for
  about 4 hours once a month, and renovate also rate-limits itself to
  ~ 2 per hour. This gives it a large enough window, without clogging
  up my runner machines.
2 weeks ago
renovate[bot] 8d269fc08e
Update Rust crate tracing-actix-web to v0.7.13 (#5070)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
3 weeks ago
renovate[bot] 12275da318
Update Rust crate sitemap-rs to v0.2.2 (#5069)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
3 weeks ago
renovate[bot] 777992e829
Update Rust crate reqwest to v0.12.8 (#5068)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
3 weeks ago
renovate[bot] 0fcbd25ad5
Update Rust crate clap to v4.5.18 (#5066)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
3 weeks ago
Nutomic 44dda08b13
Avoid stack overflow when fetching nested comments, reduce max comment depth to 50 (#5009)
* Avoid stack overflow when fetching deeply nested comments

* add test case

* reduce comment depth, add docs

* decrease

* reduce max comment depth to 50

* fmt

* clippy

* cleanup
3 weeks ago
Nutomic 5115ed4c09
Handle partial settings backup (fixes #4307) (#5063)
* Handle partial settings backup (fixes #4307)

* clippy
3 weeks ago
Dessalines f7d881ac78
Adding skip_serializing_none to another OAuth API request. (#5060) 3 weeks ago
Nutomic e82f72d3c8
Avoid breaking changes, keep response fields as deprecated (#5058) 3 weeks ago
Joseph Silva 50ce7961d1
Apply scheduled post limit to future posts instead of past posts, and verify this in test (#5054)
* test scheduled_post_count

* fix syntax error

* fix formatting

* fix argument order

* fix user_scheduled_post_count function
3 weeks ago
SleeplessOne1917 33cbd95b7e
Add skip_serialize_none to OAuth structs with option fields (#5046)
* Add skip_serialize_none to OAuth structs with option fields

* PR feedback

* Remove serde and ts export from SSO db-only structs
3 weeks ago
Nutomic f6a24e133a
Replace clippy allow annotation with expect (fixes #5012) (#5048) 3 weeks ago
Nutomic 61a02482ff
Cleanup remaining use of Result<bool, Error> (fixes #4862) (#5047) 3 weeks ago
Dessalines 0fab5bed24
Add ability to search for Community by its description (or title only). (#5044)
- This changes the post_title_only for Search to title_only, since its
  also used in the community query now.
- Fixes #4785
3 weeks ago
Dessalines a65be776e3
Remove redundant local_user.auto_expand setting. (#5041)
- Fixes #4643

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
3 weeks ago
Nutomic 9eee61dd06
Post scheduling (fixes #234) (#5025)
* Post scheduling (fixes #234)

* clippy

* replace map_err with inspect_err

* ignore unpublished posts in read queries

* add api test

* fmt

* add some checks

* address some review comments

* allow updating schedule time

* rewrite scheduled task

* fmt

* machete

* compare date in sql, more filters

* check for community ban in sql

* remove api test (scheduled task only runs every 10 mins)

* remove mut

* add index

* remove Post::read impl

* fmt

* fix

* correctly handle changes to schedule time

* normal users can only schedule up to 10 posts
3 weeks ago
Nutomic bab5c93062
Conditionally hide comments on nsfw posts (fixes #4237) (#5028)
* Conditionally hide comments on nsfw posts (fixes #4237)

* fix test
3 weeks ago
Dessalines d476d32200
Removing a few more Result<bool> . (#4977)
* Removing a few more Result<bool> .

* Running taplo fmt.

* Running fmt.

* Adding email taken test.

* Fixing tests.

* Adding back in missing admin check.

* Rename check_has_local_followers function.
4 weeks ago
Dessalines 62e1790ae7
Adding saved_only, liked_only, and disliked_only filters to search. (#5034)
* Adding saved_only, liked_only, and disliked_only filters to search.

- Fixes #4547

* Removing duplicate Url return type for search (was actually post).

- This now works like the post_title_only filter.

* Address PR comments.

* Add saved_only post_view test.
4 weeks ago
Nutomic a8843335a6
Simplify handling of NotFound SQL errors (fixes #4633) (#5031)
* Simplify handling of NotFound SQL errors (fixes #4633)

* fmt

* wip

* compiling

* clippy

* api tests

* fix
4 weeks ago
Dessalines 458bb60144
Get rid of a lot of pointless mut form initializations. (#5037)
* Get rid of a lot of pointless mut form initializations.

- Fixes #5036

* Fix clippy.
4 weeks ago
Sander Saarend 25df9d255b
Always save remote image data (#4875)
* Always save remote image data

* cleanup

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
4 weeks ago
Nutomic 8cdfc148d7
Ignore zero values when setting rate limits (fixes #4280) (#5029)
* Ignore zero values when setting rate limits (fixes #4280)

Havent bothered to add an error message for such an uncommon case.

* fmt

* reorder, add test
4 weeks ago
Nutomic ad75192bae
Remove TypedBuilder in favor of derive_new (fixes #4863) (#5020)
* Remove TypedBuilder in favor of derive_new (fixes #4863)

* fix

* fix
4 weeks ago
Dessalines 5a722146b5
Upgrading to rust 1.81 (#5032) 4 weeks ago
leoseg dbb8f9553a
Unittest for Search by title only (#5033)
* added test for search by title only

* formatted rust files
4 weeks ago
Nutomic 89745bb37d
Add category to RSS feeds (fixes #3446) (#5030) 4 weeks ago
Freakazoid182 43f20881cb
Feature/custom emoji and tagline views (#4580)
* Add custom_emoji list route

* Add tagline list route

* Apply linting

* Remove unecessary TaglineView

* Add category filter for custom emoji

* Add create tagline endpoint

* Add update tagline endpoint

* Add delete tagline endpoint

* Format through lint.sh

* Remove custom_emojis and taglines from site resource

* Get random tagline on site requets

* Impl Crud for Tagline

Remove superfluous properties

* Move tagline endpoints under /admin

* Impl Crud for CustomEmoji

* Remove delete from tagline and custom emoji impls

* Check  markdown for tagline

* Validate markdown on tagline

* Make content fields non optional

Add error types for tagline validation

* Use process_markdown instead of process_markdown_opt

* Consolidate Tagline error types

* Remove unecessary clone

* Updat misleading comments

* Remove local_site_id from tagline and custom_emoji

* Update TaglineInserForm and TaglineUpdateForm

* Add ignore_page_limits for custom emojis

EmojiPicker needs to be able to retrieve all emojis in 1 call

* Update custom_emoji_view

Only keep get_all als helper function calling list with paging ignored

Only order on category when filtering on category

* Removing pointless get_all fn.

* remove tagline length checks

* make fields of TaglineInsertForm and TaglineUpdateForm mandatory

* move emoji order statement

* add comment for GetSiteResponse.tagline

---------

Co-authored-by: Freakazoid182 <>
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
4 weeks ago
Nutomic 026e23cf32
Simplify tests using default (#5026) 4 weeks ago
Dessalines 6b6457cc54
Adding a default_comment_sort_type column for local_site and local_user. (#4469)
* Adding a default_comment_sort_type column for local_site and local_user.

- Renamed SortType to PostSortType in the DB and code.
- Renamed references to default_sort_type to default_post_sort_type.
- Fixes #4128

* Renaming migration to current date.

* Simplifying PostSortType.
4 weeks ago
Dessalines 2b3fd70afd
Adding ability to restore content on user unban. (#4845)
* Adding ability to restore content on user unban.

- Fixes #4721

* Fixing api tests.

* Fix package.json

* Fixing lemmy-js-client dep.

* Adding API test for restoring content.
1 month ago
privacyguard b26aaac523
SSO Support (#4881)
* Added OAUTH2 OIDC support

* Fixes and improvements based on review feedback

* use derive_new::new instead of TypedBuilder

* merge migrations into a single file

* fixes based on review feedback

* remove unnecessary hostname_ui config

* improvement based on review feedback

* improvements based on review feedback

* delete user oauth accounts at account deletion

* fixes and improvements based on review feedback

* removed auto_approve_application

* support registration application with sso

* improvements based on review feedback

* making the TokenResponse an internal struct as it should be

* remove duplicate struct

* prevent oauth linking to unverified accounts

* switched to manually entered username and removed the oauth name claim

* fix cargo fmt

* fix compile error

* improvements based on review feedback

* fixes and improvements based on review feedback

---------

Co-authored-by: privacyguard <privacyguard@users.noreply.github.com>
1 month ago