Commit graph

5091 commits

Author SHA1 Message Date
Dessalines 802a8a64e7 Cleanup. 2024-12-02 16:34:23 -05:00
Dessalines 0c854d2d3a Forgot to remove list report actions. 2024-12-02 16:33:45 -05:00
Dessalines 5a8b9def6e Merge remote-tracking branch 'origin/main' into combined_tables_2 2024-12-02 16:27:25 -05:00
Dessalines 612c2e916f Fixing column XOR check. 2024-12-02 16:23:50 -05:00
Dessalines 1776de2f45 Removing pointless list routes, reorganizing tests. 2024-12-02 16:10:59 -05:00
Dessalines 00beccd272 Using dullbananas trigger procedure 2024-12-02 13:46:51 -05:00
Dessalines 7fdbb58e98 Fixing migration and paged API. 2024-12-02 13:28:26 -05:00
Dessalines f25d34656f Merge branch 'combined_tables_2' of https://github.com/LemmyNet/lemmy into combined_tables_2 2024-12-02 12:56:19 -05:00
dullbananas 588e1f6c0a
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
2024-12-02 12:56:14 -05:00
Nutomic ba3e6b482b
Add note wrapper (fixes #2657) (#5221) (#5236)
* Add note wrapper (fixes #2657)  (#5221)

* Add note wrapper (fixes #2657)

* fix activity list

* fmt

* add comment

* fix api tests

* backwards compat

* remove comment

* no todo, deprecated

* wip

* make it work

* fmt

* now really working

* fixes

* add comments
2024-12-02 05:28:23 -05:00
renovate[bot] 5085d1c3e3
Update Rust crate diesel-async to v0.5.2 (#5243)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-30 20:14:07 -05:00
renovate[bot] 44f584b414
Update Rust crate diesel to v2.2.5 (#5242)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-30 19:57:32 -05:00
Dessalines 3adadf9203 Merge remote-tracking branch 'origin/main' into combined_tables_2 2024-11-30 13:54:30 -05:00
Dessalines e3fccb3f81
Fixing woodpecker secrets warning. (#5237) 2024-11-29 10:35:03 +01:00
Dessalines a9f28af554 Merge remote-tracking branch 'origin/main' into combined_tables_2 2024-11-28 18:25:55 -05:00
Nutomic 3d7fbde091
Allow bypassing image proxy for specific domains (#5223)
* Allow bypassing proxy for some domains with ProxyAllImages

* remove web::

* remove expect

* bypass imgur by default

* correct imgur domain

* restore processing, cleanup

---------

Co-authored-by: sunaurus <sander@saarend.com>
2024-11-28 18:23:18 -05:00
Nutomic 66a63df152
Instance blocks with mod log entry and expiration (fixes #2506) (#5214)
* Instance blocks with mod log entry and expiration (fixes #2506)

* separate table for instance block mod log

* fix tests

* fix ts

* modlog entry for allow instance

* fix test cleanup

* add back test

* clippy

* fix check

* more changes

* move files

* update

* sql fmt

* partly working

* fix setup

* cleanup

* fixes

* prettier

* try catch

* address comments
2024-11-28 18:21:43 -05:00
Nutomic f6de3b0388
Enable site languages for new user (fixes #5234) (#5235)
* Enable site languages for new user (fixes #5234)

* test coverage
2024-11-28 18:03:14 -05:00
Dessalines d68c0a6691 Merge remote-tracking branch 'origin/main' into combined_tables_2 2024-11-28 17:44:32 -05:00
Felix Ableitner 5a403bc250 Revert " Add note wrapper (fixes #2657) (#5221)"
This reverts commit 7304ef3261.
2024-11-28 11:14:04 +01:00
Dessalines d8dda44010 Adding profile. 2024-11-27 16:37:05 -05:00
Dessalines 0ba961ff5c Adding tests, triggers, and history updates for report_combined. 2024-11-27 16:02:11 -05:00
Dessalines 2351c7a93b Fix ts optionals. 2024-11-26 16:58:46 -05:00
Dessalines 1ff8ae0641 Finishing up combined report table. 2024-11-26 16:53:01 -05:00
Dessalines 39b3ec2473 Combined tables try 2 2024-11-26 09:27:05 -05:00
Nutomic 7304ef3261
Add note wrapper (fixes #2657) (#5221)
* Add note wrapper (fixes #2657)

* fix activity list

* fmt

* add comment

* fix api tests

* backwards compat

* remove comment

* no todo, deprecated
2024-11-26 10:37:19 +01:00
Dessalines 7ee7b069af
Move up clippy and cargo test in CI. (#5229)
- Clippy is usually the most likely CI test to fail, and it currently
  takes > 5m to reach it, wasting CPU resources.
2024-11-26 09:39:14 +01:00
Nutomic c0d7d76570
Remove getrandom dependency (#5226)
* Remove getrandom dependency

* fix
2024-11-25 18:20:45 -05:00
Nutomic bb26a701bc
Proxy pictrs healthz endpoint (#5224) 2024-11-25 11:43:34 -05:00
Dessalines ba3d574d92
Add report_counts to post and comment aggregate tables. (#5219)
* Add report_counts to post and comment aggregate tables.

- This adds a report_count and unresolved_report_count to
  the post and comment aggregate tables.
- Useful for front-ends wishing to show report links.
- Fixes #4163

* Updating the historical counts.

* Switching from bigint to smallint.

* Using dullbananas create_trigger function.
2024-11-25 11:24:57 +01:00
Dessalines 41bd830389
Fixing a few clippy recommendations on 1.84 nightly. (#5222) 2024-11-25 10:06:39 +01:00
Nutomic b8dda06f5b
More test coverage for private community, fix some bugs (#5207)
* More test coverage for private community, fix some bugs

* fmt

* stuff

* attempted fix

* fix tests

* api tests passing

* fix tests

* apub lib
2024-11-22 10:49:56 -05:00
Nutomic 2848c076af
Add helper method for caching function results (#5220)
* Add helper method for caching function results

* fmt
2024-11-22 09:33:35 -05:00
Nutomic 63ea99d38a
Guess image mime type from file extension (fixes #5196) (#5212)
* Guess image mime type from file extension (fixes #5196)

* Mime check fixes. (#5213)

* Mime check fixes.

* Adding back comment.

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-11-19 09:48:44 -05:00
Dessalines 417e18e819
Upgrading diesel and a few other deps. (#5203)
* Upgrading diesel and a few other deps.

* Update crates/db_schema/src/utils.rs

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

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2024-11-18 10:23:02 -07:00
Nutomic 556358f53e
Dont sanitize RSS content manually (fixes #5171) (#5174) 2024-11-18 09:58:31 -05:00
Nutomic 797aac7281
Check for error when fetching link metadata (fixes #5127) (#5129)
* Check for error when fetching link metadata (fixes #5127)

* use error_for_status everywhere

* dont ignore errors

* enable lint

* fixes

* review

* more review
2024-11-15 09:13:43 -05:00
Dessalines fa4825b524
Removing a few expects from production and test code. (#5193)
* Removing a few expects from production and test code.

- Fixes #5192

* Using if let filter for admin emails.

* Fixing unused error.

* Adding expect_used = deny to clippy lints.

* Update src/lib.rs

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

* Update crates/utils/src/settings/structs.rs

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

* Update crates/utils/src/settings/mod.rs

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

* Some more cleanup.

* Fix clippy

---------

Co-authored-by: Nutomic <me@nutomic.com>
2024-11-15 08:18:52 -05:00
Dessalines 231cce9350
Cleanup post action forms (#5197)
* Removing a few SuccessResponses for PostHide and MarkPostAsRead.

- This also removes the pointless multiple post_ids. These can be done
  as individual calls on the front end anyway.
- Fixes #4755

* Fixing federation tests.

* Upgrading lemmy-js-client deps.

* Add ability to mark several posts as read.

Context:

- https://github.com/LemmyNet/lemmy/pull/5043
- https://github.com/LemmyNet/lemmy/issues/4755
- https://github.com/LemmyNet/lemmy/pull/5160

* Simplifying forms.

* Fixing forms.

* Cleanup post action forms by using derive_new defaults.

- Fixes #5195

* Fix ntfy to notify on success builds also.

* Removing pointless naive_now function.

* Running taplo fmt.
2024-11-15 11:21:08 +01:00
Dessalines 7f4e26e29e
Add ability to mark multiple posts as read. (#5178)
* Removing a few SuccessResponses for PostHide and MarkPostAsRead.

- This also removes the pointless multiple post_ids. These can be done
  as individual calls on the front end anyway.
- Fixes #4755

* Fixing federation tests.

* Upgrading lemmy-js-client deps.

* Add ability to mark several posts as read.

Context:

- https://github.com/LemmyNet/lemmy/pull/5043
- https://github.com/LemmyNet/lemmy/issues/4755
- https://github.com/LemmyNet/lemmy/pull/5160

* Fix ntfy to notify on success builds also.

* Addressing PR comments.
2024-11-14 09:03:39 -05:00
Dessalines a9d6d4e6e0
Add user setting to auto-mark fetched posts as read. (#5160)
* Add user setting to auto-mark fetched posts as read.

- Rather than apps collecting up viewed posts ids, and sending many
  mark as read requests, users can now turn this setting on, and any
  results from /post/list will be auto-marked as read.
- Fixes #5144

* Adding list_post request option to auto-mark as read.

* Moving db_perf to before federation tests.

* Fixing lemmyerrortype import.

* Fixing ts_option.

* Fix clippy.

* Fix override logic.

* Revert "Fix override logic."

This reverts commit 923d7f0eca.

* Changing name to mark_as_read
2024-11-13 10:05:16 -05:00
Dessalines c4d864878f
Change "mark post as read", "hide post" api calls to take single post instead of multiple (#5043)
* Removing a few SuccessResponses for PostHide and MarkPostAsRead.

- This also removes the pointless multiple post_ids. These can be done
  as individual calls on the front end anyway.
- Fixes #4755

* Fixing federation tests.

* Upgrading lemmy-js-client deps.

* Simplifying forms.

* Fixing forms.

* Removing indexing slicing from a test.
2024-11-13 09:36:18 -05:00
Dessalines faf62de4e3
Fixing cors origin wildcard. (#5194)
* Fixing cors origin wildcard.

- Fixes #5185

* Add other allows to specified origin block.

* Fix clippy.
2024-11-13 09:45:17 +01:00
Nutomic f916309df8
Always assign default language before checking if language is allowed (#5132)
* Always assign default language before checking if language is allowed (fixes #5131)

* handle all logic in same fn

* fix test

* rename
2024-11-12 14:52:39 -05:00
Nutomic 542e59bcae
Fetch community mods synchronously (#5169)
* Fetch community mods synchronously

* fix

* fix

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-11-12 12:43:24 -05:00
Nutomic dce6c6bbf0
Move aggregates to replaceable_schema, fix error (fixes #5186) (#5190)
* Move aggregates to replaceable_schema, fix error (fixes #5186)

* fmt

* r prefix
2024-11-12 12:03:30 -05:00
SleeplessOne1917 a8fb55d6c8
Simplify regex for user/community name validation (#5164)
* Add lowercase only check for community names

* Lint

* Remove redundant check

* Lint

* Add newline escape tests

* Eliminate confounding factor in community name test

* Use same check for user names and community names

* Use min/max length check

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
2024-11-12 05:54:23 -05:00
Dessalines 7d5cb9de49
Cleanup URL tracking tests. (#5181) 2024-11-12 10:35:15 +01:00
dullbananas 2e8687e203
Combine action tables (#4459)
* Update comment_report_view.rs

* Update comment_report_view.rs

* Update post_view.rs

* Update utils.rs

* Update schema.rs

* stuff

* stuff

* fix actions

* PostLike

* fmt

* more post stuff (partial)

* remove uplete

* returning

* rename read_comments field

* PersonPostAggregates

* a

* fix usage of read_comments_amount

* comment

* community

* community_block

* instance_block

* LocalUser::export_backup

* person_block

* person

* stuff (partial)

* update cargo.lock

* fix lemmy_db_schema

* post_view

* comment_report_view

* comment_view

* post_report_view

* find and replace some selected values

* private_message_view

* vote_view

* comment_reply_view

* some action views

* action_query, find_action

* community_view

* block views

* person_mention_view

* remove struct update

* refactor actions function

* actions_alias

* clean up return types and trait bounds

* fix all rust code

* fmt

* clippy fix

* Migrate tables

* migrate indexes and contraints, and add statistics

* fix what appears to be a messed up merge

* commented thing

* Create uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update up.sql

* Update comment.rs

* Update Cargo.toml

* Update comment.rs

* Update post.rs

* Update comment_view.rs

* Update post_view.rs

* Update comment_reply_view.rs

* Update person_mention_view.rs

* Update Cargo.toml

* Update utils.rs

* Update comment.rs

* Update utils.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update comment.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update comment_view.rs

* Update post_view.rs

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* Update comment_reply_view.rs

* Update person_mention_view.rs

* Update person_mention_view.rs

* Update comment_reply_view.rs

* Update uplete.rs

* start removing post_id column

* Update down.sql

* Update schema.rs

* Update comment.rs

* Update comment.rs

* Update comment.rs

* Update schema.rs

* Update comment.rs

* Update like.rs

* Update comment.rs

* Update up.sql

* Update down.sql

* Update down.sql

* Update up.sql

* Update up.sql

* Update down.sql

* Update comment.rs

* Update vote_view.rs

* Update vote_view.rs

* Update comment_aggregates.rs

* Update person_aggregates.rs

* Update comment_view.rs

* Update vote_view.rs

* Update mod.rs

* Update create.rs

* Update comment.rs

* Update community.rs

* Update community.rs

* Update up.sql

* Update uplete.rs

* Update uplete.rs

* revert to UpleteCount

* Update comment.rs

* Update traits.rs

* Update comment.rs

* Update community.rs

* Update community_block.rs

* Update community.rs

* Update instance_block.rs

* Update instance.rs

* Update community_block.rs

* Update person.rs

* Update person_block.rs

* Update person.rs

* Update person_block.rs

* Update person.rs

* Update instance.rs

* Update instance_block.rs

* Update instance.rs

* Update person.rs

* Update post.rs

* Update comment.rs

* Update community.rs

* Update person.rs

* Update post_view.rs

* Update comment.rs

* reduce diff

* revert some changes in views

* Update post_view.rs

* Update comment.rs

* Update post.rs

* fix missing cfg_attr

* rewrite uplete

* Update Cargo.toml

* Update Cargo.toml

* Update uplete.rs

* add `pub` to structs that appear in trait bounds

* optional = true

* Update uplete.rs

* Update community.rs

* Update comment.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* something is wrong with me

* use new uplete function everywhere

* fmt

* fmt

* Keep post_id when comment_actions::liked is not null

* Update up.sql

* Update up.sql

* clean up up.sql

* clean up down.sql

* fix

* Update person_aggregates.rs

* fmt

* Update uplete.rs

* fmt

* Update uplete.rs

* Update community.rs

* Update uplete.rs

* Update local_user.rs

* fmt

* fix

* fix

* fmt

* improve uplete api

* Update uplete.rs

* fix

* fix

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* Update uplete.rs

* fix

* fix test

* fix db_views_actor imports

* fix uplete import in post_view test

* rerun ci

* fix AllNull syntax error

* fix DynColumn

* Fix rust syntax

* fmt

* fix iter

* pain

* Update community_moderators.rs

* Update community_moderator_view.rs

* Update uplete.rs

* Fix mistake found by chatgpt

* revert debugging stuff, change migration date, refactor constraint

* Update down.sql

* Update down.sql

* fmt

* make things added to db_schema::utils more understandable

* update rust version for woodpecker

* finish merge

* Fix index that checked read_comments twice instead of also checking read_comments_amount

* fix

* uplete: test_count, test_generated_sql_setting_one_column_null, test_count_methods

* refactor uplete sql test

* test setting both columns to null in uplete

* make AllNull generic

* test AllNull

* Merge remote-tracking branch 'upstream/main' into smoosh-tables-together

---------

Co-authored-by: phiresky <phireskyde+git@gmail.com>
2024-11-11 11:34:10 +01:00
SleeplessOne1917 05c3eae016
Bump versions used in compose (#5180) 2024-11-08 17:43:44 -05:00