Commit graph

5260 commits

Author SHA1 Message Date
renovate[bot]
e7ddb96659
Update Rust crate anyhow to v1.0.97 (#5579)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-31 23:10:42 -04:00
renovate[bot]
1632e57853
Update Rust crate actix-cors to v0.7.1 (#5577)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-31 22:08:23 -04:00
Undearius
2298bdbce0
Refined slur_regex pattern (#5567)
Removed duplicate match group and adjusted the pattern to narrow the match closer to the naughty word.
2025-03-31 21:37:52 -04:00
Felix Ableitner
7eafc43c63 Docker: Disable debug logs and backtrace for pictrs 2025-03-31 11:06:16 +02:00
Felix Ableitner
86382b9f55 Version 1.0.0-alpha.4 2025-03-31 09:48:57 +02:00
Richard Schwab
8b7b3ce072
fix removal of post.instance_id (#5562)
this was originally removed in #5546, but #5515 introduced a new usage of it.
due to the order of PR merges this slipped through and broke the build on main.

fixes #5561
2025-03-31 09:44:55 +02:00
Nutomic
192344231c
Donation dialog changes (#5552)
* Remove disable_donation_dialog option

* Option to hide donation dialog permanently

* fix
2025-03-28 09:10:54 -04:00
Nutomic
636811eb8e
Receive and store remote site bans (fixes #3399) (#5515)
* Receive and store remote site bans (fixes #3399)

* db schema changes, handly expiration

* partial federation changes

* add column `mod_ban.instance_id`

* remove unused

* wip: remove person.banned

* fix down migration

* fmt, keep banned status

* fixes

* simplify

* update post removed

* fix api tests

* ban from local instance

* banned() helpers

* cleanup undo_block_user

* remove order by

* cache SiteView::read_local, add instance

* use local instance id for PersonView

* add helper function person_with_instance_actions

* use exists

* comments update removed

* remove method is_mod_or_admin

* fix tests

* no unwrap

* change local_instance_person_join

* remove LocalSite::read

* wip: home_instance_actions

* add home_instance_actions to all structs

* fixes

* fix tests

* fmt

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-28 08:47:24 -04:00
Nutomic
e079a41308
Change private instance setting to allow federation (#5530) 2025-03-28 12:27:59 +01:00
Dessalines
0c78332881
Remove duped post.instance_id column. (#5546)
* Remove duped `post.instance_id` column.

- Fixes #5544

* Fix incorrect table ref.

* Fix diff check.

* Fix diff check 2.
2025-03-28 12:27:44 +01:00
Nutomic
a9c2fc77c8
Proxy post.url if it is an image (fixes #5538) (#5545)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-28 12:24:55 +01:00
Nutomic
4556a94387
Add plugin system (fixes #3562) (#5498)
* Add plugin system (fixes #3562)

* loading changes

* Use golang for default plugin (faster to compile)

* add remaining pre hooks

* Add remaining plugin hooks

* clippy

* Dont crash if plugin folder cant be read

* add metadata to /api/v4/site

* use plugin pool

* fix api common

* move plugin code to separate repo

* remove dbg

* fix api tests

* Add private message hooks

* only load plugin for epsilon test instance

* 1s timeout

* load plugin over http

* no return value for pre hooks

* dont run plugin hook code if no plugins loaded

* make plugin calls async

* clippy

* spawn_blocking

* fix vote hooks, add lemmy_url

* update before hooks, vote hooks

* adjust post hooks

* rename functions

* expose lemmy version to plugins

* fix hooks

* fix again

* update plugin

* not mut

* clippy

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-28 10:54:02 +01:00
Nutomic
1743f21258
Remove hardcoded ratelimit (#5551)
* Remove hardcoded ratelimit

* needed for api tests
2025-03-26 12:27:33 -04:00
flamingos-cant
0c1d9c9350
Wrap attributedTo for group to fix Peertube federation (#5509)
* Wrap attributedTo for group to fix Peertube federation

* Combine AttributedTo

* Add func to truncate community description

* Fix endless recursion

* Add tests

* Cleaner wrapper for attributedTo

* Address comments
2025-03-26 12:49:19 +01:00
Nutomic
6aede48c1b
Add columns post.pending, comment.pending (#5499)
* Add columns post.pending, comment.pending

* add comments

* rename migration

* helper method, set not pending on vote received

* rename to federation_pending, add comments

* fix down migration
2025-03-25 11:43:25 +01:00
matc-pub
3664f987d3
Fix migration problems with initially deferred and not null constraints (#5533)
Executes `SET CONSTRAINTS xyz IMMEDIATE;` before `CREATE INDEX` and
`ALTER COLUMN` that otherwise fail because of "pending trigger events".
2025-03-25 10:24:51 +01:00
Оксана Юрчук
cef08cde0d
Update README.md (#5537) 2025-03-24 23:30:58 -04:00
matc-pub
85c37e8edb
Return UploadImageResponse for avatar, banner and icon uploads (#5535) 2025-03-24 23:30:48 -04:00
Nutomic
401583b6ce
Change community outbox to use total post count (ref #5522) (#5524)
* Change community outbox to use total post count (ref #5522)

* fix
2025-03-24 17:06:13 -04:00
matc-pub
f075b2da3c
Move /account/auth/saved to /account/saved (#5534) 2025-03-24 14:59:46 -04:00
Оксана Юрчук
ea8d5dc7e7
Update README.md (#5527) 2025-03-24 14:11:29 +01:00
Felix Ableitner
d88b624ced Version 1.0.0-alpha.3 2025-03-24 09:28:55 +01:00
flamingos-cant
8e080e4926
Add backslahses to prevent image embeds breaking (#5506)
* Replace newlines with spaces in attachments

* Use backslash to prevent breaks instead

* fmt

* Split + join with spaces
2025-03-19 11:56:34 +01:00
Nutomic
d517f16e2c
Install pgformatter from Debian repos (#5521) 2025-03-18 13:15:03 -04:00
dullbananas
3324003049
Fix error type returned by verify_person (#5519) 2025-03-18 10:09:54 -04:00
dullbananas
4c3a52e94c
Remove underscores that are no longer needed in impls/site.rs (#5507) 2025-03-15 13:11:52 -04:00
Nutomic
d78fe5fb1f
Community local removed (#5500)
* Better handling of local and remote bans (fixes #3399, ref #4571)

* rename migration

* basic code changes

* post/community pending

* revert person.local_banned

* ignore local_removed communities in queries

* fix test

* Add column `community.local_removed`

* fmt
2025-03-14 10:37:20 -04:00
Nutomic
fcd4bbe8e3
Add comment for database pool size memory size (#5503) 2025-03-14 09:53:45 -04:00
Nutomic
7daa1c6543
Document environment variable for database url (#5501) 2025-03-13 08:11:58 -04:00
Dessalines
5fa6a490d5
Create actions structs (#5482)
* migration

* update code

* tests

* triggers

* fix

* fmt

* clippy

* post aggregate migration

* changes for post aggregate code

* wip: update tests for post aggregate

* format

* fix partialeq

* trigger fix

* fix post insert trigger

* wip

* reorder

* fixes

* community aggregate migration

* update code

* triggers

* person aggregate migration

* person aggregate code

* person triggers

* test fixes

* fix scheduled task

* update api tests

* site_aggregates to local_site migration

* site_aggregates code changes

* triggers, tests

* more fixes

* Rename PersonPostAggregates to PostActions

* Merge local_user_vote_display_mode into local_user

* fix schema

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* remove commentaggregates

* Fix triggers in remove aggregates tables pr (#5451)

* prevent all db_schema test errors

* fix the delete_comments_before_post problem in a way that doesn't affect the returned number of affected rows

* remove unnecessary recursion checks and add comment to remaining check

* clean up

* Fixing SQL format.

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* remove update of deleted column

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>

* rename migration

* Fix migration errors

* Move community.hidden to visibility (fixes #5458)

* Fixing person_saved_combined. (#5481)

* Remove comment and post specific action structs. #5473

* Doing reports

* fix up migration by dropping index

* also add enum variant `LocalOnlyPublic`, rename `LocalOnly` to `LocalOnlyPrivate`

fixes #5351

* fix column order in down.sql

* wip

* Moving blocks.

* Adding a few more views.

* more wip

* fixes

* migration for modlog

* fix migration

* Working views and schema.

* Fix ts_optionals.

* wip

* db_schema compiling

* make the code compile

* Merging from main.

* lint

* Fixing SQL format.

* fix down migration

* Fixing api tests.

* Adding field comments for the actions tables.

* Refactoring CommunityFollower to include follow_state

* fix test

* make hidden status federate

* ts attr

* fix

* fix api test

* Update crates/api/src/reports/post_report/resolve.rs

Co-authored-by: Nutomic <me@nutomic.com>

* Addressing PR comments

* Fix ts export.

* update api client

* review

* Extracting filter_not_hidden_or_is_subscribed (#5497)

* Extracting filter_not_hidden_or_is_subscribed

* Cleanup.

* Cleanup 2.

* Remove follower_state_helper function.

* Cleaning up some utils functions.

* rename hidden to unlisted

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-03-12 11:51:34 -04:00
Nutomic
8ffeeca52d
Changes to community visibility (#5478)
* Move community.hidden to visibility (fixes #5458)

* fix up migration by dropping index

* also add enum variant `LocalOnlyPublic`, rename `LocalOnly` to `LocalOnlyPrivate`

fixes #5351

* fix column order in down.sql

* wip

* more wip

* fixes

* migration for modlog

* fix migration

* wip

* db_schema compiling

* make the code compile

* lint

* fix down migration

* fix test

* make hidden status federate

* ts attr

* fix

* fix api test

* update api client

* review

* Extracting filter_not_hidden_or_is_subscribed (#5497)

* Extracting filter_not_hidden_or_is_subscribed

* Cleanup.

* Cleanup 2.

* rename hidden to unlisted

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-12 09:45:02 -04:00
dullbananas
d93bfdd2fa
Update user count from local_user table instead of person table, and only count users with accepted application (#5495)
* Update user count from local_user instead of person, and only count users with accepted application

* fix

* Update up.sql

* Update down.sql
2025-03-11 16:37:40 +01:00
Nutomic
b6f46cd38c
When creating community copy allowed languages from creator profile (#5490) 2025-03-11 09:53:41 -04:00
Dessalines
bb82e5dd43
Register users in a transaction. (#5480)
* Register users in a transaction.

- Fixes #5477

* Removing transactions from language code.

* Replace build_transactions with async transactions.

* Forgot one transaction.
2025-03-11 10:39:48 +01:00
Dessalines
91d10092b6
Adding pagination for GetBannedPersons (#5428)
* Extracting pagination cursor utils into a trait.

- Fixes #5275

* Refactoring to avoid stack overflows.

* Fixing api_common feature.

* Adding pagination for GetBannedPersons.

- Must come after #5424
- Fixes #2847

* Rename the traits and paginationcursor::new

* Using combined trait.

* Removing empty files.

* Merge from main, limit fetch.

* Adding local ban check, and ignore_page_limits.

* Only do page limits if not admin.
2025-03-11 09:41:02 +01:00
Nutomic
304df35f3b
Only enable English for users on instances with all languages enabled (ref #5489) (#5493) 2025-03-11 09:38:47 +01:00
Nutomic
96e4621cb8
Dont force enable undetermined language anymore (fixes #5487) (#5491)
* Dont force enable undetermined language anymore (fixes #5487)

* fix test
2025-03-10 11:52:35 -04:00
Nutomic
3dfb0cab36
Speedup generation of RSA keys in debug mode (#5494) 2025-03-10 11:41:43 -04:00
dullbananas
c315145146
Make post id indexed again (#5492) 2025-03-10 10:33:21 -04:00
dullbananas
08defa29fe
Add community reports to API (#5435)
* add routes

* implement some of api

* fix use of check_report_reason

* fix create_community_report

* fix all compile errors

* add field to reportcombined struct

* add CommunityReportView::read test

* import resolve_community_report

* remove references to deleted table

* resolve reports after remove
2025-03-10 09:37:50 -04:00
vaskebjoern
b8de9a518b
Added display of image files to post description. (#5488) 2025-03-07 21:29:55 -05:00
Nutomic
85a4071a5c
Enable english for all users in db migration (#5489) 2025-03-07 08:44:23 -05:00
Nutomic
9a64902ace
Remove aggregate tables (fixes #4869) (#5407)
* migration

* update code

* tests

* triggers

* fix

* fmt

* clippy

* post aggregate migration

* changes for post aggregate code

* wip: update tests for post aggregate

* format

* fix partialeq

* trigger fix

* fix post insert trigger

* wip

* reorder

* fixes

* community aggregate migration

* update code

* triggers

* person aggregate migration

* person aggregate code

* person triggers

* test fixes

* fix scheduled task

* update api tests

* site_aggregates to local_site migration

* site_aggregates code changes

* triggers, tests

* more fixes

* Rename PersonPostAggregates to PostActions

* Merge local_user_vote_display_mode into local_user

* fix schema

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* remove commentaggregates

* Fix triggers in remove aggregates tables pr (#5451)

* prevent all db_schema test errors

* fix the delete_comments_before_post problem in a way that doesn't affect the returned number of affected rows

* remove unnecessary recursion checks and add comment to remaining check

* clean up

* Fixing SQL format.

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* remove update of deleted column

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>

* rename migration

* Fix migration errors

* Fixing person_saved_combined. (#5481)

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-06 16:18:41 +01:00
Nutomic
7b86307760
Ignore accept-language header if not site languages are specified (#5485) 2025-03-06 09:34:20 -05:00
Nutomic
b14c6ae0ee
Add more options for image uploads (#5483)
* Add more options for image uploads

* remove separate option for animations

* add comment
2025-03-06 04:44:52 -05:00
Nutomic
1e02dea397
Use connection url to configure email (fixes #5472) (#5476)
* Use connection url for configure email (fixes #5472)

* clippy
2025-03-04 13:50:19 -05:00
Dessalines
a6507c169d
Extracting pagination cursor utils into a trait. (#5424)
* Extracting pagination cursor utils into a trait.

- Fixes #5275

* Refactoring to avoid stack overflows.

* Fixing api_common feature.

* Rename the traits and paginationcursor::new

* Using combined trait.

* Removing empty files.
2025-03-04 13:00:18 -05:00
flamingos-cant
2f2f58da65
Add HTML classes to mention (#5475) 2025-03-04 09:31:44 -05:00
Dessalines
03630c8abd
Direct questions to lemmy.ml/c/lemmy_support. #5464 (#5467)
* Direct questions to lemmy.ml/c/lemmy_support. #5464

* Add matrix chat.
2025-03-04 09:50:53 +01:00
Nutomic
62fb03599a
Use version from git to indicate unreleased changes (#5470) 2025-03-03 10:55:33 -05:00