Commit graph

4967 commits

Author SHA1 Message Date
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
Dessalines 5a722146b5
Upgrading to rust 1.81 (#5032) 2024-09-19 17:00:20 -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 ff939e04fd
Removing embedded pict-rs. (#5023)
Some reasons for removing this:

- Even as an optional dependency, it locks us to many specific versions
  of rust deps.
- Pict-rs is a large app that can and should be run in on its own.
- Violates the philosophy of separation of concerns.
2024-09-16 11:08:18 -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 ef5e2d96cd
Fixing woodpecker warnings 1. (#5011) 2024-09-10 17:42:20 -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
renovate[bot] f98b15511a
chore(deps): update rust crate derive-new to 0.7.0 (#4995)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 16:47:16 +00:00
renovate[bot] 5683d5ed7a
chore(deps): update pnpm to v9.9.0 (#4994)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 12:30:05 +00:00
renovate[bot] b1afd98d29
chore(deps): update dependency @types/node to v22.5.1 (#4991)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 09:40:23 +00:00
renovate[bot] f617227f0d
chore(deps): update dependency ts-jest to v29.2.5 (#4990)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 06:41:42 +00:00
renovate[bot] fa94a5869e
chore(deps): update dependency eslint to v9.9.1 (#4992)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 03:11:01 +00: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
dullbananas 101476df87
Make scripts work in path that contains spaces (#4986) 2024-08-22 17:33:00 +02: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
Dessalines 128e78f7c2 Version 0.19.6-beta.4 2024-08-08 20:01:58 -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
Dessalines 88fbcea246 Version 0.19.6-beta.3 2024-08-06 10:32:41 -04:00
Dessalines eff87b2764
Upgrading arm image. (#4962) 2024-08-05 22:25:18 -04:00