Commit graph

5420 commits

Author SHA1 Message Date
Nutomic
cbc8f703b7
Extism release version (#5865) 2025-07-15 09:53:24 -04:00
Nutomic
2705728dbf
Delete report views, add missing report fields (#5863)
* Delete report views

* cleanup

* Add missing report fields

* simplify report trait

* simplify sized traits

* remove unnecessary traits with only one impl

* fix
2025-07-15 04:58:38 -04:00
Nutomic
cf0e021129
Add unique constraint for person(name, instance) (fixes #5045) (#5858)
* Add unique constraint for person(name, instance) (fixes #5045)

* fix

* not local

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

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-07-14 17:14:05 -04:00
dullbananas
21c1784a01
Use a new separate crate for uplete (#5848)
* replace lemmy_db_schema::utils::uplete with in-progress crate

* use published diesel-uplete crate

* remove unused tuplex dependency

* move diesel-uplete to dev-dependencies for lemmy_db_views_post

* import table modules in table_impls.rs

* update to new diesel-uplete with renamed stuff
2025-07-14 16:37:11 -04:00
Dessalines
fe30f30c4e
Don't export inbox combined view internal. (#5860)
Noticed this in the js-client. It's only used internally.
2025-07-11 17:15:59 -04:00
Nutomic
b5dee35b84
Update extism (#5859) 2025-07-11 16:52:53 -04:00
dullbananas
df4a79f4b6
Allow running all migrations with minimal dependencies (#5841)
* move schema_setup to separate crate

* remove lemmy_utils dependency

* add db_schema_setup/src/main.rs

* fix diesel.toml

* run diesel print-schema

* fix replaceable_schema paths

* remove unneeded dependencies

* taplo format

* fix duplicated cfg(test) attribute

* move replaceable_schema to crates/db_schema_setup/replaceable_schema

* warn if lemmy_db_schema_setup can be used instead of lemmy_server
2025-07-11 09:36:42 +02:00
Nutomic
a8a407ca6d
Federation refactoring (#5855)
* refactor federation http responses

* Rename Activity

* test fixes

* library release
2025-07-10 23:31:33 -04:00
Nutomic
7fb11c36fa
Fix comment depth off by one (#5851)
* Fix comment depth off by one

* fix

* test and comment
2025-07-10 23:28:06 -04:00
SleeplessOne1917
fd1e0b01e5
Add missing TS derives that were causing errors when generating Typescript bindings (#5853) 2025-07-09 09:48:14 +02:00
SleeplessOne1917
e66d0a3d61
Add creator_banned to VoteView (#5849) 2025-07-08 09:55:34 +02:00
Nutomic
8cf14f407f
Move local site user count updates to scheduled task (#5822)
* Move local site stats updates to scheduled task (fixes #5816, fixes #3213)

* only user count via scheduled task

* join to local site
2025-07-04 09:31:13 +02:00
Nutomic
3922f0f325
Revert " Add post_actions.disable_notifications (fixes #3042) (#5826)" (#5843)
This reverts commit 76fbb29079.
2025-07-02 11:29:42 +02:00
Nutomic
0d149dd613
Add missing comment depth check (#5840) 2025-07-02 09:37:20 +02:00
renovate[bot]
568e93ebef
Update docker (#5838)
* Update docker

* Update .woodpecker.yml

* Update .woodpecker.yml

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2025-07-01 03:58:18 -04:00
renovate[bot]
9029338e59
Update Rust crate diesel to v2.2.11 (#5839)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-01 00:23:59 -04:00
Nutomic
76fbb29079
Add post_actions.disable_notifications (fixes #3042) (#5826)
* Add post_actions.disable_notifications (fixes #3042)

* Split up logic for send_local_notifs()

* refactor

* fmt

* add api endpoint, check

* dont call send_local_notifs from comment delete/remove

* move scrape_text_for_mentions() inside send_local_notifs()

* nullable

* simplify

* handle parent notification first

* cleanup

* remove `CommentResponse.recipient_ids`

* post notifications enum

* adjust enum case
2025-06-30 09:52:19 +02:00
Dessalines
dc56863b75
Use vec_into (#5833) 2025-06-30 09:34:50 +02:00
Dessalines
899c87f21f
Adding GDPR-style data export (#5801)
* Adding GDPR-style data export

- Fixes #4540

Still need to:

- [ ] Figure out limits

* Fixing format

* Adding no_limit overrides.

* Slimming down export.

* Cleaning up types some more.

* Addressing PR comments.

* Embedding settings in backup.

* Fixing comment.
2025-06-27 13:14:59 -04:00
Nutomic
e3d36d4f9a
Revert "Use same federation keypair for all new users and communities (#5709)" (#5830)
This reverts commit b4180a57bf.
2025-06-26 13:15:12 -04:00
Nutomic
d77c9a0544
Drop table person_ban (fixes #5828) (#5831) 2025-06-26 13:13:39 -04:00
Nutomic
35f48c5a95
Better way to check if we should accept activity in remote community (#5823)
* Better way to check if we should accept activity in remote community (fixes #5596)

* fix test
2025-06-26 12:52:17 -04:00
Dessalines
a6b03fabdb
Keep totals of upvotes and downvotes given to each user. (#5786)
* Keep totals of upvotes and downvotes given to each user.

- Adds a `voted_at`, `upvotes` and `downvotes` to person_actions.
- Didn't use triggers, because I couldn't figure out how to get the
  voter, and also because it should only be for local users anyway.
- Fixes #2370

* Clippy

* Adding history filling.

* Try to fix postgres alias error 1

* Update crates/db_schema/src/impls/person.rs

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

* Addressing PR comments

* Removing commented line.

* Fixing type errors.

* Fixing test

* Fixing like score 0 and api test errors.

* Some clippy fixes

* Update migrations/2025-06-14-141408_person_votes/up.sql

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

* Update migrations/2025-06-14-141408_person_votes/up.sql

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

* Update migrations/2025-06-14-141408_person_votes/up.sql

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

* Formatting sql

* Fixing migration.

* Cleaning up merge

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-06-26 09:58:10 +02:00
Dessalines
d274d2bb1d
Remove votes when ban + remove data for a site or community. (#5810)
* Remove votes when ban + remove data for a site or community.

- Fixes #5569

* Starting to revert cleanup.

* Finishing up.
2025-06-26 09:52:13 +02:00
Dessalines
9ccd647e02
Fixing docker_update.sh script to not add context. (#5820)
* Fixing docker_update.sh script to not add context.

Use docker build from a higher level to not load massive context.

* Adding a custom postgresql for testing.

* Fixing docker update

* Fixing dir.

* Fix rust log

* Add bash / shell file format checking.

* Adding shfmt package.

* Running bash format.

* Fixing bash fmt.

* Fixing bash fmt 2.

* Adding pgtune note.
2025-06-26 09:48:39 +02:00
Dessalines
78fc703ebd
Optimizing person_content_combined migration. (#5819) 2025-06-26 09:40:21 +02:00
Nutomic
cc61b70b29
Send Undo/Dislike activity (fixes #4465) (#5825) 2025-06-24 10:29:01 -04:00
Dessalines
7e55a39677
Optimizing a few more combined migrations (#5821)
* Add indexes after insert to search_combined.

* Add indexes after for inbox_combined.

* Move index after for modlog combined.

* Fixing unique.
2025-06-24 10:22:17 -04:00
Nutomic
99ec0b7116
Rename rate limit columns (fixes #5805) (#5824)
* Rename rate limit columns (fixes #5805)

* update js client
2025-06-24 10:21:50 -04:00
Nutomic
497ec72f26
Optimize migrations (#5800)
* Fix migration local_image_person

* Make constraints deferrable (ref #5798)

* Some more adjustments

* fix down migrations

* set not deferrable once done

* fix

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-06-23 08:05:21 -04:00
dullbananas
6accb4110d
Fix db_perf.sh (#5815)
* db_perf.sh

* get_option function
2025-06-22 11:56:10 -04:00
Nutomic
0a22fac562
Remove creator_*_actions fields from api (ref #5532) (#5808)
* Dont return action structs in api (ref #5532)

* rename methods

* Remove creator instance fields, add missing check

* update js client

* Remove remaining creator actions

* update api tests
2025-06-20 11:58:41 -04:00
Nutomic
06e7ea00b8
Move config updated check to unit test, use diffy (#5803)
* Move config updated check to test

* use diffy

* clippy

* Fixes for "Move config updated check to unit test, use diffy" PR (#5812)

* replace diffy with unified_diff in test_config_defaults_updated

* revert changes to lemmy_db_schema_file

* use unified_diff in diff_check

* simplify

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-06-20 08:42:37 -04:00
Dessalines
e07e251ada
Removing an existing deferrable constraint, and fail test if any constraint is deferrable. (#5806)
* Removing an existing deferrable constraint.

- Also adding a check to make sure the final dump contains no DEFERs.

* Spelling error
2025-06-20 09:49:44 +02:00
dullbananas
fb762a3f9b
Remove outdated comment about deferrable constraints in triggers.sql (#5813) 2025-06-20 09:49:07 +02:00
Nutomic
9e3395dc22
Switch to library for rate limit (fixes #5550, fixes #5548) (#5731)
* Switch to library for rate limit (fixes #5550, fixes #5548)

* move debug rate limit logic

* move to file

* various rate limit methods

* move to utils crate

* use new code

* delete old rate limit code

* live updates

* live updates working

* clippy

* use binary keys

* clippy

* remove error

* cleanup
2025-06-19 18:52:56 -04:00
Nutomic
7cda94ca97
Set Accept: Vary header (fixes #5632) (#5809) 2025-06-19 18:44:48 -04:00
Nutomic
1f190e015e
Add incoming activity hook for plugins (#5792)
* Add incoming activity hook

* async working

* remove generic

* update with references

* remove insert_received_activity

* remove todo

* use crates.io dep
2025-06-18 16:28:25 +02:00
Nutomic
9a84180b5a
Fix migration local_image_person (#5799) 2025-06-18 08:56:01 -04:00
Anton Boitsov
070d049c49
Test migrations improvement (#5788)
* some test data in migration tests after initial setup (40 migrations)

* - fixed migration rollbacks creating NOT NULL fields without DEFAULT value
- added couple of checks

* fix sql fmt

* fix sql fmt

* allow indexing and unwrapping in tests
2025-06-18 09:39:08 +02:00
Nutomic
66540f1fe7
Delete scripts/ts_bindings_check.sh (#5797) 2025-06-17 11:20:58 -04:00
Dessalines
aef564f098
Better ntfy notifs. (#5793) 2025-06-17 11:37:18 +02:00
Nutomic
bc23e95f50
Implement multi-community (fixes #818, fixes #5340) (#5601)
* Implement multi-community (fixes #818, fixes #5340)

* db methods

* add api methods

* ts opt

* wip

* sql queries

* cleanup

* wip: federation

* query by name

* add ap_id column

* add read_apub, compiles now

* validate multi-comm name

* disallow removed, deleted, private

* scheduled task

* remove piefed test

* resolve_object with workaround

* review

* avoid db read

* api client

* fix api test fetch

* wip: test cases

* wip

* add max elements, array_remove comments

* simplify post view query

* mvoe structs

* fix api test

* fix api test

* rename to suggested_communities, add api param

* filter removed/deleted

* check_api_elements_count

* filter out removed/deleted during update

* inner join

* add listing type suggested

* db schema changes

* transaction

* address some review comments

* separate methods for create, delete entry

* update js client

* get multi

* remove CommunityOrMulti

* check helper, other stuff

* fix api test

* change get multi comm return type

* Replace MultiCommunityView with GetMultiCommunityResponse

* get rid of todo

* add local column, admins can edit local multi-comm

* implement multi-comm follow (db and api)

* api for multi-comm follow

* move and rename MultiCommunityApub

* move multi-comm to apub-objects

* move multi-comm url to top-level

* list multi-comms followed by user

* add todo

* remove param

* update local follows

* update query

* db functions and tests

* cleanup

* fix api test

* add entry limit

* rewrite links

* federation changes

* wip federation

* simplify generate_activity_id

* more wip

* more wip

* multi-comm follow

* federate changes

* cleanup

* clippy

* test fixes

* fmt

* fix

* wip: update follows after federated multi-comm change

* remove scheduled task

* update follows after multi update

* fmt

* fixes

* review comments

* indexes

* remove MultiCommunityApub

* fix test

* ts fix

* review

* db schema for local_site.multi_comm_follower

* adjust code and tests

* fixes

* cleanup, comment

* fix tests

* fix

* remove more test code

* fix new install

* add index

* fix api tests

* fix

* remove index

* more fix

* Implement multi-community search (fixes #5778) (#5779)

* Implement multi-community search (fixes #5778)

* fixes

* search title and description

* MultiCommunityView

* rename fields

* revert test change
2025-06-17 11:04:47 +02:00
Dessalines
c198c98bed
Remove ts-bindings null check from CI. (#5795)
- This takes 12 minutes, and its a waste of time.
- I'm adding it to the lemmy-js-client copy script which needs to
  do this build there anyway, so errors will be found while devving.
2025-06-17 09:39:51 +02:00
SleeplessOne1917
8024e46d89
More reexports (#5796) 2025-06-17 00:47:00 +00:00
Integral
313e2ff061
chore: replace nightly API Duration::from_days with Duration::from_secs (#5791) 2025-06-16 11:56:03 -04:00
Nutomic
5c6e7c32b0
Replace most uses of context.reset_request_count() with clone() (#5790)
* Replace most uses of context.reset_request_count() with clone()

* fix features

* replace more

* reset count for community collection fetch
2025-06-16 11:54:54 -04:00
dullbananas
bb63eaa794
Improve migration diff check and fix old migrations (#5204)
* Update schema.rs

* rename

* stuff

* finish new implementation of schema_setup::run (not including revert, test, etc.)

* fmt

* refactor

* fix sql

* migriation run command

* use trigger on migrations table

* add Options with disable_migrations field for test

* rename to enable_forbid_diesel_cli_trigger

* fix

* fix merge

* diff_checker (partial)

* Revert "diff_checker (partial)"

This reverts commit 6709882e14.

* Revert "Revert "diff_checker (partial)""

This reverts commit d4bdda5d11.

* diff check

* improve schema diff

* timestamp replacement

* ignore column order

* remove fedi_name default

* stuff

* improve diff

* stuff

* attempt parallel pg_dump

* attempt 2

* Revert "attempt 2"

This reverts commit a909d2d643.

* Revert "attempt parallel pg_dump"

This reverts commit 592a127954.

* improve diff check

* finish fixing migrations

* stuff

* use advisory lock

* stuff

* Update lib.rs

* fmt

* fmt

* clippy

* Update diff_check.rs

* Update .woodpecker.yml

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update lib.rs

* re-run ci

* fmt

* fmt

* Update .woodpecker.yml

* Update .woodpecker.yml

* create separate database in ci

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* try to fix env var

* Update diff_check.rs

* Remove condition that's not needed anymore

* clippy

* exclude views and fast tables

* revert some migration changes

* fix

* fmt

* re-attempt checking character after skipped trigger name, and make code less confusing

* fmt

* fix

* rerun ci

* rerun ci

* fix strip_prefix order

* fix weird big Cargo.lock change by running `git checkout upstream/main Cargo.lock` then letting it auto update again

* fix

* remove installation commands that were removed in main branch

* Revert "remove installation commands that were removed in main branch"

This reverts commit fd65234a76.

* move create_database_user woodpecker step to make diff less weird

* Fix migration duplication caused by merge

* optimize

* Merge remote-tracking branch 'upstream/main' into new-migration-diff-check

* fmt

* Revert "fmt"

This reverts commit 7d5652945f.

* Revert "Merge remote-tracking branch 'upstream/main' into new-migration-diff-check"

This reverts commit 28bb1c7497.

* fmt

* move diff dependency to db_schema_file

* stuff

* revert some migration changes

* stuff

* refactor pair selection

* fix all migrations

* clippy

* stuff

* remove thing from removed dbg

* remove use of BTreeSet::difference

* trim_matching_chunks_at_beginning_and_end

* use sorted_unstable itertools method

* display_diffs

* use aho-corasick for chunk filtering

* fsync=off

* remove some unimportant optimizations

* Revert "remove some unimportant optimizations"

This reverts commit f8d88ddcce.

* Revert "use aho-corasick for chunk filtering"

This reverts commit 6b1f3e4416.

* remove some unimportant optimizations

* refactor diff_check.rs

* clippers
2025-06-16 11:35:41 -04:00
SleeplessOne1917
d1aed75956
Small lemmy_api_common/db_views fixes/tweaks (#5783)
* Refactor Taglines

* Include crate ts-rs dependencies when needed, move some views to account_management views

* Re export NotePerson from lemmy_api_common

* Remove unused "full" feature from lemmy_db_views_tagline

* Replace "full" feature in lemmy_api_common with "ts-rs"

* Remove newly added db_views crates and put structs in existing db_views crates
2025-06-16 10:34:05 +02:00
dullbananas
38e87f6dc4
Fix assumption that is_err always means the local site doesn't exist, which may cause the local site's keypair to be regenerated (#5724)
* Fix assumption that is_err always means the local site doesn't exst, which may cause things like keypairs to be overwritten

* remove use of unstable feature

* fix map_err

* exists query and transaction
2025-06-13 19:12:12 -04:00