Commit Graph

1356 Commits

Author SHA1 Message Date
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
2024-09-30 20:27:14 -04:00
Nutomic
5115ed4c09
Handle partial settings backup (fixes #4307) (#5063)
* Handle partial settings backup (fixes #4307)

* clippy
2024-09-30 20:21:06 -04:00
Dessalines
f7d881ac78
Adding skip_serializing_none to another OAuth API request. (#5060) 2024-09-27 11:15:44 -04:00
Nutomic
e82f72d3c8
Avoid breaking changes, keep response fields as deprecated (#5058) 2024-09-27 09:23:19 -04:00
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
2024-09-27 08:51:10 -04:00
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
2024-09-26 10:24:51 +02:00
Nutomic
f6a24e133a
Replace clippy allow annotation with expect (fixes #5012) (#5048) 2024-09-24 13:29:02 -04:00
Nutomic
61a02482ff
Cleanup remaining use of Result<bool, Error> (fixes #4862) (#5047) 2024-09-24 13:25:33 -04:00
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
2024-09-24 13:24:28 -04:00
Dessalines
a65be776e3
Remove redundant local_user.auto_expand setting. (#5041)
- Fixes #4643

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-09-24 08:55:09 -04:00
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
2024-09-24 05:39:40 -04:00
Nutomic
bab5c93062
Conditionally hide comments on nsfw posts (fixes #4237) (#5028)
* Conditionally hide comments on nsfw posts (fixes #4237)

* fix test
2024-09-24 10:33:53 +02:00
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.
2024-09-23 20:55:35 -04:00
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.
2024-09-23 11:27:06 -04:00
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
2024-09-23 11:26:50 -04:00
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.
2024-09-23 12:05:18 +02:00
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>
2024-09-23 09:58:49 +02:00
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
2024-09-20 14:43:04 +02:00
Nutomic
ad75192bae
Remove TypedBuilder in favor of derive_new (fixes #4863) (#5020)
* Remove TypedBuilder in favor of derive_new (fixes #4863)

* fix

* fix
2024-09-20 08:15:25 -04:00
leoseg
dbb8f9553a
Unittest for Search by title only (#5033)
* added test for search by title only

* formatted rust files
2024-09-19 17:00:07 -04:00
Nutomic
89745bb37d
Add category to RSS feeds (fixes #3446) (#5030) 2024-09-19 09:43:58 -04:00
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>
2024-09-19 05:15:04 -04:00
Nutomic
026e23cf32
Simplify tests using default (#5026) 2024-09-19 04:43:27 -04:00
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.
2024-09-19 10:03:58 +02:00
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.
2024-09-18 09:11:42 -04:00
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>
2024-09-18 14:52:33 +02:00
Nutomic
6454a4d43d
Remove enable nsfw (#5017)
* Remove `local_site.enable_nsfw` in favor of `site.content_warning` (fixes #4627)

* cleanup usage of SiteView::read_local

* test

* uppercase
2024-09-16 11:18:16 -04:00
Dessalines
5febf2b8fb
Adding clearurls crate to clean tracking params from links and markdown. (#5018)
* Adding clearurls crate to clean tracking params from links and markdown.

- Thanks to @jenrdikw for creating this
- Fixes #4905

* Upgrading to new version of clearurls

* Fix clippy
2024-09-16 11:15:41 -04:00
Dessalines
987e3f8026
Upgrading webmention to 0.6.0, removes native-tls (#4976) 2024-09-16 10:11:02 +02:00
Carlos Cabello
fa192f16bd
Add option to search exclusively by post title (#5015)
* Add option to search exclusively by post title

* Address format issues

* Remove duplicated 'removed' filter

* Replace url_search with search_term

* Build generic PostQuery before search match

* Create default queries. Move title_only to Search struct. Rename Url to PostURL

* Revert PostUrl to Url
2024-09-16 09:59:09 +02:00
Nutomic
dea6ee462c
Upgrade http crate (#5006)
* Remove opentelemetry

* remove unused deps, use backtrace

* always print db migration messages regardless of log level (fixes #4725)

* fix ci

* Remove useless root span builder

* Upgrade http and opentelemetry crates

* more fixes

* cleanup

* use release

* upgrade more deps
2024-09-12 05:49:09 -04:00
Dessalines
a6220537b5
Increase bio max length from 300 to 1000. (#5014)
- Fixes #4972
2024-09-11 15:27:16 +00:00
Sander Saarend
fbb3960c36
Image proxy fixes (#4871)
* Fix remote image urls

* Remove unnecessary URL decode

* Removing the proxy changes.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2024-09-11 10:11:25 -04:00
Nutomic
fc13009611
In debug mode allow resolving objects without auth (#5013) 2024-09-11 08:53:24 -04:00
Dessalines
d1866cbd04
Remove pointless block_views. (#4841)
- Fixes #4793
2024-09-10 14:32:12 -04:00
Dessalines
84794714da
Removing local_user.show_scores column, since its now on the (#4497)
local_user_vote_display_mode table.

- See https://github.com/LemmyNet/lemmy/pull/4450
2024-09-10 14:27:17 -04:00
Nutomic
c90ee3094d
Remove opentelemetry (#4741)
* Remove opentelemetry

* remove unused deps, use backtrace

* always print db migration messages regardless of log level (fixes #4725)

* fix ci

* Remove useless root span builder

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-09-10 13:36:03 -04:00
Dessalines
ef49a0eb8d
Changing list_logins to return a ListLoginsResponse object. (#4888)
- Fixes #4873
2024-09-10 12:41:30 +02:00
Dessalines
c8ad0f2d09
Remove pointless local_user_id from LocalUserVoteDisplayMode (#4890)
- Fixes #4866
2024-09-10 12:39:45 +02:00
Nutomic
234f5c2060
Remove nonstandard field expires from apub block activity (ref #2316) (#4542)
* Migrate apub block activity to standard `endTime` property (fixes #2316)

* Remove nonstandard apub field `expires` (ref #2316)
2024-09-10 12:35:58 +02:00
Joseph Silva
ae3df4db72
Replace "post" with "comment" in comment_report_view.rs (#4989) 2024-08-31 22:36:47 -04:00
Dessalines
d479bb96c6 Version 0.19.6-beta.7 2024-08-27 16:32:08 -04:00
flamingos-cant
bd1b7aa6ef
Let federation modify groups (#4937)
* Don't check if group is local

* Add API test for mods modifying communities
2024-08-20 16:16:14 +02:00
Dessalines
2913cdf556 Version 0.19.6-beta.6 2024-08-19 19:44:13 -04:00
Dessalines
6b9e5ecb48 Version 0.19.6-beta.5 2024-08-15 08:50:27 -04:00
Richard Schwab
76a2c6e79b
Fix scheduled task to delete users with denied applications (#4907)
After an admin interacted with an application it can only be accepted or denied.
Denial reasons are not required by Lemmys backend, even though they're mandatory in Lemmy-UI, and therefore they are not a reliable indicator of an application being denied.
This aligns the cleanup logic  with the logic used for the unread application count.
2024-08-13 18:54:56 -04:00
Dessalines
254ef6dab3
Make site metadata fetch endpoint require auth. (#4968)
* Make site metadata fetch require auth.

* Update crates/api/src/post/get_link_metadata.rs

Co-authored-by: dullbananas <dull.bananas0@gmail.com>

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2024-08-13 16:53:05 -04:00
Richard Schwab
63a686d390
Approve applications in transaction (#4970)
* Implement tests for registration application count and list api

* Use transaction when approving applications to ensure consistent approval state
2024-08-13 16:18:26 -04:00
flamingos-cant
ea18d462b0
Throw error when non-mod posts to mod-only comm (#4966) 2024-08-13 14:56:26 -04:00
phiresky
606545ccaf
fix: Run extract_opengraph_data only on first 64kB of data and if Content-Type html (#4957)
* fix: Run extract_opengraph_data only on first 64kB of data and if data is not binary.

* use mime type for determination

* chore: simplify collect function
2024-08-07 10:35:08 -04:00