Commit graph

5072 commits

Author SHA1 Message Date
3a0c1dca90
Avoid overwriting local objects via federation ()
* Dont allow federation to overwrite local objects

* is_local check in apub lib

* use imports

* fix check, update lib

* use verify_is_remote_object()

* submodule
2024-04-11 10:05:49 -04:00
dullbananas
0f6b13a4ec
Test coverage ()
* update .gitignore

* add test-with-coverage.sh

* coverage gutters extension comment

* move lcov.info to target folder

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-11 10:32:07 +02:00
64760ec960 Version 0.19.4-beta.3 2024-04-10 11:03:11 -04:00
Dessalines
555f789269
Fixing custom_thumbnail updates. ()
* Fixing custom_thumbnail updates.

* Fixing issue with image posts.

* Fixing upgrade deps script.

* Adding API tests for custom thumbnails.

* Remove pointless todo.

* Address PR comments.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 10:59:46 -04:00
Dessalines
5dea21d531
Convert all Result<..., LemmyError> into LemmyResult<...> Fixes ()
* Convert all Result<..., LemmyError> into LemmyResult<...> Fixes 

* Fixing clippy.
2024-04-10 10:14:11 -04:00
Kroese
d5622a65f8
Fix for PictrsImageMode::None ()
* Fix PictrsImageMode::None

* Update crates/api_common/src/request.rs

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>

* Fix formatting

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 10:09:54 -04:00
9059de8569
Allow fetching from local url, add fetch redirect test (fixes ) ()
* Allow fetching from local url, at fetch redirect test (fixes )

* prettier

* update lib

* update apub lib
2024-04-10 10:04:57 -04:00
0203b62a6d
Ignore old federated post edits (ref ) ()
* Ignore old federated post edits (ref )

* use filter on insert

* coalesce(updated, published)

* avoid comment conflict clause

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 10:03:51 -04:00
Dessalines
99d585b7be
Change defaults on user vote display mode to upvotes + downvotes ()
* Change defaults on user vote display mode to upvotes + downvotes

* Forgot to regenerate the rows.

* Drop and re-add columns instead.
2024-04-10 10:47:05 +02:00
b4670988b5
Change exponential backoff algorithm for federation send ()
* Limit federation send retry interval to one hour

* clippy

* avoid overflow

* change base for exp backoff

* ignore first error

* fix day duration
2024-04-09 19:33:01 -04:00
1d0a6ac08f
Avoid breaking api change, reduce api cache duration ()
* Dont mark site.public_key as `serde(skip)` to avoid breaking change (fixes )

* Reduce cache duration for api
2024-04-09 10:10:20 -04:00
Dessalines
8e54a4a6cc
Fixing bug where comment replies wouldn't be sent to blocked instances. ()
* Fixing bug where comment replies wouldn't be sent to blocked instances.

- Instance blocks should only affect communities, not comments.
- Fixes 

* Revert "Fixing bug where comment replies wouldn't be sent to blocked instances."

This reverts commit 1349aa351a.

* Only block replies from the community's instance id.

- Also refactor send_local_notifs slightly, since it has to fetch the
  community now.
- Fixes 

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-08 16:26:24 +02:00
jim-taylor-business
a14ebefd24
When env variable is set, any config file will be ignored and the default settings will be used ()
* do not panic when no config file found use defaults

* formatting

* implement env variable

* ermove commented code

* remove redundant comment

* remove redundant space

* simplify check logic

* format

* returns and messages

* correct mistake
2024-04-08 12:05:54 +02:00
Dessalines
705e86eb4c
Fixing docker release ()
* Re-add notif on tag failure.

* Upping rust version.

* Version 0.19.4-beta.1a

* Try again.

* Version 0.19.4-beta.1b

* Removing unstable inspect.

* Version 0.19.4-beta.1c

* Remove use release cache.

* Trying to fix cargo publish 1.

* Version 0.19.4-beta.1d

* Re-adding publish release

* Version 0.19.4-beta.2

* Fixing workspace for lemmy_federate
2024-04-04 16:14:59 +02:00
Dessalines
a1d632e582
Re-add notif on tag failure. () 2024-04-04 10:21:31 +02:00
087684658a
Cache result of LocalSite::read to avoid unnecessary db calls ()
* Cache result of LocalSite::read to avoid unnecessary db calls

* single const for cache duration

* clippy

* revert apub send changes

* clippy

* fmt
2024-04-03 17:38:31 -04:00
Dessalines
aaaa362b98
Remove latest tag for pgformatter. () 2024-04-03 17:29:24 -04:00
5237233f97 Version 0.19.4-beta.1 2024-04-03 16:50:35 -04:00
Dessalines
94438a8516
Removing cardano, this was never used. () 2024-04-03 10:38:57 +02:00
Dessalines
4d9c16a336
Fix private message sort order. () 2024-04-02 13:25:28 -04:00
ae9f82b452
Read crate version from cargo.toml (fixes ) () 2024-04-02 11:19:51 -04:00
dullbananas
007e9b7aab
Optimize Community::set_featured_posts ()
* Don't lock excess rows in Community::set_featured_posts

* Update community.rs

* Update community.rs

* Update community.rs

* Update community.rs
2024-04-02 11:19:04 -04:00
tracyspacy
60f9a97dfa
Fix unnecessarily duplicated notifs ()
* add check to remove duplicated notifs

* added comments
2024-03-29 17:09:19 -04:00
Dessalines
067332553d
Fixing woodpecker. () 2024-03-27 11:09:44 -04:00
a4b79ca610
Generate post thumbnail/metadata in background (ref ) ()
* Generate post thumbnail/metadata in background (ref )

* fix api test

* Apply suggestions from code review

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>

* fix test

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-27 10:54:42 -04:00
Dessalines
a632a86852
Delete a person's local images on delete account. ()
* Delete a person's local images on delete account.

* Rename purge function to delete.

* Use purge_user_account instead of Person::delete_account in purge person.

* Fixing clippy
2024-03-27 10:28:02 -04:00
85ee89f4e8
When uploading new icon/avatar/banner, delete old one () 2024-03-27 09:00:52 -04:00
Dessalines
6bfbb9332d
Adding listMedia endpoint, to view all your local image uploads. ()
* Adding listMedia endpoint, to view all your local image uploads.

- Fixes 

* Fix ts import.

* Forgot to order by published desc

* Adding an endpoint to list all images, for admins only.

* Forgot to add file.

* Add additional test.

* Use better logic for no-limit version.

* Better call sites.

* Adding another test.

* Fix tests.

* Moving list_media to /account action.

* Addressing PR comments.

* Removing pointless comment.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-26 12:06:11 -04:00
Dessalines
945064726f
Add creator_banned_from_community to vote_view. ()
* Add creator_banned_from_community to vote_view.

- Fixes 

* Adding tests.
2024-03-26 16:22:04 +01:00
Dessalines
7929e77602
Fixing issue with comment replies wrongly marked as read. ()
* Fixing issue with comment replies wrongly marked as read.

- Fixes 

* Elaborating on a comment.
2024-03-26 10:46:37 -04:00
Dessalines
95069d7648
Fixing some clippy and woodpecker lints. ()
* Fixing some clippy and woodpecker lints.

* Try fixing woodpecker 1.

* Revert "Try fixing woodpecker 1."

This reverts commit 7c2020a08d.
2024-03-26 10:17:42 +01:00
Dessalines
e4356a7701
Fixing a few broken tests from the change in LocalUser::create () 2024-03-25 19:14:35 -04:00
846848c4f6
On registration, automatically set content languages from accept-language header ()
* On registration, automatically set content languages from accept header

* no need to set site language or default language for new user anymore

* fix test

* fix langs

* avoid duplicate writing of new user languages
2024-03-25 16:02:12 -04:00
d06ef2c47e
Migrate apub block activity to standard endTime property and deprecate expires (fixes ) ()
* Migrate apub block activity to standard `endTime` property (fixes )

* add todo
2024-03-25 08:10:09 -04:00
Sander Saarend
99d01e186a
Fix rate limiter () 2024-03-25 07:56:03 -04:00
ef4bb3cc40
Add delete user field removeData to apub assets (fixes ) () 2024-03-22 18:41:59 -04:00
21547dedf7
Fix handling of apub downvote (fixes ) ()
* Fix handling of apub downvote (fixes )

* fmt

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-22 18:41:09 -04:00
baf5921d2c
Add comment about console feature requiring tokio_unstable (fixes ) () 2024-03-22 18:40:08 -04:00
SleeplessOne1917
6679b2559f
Add SleeplessOne1917 to CODEOWNERS ()
Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-03-22 18:31:45 -04:00
SleeplessOne1917
38c22d9453
Add banned_from_community to PostView and CommentView ()
* Add banned_from_community to PostView and CommentView

* Add post view test

* Add tests for CommentView

* Add tests for case where local user is not banned from community

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-03-22 18:31:08 -04:00
Tomas
78581bd696
Add ARG RUSTFLAGS into Dockerfile ()
* Add ARG RUSTFLAGS into Dockerfile 

Allows passing RUSTFLAGS through --build-arg

* Remove invalid ARG syntax
2024-03-21 16:42:30 +01:00
Dessalines
2fd81067c7
Temporarily comment sticky test. () 2024-03-18 12:54:45 +01:00
Dessalines
0f77951e05
Upgrading deps. ()
* Upgrading deps.

* Addressing PR comments
2024-03-18 10:36:49 +01:00
9d4299aaac
Dont require leading ! or @ for webfinger resolve ()
* Dont require leading ! or @ for webfinger resolve

* fmt

* clippy
2024-03-15 08:42:09 -04:00
43378c5bb3
Fix video thumbnail generation (fixes ) ()
* Fix video thumbnail generation (fixes )

* fix test
2024-03-15 08:41:16 -04:00
flamingos-cant
19a1a077c5
Add a blocklist for URLs. ()
* Add a blocklist for URLs.

* Fix SQL format

* Make clippy happy.

* Use regex for URL matching.

* Escape regex chars in URLs.

* Use post for modification.

* Make URL block regex static and remove API routes.

* Add date fields to table and use transaction.

* Use Cache for blocklist.

* Rename check_links + move list to parameters of process_markdown.

* SQL format.

* Format, again.

* Remove println.

* Add API test.

* Set a shorter lifetime for regex in debug mode.

* Add missing macro.

* Update lemmy-js-client

* Update api_test/pnpm-lock.yaml

* Don't break other tests

* Use different URL for test

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2024-03-15 07:03:29 -04:00
0e7080337b
Dont allow admins to post in community with posting_restricted_to_mods (fixes ) ()
* Dont allow admins to post in community with `posting_restricted_to_mods` (fixes )

* fmt
2024-03-14 17:31:54 -04:00
835d329134
Fix longstanding bug that breaks initial community view (fixes ) () 2024-03-14 16:57:56 -04:00
f1de7b7590
Automatically include apub hashtag with posts (fixes ) () 2024-03-14 12:16:45 -04:00
Dessalines
255e695633
Adding extra fields to PostReport and CommentReport views. ()
- Fixes 
2024-03-13 12:11:24 -04:00