Commit graph

1545 commits

Author SHA1 Message Date
Dessalines 236d8bda3e Merge remote-tracking branch 'origin/main' into combined_inbox 2025-01-15 11:31:14 -05:00
Nutomic 5bc3f0c4d9
Pictrs delete token (#5317)
* Split image endpoints into API v3 and v4

* Move into subfolders

* Upload avatar endpoint and other changes

* Various other changes

fixes #1772
fixes #4001

* clippy

* config options

* fix ts bindings

* fix api tests

* Add option to disable image upload (fixes #1118)

* split files into upload, download

* move sitemap to top level, not in api

* simplify code

* add upload user banner

* community icon/banner

* site icon/banner

* update js client

* wip

* add delete endpoints

* change comment

* optimization

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

* move fn

* 1024px banner

* dont use static client

* fix api tests

* shear

* proxy pictrs in request.rs (fixes #5270)

* clippy

* Get rid of pictrs delete token

* remove delete token params

* try to fix api tests

* fmt

* skip api tests

* clippy

* create user

* debug

* dbg

* ignore test

* test

* image

* run another

* fixed?

* clippy

* fix

* migration with column order

* drop default

* fix health check

* update client

* remove unused

* fix

* reuse delete_image_from_pictrs

* update lib

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-15 11:28:43 -05:00
Dessalines c68473c122
Upgrading deps. (#5326)
* Upgrading deps.

* Upgrading a few more.

* A few more
2025-01-15 10:10:12 +01:00
Dessalines 8f39568760 Fixing mark all as read route, changing mark read to SuccessResponse. 2025-01-14 17:58:10 -05:00
Dessalines 70fcd5cdb4 Merge branch 'combined_modlog' into combined_inbox 2025-01-14 16:49:54 -05:00
Dessalines 9c1347c7a0
Adding Combined modlog (#5253)
* Combined tables try 2

* Finishing up combined report table.

* Fix ts optionals.

* Adding tests, triggers, and history updates for report_combined.

* Adding profile.

* Add cursor pagination to report_combined view (#5244)

* add pagination cursor

* store timestamp instead of id in cursor (partial)

* Revert "store timestamp instead of id in cursor (partial)"

This reverts commit 89359dde4b.

* use paginated query builder

* Fixing migration and paged API.

* Using dullbananas trigger procedure

* Removing pointless list routes, reorganizing tests.

* Fixing column XOR check.

* Forgot to remove list report actions.

* Cleanup.

* Use internal tagging.

* Fixing api tests.

* Adding a few indexes.

* Fixing migration name.

* Fixing unique constraints.

* Addressing PR comments.

* Start working on profile combined

* Adding views and replaceable schema.

* A few changes to profile view.

- Separating the profile fetch from its combined content fetch.
- Starting to separate saved_only into its own combined view.

* Finishing up combined person_saved and person_content.

* Fixing api tests.

* Moving to api-v4 routes.

* Fixing imports.

* Update crates/db_views/src/report_combined_view.rs

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

* Update crates/db_views/src/report_combined_view.rs

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

* Update crates/db_views/src/report_combined_view.rs

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

* Update migrations/2024-12-02-181601_add_report_combined_table/up.sql

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

* Update migrations/2024-12-02-181601_add_report_combined_table/up.sql

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

* Fixing import and fmt.

* Fixing null types in postgres.

* Comment out err.

* Fixing TS issues.

* Adding types, fixing allow and blocklist crud.

* Starting to work on combined views.

* Using dullbananas trigger procedure

* Adding the full combined view queries.

* Adding tests.

* taplo fmt.

* Upgrading package.json deps.

* Updating pnpm

* Addressing PR comments.

* Removing serialization

* Removing serialization

* Fixing duped trigger.

* Remove saved_only test.

* Remove pointless post_tags types.

* Remove pointless index.

* Changing published to saved for person_saved_combined.

* Removing comment.

* Renaming modlog when_ columns to published.

- Fixes #5312

* Adding strum and simplifying imports.

* Avoiding clone in map_to_enum

* Changing modded_person to other_person.

* Update crates/db_views_moderator/src/modlog_combined_view.rs

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

* Update crates/db_views_moderator/src/modlog_combined_view.rs

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

* Update crates/db_views_moderator/src/modlog_combined_view.rs

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

* Addressing PR comments.

* Fixing split.

* Revert "Adding strum and simplifying imports."

This reverts commit 15f1671107.

* Running fmt.

* Using assert + matches instead of filter_map.

* Adding listPersonContent check.

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-14 15:14:58 +01:00
Dessalines 85d8810139
Merge branch 'main' into combined_modlog 2025-01-13 23:23:11 -05:00
Nutomic a91a03a536
Image api rework (#5260)
* Split image endpoints into API v3 and v4

* Move into subfolders

* Upload avatar endpoint and other changes

* Various other changes

fixes #1772
fixes #4001

* clippy

* config options

* fix ts bindings

* fix api tests

* Add option to disable image upload (fixes #1118)

* split files into upload, download

* move sitemap to top level, not in api

* simplify code

* add upload user banner

* community icon/banner

* site icon/banner

* update js client

* wip

* add delete endpoints

* change comment

* optimization

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

* move fn

* 1024px banner

* dont use static client

* fix api tests

* shear

* proxy pictrs in request.rs (fixes #5270)

* clippy

* try to fix api tests

* skip api tests

* create user

* debug

* dbg

* test

* image

* run another

* fixed?

* clippy

* fix

* fix health check

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-13 16:09:00 -05:00
Dessalines c3a74f9b01 Using assert + matches instead of filter_map. 2025-01-13 16:04:38 -05:00
Dessalines 143da4bb45 Merge remote-tracking branch 'origin/main' into combined_modlog 2025-01-13 15:48:13 -05:00
dullbananas c08e216ae8
Correctly paginate PostView when read_only is enabled (#5320) 2025-01-13 15:46:46 -05:00
Dessalines b021e4b416 Merge remote-tracking branch 'origin/main' into combined_modlog 2025-01-13 10:53:12 -05:00
dullbananas 4d17eef82b
Add community reports (only the database part) (#4996)
* database stuff, not including tests

* change migration date

* fix community_report_view

* update stuff related to report_combined

* add db_schema/src/impls/community_report.rs

* add report counts to community_aggregates

* fix community_report columns and update report_combined_view::tests::test_combined

* add column for original sidebar; use None instead of clone; add report_combined_view::tests::test_community_reports

* use ts(optional) in CommunityReportView

* remove CommunityReportView::read
2025-01-13 05:14:56 -05:00
Dessalines 50043afe36 Merge remote-tracking branch 'origin/main' into combined_modlog 2025-01-10 14:24:12 -05:00
Nutomic 11e0513592
Change default image_mode to proxy, remove deprecated option (#5176)
* Change default image_mode to proxy, remove deprecated option

* fix api test
2025-01-10 12:34:12 -05:00
Dessalines 11e9514c37 Running fmt. 2025-01-10 12:31:31 -05:00
Dessalines 45e312f020 Revert "Adding strum and simplifying imports."
This reverts commit 15f1671107.
2025-01-10 12:31:04 -05:00
Dessalines 4b71bc6701 Fixing split. 2025-01-10 12:26:39 -05:00
Dessalines 46bbf2f124 Merge branch 'combined_modlog' of https://github.com/LemmyNet/lemmy into combined_modlog 2025-01-10 12:09:38 -05:00
Dessalines 0a7d88f874 Addressing PR comments. 2025-01-10 12:09:37 -05:00
Dessalines b1d4e9c7fb
Update crates/db_views_moderator/src/modlog_combined_view.rs
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-10 12:06:05 -05:00
Dessalines d09616cbc9
Update crates/db_views_moderator/src/modlog_combined_view.rs
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-10 12:05:48 -05:00
Dessalines 9b561dfa2b
Update crates/db_views_moderator/src/modlog_combined_view.rs
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-10 12:05:13 -05:00
Dessalines d64a0860c5 Merge remote-tracking branch 'origin/main' into combined_modlog 2025-01-10 10:20:23 -05:00
Nutomic c879eb1244
Remove unused apub audience field (fixes #5278) (#5315)
* Remove unused apub audience field (fixes #5278)

* fix

* fix test

* remove comments
2025-01-09 09:41:39 -05:00
Nutomic 15473e5137
Correct HTTP status for NotFound error (fixes #5309) (#5313) 2025-01-09 04:51:52 -05:00
Dessalines d83f96293d
Automatically marking posts created in an NSFW community as NSFW. (#5310)
* Automatically marking posts created in an NSFW community as NSFW.

- Context: https://github.com/LemmyNet/lemmy-ui/issues/2885

* Update crates/api_crud/src/post/create.rs

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

---------

Co-authored-by: Nutomic <me@nutomic.com>
2025-01-09 10:02:44 +01:00
Dessalines 0723ef2055 Changing modded_person to other_person. 2025-01-08 18:26:25 -05:00
Dessalines 43179177a0 Avoiding clone in map_to_enum 2025-01-08 18:19:51 -05:00
Dessalines 15f1671107 Adding strum and simplifying imports. 2025-01-08 18:08:35 -05:00
Dessalines be4a05e549 Merge remote-tracking branch 'origin/main' into combined_modlog 2025-01-08 16:58:56 -05:00
Dessalines d27a6346ab Renaming modlog when_ columns to published.
- Fixes #5312
2025-01-08 16:58:19 -05:00
Nutomic c81144cd14
Remove unused params on CreateSite/EditSite (#5311) 2025-01-08 16:48:29 -05:00
dullbananas 6b1b29419d
Add custom migration runner, forbid some diesel migration commands, fix old migrations (#4673)
* 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 clippy

* Make diff check work just like before

* Move new migrations to the end

* Revert changes to old migrations

* don't assume that migrations are already sorted

* retry CI

* fix merge

* find migrations dir in debug mode using CARGO_MANIFEST_DIR variable instead of current working directory

* always use embedded migrations

* improve doc comments for migration subcommand

* clippy fix

* move cfg(test) attribute to diff_check.rs

* copy `o` variable instead of calling `o` function

* use chrono::TimeDelta Display implementation to show migration duration
2025-01-08 11:07:32 +01:00
Felix Ableitner 9df10b3dc9 Remove unused param Create/EditSite.enable_nsfw 2025-01-08 10:28:01 +01:00
flamingos-cant 2a89179611
Add markdown-it-footnotes (#5303) 2025-01-07 13:16:30 -05:00
Dessalines 03e876b1e9 Removing comment. 2025-01-05 20:37:34 -05:00
Dessalines 0bfbd74e59
Adding combined person content and person saved tables. (#5251)
* Combined tables try 2

* Finishing up combined report table.

* Fix ts optionals.

* Adding tests, triggers, and history updates for report_combined.

* Adding profile.

* Add cursor pagination to report_combined view (#5244)

* add pagination cursor

* store timestamp instead of id in cursor (partial)

* Revert "store timestamp instead of id in cursor (partial)"

This reverts commit 89359dde4b.

* use paginated query builder

* Fixing migration and paged API.

* Using dullbananas trigger procedure

* Removing pointless list routes, reorganizing tests.

* Fixing column XOR check.

* Forgot to remove list report actions.

* Cleanup.

* Use internal tagging.

* Fixing api tests.

* Adding a few indexes.

* Fixing migration name.

* Fixing unique constraints.

* Addressing PR comments.

* Start working on profile combined

* Adding views and replaceable schema.

* A few changes to profile view.

- Separating the profile fetch from its combined content fetch.
- Starting to separate saved_only into its own combined view.

* Finishing up combined person_saved and person_content.

* Fixing api tests.

* Moving to api-v4 routes.

* Fixing imports.

* Update crates/db_views/src/report_combined_view.rs

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

* Update crates/db_views/src/report_combined_view.rs

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

* Update crates/db_views/src/report_combined_view.rs

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

* Update migrations/2024-12-02-181601_add_report_combined_table/up.sql

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

* Update migrations/2024-12-02-181601_add_report_combined_table/up.sql

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

* Fixing import and fmt.

* Fixing null types in postgres.

* Comment out err.

* Fixing TS issues.

* Using dullbananas trigger procedure

* Addressing PR comments.

* Removing serialization

* Removing serialization

* Fixing duped trigger.

* Remove saved_only test.

* Remove pointless post_tags types.

* Remove pointless index.

* Changing published to saved for person_saved_combined.

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-05 12:48:57 -05:00
Dessalines b46fdab768 Merge branch 'combined_profile' into combined_modlog 2025-01-03 14:45:08 -05:00
Dessalines 5cf0bb834a Merge remote-tracking branch 'origin/main' into combined_profile 2025-01-03 14:33:34 -05:00
Nutomic 41421991d6
Error handling for thumbnail generation (ref #5196) (#5298) 2025-01-03 14:09:24 -05:00
Felix Ableitner 6de73f37ca Rename variable 2025-01-03 15:57:02 +01:00
Dessalines b6d0ecfcb3 Merge branch 'combined_profile' into combined_modlog 2025-01-03 09:16:54 -05:00
Dessalines e9d27f2840
Don't send out new user email verifies to admins, if already verified. (#5288)
- Fixes #5272
2025-01-03 11:16:25 +01:00
leoseg ba779b978f
New parameter read_only for /api/v3/post/list (#5264)
* added option to get only read only posts with unittests

* formatted code

* added index on (person_id, read) on post actions where read is not null

* formatted sql

* Update migrations/2024-12-15-151642_add_index_on_person_id_read_for_read_only_post_actions/up.sql

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

* Fixxed error in down.sql for migration of index on (person_id,read_only,post_id) on post_actions

* Fixxed error in unittests

* Update crates/db_views/src/post_view.rs

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

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-01-03 11:08:00 +01:00
Dessalines c656465e28
Fix contradicting filters. (#5281) 2025-01-03 11:02:20 +01:00
Dessalines 2244fd005d Changing published to saved for person_saved_combined. 2025-01-02 17:08:05 -05:00
Dessalines 918c5e820d Merge remote-tracking branch 'origin/main' into combined_profile 2025-01-02 16:38:02 -05:00
anhcuky c034229295
reset_password API to always return success (#5284) 2025-01-02 12:37:13 -05:00
dullbananas b91790e29e
Fix incorrect comment in report_combined_view test (#5297) 2025-01-02 12:35:56 -05:00