Commit Graph

263 Commits

Author SHA1 Message Date
dull b
c1ad7a161b Fix lifetime for everything except Crud::delete 2023-07-25 02:35:35 +00:00
dull b
3129cd0fc3 Revert "Revert "Change Crud to Crud<'a> (won't compile)""
This reverts commit 25a27165a8.
2023-07-24 19:36:19 +00:00
dull b
a1084530d2 Revert "Use non-borrowed forms"
This reverts commit d2dd442563.
2023-07-24 19:04:36 +00:00
dull b
d2dd442563 Use non-borrowed forms 2023-07-24 19:04:30 +00:00
dull b
78c1530601 Revert "Insert trait"
This reverts commit 9d780c2403.
2023-07-24 18:43:18 +00:00
dull b
9d780c2403 Insert trait 2023-07-24 18:43:13 +00:00
dull b
9f61be4035 Remove commented Site::read 2023-07-24 04:43:32 +00:00
dull b
9f47fcbe87 Remove Crud::delete definitions that match default 2023-07-24 04:43:02 +00:00
dull b
c37cd3ccd9 Default Crud::delete 2023-07-24 04:37:53 +00:00
dull b
25a27165a8 Revert "Change Crud to Crud<'a> (won't compile)"
This reverts commit 7ed20f5f71.
2023-07-24 04:21:14 +00:00
dull b
7ed20f5f71 Change Crud to Crud<'a> (won't compile) 2023-07-24 04:21:06 +00:00
dull b
3b3540cb27 Attempt default Crud::create 2023-07-24 04:12:27 +00:00
dull b
183c61b3d2 Replace filter with find 2023-07-24 03:45:33 +00:00
dull b
e1797a8eb4 Clean up default Crud::read and rename 'query2 2023-07-24 03:39:40 +00:00
dull b
32ad580239 Restore Person::read 2023-07-24 03:32:16 +00:00
dull b
f77b0d758f Successfully make default read implementation work 2023-07-24 01:23:06 +00:00
dull b
cab4bc6ab3 Stuff 2023-07-24 01:18:37 +00:00
dull b
374b0f6f9e Merge remote-tracking branch 'upstream/main' into defaults 2023-07-23 18:20:19 +00:00
Sander Saarend
b511c2e6cb
Denormalize community_id into post_aggregates for a 1000x speed-up when loading posts (#3653)
* Denormalize community_id into post_aggregates for a 1000x speed-up when loading posts

* Remove unused index

* Add creator_id to post_aggregates

* Use post_aggregates as main table for PostQuery

* Make post_aggregates the main table for PostView

* Reformat SQL
2023-07-20 11:13:21 -04:00
cetra3
9256895635
Cache & Optimize Woodpecker CI (#3450)
* Try using drone cache plugin

* Try another path

* Include volume

* Fix formatting

* Include fmt

* Exclude cargo dir from prettier

* Don't override cargo

* Just do check

* Add cache key

* Use different cache plugin

* Add clippy

* Try minio

* Add quotes

* Try adding secrets

* Try again

* Again

* Use correct secret formation

* Add back clippy

* Use secret for the root bucket name

* Try drone cache instead

* Add region

* Add path-style option

* Include cargo clippy

* Include everything again

* Fix formatting

* Don't run clippy twice

* Add `allow` statements for tests to pass

* Adjust endpoint to be a secret

* Fix prettier

* Merge & fix tests

* Try to restart the woodpecker test

* Change the ENV var name

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-17 11:04:14 -04:00
Nutomic
e9e76549a8
Split activity table into sent and received parts (fixes #3103) (#3583)
* Split activity table into sent and received parts (fixes #3103)

The received activities are only stored in order to avoid processing
the same incoming activity multiple times. For this purpose it is
completely unnecessary to store the data. So we can split the
table into sent_activity and received_activity parts, where
only sent_activity table needs to store activity data. This should
reduce storage use significantly.

Also reduces activity storage duration to three months, we can reduce
this further if necessary.

Additionally the id columns of activity tables are removed because
they are completely unused and risk overflowing (fixes #3560).

* address review

* move insert_received_activity() methods to verify handlers

* remove unnecessary conflict line

* clippy

* use on conflict, add tests
2023-07-14 11:17:06 -04:00
dull b
43789f04ec Stuff 2023-07-14 14:56:26 +00:00
phiresky
2938b50908
work around race condition on community fetch (#3414) 2023-07-14 14:57:36 +02:00
Dessalines
164f4b93d9
Make lemmy_api_common wasm-compatible (#3587)
* Fixing lemmy_api_common optionals

* Adding taplo for .toml files.

* Versioning taplo in woodpecker.

* Addressing PR comments.
2023-07-14 10:45:18 +02:00
dull b
ceab862021 fmt 2023-07-14 05:05:09 +00:00
dull b
8745a6cc45 Simplify Crud::read lifetimes 2023-07-14 05:02:52 +00:00
dull b
1f108177d0 Default impl for Crud::read 2023-07-14 04:14:48 +00:00
dull b
b33b459a66 Start doing stuff 2023-07-13 16:33:42 +00:00
Nutomic
7d8cb93b53
Check for dead federated instances (fixes #2221) (#3427)
* Check for dead federated instances (fixes #2221)

* move to apub crate, use timestamp

* make it compile

* clippy

* use moka to cache blocklists, dead instances, restore orig scheduled tasks

* remove leftover last_alive var

* error handling

* wip

* fix alive check for instances without nodeinfo, add coalesce

* clippy

* move federation blocklist cache to #3486

* unused deps
2023-07-13 16:12:01 +02:00
Simon Bordeyne
9b5e765364
Add infinite scroll user option (#3572) 2023-07-12 09:12:01 -04:00
dull b
21a2e7b898 Merge remote-tracking branch 'upstream/main' into defaults 2023-07-11 18:02:05 +00:00
dull b
239686be0b h 2023-07-11 18:00:09 +00:00
dullbananas
1d38aad9d3
Make functions work with both connection and pool (#3420)
* a lot

* merge

* Fix stuff broken by merge

* Get rid of repetitive `&mut *context.conn().await?`

* Add blank lines under each line with `conn =`

* Fix style mistakes (partial)

* Revert "Fix style mistakes (partial)"

This reverts commit 48a033b87f.

* Revert "Add blank lines under each line with `conn =`"

This reverts commit 773a6d3beb.

* Revert "Get rid of repetitive `&mut *context.conn().await?`"

This reverts commit d2c6263ea1.

* Use DbConn for CaptchaAnswer methods

* DbConn trait

* Remove more `&mut *`

* Fix stuff

* Re-run CI

* try to make ci start

* fix

* fix

* Fix api_common::utils

* Fix apub::activities::block

* Fix apub::api::resolve_object

* Fix some things

* Revert "Fix some things"

This reverts commit 2bf8574bc8.

* Revert "Fix apub::api::resolve_object"

This reverts commit 3e4059aabb.

* Revert "Fix apub::activities::block"

This reverts commit 3b02389abd.

* Revert "Fix api_common::utils"

This reverts commit 7dc73de613.

* Revert "Revert "Fix api_common::utils""

This reverts commit f740f115e5.

* Revert "Revert "Fix apub::activities::block""

This reverts commit 2ee206af7c.

* Revert "Revert "Fix apub::api::resolve_object""

This reverts commit 96ed8bf2e9.

* Fix fetch_local_site_data

* Fix get_comment_parent_creator

* Remove unused perma deleted text

* Fix routes::feeds

* Fix lib.rs

* Update lib.rs

* rerun ci

* Attempt to create custom GetConn and RunQueryDsl traits

* Start over

* Add GetConn trait

* aaaa

* Revert "aaaa"

This reverts commit acc9ca1aed.

* Revert "Revert "aaaa""

This reverts commit 443a2a00a5.

* still aaaaaaaaaaaaa

* Return to earlier thing

Revert "Add GetConn trait"

This reverts commit ab4e94aea5.

* Try to use DbPool enum

* Revert "Try to use DbPool enum"

This reverts commit e4d1712646.

* DbConn and DbPool enums (db_schema only fails to compile for tests)

* fmt

* Make functions take `&mut DbPool<'_>` and make db_schema tests compile

* Add try_join_with_pool macro and run fix-clippy on more crates

* Fix some errors

* I did it

* Remove function variants that take connection

* rerun ci

* rerun ci

* rerun ci
2023-07-11 09:09:59 -04:00
Piotr Juszczyk
9c2490d4f2
Fix #3501 - Fix aggregation counts for elements removed and deleted (#3543)
Two bugs were found and fixed:
- previously elements removal and deletion were counted as two separate disappearances
- removing comments did not affect post aggregations
2023-07-10 11:30:30 -04:00
Nutomic
93225e5ddf
Error enum fixed (#3487)
* Create error type enum

* Replace magic string slices with LemmyErrorTypes

* Remove unused enum

* Add rename snake case to error enum

* Rename functions

* clippy

* Fix merge errors

* Serialize in PascalCase instead of snake_case

* Revert src/lib

* Add serialization tests

* Update translations

* Fix compilation error in test

* Fix another compilation error

* Add code for generating typescript types

* Various fixes to avoid breaking api

* impl From<LemmyErrorType> for LemmyError

* with_lemmy_type

* trigger ci

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
2023-07-10 16:50:07 +02:00
Dessalines
8bcf2ea7c9
Fixing clippy. (#3471) 2023-07-04 12:15:27 +02:00
JP Moresmau
bbca6ef6dc
Do not decrement comment score twice when removing then deleting. (#3196)
Fixes #3004

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-03 14:13:53 -04:00
Simon Bordeyne
b8ee9315bc
Add Open links in new tab setting (#3318)
* Add Open links in new tab setting

* reorder because it fixes tests ?
2023-07-03 11:10:25 -04:00
Nutomic
cb91eedd24
Use serde(skip) instead of skip_serializing, add placeholder values (#3362)
* Use serde(skip) instead of skip_serializing

The latter breaks lemmy_crawler as the field is not included in
the Lemmy API, but is required when attempting to parse API responses.
Should only use serde(skip) to avoid this problem

* use option

* add placeholders

* no unwrap
2023-07-03 15:14:01 +02:00
Sander Saarend
ec18fd9869
Fix cargo warnings (#3397) 2023-06-28 12:57:49 -04:00
dullbananas
bef76630c5
Remove redundant calls to Iterator::collect (#3365)
* Remove redundant calls to `Iterator::collect`

* Update mentions.rs

* Add clippy lints and run fmt

* CI ran on the wrong commit again 
2023-06-28 11:19:26 +02:00
TKilFree
2aef6a5a33
feat: re-added captcha checks (#3289) 2023-06-27 06:38:53 -04:00
Sander Saarend
76a4513774
Limit password resets (#3344) 2023-06-27 11:20:53 +02:00
c-andy-candies
f5209fffc1
Feature add three six and nine months options backend (#3226)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-26 15:03:35 -04:00
Felix Ableitner
73d2faa9f5 Remove another unused dev dependency 2023-06-26 12:46:44 +02:00
Nutomic
ddfa112e0b
Allow wildcard imports in schema.rs (#3293)
Dont mess with auto-generated code, this avoids problems with
clippy after running diesel commands
2023-06-26 11:18:29 +02:00
Scott
c5886404ef
Update DB local_user.theme type to text (#3266)
* Update local_user.theme type to text

* fix default value

* Undo auto generate changes
2023-06-26 10:53:04 +02:00
Felix Ableitner
ce0cf0e41b Remove DELETED_REPLACEMENT_URL 2023-06-26 10:45:37 +02:00
Sander Saarend
6b28f8c616 Add support for sslmode=require for diesel-async DB connections (#3189) 2023-06-26 10:45:22 +02:00
cetra3
d6b580a530 Remove actix_rt & use standard tokio spawn (#3158)
* Remove `actix_rt` & use standard tokio spawn

* Adjust rust log back down

* Format correctly

* Update cargo lock

* Add DB settings

* Change name and update to latest rev

* Clean up formatting changes

* Move `worker_count` and `worker_retry_count` to settings

* Update defaults

* Use `0.4.4` instead of git branch
2023-06-26 10:45:22 +02:00