Compare commits

...

3735 Commits

Author SHA1 Message Date
Dessalines 69bdcb3069 Version 0.19.4-rc.2 2024-05-23 12:10:33 -04:00
Dessalines 6a6108ac55
Fixing proxied images for federated posts. (#4737)
* Fixing proxied images for federated posts.

- Also added test.
- Fixes #4736

* Address PR comments.
2024-05-23 11:11:25 -04:00
Nutomic b2c1a14234
Correct url for nodeinfo version (#4734)
* Correct url for nodeinfo version

* add compat redirect

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-05-23 10:59:56 -04:00
Nutomic d8dc38eb06
Upgrade dependencies (#4740) 2024-05-23 10:55:20 -04:00
Nutomic c96017c009
Configure max comment width in clippy (#4738)
* Configure max comment width in clippy

* update default config
2024-05-23 08:46:26 -04:00
Dessalines 9aa565b559 Version 0.19.4-rc.1 2024-05-22 08:58:31 -04:00
Dessalines 7d7cd8ded4
Dont show replies / mentions from blocked users. Fixes #4227 (#4727)
* Dont show replies / mentions from blocked users. Fixes #4227

* Adding unit tests for reply and mention views.

- Also cleaned up some unwraps in the tests.

* Add allow deprecated to pass clippy for deprecated wav crate.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-05-22 08:50:26 -04:00
Nutomic 943c31cc72
Allow passing command line params via environment (fixes #4603) (#4729)
* Allow passing command line params via environment (fixes #4603)

* add prefix

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-05-22 08:39:01 -04:00
Nutomic 973f39601c
Dont allow removing comment which was deleted (fixes #4731) (#4732) 2024-05-22 08:29:01 -04:00
Felix Ableitner a39c19c9db Version 0.19.4-beta.8 2024-05-22 10:30:38 +02:00
Dessalines 55f84dd38a
Fixing proxy images (#4722)
* Adding an image_details table to store image dimensions.

- Adds an image_details table, which stores the height,
  width, and content_type for local and remote images.
- For LocalImages, this information already comes back with
  the upload.
- For RemoteImages, it calls the pictrs details endpoint.
- Fixed some issues with proxying non-image urls.
- Fixes #3328
- Also fixes #4703

* Running sql format.

* Running fmt.

* Don't fetch metadata in background for local API requests.

* Dont export remote_image table to typescript.

* Cleaning up validate.

* Dont proxy url.

* Fixing tests, fixing issue with federated thumbnails.

* Fix tests.

* Updating corepack, fixing issue.

* Refactoring image inserts to use transactions.

* Use select exists again.

* Fixing imports.

* Fix test.

* Removing pointless backgrounded metadata generation version.

* Removing public pictrs details route.

* Fixing clippy.

* Fixing proxy image fetching. Fixes #4703

- This extracts only the proxy image fixes from #4704, leaving off
  thumbnails.

* Fix test.

* Addressing PR comments.

* Address PR comments 2.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-05-22 10:28:47 +02:00
Nutomic 6b46a70535
Extra logging to debug duplicate activities (ref #4609) (#4726)
* Extra logging to debug duplicate activities (ref #4609)

* Fix logging for api tests

* fmt
2024-05-21 14:47:06 -04:00
Nutomic 4ffaa93431
Dont allow reusing password reset token, use normal rate limit (#4719)
* Dont allow reusing password reset token, use normal rate limit

* fix
2024-05-21 14:46:49 -04:00
flamingos-cant a0ad7806cb
Increase alt_text size to 1500 (#4724) 2024-05-17 13:03:19 -04:00
Nutomic 99aac07714
Mark database fields as sensitive so they dont show up in logs (#4720)
* Mark database fields as sensitive so they dont show up in logs

* add file

* fix test

* Update crates/apub/src/objects/person.rs

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

* Update crates/apub/src/objects/community.rs

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

* Update crates/apub/src/objects/instance.rs

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

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-05-16 20:41:57 -04:00
Dessalines 1a4aa3eaba
Stop using a diesel_cli docker image, use cargo-install in woodpecker. (#4723)
* Stop using a diesel_cli docker image, use cargo-binstall in woodpecker.

- The diesel_cli image is 500MB, and rebuilt daily. Much easier to use
  binstall to install it.

* Trying out a multiline var.

* Try sequence merges 1

* Try removing features.

* Try path fix.

* Abstracting diesel cli install.

* Try installing mysql and postgres.

* Try installing mysql and postgres 2.

* Try installing mysql and postgres 3.

* Try installing mysql and postgres 4.

* Try installing mysql and postgres 5.

* Try installing mysql and postgres 6.

* Try installing mysql and postgres 7.

* Try installing mysql and postgres 8.

* Try installing mysql and postgres 9.

* Try installing mysql and postgres 10.

* Try installing mysql and postgres 11.

* Try installing mysql and postgres 12.

* Try installing mysql and postgres 13.

* Add logging line.

* Add logging line 2.

* Add logging line 3.

* Add logging line 4.

* Removing binstall.

* Extract taplo into its own image, ignore binstall.

* Use a smaller taplo.

* taplo is the same image.
2024-05-16 16:41:36 -04:00
Nutomic 93c9a5f2b1
Dont federate post locking via Update activity (#4717)
* Dont federate post locking via Update activity

* cleanup

* add missing mod log entries

* update assets
2024-05-15 07:36:00 -04:00
Nutomic 9a9d518153
Fix import blocked objects (#4712)
* Allow importing partial backup (fixes #4672)

* Fetch blocked objects if not known locally (fixes #4669)

* extract helper fn

* add comment

* cleanup

* remove test

* fmt

* remove .ok()
2024-05-14 23:03:43 -04:00
Nutomic 7fb03c502e
Add test to ensure reports are sent to user's home instance (ref #4701) (#4711)
* Add test to ensure reports are sent to user's home instance (ref #4701)

* enable all tests

* set package-manager-strict=false
2024-05-14 22:48:24 -04:00
Nutomic 49bb17b583
Stricter rate limit for login (#4718) 2024-05-14 22:43:43 -04:00
Nutomic 723cb549d4
Allow importing partial backup (fixes #4672) (#4705)
* Allow importing partial backup (fixes #4672)

* Dont throw error on empty LocalUser::update

* fix tests
2024-05-14 22:37:30 -04:00
Nutomic 8b6a4c060e
Make nodeinfo standard compliant, upgrade to nodeinfo 2.1 (fixes #4702) (#4706)
* Always set activitypub protocol in nodeinfo response (fixes #4702)

* Add mandatory fields
2024-05-13 22:53:20 -04:00
Dessalines cb80980027 Version 0.19.4-beta.7 2024-05-11 13:51:09 -04:00
dullbananas c4fc3a8ede
Optimize stuff in attempt to fix high amount of locks, and fix comment_aggregates.child_count (#4696)
* separate triggers

* auto_explain.log_triggers=on

* Revert "auto_explain.log_triggers=on"

This reverts commit 078b2dbb9bbb878078f1089cffda06b6458d127c.

* Revert "separate triggers"

This reverts commit 95600da4afb49e1dc203c2d61da4c57858e107db.

* bring back migration

* re-order statements

* add comment about statement ordering

* no redundant updates

* optimize post_aggregates update in comment trigger

* set comment path in trigger

* update comment_aggregates.child_count using trigger

* move `LEFT JOIN post` to inner query

* clean up newest_comment_time_necro

* add down.sql
2024-05-09 08:18:55 -04:00
Nutomic b4f9ef24a5
Dont exit early when running only scheduled tasks (#4707)
* Dont exit early when running only scheduled tasks (fixes #4709)

* fix
2024-05-08 14:56:44 +02:00
Nutomic 866d752a3c
Instance.preferred_username should be optional (fixes #4701) (#4713) 2024-05-08 08:01:04 -04:00
Nutomic e0b1d0553d
Add timeout for processing incoming activities (#4708)
* Add timeout for processing incoming activities

* move to const
2024-05-08 08:00:55 -04:00
Nutomic 7c146272c3
Federate with wordpress, improvements for NodeBB, Discourse federation (#4692)
* Federate with wordpress

* upgrade apub lib with fix

* Also read post's community from `audience`

* cleanup

* cargo update

* upgrade apub lib

* add wordpress test activity
2024-05-07 16:20:43 -04:00
Nutomic cfdc732d3a
On registration set show_nsfw based on site.content_warning (#4616)
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-05-07 16:18:58 -04:00
Tim Coombs 522f974e30
fix: use docker compose v2 (#4622)
* fix: use docker compose v2

* Using sudo tee.

* fix: correct postgres sed command

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-05-07 11:41:40 +02:00
SleeplessOne1917 b152be7951
Update rustls (#4690)
* Update rustls

* Format code
2024-05-03 16:06:14 -04:00
SleeplessOne1917 485b0f1a54
Replace unmaintained encoding dep with maintained encoding_rs dep (#4694)
* Replace dependency on unmaintained encoding crate with dep on maintained encoding_rs crate

* Update lockfile

* Taplo format Cargo.toml

* Use better variable name

* Replace into_owned with into
2024-05-03 10:42:48 +00:00
Nutomic 7540b02723
Update activitypub library (#4691)
https://github.com/LemmyNet/activitypub-federation-rust/releases/tag/0.5.5
2024-05-02 12:46:34 -04:00
Nutomic 7746db4169
Testing and minor fix for federation with Discourse (#4628)
* Testing and minor fix for federation with Discourse

* prettier
2024-05-02 07:49:19 -04:00
Dessalines db2ce81fc4
Show trigger logging. #4681 (#4688) 2024-05-01 18:46:14 -04:00
renovate[bot] 4175a1af80
chore(deps): update rust crate serde_with to 3.8.1 (#4687)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-30 23:47:02 -04:00
renovate[bot] 563280456e
chore(deps): update pnpm to v9.0.6 (#4682)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-30 23:43:14 -04:00
Dessalines 2fecb7ecdf
Dont show own comments for liked and disliked_only. Fixes #4675 (#4679)
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-30 23:26:55 -04:00
renovate[bot] 2c6f9c7fd5
chore(deps): update rust crate serde to 1.0.199 (#4684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-30 23:17:23 -04:00
renovate[bot] e338e59868
fix(deps): update rust crate lettre to 0.11.7 (#4685)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-30 22:54:16 -04:00
renovate[bot] b0caa85ed4
chore(deps): update rust crate base64 to 0.22.1 (#4683)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-30 22:30:19 -04:00
Dessalines ad60d91f5c
Dont publish lemmy_db_perf to fix crates.io publish. Fixes #4678 (#4680) 2024-04-30 17:51:12 +00:00
Dessalines 6423d2dde5 Version 0.19.4-beta.6 2024-04-30 06:38:44 -04:00
Nutomic 12163701e7
Avoid crash when handling urls without domain (#4676)
* Avoid crash when handling urls without domain

* Add some extra checks
2024-04-30 06:33:37 -04:00
Dessalines 5c35e97a75
Dont show deleted / removed posts when searching. Fixes #4576 (#4671)
* Dont show deleted / removed posts when searching. Fixes #4576

* Address PR comments.

* Clean up comment removed also.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-30 12:24:18 +02:00
SleeplessOne1917 b05f221565
Remove login step from publish to crates.io (#4674) 2024-04-30 00:07:03 +00:00
Nutomic beec080274
Testing for federation with NodeBB, make community.followers_url optional (#4629)
* Testing for federation with NodeBB, make community.followers_url optional

* clippy
2024-04-29 12:34:11 +02:00
Dessalines 492d8f1b01
Fix communities with broken outboxes, and use PostView. Fixes #4658 (#4668)
* Fix communities with broken outboxes, and use PostView. Fixes #4658

* Fixing tests.

* Dont pass ref and clone.
2024-04-29 12:22:00 +02:00
dullbananas d3737d4453
Optimize actor_language.rs (#4612)
* Remove useless transaction in actor_language.rs

* Update actor_language.rs

* site

* community

* Update actor_language.rs

* Update actor_language.rs

* Update actor_language.rs

* Update actor_language.rs

* Update actor_language.rs
2024-04-27 10:59:58 -04:00
Dessalines b459949f57 Version 0.19.4-beta.5 2024-04-25 19:59:24 -04:00
Dessalines 93f5df2d2a
Adding post_id desc to all post_aggregates indexes. Fixes #4618 (#4662)
* Adding post_id desc to all post_aggregates indexes. Fixes #4618

* Running pg_format

* Not rebuilding indexes which had no changes.
2024-04-25 18:19:02 -04:00
Nutomic cf426493e1
Fix community add mod check (fixes #4624) (#4667) 2024-04-25 11:47:38 -04:00
Dessalines 8e3ff0408e
Fixing extra modlog entries when post_id or comment_id is given. (#4664)
- Previously when given a post_id, it didn't filter out any other
  modlog entries, such as community removals. This fixes that problem.
- Context: https://github.com/LemmyNet/lemmy-ui/pull/2437

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-25 10:26:17 +02:00
Dessalines 66e06b3952
Removing scheme from block urls. Fixes #4656 (#4659)
* Removing scheme from block urls. Fixes #4656

* Fix comment.

* Fixing domain checking.

* Removing pointless URL building in url blocklist regex.

* Remove trailing /
2024-04-23 23:15:20 -04:00
Kroese 6b9d9dfaa5
Fix broken thumbnails (#4661)
* Check is_image_post flag

* Keep cargo_fmt happy

* Filter on is_image_post

* Trigger CI

* Keep cargo_fmt happy
2024-04-23 22:52:56 -04:00
tracyspacy 0eaf8d33e7
Filter_removed_comments_from_search (#4634)
* filter_removed_comments_from_search

* Revert "filter_removed_comments_from_search"

This reverts commit c6d6490afa923a666b96c785a776711ef42baed7.

* filtering_removed_comments_search

* filter_deleted_comments

* Revert "filter_deleted_comments"

This reverts commit 7dc1d13d24f0300ae17cecdf13abbfba24ac9a06.

* Revert "filtering_removed_comments_search"

This reverts commit 6e9b1de7a21a03caed3b2832fbf5d09c204b7994.

* filtering_removed_dELeted_comments_search
2024-04-22 11:33:02 -04:00
renovate[bot] c31a29ec7f
chore(deps): update dependency @types/node to v20.12.7 (#4647)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-19 18:56:35 -04:00
renovate[bot] 80635c9e24
chore(deps): update rust crate base64 to 0.22.0 (#4651)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-19 18:40:38 -04:00
renovate[bot] 95d75e07b2
chore(deps): update pnpm to v9.0.4 (#4649)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-19 18:23:06 -04:00
renovate[bot] efbfdc9340
chore(deps): update docker/dockerfile docker tag to v1.7 (#4650)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-19 18:12:26 -04:00
renovate[bot] 1ae3aab764
chore(deps): update dependency typescript to v5.4.5 (#4648)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-19 18:11:21 -04:00
renovate[bot] f68881c552
chore: Configure Renovate (#4644)
* Add renovate.json

* Updating renovate.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-04-19 17:00:23 -04:00
Dessalines 2ba1ba88b8
Upgrading deps. (#4645) 2024-04-19 16:50:27 -04:00
Dessalines 079fa0b8f6 Version 0.19.4-beta.4 2024-04-18 21:11:15 -04:00
dependabot[bot] b0a740d5c5
Bump h2 from 0.3.25 to 0.3.26 (#4639)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.25 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.25...v0.3.26)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 21:05:45 -04:00
Kroese ee46242a43
Update aarch64-lemmy-linux-gnu to v0.3.0 (#4638) 2024-04-18 20:34:55 -04:00
dullbananas 4ba6221e04
Move SQL triggers from migrations into reusable sql file (#4333)
* stuff

* stuff including batch_upsert function

* stuff

* do things

* stuff

* different timestamps

* stuff

* Revert changes to comment.rs

* Update comment.rs

* Update comment.rs

* Update post_view.rs

* Update utils.rs

* Update up.sql

* Update up.sql

* Update down.sql

* Update up.sql

* Update main.rs

* use anyhow macro

* Create down.sql

* Create up.sql

* Create replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update utils.rs

* Update .woodpecker.yml

* Update sql_format_check.sh

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Create dump_schema.sh

* Update start_dev_db.sh

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* stuff

* Update replaceable_schema.sql

* Update .pg_format

* fmt

* stuff

* stuff (#21)

* Update replaceable_schema.sql

* Update up.sql

* Update replaceable_schema.sql

* fmt

* update cargo.lock

* stuff

* Update replaceable_schema.sql

* Remove truncate trigger because truncate is already restricted by foreign keys

* Update replaceable_schema.sql

* fix some things

* Update replaceable_schema.sql

* Update replaceable_schema.sql

* Update .woodpecker.yml

* stuff

* fix TG_OP

* Psql env vars

* try to fix combine_transition_tables parse error

* Revert "try to fix combine_transition_tables parse error"

This reverts commit 75d00a46266fbb49b7fab1b149c79fa1c31ee84a.

* refactor combine_transition_tables

* try to fix create_triggers

* fix some things

* try to fix combined_transition_tables

* fix sql errors

* update comment count in post trigger

* fmt

* Revert "fmt"

This reverts commit a5bcd0834bb91a63b66bf63a848caa078f193940.

* Revert "update comment count in post trigger"

This reverts commit 0066a4b42b3472c088eed945605a2cf0bfcc1362.

* fix everything

* Update replaceable_schema.sql

* actually fix everything

* refactor create_triggers

* fix

* add semicolons

* add is_counted function and fix incorrect bool operator in update_comment_count_from_post

* refactor comment trigger

* refactor post trigger

* fix

* Delete crates/db_schema/src/utils/series.rs

* subscribers_local

* edit migrations

* move migrations

* remove utils::series module declaration

* fix everything

* stuff

* Move sql to schema_setup dir

* utils.sql

* delete .pg_format

* Update .woodpecker.yml

* Update sql_format_check.sh

* Update .woodpecker.yml

* Merge remote-tracking branch 'upstream/main' into bliss

* fmt

* Create main.rs

* Update lib.rs

* Update main.rs

* Update .woodpecker.yml

* Update main.rs

* Update Cargo.toml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update triggers.sql

* YAY

* Update mod.rs

* Update Cargo.toml

* a

* Update Cargo.toml

* Update Cargo.toml

* Delete crates/db_schema/src/main.rs

* Update Cargo.toml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update utils.sql

* Update utils.sql

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update down.sql

* Update up.sql

* Update triggers.sql

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update triggers.sql

* Update down.sql

* Update .woodpecker.yml

* Update Cargo.toml

* Update .woodpecker.yml

* Update Cargo.toml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update mod.rs

* Update Cargo.toml

* Update mod.rs

* make dump_schema.sh executable

* fix dump_schema.sh

* defer

* diff dumps

* fmt

* Update utils.sql

* Update .woodpecker.yml

* use correct version for pg_dump

* Update .woodpecker.yml

* Update .woodpecker.yml

* change migration date

* atomic site_aggregates insert

* temporarily repeat tests in CI

* drop r schema in CI migration check

* show ReceivedActivity::create error

* move check_diesel_migration CI step

* Update .woodpecker.yml

* Update scheduled_tasks.rs

* Update scheduled_tasks.rs

* update cargo.lock

* move sql files

* move rank functions

* filter post_aggregates update

* fmt

* cargo fmt

* replace post_id with id

* update cargo.lock

* avoid locking rows that need no change in up.sql

* only run replaceable_schema if migrations were run

* debug ci test failure

* make replaceable_schema work in CI

* Update .woodpecker.yml

* remove println

* Use migration revert and git checkout

* Update schema_setup.rs

* Fix

* Update schema_setup.rs

* Update schema_setup.rs

* Update .woodpecker.yml

---------

Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-04-17 20:58:44 -04:00
Nutomic 31829b6c05
Untangle thumbnail generation logic (ref #4604) (#4615)
* Untangle thumbnail generation logic (ref #4604)

* prettier

* test cleanup

* fix tests

* also consider opengraph image for local thumbnail generation
2024-04-17 10:36:45 -04:00
TechVest b0370ae2fd
chore: fix some comments (#4637)
Signed-off-by: TechVest <techdashen@qq.com>
2024-04-17 14:35:54 +02:00
Dessalines 6efab9aab1
Creating a LocalImageView, so that front ends have the Person struct. (#4631)
* Creating a LocalImageView, so that front ends have the Person struct.

* Removing local_user from LocalImageView.

* Add uploader check.
2024-04-16 19:20:44 -04:00
Dessalines d075acce43
Make all single-fetch database calls return an Option. (#4617)
- Diesel ordinarily throws an error when no results are returned for a
  single fetch, which is a bit confusing. This PR ensures that the
  missing value cases are all caught, and wrapped with new LemmyErrors,
  rather than diesel errors.
- Fixes #4601
2024-04-16 14:48:15 +02:00
Nutomic 3a0c1dca90
Avoid overwriting local objects via federation (#4611)
* Dont allow federation to overwrite local objects

* is_local check in apub lib

* use imports

* fix check, update lib

* use verify_is_remote_object()

* submodule
2024-04-11 10:05:49 -04:00
dullbananas 0f6b13a4ec
Test coverage (#4596)
* update .gitignore

* add test-with-coverage.sh

* coverage gutters extension comment

* move lcov.info to target folder

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-11 10:32:07 +02:00
Dessalines 64760ec960 Version 0.19.4-beta.3 2024-04-10 11:03:11 -04:00
Dessalines 555f789269
Fixing custom_thumbnail updates. (#4593)
* Fixing custom_thumbnail updates.

* Fixing issue with image posts.

* Fixing upgrade deps script.

* Adding API tests for custom thumbnails.

* Remove pointless todo.

* Address PR comments.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 10:59:46 -04:00
Dessalines 5dea21d531
Convert all Result<..., LemmyError> into LemmyResult<...> Fixes #4613 (#4614)
* Convert all Result<..., LemmyError> into LemmyResult<...> Fixes #4613

* Fixing clippy.
2024-04-10 10:14:11 -04:00
Kroese d5622a65f8
Fix for PictrsImageMode::None (#4604)
* Fix PictrsImageMode::None

* Update crates/api_common/src/request.rs

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

* Fix formatting

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 10:09:54 -04:00
Nutomic 9059de8569
Allow fetching from local url, add fetch redirect test (fixes #4526) (#4607)
* Allow fetching from local url, at fetch redirect test (fixes #4526)

* prettier

* update lib

* update apub lib
2024-04-10 10:04:57 -04:00
Nutomic 0203b62a6d
Ignore old federated post edits (ref #4529) (#4586)
* Ignore old federated post edits (ref #4529)

* use filter on insert

* coalesce(updated, published)

* avoid comment conflict clause

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 10:03:51 -04:00
Dessalines 99d585b7be
Change defaults on user vote display mode to upvotes + downvotes (#4599)
* Change defaults on user vote display mode to upvotes + downvotes

* Forgot to regenerate the rows.

* Drop and re-add columns instead.
2024-04-10 10:47:05 +02:00
Nutomic b4670988b5
Change exponential backoff algorithm for federation send (#4597)
* Limit federation send retry interval to one hour

* clippy

* avoid overflow

* change base for exp backoff

* ignore first error

* fix day duration
2024-04-09 19:33:01 -04:00
Nutomic 1d0a6ac08f
Avoid breaking api change, reduce api cache duration (#4610)
* Dont mark site.public_key as `serde(skip)` to avoid breaking change (fixes #4605)

* Reduce cache duration for api
2024-04-09 10:10:20 -04:00
Dessalines 8e54a4a6cc
Fixing bug where comment replies wouldn't be sent to blocked instances. (#4595)
* Fixing bug where comment replies wouldn't be sent to blocked instances.

- Instance blocks should only affect communities, not comments.
- Fixes #4590

* Revert "Fixing bug where comment replies wouldn't be sent to blocked instances."

This reverts commit 1349aa351a.

* Only block replies from the community's instance id.

- Also refactor send_local_notifs slightly, since it has to fetch the
  community now.
- Fixes #4590

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-08 16:26:24 +02:00
jim-taylor-business a14ebefd24
When env variable is set, any config file will be ignored and the default settings will be used (#4594)
* do not panic when no config file found use defaults

* formatting

* implement env variable

* ermove commented code

* remove redundant comment

* remove redundant space

* simplify check logic

* format

* returns and messages

* correct mistake
2024-04-08 12:05:54 +02:00
Dessalines 705e86eb4c
Fixing docker release (#4592)
* Re-add notif on tag failure.

* Upping rust version.

* Version 0.19.4-beta.1a

* Try again.

* Version 0.19.4-beta.1b

* Removing unstable inspect.

* Version 0.19.4-beta.1c

* Remove use release cache.

* Trying to fix cargo publish 1.

* Version 0.19.4-beta.1d

* Re-adding publish release

* Version 0.19.4-beta.2

* Fixing workspace for lemmy_federate
2024-04-04 16:14:59 +02:00
Dessalines a1d632e582
Re-add notif on tag failure. (#4591) 2024-04-04 10:21:31 +02:00
Nutomic 087684658a
Cache result of LocalSite::read to avoid unnecessary db calls (#4585)
* Cache result of LocalSite::read to avoid unnecessary db calls

* single const for cache duration

* clippy

* revert apub send changes

* clippy

* fmt
2024-04-03 17:38:31 -04:00
Dessalines aaaa362b98
Remove latest tag for pgformatter. (#4589) 2024-04-03 17:29:24 -04:00
Dessalines 5237233f97 Version 0.19.4-beta.1 2024-04-03 16:50:35 -04:00
Dessalines 94438a8516
Removing cardano, this was never used. (#4588) 2024-04-03 10:38:57 +02:00
Dessalines 4d9c16a336
Fix private message sort order. #4581 (#4587) 2024-04-02 13:25:28 -04:00
Nutomic ae9f82b452
Read crate version from cargo.toml (fixes #4583) (#4584) 2024-04-02 11:19:51 -04:00
dullbananas 007e9b7aab
Optimize Community::set_featured_posts (#4579)
* Don't lock excess rows in Community::set_featured_posts

* Update community.rs

* Update community.rs

* Update community.rs

* Update community.rs
2024-04-02 11:19:04 -04:00
tracyspacy 60f9a97dfa
Fix unnecessarily duplicated notifs (#4578)
* add check to remove duplicated notifs

* added comments
2024-03-29 17:09:19 -04:00
Dessalines 067332553d
Fixing woodpecker. (#4575) 2024-03-27 11:09:44 -04:00
Nutomic a4b79ca610
Generate post thumbnail/metadata in background (ref #4529) (#4564)
* Generate post thumbnail/metadata in background (ref #4529)

* fix api test

* Apply suggestions from code review

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

* fix test

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-27 10:54:42 -04:00
Dessalines a632a86852
Delete a person's local images on delete account. (#4506)
* Delete a person's local images on delete account.

* Rename purge function to delete.

* Use purge_user_account instead of Person::delete_account in purge person.

* Fixing clippy
2024-03-27 10:28:02 -04:00
Nutomic 85ee89f4e8
When uploading new icon/avatar/banner, delete old one (#4573) 2024-03-27 09:00:52 -04:00
Dessalines 6bfbb9332d
Adding listMedia endpoint, to view all your local image uploads. (#4509)
* Adding listMedia endpoint, to view all your local image uploads.

- Fixes #4445

* Fix ts import.

* Forgot to order by published desc

* Adding an endpoint to list all images, for admins only.

* Forgot to add file.

* Add additional test.

* Use better logic for no-limit version.

* Better call sites.

* Adding another test.

* Fix tests.

* Moving list_media to /account action.

* Addressing PR comments.

* Removing pointless comment.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-26 12:06:11 -04:00
Dessalines 945064726f
Add creator_banned_from_community to vote_view. (#4568)
* Add creator_banned_from_community to vote_view.

- Fixes #4561

* Adding tests.
2024-03-26 16:22:04 +01:00
Dessalines 7929e77602
Fixing issue with comment replies wrongly marked as read. (#4567)
* Fixing issue with comment replies wrongly marked as read.

- Fixes #4566

* Elaborating on a comment.
2024-03-26 10:46:37 -04:00
Dessalines 95069d7648
Fixing some clippy and woodpecker lints. (#4565)
* Fixing some clippy and woodpecker lints.

* Try fixing woodpecker 1.

* Revert "Try fixing woodpecker 1."

This reverts commit 7c2020a08d.
2024-03-26 10:17:42 +01:00
Dessalines e4356a7701
Fixing a few broken tests from the change in LocalUser::create (#4569) 2024-03-25 19:14:35 -04:00
Nutomic 846848c4f6
On registration, automatically set content languages from `accept-language` header (#4550)
* On registration, automatically set content languages from accept header

* no need to set site language or default language for new user anymore

* fix test

* fix langs

* avoid duplicate writing of new user languages
2024-03-25 16:02:12 -04:00
Nutomic d06ef2c47e
Migrate apub block activity to standard `endTime` property and deprecate `expires` (fixes #2316) (#4541)
* Migrate apub block activity to standard `endTime` property (fixes #2316)

* add todo
2024-03-25 08:10:09 -04:00
Sander Saarend 99d01e186a
Fix rate limiter (#4560) 2024-03-25 07:56:03 -04:00
Nutomic ef4bb3cc40
Add delete user field `removeData` to apub assets (fixes #4544) (#4549) 2024-03-22 18:41:59 -04:00
Nutomic 21547dedf7
Fix handling of apub downvote (fixes #4545) (#4551)
* Fix handling of apub downvote (fixes #4545)

* fmt

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-22 18:41:09 -04:00
Nutomic baf5921d2c
Add comment about console feature requiring tokio_unstable (fixes #4553) (#4555) 2024-03-22 18:40:08 -04:00
SleeplessOne1917 6679b2559f
Add SleeplessOne1917 to CODEOWNERS (#4558)
Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-03-22 18:31:45 -04:00
SleeplessOne1917 38c22d9453
Add banned_from_community to PostView and CommentView (#4552)
* Add banned_from_community to PostView and CommentView

* Add post view test

* Add tests for CommentView

* Add tests for case where local user is not banned from community

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-03-22 18:31:08 -04:00
Tomas 78581bd696
Add ARG RUSTFLAGS into Dockerfile (#4556)
* Add ARG RUSTFLAGS into Dockerfile 

Allows passing RUSTFLAGS through --build-arg

* Remove invalid ARG syntax
2024-03-21 16:42:30 +01:00
Dessalines 2fd81067c7
Temporarily comment sticky test. (#4538) 2024-03-18 12:54:45 +01:00
Dessalines 0f77951e05
Upgrading deps. (#4537)
* Upgrading deps.

* Addressing PR comments
2024-03-18 10:36:49 +01:00
Nutomic 9d4299aaac
Dont require leading ! or @ for webfinger resolve (#4513)
* Dont require leading ! or @ for webfinger resolve

* fmt

* clippy
2024-03-15 08:42:09 -04:00
Nutomic 43378c5bb3
Fix video thumbnail generation (fixes #3484) (#4539)
* Fix video thumbnail generation (fixes #3484)

* fix test
2024-03-15 08:41:16 -04:00
flamingos-cant 19a1a077c5
Add a blocklist for URLs. (#4515)
* Add a blocklist for URLs.

* Fix SQL format

* Make clippy happy.

* Use regex for URL matching.

* Escape regex chars in URLs.

* Use post for modification.

* Make URL block regex static and remove API routes.

* Add date fields to table and use transaction.

* Use Cache for blocklist.

* Rename check_links + move list to parameters of process_markdown.

* SQL format.

* Format, again.

* Remove println.

* Add API test.

* Set a shorter lifetime for regex in debug mode.

* Add missing macro.

* Update lemmy-js-client

* Update api_test/pnpm-lock.yaml

* Don't break other tests

* Use different URL for test

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2024-03-15 07:03:29 -04:00
Nutomic 0e7080337b
Dont allow admins to post in community with `posting_restricted_to_mods` (fixes #3571) (#4534)
* Dont allow admins to post in community with `posting_restricted_to_mods` (fixes #3571)

* fmt
2024-03-14 17:31:54 -04:00
Nutomic 835d329134
Fix longstanding bug that breaks initial community view (fixes #3529) (#4535) 2024-03-14 16:57:56 -04:00
Nutomic f1de7b7590
Automatically include apub hashtag with posts (fixes #3906) (#4533) 2024-03-14 12:16:45 -04:00
Dessalines 255e695633
Adding extra fields to PostReport and CommentReport views. (#4520)
- Fixes #4200
2024-03-13 12:11:24 -04:00
Dessalines 15f02f00a9
Add a vote_display_mode local_user setting. (#4450)
* Add a vote_display_mode local_user setting.

- Fixes #4449

* Changing HideDownvotes to Score.

* Adding ScoreAndDownvote display mode.

* Adding upvote and downvote mode.

* Extracting vote_display_mode to another table.

* Fixing fmt.

* Remove published and updated columns.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-13 12:10:58 -04:00
Dessalines 45c56df4e8
Adding git cliff to help generate changelogs. (#4522) 2024-03-12 11:24:27 +01:00
Nutomic 5d361d63ef
Change 2FA to use hostname as issuer (fixes #4518) (#4525) 2024-03-11 16:27:05 -04:00
Dessalines 10bf7464b1
Add code of conduct rules to issue template. (#4523) 2024-03-08 11:53:57 -05:00
Nutomic 5859502a2a
Fix missing private key for signed fetch (#4516)
* Fix missing private key for signed fetch (fixes #4451)

* clippy

* instance actor name and webfinger

* better webfinger handling

* upgrade lib

* update test asset
2024-03-08 10:23:15 -05:00
Nutomic 00f7778485
Store thumbnails in db table local_image (#4512)
* Store thumbnails in db table local_image

* fmt
2024-03-08 10:17:26 -05:00
Nutomic bc2e75d5a3
Add @dullbananas to codeowners (#4521) 2024-03-08 10:16:05 -05:00
battmdpkq f228f9d7a9
fix some typos (#4519)
Signed-off-by: battmdpkq <cmaker@163.com>
2024-03-08 10:38:20 +01:00
Nutomic fed6b61eaf
Upgrade apub lib, correct webfinger content-type (#4498)
* Upgrade apub lib, correct webfinger content-type

* fmt

* fix test by avoiding network fetch
2024-03-06 11:21:46 -05:00
Raphael Lullis bdabc5e827
Add curl to base images (#4510)
Having a tool like curl or wget can help us to run healthchecks on
docker-based deployments more easily. This commit adds curl to the
list of deb packages that are installed as external dependencies
2024-03-06 11:15:13 +01:00
Nutomic 97e2dbdfd7
Update contact section in readme (#4508)
* Update contact section in readme

* Update README.md

* Update README.md
2024-03-05 13:07:52 -05:00
Nutomic 22c2e20fc5
Remove contributing.md (#4507) 2024-03-05 13:07:20 -05:00
Dessalines 6778279bb6
When purging a federated user, federate local community removals. (#4505) 2024-03-05 09:31:04 -05:00
Nutomic 1ad9a211c9
Improve contributing instructions (#4504) 2024-03-05 09:14:15 -05:00
Nutomic 157378b4c9
Clear text of deleted/removed comments (#4503) 2024-03-05 08:52:35 -05:00
Dessalines 7f9950fe85
Add alt_text for posts. Fixes #1086 (#4477)
* Add alt_text for posts. Fixes #1086

* Moving alt_text to attachment name.

* Cleaning up mod action line.

* Addressing PR comments

* Addressing PR comments.

* Fixing clones.
2024-03-05 11:34:57 +01:00
Dessalines 52155c74cb
View report history for a post or comment. Fixes #4190 (#4492) 2024-03-05 11:31:40 +01:00
SleeplessOne1917 36ad1868b3
Make SiteAggregates derive Copy and Hash (#4501)
Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-03-05 11:14:12 +01:00
Dessalines 65da4e7dbd
View mod history for a post or comment. Fixes #4162 (#4491) 2024-03-04 11:42:25 -05:00
Nutomic 3c358e5b0b
Mods and admins can comment in locked posts (fixes #4116) (#4488)
* Mods and admins can comment in locked posts (fixes #4116)

* fmt

* fix

* fix test
2024-03-04 09:15:21 -05:00
Dessalines eb1245bceb
When using `saved_only`, sort posts / comments by the saved publish time, not the item creation time (#4479)
* Work on saved selection.

* Using single value for join.

* Removing unecessary check.

* Remove saved_only pointless block.
2024-03-04 14:19:51 +01:00
Dessalines 7eec8714d7
When site banning a federated user, also remove their content from our local communities. (#4464)
* When banning a federated user, also remove their content from our local
communities.

- This works by:
  - Before a site ban, find all posts and comments to local communities
  - Send a federated community ban action for each local comm.
  - This also removes their content in the apub receive code.
- Adding back in federated community ban api tests.
- Adding in two more api tests for site bans.
- Fixes #4118

* Add local community ban, and nonlocal person check.

* Ignoring errors.

* Move local check into function.

* Addressing PR comments 2
2024-03-01 13:45:06 -05:00
Nutomic 08b01a377d
Support listing type for person (fixes #4146) (#4487)
* Support listing type for person (fixes #4146)

* add test
2024-03-01 11:53:20 -05:00
Nutomic c5e54a318a
Store password reset token after email successfully sent (fixes #3757) (#4489) 2024-03-01 11:32:59 -05:00
Nutomic a7fa075e8c
Make logs less verbose (fixes #3627) (#4490) 2024-03-01 11:32:13 -05:00
Nutomic c895e57086
Remove unneeded error "last successful id is higher than latest id" (fixes #4363) (#4486) 2024-03-01 11:31:37 -05:00
Dessalines e1b26897be
Add nlnet grant line in readme. (#4484) 2024-03-01 11:22:53 -05:00
Dessalines 87b577467b
Adding ability to hide posts. (#4480)
* Adding ability to hide posts.

- Adds an post/hide API route.
- Adds a `show_hidden` (default false) to `GetPosts`.
- Adds a `hidden` field to `PostView`.
- Removes the single `post_id` from MarkPostAsRead.
- Fixes #1403

* Add a check to make sure hidden field is true.

* Fixing test.

* Add back semicolon
2024-02-29 10:42:34 -05:00
Nutomic 6d815db375
Require verified email to reset password (#4482) 2024-02-29 09:12:45 -05:00
Nutomic 328a48c9f5
Remove error-type feature from lemmy-utils (#4474)
* Remove error-type feature from lemmy-utils

* fixes

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-02-27 11:13:52 -05:00
Nutomic ab4deaa49a
Add api test for synchronizing featured posts (ref #4475) (#4476)
* Correctly synchronize collection of community featured posts (fixes #3867)

* Add api test for synchronizing featured posts (ref #4475)

* prettier
2024-02-27 09:11:41 -05:00
Dessalines e01ea32928
Fix doctype check issue for metadata fetching. Fixes #4468 (#4472)
* Fix doctype check issue for metadata fetching. Fixes #4468

* Change warn to info.
2024-02-26 10:24:09 -05:00
Dessalines f3d48f2c2c
Adding some recommended fixes from nightly clippy. (#4473) 2024-02-26 09:47:10 -05:00
Nutomic 7316dd281a
Correctly synchronize collection of community featured posts (fixes #3867) (#4475) 2024-02-26 09:45:23 -05:00
Richard Schwab 80bfd23b4d
Ensure rustfmt is installed in cargo fmt CI job (#4466) 2024-02-26 11:22:22 +01:00
SleeplessOne1917 f42420809b
Expose LemmyErrorType in lemmy_api_common (#4439)
* Expose LemmyErrorType in lemmy_api_common

* Make conditional compilation gates for utils

* Make it so api_common doesn't pull in unnecessary deps

* Make error type non exhaustive

* Fix formatting

* Format toml

* Add some convenience derives to LemmyError

* Simplify features

* Fix CI compile error

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-02-24 19:54:27 -05:00
dullbananas f56b84615c
Move DbUrl trait impls to newtypes.rs (#4463)
* Move DbUrl trait impls to newtypes.rs

* Update utils.rs
2024-02-19 12:41:28 -05:00
dullbananas d79502dff3
Escape backslashes in fuzzy_search (#4462)
* Escape backslashes in fuzzy_search

* Update utils.rs
2024-02-18 09:12:56 -05:00
dullbananas ae62ef2b7e
Ignore expired bans in CommentReportView::read, just like in CommentReportQuery::list (#4457)
* Update comment_report_view.rs

* Update comment_report_view.rs

* Update comment_report_view.rs

* Update comment_report_view.rs
2024-02-18 09:12:12 -05:00
SleeplessOne1917 39345466da
Make it so the signed in user can see if they're banned from a community (#4458)
* Make it so the signed in user can see if they're banned from a community

* Use more appropriate field name

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-02-18 09:09:46 -05:00
Dessalines 5d551e6da5
Adding an instance-level default_sort_type (#4454)
* Adding an instance-level default_sort_type

- Fixes #3796

* Fixing comment.

* Put user sort before site sort.
2024-02-16 09:36:46 -05:00
Nutomic ffcf415cac
Dont log db url on connection error (fixes #4453) (#4456)
* Dont log db url on connection error (fixes #4453)

* remove format
2024-02-16 08:50:06 -05:00
Nutomic 86b44c2a4d
Add site.content_warning, local_site.default_post_listing_mode (#4393)
* Include local_site.content_warning setting for showing nsfw by default

* Add community setting `only_followers_can_vote`

* clippy

* add auto_expand_images site setting

* cleanup

* add missing api params

* postquery/communityquery changes

* clippy

* change error

* replace auto_expand_images with default_site_post_listing_mode

* change post/community query params

* get rid of only_followers_can_vote

* machete

* fix

* clippy

* revert remaining vote changes

* remove dead code

* remove unused var

* fmt
2024-02-16 07:24:35 -05:00
Dessalines a3bf2f1cf1
Auto resolve reports on removing a comment or post. Fixes #4390 (#4402)
* Automatically resolve report when post/comment is removed (#3850)

* Automatically resolve report when post/comment is removed

* also handle apub removes

* Removing auto-resolve report triggers.

* Dont allow creating reports for deleted / removed items.

* Running pgformat.

* Fixing test.

* Addressing PR comments.

* Forgot comment report.

---------

Co-authored-by: Nutomic <me@nutomic.com>
2024-02-15 08:52:04 -05:00
Dessalines 890565ca14
Deleting denied local_users older than a week. Fixes #4434 (#4448)
* Deleting denied local_users older than a week. Fixes #4434

* Addressing PR comments.

* Upping rust to 1.76

* Delete the person rows also.
2024-02-15 07:50:53 -05:00
Dessalines 3f7cc07b02
Adding ability to specify a custom post thumbnail. (#4425)
* Adding ability to specify a custom post thumbnail.

- Context: #4204

* Fixing ts-rs serialization.

* Fixing conversion, adding checks.

* Proxying custom_thumbnail. Fixed logic for update.

* Only generate metadata thumbnail is theres no custom thumbnail.
2024-02-15 10:42:23 +01:00
Dessalines 33989f5518
Blocking an instance also hides private messages from their users. (#4447)
* Blocking an instance also hides private messages from their users.

- Fixes #4444

* Separating private message tests.
2024-02-14 10:49:55 +01:00
Lcchy 8a6a86c1bb
Add support for RSS media enclosures in feeds (#4442)
* Add support for RSS media enclosures in feeds

* Use post.url_content_type
2024-02-13 10:46:46 +01:00
dullbananas 677d54ae57
Allow better query plans (#4424)
* Update utils.rs

* Create bind_if_some.rs

* limit connection age

* Delete crates/db_schema/src/utils/bind_if_some.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs

* Update utils.rs
2024-02-12 16:44:29 +01:00
SleeplessOne1917 300869d397
Make request models derive PartialEq, Eq, and Hash (#4443)
* Make request models derive PartialEq, Eq, and Hash

* Fix clippy error

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-02-11 00:32:14 -05:00
Dessalines 609de3e9e2
Remove front end size. Fixes #4437 (#4440) 2024-02-09 10:42:12 +01:00
Elara 3c5b1ac6dd
Use the Accept-Language header to set new users' language (#4435)
* Use the Accept-Language header to set new users' language

* Implement clippy suggestions

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-02-08 10:53:03 +01:00
dullbananas f631f43024
Run analyze in db_perf (#4420) 2024-02-07 22:37:44 -05:00
Dessalines 9367cbdb00
Upgrading from postgres 15 -> 16-alpine. (#4426)
- Includes an upgrade script.
- Fixes #4406
2024-02-07 11:21:02 +01:00
Dessalines 3647a46e86
Remove ansible tagging. (#4417)
- See https://github.com/LemmyNet/lemmy-ansible/issues/215
2024-01-31 10:46:13 +01:00
Elara 328d48ef7e
Remove invalid XML characters from RSS feeds (#4416)
* Remove all characters that are disallowed by XML

* Combine contiguous unicode ranges into one range
2024-01-30 15:55:45 +01:00
Nutomic a09027c4c0
Silence warnings from ts-rs (#4415)
* Silence warnings from ts-rs

https://github.com/Aleph-Alpha/ts-rs/issues/108

* fmt
2024-01-29 09:22:53 -05:00
Elara 0e9924a2b3
Add `media:content` thumbnail to RSS feed (#4413)
* Add media:content thumbnail to RSS feed

* Run formatter

* Add media namespace definition

* Add comment linking to media-rss documentation
2024-01-29 08:56:35 -05:00
Dessalines eb0dc2fda4
Moving from yarn to pnpm. (#4414)
* Moving from yarn to pnpm.

* Prettier check.
2024-01-29 11:38:39 +01:00
Dessalines 9a2fb8e7c2
Fix image_mode for docker lemmy.hjson (#4403) 2024-01-26 10:51:59 +01:00
dullbananas f481a607d0
Show server output if federation tests fail in CI (#4389)
* Show server output if federation tests fail in CI

* dummy failure

* Revert dummy failure

* Update private_message.rs

* Fix errors

* Update private_message.rs

* Update private_message.rs

* Update .woodpecker.yml

* correct exit code

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update .woodpecker.yml

* Update prepare-drone-federation-test.sh

* Update .woodpecker.yml

* Update prepare-drone-federation-test.sh

* Update .woodpecker.yml

* Update prepare-drone-federation-test.sh

* Update private_message.rs

* Update lib.rs

* Update lib.rs

* Update session_middleware.rs

* Update session_middleware.rs

* Update .woodpecker.yml
2024-01-26 10:38:15 +01:00
dullbananas ade1cb1495
Remove outdated comment from .woodpecker.yml (#4404) 2024-01-26 10:33:03 +01:00
Nutomic 0f414a95d5
Local only community (#4350)
* Add support for local only community (fixes #1576)

* add filters and tests to db views

* dont federate local only community

* test get apub community http

* tests

* more checks

* wip

* api test

* fix tests

* change community.local_only column to visibility enum
(for private communities)

* sql fmt

* rename vars

* clippy

* fix tests

* update lib

* review

* fix js client version

* update client
2024-01-25 11:04:25 -05:00
Dessalines 8cde452fca
Add a comment to clarify the ban expires field. (#4400)
* Add a comment to clarify the ban expires field.

* Add comment about simpler client implementation.

* Better language.
2024-01-25 16:45:42 +01:00
Nutomic dadf8f28f9
Send purges to federated instances (fixes #4119) (#4398)
* Send purges to federated instances (fixes #4119)

* clippy

* review

* remove unused function

* clippy
2024-01-25 09:24:09 -05:00
Nutomic e8a52d3a5c
Rewrite images to use local proxy (#4035)
* Add markdown rule to add rel=nofollow for all links

* Add markdown image rule to add local image proxy (fixes #1036)

* comments

* rewrite markdown image links working

* add comment

* perform markdown image processing in api/apub receivers

* clippy

* add db table to validate proxied links

* rewrite link fields for avatar, banner etc

* sql fmt

* proxy links received over federation

* add config option

* undo post.url rewriting, move http route definition

* add tests

* proxy images through pictrs

* testing

* cleanup request.rs file

* more cleanup (fixes #2611)

* include url content type when sending post over apub (fixes #2611)

* store post url content type in db

* should be media_type

* get rid of cache_remote_thumbnails setting, instead automatically
take thumbnail from federation data if available.

* fix tests

* add setting disable_external_link_previews

* federate post url as image depending on mime type

* change setting again

* machete

* invert

* support custom emoji

* clippy

* update defaults

* add image proxy test, fix test

* fix test

* clippy

* revert accidental changes

* address review

* clippy

* Markdown link rule-dess (#4356)

* Extracting opengraph_data to its own type.

* A few additions for markdown-link-rule.

---------

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

* fix setting

* use enum for image proxy setting

* fix test configs

* add config backwards compat

* clippy

* machete

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-25 09:22:11 -05:00
Dessalines 1782aafd10
Upgrading deps. (#4401) 2024-01-25 10:24:07 +01:00
dullbananas d8f9e8a64c
Post view: move cursor pagination to separate library, add backward pagination to PostQuery (#4320)
* stuff

* stuff

* crates.io

* Update up.sql

* Rerun federation tests

* Update post_view.rs

* Update post_view.rs

* Update up.sql

* Update utils.rs

* Fix precision loss

* Update up.sql

* Update down.sql

* remove unwrap

* Update post_view.rs

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-24 10:50:11 -05:00
dullbananas 759f6d8a9a
Better query plan viewing experience (#4285)
* stuff

* stuff including batch_upsert function

* stuff

* do things

* stuff

* different timestamps

* stuff

* Revert changes to comment.rs

* Update comment.rs

* Update comment.rs

* Update post_view.rs

* Update utils.rs

* Update up.sql

* Update up.sql

* Update down.sql

* Update up.sql

* Update main.rs

* use anyhow macro

* replace get(0) with first()

* as_slice

* Update series.rs

* Update db_perf.sh

* Update and rename crates/db_schema/src/utils/series.rs to crates/db_perf/src/series.rs

* Update utils.rs

* Update main.rs

* Update main.rs

* Update .woodpecker.yml

* fmt main.rs

* Update .woodpecker.yml

* Instance::delete at end

* Update main.rs

* Update Cargo.toml

---------

Co-authored-by: Nutomic <me@nutomic.com>
2024-01-24 10:22:33 -05:00
İsmail Karslı 8670403a67
Add local_subscribers field to CommunityAggregates. Fixes #4144 (#4166)
* Add upload timeout to PictrsConfig

* Bad space 🤔

* Update PictrsConfig upload timeout to include units.

* Add local_subscribers field to CommunityAggregates
struct and schema

* sql format

* local_subscribers test

* fix local_subscribers test

* Revert "fix local_subscribers test"

This reverts commit 4bbac5ce4afe101b2db4b9f099ca772c5ce2932b.

* Revert "local_subscribers test"

This reverts commit 735107e1f7554dfac6e474104eb87047675f11a5.

* Create trigger for local_subscribers

* Rename variable

* re-trigger ci

* re-trigger ci

* Add local_subscribers count to follow.spec.ts

* Rename local_subscribers to subscribers_local

* Add subscribers_local to community_aggregates

* added subscribers_local to the aggregate tests

* Check if person exists on community_follower trigger

* Delete community follows before deleting person

* Update lemmy-js-client in api_tests

* Refactor local_subscriber migration

* fix format

* Move migration files date to now

* Fix test to wait for aggregates to federate

* re-trigger ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-24 10:22:05 -05:00
Dessalines 922ec7c2cd
Forgot to add skip_serializing_none to persondetailsres. (#4399) 2024-01-24 09:58:58 -05:00
jim-taylor-business f43d2eca70
make inner type pub so it can be read and created easily in other crates (#4397)
this is for use in SSR pagination in Lemmy-UI-Leptos
2024-01-24 09:03:31 -05:00
Dessalines 20fd4b5869
Clippy fixes for 1.77.0 nightly (#4395)
* A few 1.77.0-nightly clippy fixes.

* Dead code warnings.

* More fixes.
2024-01-24 10:34:09 +01:00
Dessalines eb56d9253c
Adding site to GetPersonDetails. Fixes #4373 (#4394)
* Adding site to GetPersonDetails. Fixes #4373

* Removing the conditioned site return.
2024-01-24 10:32:14 +01:00
SleeplessOne1917 4b4b99aa78
Allow community mods to see votes in addition to admins (#4392)
* Allow community mods to see votes in addition to admins

* Use Post instead of PostView

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2024-01-23 18:47:28 -05:00
Dessalines 2133bcea4e Version 0.19.3 2024-01-22 08:56:08 -05:00
Nutomic 0868910570
Add secondary sort by published date for post view (fixes #4383) (#4384) 2024-01-22 08:52:21 -05:00
Dessalines e78fe5a34c
Removing group from woodpecker, as its deprecated. (#4387)
* Removing group from woodpecker, as its deprecated.

* Removing meltwater drone cache.
2024-01-22 10:57:07 +01:00
Dessalines f652513030 Version 0.19.3-rc.1 2024-01-19 11:25:45 -05:00
Dessalines df11d77a0d Updating translations. 2024-01-19 11:23:47 -05:00
Nutomic 3d6f7ff911
Revert "Dont ignore errors during login (fixes #4319) (#4321)" (#4380)
This reverts commit 4163e0465e.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-19 11:21:43 -05:00
Nutomic 516db012bf
Dont allow caching captcha response (#4381)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-19 10:41:05 -05:00
Nutomic b58da11fb7
Mark instance as alive after successful activity send (fixes #4039) (#4377)
* Mark instance as alive after successful activity send (fixes #4039)

* clippy

* Instance::update

* domain

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-19 09:40:12 -05:00
Nutomic 1be7dbde33
Count chars, not bytes for max title length (fixes #4366) (#4367)
* Count chars, not bytes for max title length (fixes #4366)

* fix api test
2024-01-15 09:33:39 -05:00
Nutomic 9240a653c0
Fix bug with Mastodon undo follow activities (#4364) 2024-01-11 18:56:19 -05:00
Dessalines 0d35c247f9 Version 0.19.2 2024-01-10 10:18:09 -05:00
Dessalines 143fdb62b1 Updating translations. 2024-01-10 10:16:36 -05:00
Nutomic 2d16d12cb7
Move `publish = false` to correct place in lemmy_server (fixes #4359) (#4361) 2024-01-10 09:07:09 -05:00
Dessalines 3b717cfc88
Removing serde_skip from newest_comment_time. Fixes #4351 (#4360) 2024-01-10 10:44:27 +01:00
Dessalines ea0b856f1e Version 0.19.2-rc.5 2024-01-09 12:45:54 -05:00
Nutomic 92b49dea3a
Increase CI timeout for restore cache (#4358) 2024-01-09 12:37:48 -05:00
dullbananas 1ef90773e0
Refactor post view tests (#4313)
* Refactor post view tests

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* remove unused import
2024-01-09 12:19:25 -05:00
Dessalines 3d9dda4677
Woodpecker rust 1.75 (#4355)
* Upgrading woodpecker rust to 1.75

* Trying to get publish working, try 1.

* Version 0.19.2-rc.3.publish1

* Temporarily disable arm builds.

* Version 0.19.2-rc.3.publish2

* Comment out arm blocks.

* Version 0.19.2-rc.3.publish3

* Moving back publish block to below.

* Upgrade to rasky lemmy-arm v0.2.0

* Version 0.19.2-rc.3.publish4

* Test bump for upgraded woodpecker.

* Revert "Test bump for upgraded woodpecker."

This reverts commit e2a5a99f33b63ef2a6f731b1ba7b4f06a02ded5f.

* Adding link to raskys repo.
2024-01-09 11:48:29 -05:00
Dessalines 2f09ad8e5b Version 0.19.2-rc.4 2024-01-09 09:25:52 -05:00
Nutomic e3b715002b
Handle federated reports from Mastodon, Kbin (#4323)
* Test Kbin/Mbin federation

* Handle reports from Mastodon/Kbin (fixes #4217)

* prettier

* revert

* add mastodon activity

* ci

* revert

* ci
2024-01-05 11:03:13 -05:00
Nutomic 4ca63c5641
Move apub context to join-lemmy.org (fixes #4234) (#4302)
* Move apub context to join-lemmy.org (fixes #4234)

* Dont store federation context in sent_activity table

* include basic activitypub context

* update lib

* ci
2024-01-05 15:42:46 +01:00
Felix Ableitner 346ff11795 Version 0.19.2-rc.2 2024-01-05 12:33:20 +01:00
Nutomic 747ab89e87
Upgrade docker rust version to 1.75 (#4353) 2024-01-05 12:32:06 +01:00
Felix Ableitner d3efebfa4e Version 0.19.2-rc.1 2024-01-05 11:33:37 +01:00
Dessalines 1856e7c0ca
Increasing max items for user settings import. (#4352)
- Fixes #4307
2024-01-05 10:43:30 +01:00
phiresky 0e6669f617
no endless loop if queue too recent (#4349) 2024-01-04 13:28:26 -05:00
Dessalines 4a740ee80a Version 0.19.1 2024-01-04 12:32:26 -05:00
Nutomic 7d9b59c467
Reduce default db pool size to 30, remove db timeout (ref #4282) (#4301)
* Reduce default db pool size to 30 (ref #4282)

* remove db timeout
2024-01-04 12:16:51 -05:00
Nutomic 38e64825e6
Add macro assert_length!() for tests (#4348)
* Add macro assert_length!() for tests

* fix

* number
2024-01-04 11:51:55 -05:00
Nutomic 3cad3b2119
Dont overwrite cache-control header in session middleware (#4337) 2024-01-04 11:44:36 -05:00
Nutomic 023c9f4fcd
Fix fetching of community posts (fixes #4283) (#4293)
* Fix fetching of community posts (fixes #4283)

Also use spawn_try_task to fetch community outbox, mods etc to avoid
delay/timeout when fetching new community.

* prettier

* fix test

* fix api test

* prettier

* add delay

* Update run-federation-test.sh

* fix test
2024-01-04 11:42:18 -05:00
Nutomic 952c162dac
Fix CI cache (#4276)
* Minor CI improvements (second attempt)

* test slow check condition

* remove rebuild cache condition for testing

* trigger quick ci check

* mkdir

* ls, remove steps

* exclude cargo home from prettier

* ci

* increase timeout

* more timeout

* even higher just for testing

* disable compression

* also increase restore timeout

* cleanup

* try again

* Update .woodpecker.yml

* Update .woodpecker.yml

* cleanup

* rerun ci

* cleanup
2024-01-04 11:40:41 -05:00
ALEX11BR a5289dd4cf
Use `pretty_assertions` for assertions (#4347)
* Use `pretty_assertions` for assertions

* fixed ordering of `use`s

* ci

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
2024-01-04 04:47:18 -05:00
Dessalines 009a45dffb
Adding /post/like/list and /comment/like/list for admins. (#4332)
- Allows admins to view likes, sorted by downvotes first,
  for a given comment or post.
- Fixes #4088
2024-01-03 13:39:21 -05:00
phiresky 024ab7d530
Fix federate loop (#4330)
* make activity channel infallible

* clippy

* federate: make cancellabletask loop itself
2024-01-03 13:30:06 -05:00
Nutomic 53147596b4
Drop unique constraint for site.name (fixes #4329) (#4342)
* Drop unique constraint for site.name (fixes #4329)

* working down migration
2024-01-03 12:47:39 -05:00
Nutomic 4163e0465e
Dont ignore errors during login (fixes #4319) (#4321)
* Dont ignore errors during login (fixes #4319)

* fix test

* fmt
2024-01-03 10:34:03 -05:00
Nutomic abe8b18ea8
Also send reports to user's home instance (fixes #4286) (#4305) 2024-01-03 10:31:51 -05:00
Sander Saarend 35db0dc8e7
Reduce initial federation retry delay (#4346) 2024-01-03 10:31:23 +01:00
Dessalines 5f603985c0
Allow reports to be resolved, even if the community is deleted / removed. (#4345)
Fixes #4344
2024-01-03 10:31:03 +01:00
Ikko Eltociear Ashimine 2f3a7abe6b
Update READMEs (#4325)
* Update README.ja.md

fix image path

* Update README.es.md

* Update README.ru.md

* Update README.zh.hans.md

* Update README.zh.hant.md

* prettier

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
2023-12-26 05:23:03 -05:00
Andrew Voynov f223eb94d5
Fixed `matrix_user_id` regex (#4312)
* fix(matrix_user_id): fixed regex

* test(matrix_user_id): added test with underscore
2023-12-21 12:13:24 +01:00
SleeplessOne1917 4ef00e068f
Prevent crates that shouldn't be published from being published (#4309)
* Prevent crates that shouldn't be published from being published

* Make dependent crates publishable

* Make dependent crates publishable

* fix toml formatting

* Removing publish=true

* Removing versioned deps.

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-12-20 09:11:58 -05:00
Nutomic 2b9d89057d
Reenable crates.io releases (fixes #4291) (#4294)
* Reenable crates.io releases (fixes #4291)

* disable docker release for now

* fixes

* fix indent

* move to top

* install libssl

* -y

* apt update

* debian version

* install cargo, git

* use cargo install

* move to orig position
2023-12-20 08:18:54 -05:00
Felix Ableitner 08b7e0f03d Version 0.19.1-rc.2 2023-12-20 10:32:51 +01:00
Dessalines 7f780376bc
Add end software patents bagde (#4296)
* Adding End software patents badge.

Context: https://github.com/LemmyNet/joinlemmy-site/issues/283

* Smaller badge.

* Smaller badge 2.

* Smaller badge 3.
2023-12-19 19:59:48 -05:00
Nutomic a507a39336
Add missing test cleanup (#4289)
* Add missing test cleanup

* cleanup
2023-12-19 05:26:00 -05:00
Dessalines 2899ba0131
Fixing broken post_read logic. Fixes #4290 (#4297) 2023-12-19 10:46:41 +01:00
Dessalines 8583a85607 Version 0.19.1-rc.1 2023-12-18 14:20:42 -05:00
phiresky 6790b54d4d
make activity channel infallible (#4295) 2023-12-18 13:17:10 -05:00
dullbananas dcb89f52d6
Don't update comment_aggregates if updating path fails (#4281) 2023-12-18 10:31:39 +01:00
Dessalines bc32b408b5
Fixing private message reports. (#4279) 2023-12-18 10:25:05 +01:00
Dessalines aab3ca4eb0 Version 0.19.0 2023-12-15 06:53:26 -05:00
dullbananas a7ba5c9dd3
Sort by post id in post view (#4270)
* Sort by post id in post view

* Remove tie_breaker

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2023-12-15 06:42:28 -05:00
Nutomic 7a182c982b
Debug random test failure (#4275) 2023-12-15 12:28:08 +01:00
Dessalines 719b76a6e7
Create comment in transaction. Fixes #3741 (#4265)
* Create comment in transaction. Fixes #3741

* Removing if let on comment create.
2023-12-15 11:36:58 +01:00
Dessalines 246e38a45b
Making login case-insensitive. Fixes #4272 (#4273)
* Making login case-insensitive. Fixes #4272

* Removing redundant lowercase.
2023-12-15 11:34:17 +01:00
Dessalines e4b97ad8a9
Revert "Minor CI improvements (#4266)" (#4271)
This reverts commit af4d008ce4.
2023-12-14 18:36:33 -05:00
Dessalines 70530a8ad2
Optimizing sql format check. (#4268)
* Optimizing sql format check.

* Fixing format testing.

* Fixing format testing 2.
2023-12-14 11:35:52 -05:00
Nutomic af4d008ce4
Minor CI improvements (#4266)
* Speed up SQL formatting in CI with parallel processing

* mess up formatting

* check permissions

* make repo world writable

* need git

* use debian image

* apt update

* perl image for faster install

* fix format

* run restore cache in parallel to format

* add drone-cache exit code

* revert sql format changes
2023-12-14 11:18:15 -05:00
Dessalines ac209d58b4
Adding a retry on a few fetches. (#4267) 2023-12-14 16:26:42 +01:00
Dessalines 59eef85bb7 Version 0.19.0-rc.16 2023-12-14 07:59:27 -05:00
Dessalines 442ec0b9f8
Upgrading lemmy-js-client to 0.19.0 (#4260) 2023-12-14 07:26:01 -05:00
Nutomic 4a55d4f871
Quick fix for Peertube federation (fixes #4261) (#4264)
* Quick fix for Peertube federation (fixes #4261)

* prettier

* apub assets should be included in slow check paths
2023-12-14 07:25:47 -05:00
phiresky 7353be5b68
federate-less-noisy (#4263) 2023-12-14 07:25:04 -05:00
dullbananas 32afc32bc0
Correctly combine sorts in post view cursor-based pagination (#4247)
* Update post_view.rs

* Update post_view.rs

* Update Cargo.toml

* Update post_view.rs

* fix

* Update post_view.rs

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-12-14 07:10:01 -05:00
Nutomic 01aa17f38e
Reenable API tests that were accidentally skipped (#4259)
* Reenable API tests that were accidentally skipped

* log get comment parent id failure
2023-12-13 09:29:10 -05:00
Dessalines 0b2df3980f Version 0.19.0-rc.15 2023-12-13 09:24:24 -05:00
Nutomic 6626d35b98
Second attempt to make command line options more consistent (#4249)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-12-13 09:14:59 -05:00
Nutomic 60ffa2a599
Upgrade pictrs to 0.5.0-rc.2, remove cargo unstable flags (#4258) 2023-12-13 07:05:13 -05:00
dullbananas 5e589004a5
Add test for fixed deleted post filter (#4256)
* Add test for fixed deleted post filter

* fmt

* Fmt

* Update post_view.rs
2023-12-13 11:09:10 +01:00
dullbananas a0ef56b9b7
Remove moderator_view field from PostQuery (#4255) 2023-12-13 10:52:28 +01:00
Dessalines 93d123b46e
Fixing metadata endpoint. (#4257) 2023-12-13 10:50:51 +01:00
Dessalines 5ad881f3df Version 0.19.0-rc.14 2023-12-12 14:58:17 -05:00
dullbananas 3e2393993e
Update mod.rs (#4240)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-12-12 13:06:17 -05:00
SleeplessOne1917 8d52c7e7c7
See if different SQL query fixes performance regression (#4246)
* See if different SQL query fixes performance regression

* Fix formatting

* Hopefully fix failing federation test

* Hopefully solve federation test problem

* Use already-existing coalesce function

* Update person_view.rs

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-12-12 12:09:52 -05:00
Nutomic 30d58865b8
Speed up GET /api/v3/site endpoint (#4245)
* Make db queries for GET /api/v3/site in parallel (ref #4244)

* Cache site response

* machete

* Use try_join_with_pool macro

* machete

* taplo

* ttl 1s
2023-12-12 11:56:39 -05:00
Nutomic e0e74e50ae
Dont use test.png image for api tests (#4254) 2023-12-12 10:58:22 -05:00
Nutomic c7ee53026f
Upgrade dependencies (#4248)
* Upgrade dependencies

* clippy
2023-12-12 08:56:33 -05:00
Nutomic b2ae69f96c
Set explicit limit for getPosts/getComments in tests (#4250)
* Set explicit limit for getPosts/getComments in tests

* pretier
2023-12-12 08:54:54 -05:00
Nutomic 95130370f0
Add CI check for ignored files (#4252)
* Add CI check for ignored files

* remove ignored files
2023-12-12 08:54:06 -05:00
Dessalines f764996745
Show federated posts on user profile. Fixes #4228 (#4229)
* Show federated posts on user profile. Fixes #4228

* Make sure posts are hidden if no listing_type is given.
2023-12-11 14:36:12 -05:00
Nutomic e317947b75
Dont allow blocking local instance (fixes #4241) (#4242)
* Dont allow blocking local instance (fixes #4241)

* use localuserview
2023-12-11 14:35:53 -05:00
Nutomic cef3f220a2
Make command line options consistent (#4243) 2023-12-11 09:39:18 -05:00
Benjamin Barbeau 60849355db
Add voters to active users (#4235)
* Add voters to active users

* Edit formatting

* Edit formatting

* Edit formatting in down.sql

* Fix person table inner joins

* Remove post read from calculations
2023-12-11 09:38:17 -05:00
Kroese 2d4037ba61
Extend sitemap span (#4231)
* Extend sitemap span

* Keep cargo_fmt happy

* Add FETCH_LIMIT_SITEMAP

* Use FETCH_LIMIT_SITEMAP

* Keep cargo_fmt happy

* Update utils.rs

* Use SITEMAP_DAYS

* Keep cargo_fmt happy

* Sitemap

* Keep cargo_fmt happy

* Sitemap

* Sitemap

* Increase to 31 days
2023-12-11 11:24:51 +01:00
Dessalines c85e680aba Version 0.19.0-rc.13 2023-12-06 18:20:52 -05:00
Kroese 203ca9d617
Print version to log (#4226)
* Print version to log

* Keep cargofmt happy

* Keep cargo_fmt happy

* Keep Clippy happy
2023-12-05 11:35:59 -05:00
Nutomic a790a24c4d
Revert debug auth (#4232)
* Revert "Some changes to help debug auth problems on lemmy.ml (#4220)"

This reverts commit 16ac893e15.

* Rename auth cookie back to jwt
2023-12-05 11:22:08 -05:00
Nutomic de85e51fac
Dont set duplicate context for activities (#4233) 2023-12-05 11:19:12 -05:00
Nutomic a5386187e3
Enable missing code for prometheus actix-web stats (#4230)
* Enable missing code for prometheus actix-web stats

* enable middleware conditionally
2023-12-04 09:53:53 -05:00
Dessalines 3f79eacb53 Version 0.19.0-rc.12 2023-12-01 09:29:44 -05:00
Nutomic 16ac893e15
Some changes to help debug auth problems on lemmy.ml (#4220)
* Some changes to help debug auth problems on lemmy.ml

* fix

* clippy
2023-12-01 09:18:29 -05:00
Nutomic d7376d9541
Fix cors_origin wildcard (fixes #4214) (#4221) 2023-12-01 09:16:55 -05:00
Nutomic 809fc05cb3
Only allow distinguishing own comments (fixes #4216) (#4222) 2023-12-01 09:16:22 -05:00
Dessalines 70003407a7 Version 0.19.0-rc.11 2023-11-30 05:02:18 -05:00
Dessalines 170b3ec45f
Removing cookie secure check. (#4213) 2023-11-30 04:44:18 -05:00
Dessalines 7ef6476520 Version 0.19.0-rc.10 2023-11-29 10:04:42 -05:00
Dessalines e84f8f55a2
Remove httpOnly requirement. (#4212) 2023-11-29 09:58:35 -05:00
Dessalines 86990d5138
Registrations and Reports should sort by New when viewing unresolved / unread. (#4207)
- Fixes #4206
2023-11-29 11:08:23 +01:00
Dessalines 23b266ec12
Upgrade deps, fix issue with wrong diesel-async in Cargo.lock (#4211)
Co-authored-by: Nutomic <me@nutomic.com>
2023-11-29 11:06:34 +01:00
Dessalines a986db1a00
Fixing rust-analyzer suggestions on rss feeds. (#4210)
* Fixing rust-analyzer suggestions on rss feeds.

* Get rid of other pointless builders.

* More cleanup.
2023-11-29 11:00:06 +01:00
Bhoomtawath Plinsut 6fa3b59d25
Fix:#4197: validate post title must be shorter than 200 letters (#4198)
* validate post title must be shorter than 200 letters

* use range contains
2023-11-27 10:46:03 +01:00
dullbananas d95df3a46f
Update diesel-async (#4203)
* Update diesel-async

* Fix
2023-11-27 10:31:19 +01:00
Dessalines 7972dd0fcf Version 0.19.0-rc.8 2023-11-26 22:26:57 -05:00
Kroese fc07ba2d3b
Fix entrypoint in Dockerfile (#4202)
* Fix entrypoint

* Delete docker/builders/lemmy-builder-arm64/docker-build.sh

* Delete docker/builders directory

* Remove exception for builder

* Remove publish_builder_arm64
2023-11-26 16:50:31 -05:00
Enzo Nocera 8a05c8f8be
fix: Cross-compilation to ARM64 (#4142)
* feat(docker/docs): explain how building lemmy works

Signed-off-by: Enzo NOCERA <enzo@nocera.eu>

* feat: add arm build

* review: rename script & fix typo

* feat(ci): allow cross platform compilation

* feat(ci): prettier

* fix(docker): fix base image name

* fix: add dockerfile in CI path

Signed-off-by: Enzo Nocera <enzo@nocera.eu>

* fix(docker): fix runner name

* fix(docker): fix builder base image

* fix(docker): fix builder base image platform

* fix(docker): avoid using the wrapper adduser/addgroup

* feat: avoid adding the whole docker directory in the build context

---------

Signed-off-by: Enzo NOCERA <enzo@nocera.eu>
Signed-off-by: Enzo Nocera <enzo@nocera.eu>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2023-11-24 12:52:19 -05:00
Nutomic 934fe7d1cb
Remove pictrs config section `old_db` (#4199)
* Remove pictrs config section `old_db` (ref #4194)

* ci

* remove cargo config comment

* ci

* Revert "remove cargo config comment"

This reverts commit 9389e936490ec1a82e5a51a61f61a576201479a8.

* rename .cargo to .cargo_home
2023-11-24 11:26:21 -05:00
Nutomic 7d489f1e3f
Upgrade pictrs to 0.5.0-beta.2 (#4194)
* Upgrade pictrs to 0.5.0-beta.2

* Update src/main.rs

Co-authored-by: asonix <asonix@asonix.dog>

* add comment

---------

Co-authored-by: asonix <asonix@asonix.dog>
2023-11-24 07:44:17 -05:00
Dessalines 2b5a31b411
Upgrading deps. (#4196)
* Upgrading deps.

* Try to use native node-fetch function.

* Fixing image upload tests.
2023-11-24 10:29:41 +01:00
Dessalines d795c54a7a Version 0.19.0-rc.7 2023-11-23 21:09:56 -05:00
Dessalines 6e4278b1c9
Setting rank column defaults to a small number. Fixes #4178 (#4191)
* Setting rank column defaults to a small number. Fixes #4178

* Fixing tests.
2023-11-23 20:39:46 -05:00
Nutomic 26297b4035
Users can view their own posts after removal (fixes #4186) (#4192) 2023-11-23 09:47:49 -05:00
Nutomic cafeb14f1c
Add API tests for purge user and purge post (#4183)
* Add API tests for purge user and purge post

* prettier

* fix test

* ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-11-22 10:15:06 -05:00
Dessalines 58258414cc Version 0.19.0-rc.6 2023-11-22 09:59:04 -05:00
Nutomic e58a167d64
Fix remote community posts appearing in local listing (fixes #4180) (#4181)
* Fix remote community posts appearing in local listing (fixes #4180)

* fmt

* fix typo
2023-11-22 09:41:52 -05:00
Nutomic 375e232217
Prevent purged user getting refetched from home instance (fixes #3815) (#4189) 2023-11-22 09:36:20 -05:00
Dessalines 9d4d6ce881
Removing yarn-error.log (#4185) 2023-11-22 09:34:15 -05:00
Dessalines 3e1f7f2efa
Adding `creator_is_admin` to `PersonView`, `CommentView`, and `PostView`. (#4165)
* Adding creator_is_admin to PersonView, CommentView, and PostView.

* Removing left joins from comment_view.

* Removing joins from person_mention and comment_reply views.

* Removing extra left join from person_view.

* Reverting some changes in post_view.

* Fixing compile error.
2023-11-21 11:20:24 -05:00
Dessalines 28d779a960
Fixing issue with mods not being able to view reports. Fixes #4172 (#4174)
* Fixing issue with mods not being able to view reports. Fixes #4172

* Addressing PR comments.
2023-11-21 16:33:49 +01:00
Nutomic 7ba1d98915
Prevent random test failure (#4184) 2023-11-21 10:08:19 -05:00
Nutomic 49377c195e
Fix deleted posts so they can only be seen by creator (#4182) 2023-11-21 08:59:47 -05:00
dullbananas 30f7135f32
Use rust 1.74.0 in CI and move clippy lints to Cargo.toml (#4170)
* ci rust 1.74.0

* do it

* Update .woodpecker.yml

* Update Cargo.toml

* Update lint.sh

* Update lib.rs

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-11-21 08:51:22 -05:00
Nutomic 62357f4444
Fix banning of remote user (fixes #4169) (#4171) 2023-11-21 08:44:55 -05:00
Dessalines 82b30b5467
Adding Selectable and diesel postgres backend check. (#4175) 2023-11-21 08:42:28 -05:00
cetra3 1c03a86c17
Upgrade activitypub to `0.5.0-beta.5` (#4179)
* Remove anyhow test

* Update lock

* Fix lints hopefully!
2023-11-21 10:26:12 +01:00
Nutomic f786df151f
Include instance blocks in settings export (#4173) 2023-11-17 21:59:15 -05:00
Nutomic 25450ea090
Fix following local communities stuck on pending (fixes #4160) (#4161)
* Fix following local communities stuck on pending (fixes #4160)

* fmt

* remove import

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-11-17 04:55:26 -05:00
İsmail Karslı 2070381e81
Add upload_timeout to PictrsConfig (#4159)
* Add upload timeout to PictrsConfig

* Bad space 🤔

* Update PictrsConfig upload timeout to include units.
2023-11-17 04:01:32 -05:00
Nutomic 525359f7c5
Add api tests for image endpoints (#4150)
* Add api tests for image endpoints (fixes #4105)

* curl instead of wget

* add missing files

* revert cargo update

* simplify setup

* use const

* rename to image.spec.ts

* adjust to client changes

* update client lib

* remove todos, move import

* try to fix ci

---------

Co-authored-by: SleeplessOne1917 <insomnia_void@protonmail.com>
2023-11-16 23:43:40 -05:00
Dessalines 7cb20200d8 Version 0.19.0-rc.5 2023-11-16 23:30:09 -05:00
Nutomic fc56d0aa05
Use result instead of unwrap in apub tests (#4168) 2023-11-16 22:51:33 -05:00
SleeplessOne1917 e573010202
Fix report count endpoint error (#4167) 2023-11-16 08:50:15 -05:00
Nutomic a00313e680
Merge `/site_inbox` into `/inbox`, remove unique constraint for inboxes (#4138)
* Merge /site_inbox into /inbox (fixes #4137)

Get rid of different inboxes, only use /inbox

Remove shared_inbox_url db columns

add code migration

move to db migration, fixes

machete

fix sql

drop inbox url unique constraints

Dont create auth cookie in backend (#4136)

dont change individual inboxes to shared inbox

Dont send comment reply to user who has community blocked. Fixes #3684 (#4096)

* Dont send comment reply to user who has community blocked. Fixes #3684

* Adding source instance block check.

* Adding api test.

* Addressing PR comments.

* move site inbox rewrite to db

* fix test

* clippy

* clippy 2

* fix test
2023-11-16 14:22:40 +01:00
Dessalines a53892d2bb
Fixing an issue with timezone migration. (#4153) 2023-11-16 14:19:31 +01:00
Dessalines e2bf2ce530
Removing show_new_post_notifs. (#4158) 2023-11-15 10:20:01 +01:00
Nutomic 9a94a86363
Fix cors wildcard (ref #4095) (#4156)
* Fix cors wildcard (ref #4095)

* cleanup

* clippy
2023-11-14 09:39:13 -05:00
Dessalines 28c30cc502
Adding skip_serializing_none to federation state. (#4152) 2023-11-14 08:20:44 -05:00
Dessalines 907e0ce726
Removing one other cache_remote_images. (#4151) 2023-11-14 11:09:35 +01:00
Nutomic 1d23df37d8
Rename cache_remote_images setting to cache_external_link_previews (ref #4035) (#4148) 2023-11-13 09:19:09 -05:00
dullbananas 8e2cbc9a0f
Remove id column and use different primary key on some tables (#4093)
* post_saved

* fmt

* remove unique and not null

* put person_id first in primary key and remove index

* use post_saved.find

* change captcha_answer

* remove removal of not null

* comment_aggregates

* comment_like

* comment_saved

* aggregates

* remove "\"

* deduplicate site_aggregates

* person_post_aggregates

* community_moderator

* community_block

* community_person_ban

* custom_emoji_keyword

* federation allow/block list

* federation_queue_state

* instance_block

* local_site_rate_limit, local_user_language, login_token

* person_ban, person_block, person_follower, post_like, post_read, received_activity

* community_follower, community_language, site_language

* fmt

* image_upload

* remove unused newtypes

* remove more indexes

* use .find

* merge

* fix site_aggregates_site function

* fmt

* Primary keys dess (#17)

* Also order reports by oldest first (ref #4123) (#4129)

* Support signed fetch for federation (fixes #868) (#4125)

* Support signed fetch for federation (fixes #868)

* taplo

* add federation queue state to get_federated_instances api (#4104)

* add federation queue state to get_federated_instances api

* feature gate

* move retry sleep function

* move stuff around

* Add UI setting for collapsing bot comments. Fixes #3838 (#4098)

* Add UI setting for collapsing bot comments. Fixes #3838

* Fixing clippy check.

* Only keep sent and received activities for 7 days (fixes #4113, fixes #4110) (#4131)

* Only check auth secure on release mode. (#4127)

* Only check auth secure on release mode.

* Fixing wrong js-client.

* Adding is_debug_mode var.

* Fixing the desktop image on the README. (#4135)

* Delete dupes and add possibly missing unique constraint on person_aggregates.

* Fixing clippy lints.

---------

Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: phiresky <phireskyde+git@gmail.com>

* fmt

* Update community_block.rs

* Update instance_block.rs

* Update person_block.rs

* Update person_block.rs

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: phiresky <phireskyde+git@gmail.com>
2023-11-13 08:14:07 -05:00
SleeplessOne1917 1dc6c60760
Make import and export settings endpoints reachable (#4143)
* Make import and export settings endpoints reachable

* Preserve original routes
2023-11-13 08:08:07 -05:00
Dessalines e00b0c9da2
Dont send comment reply to user who has community blocked. Fixes #3684 (#4096)
* Dont send comment reply to user who has community blocked. Fixes #3684

* Adding source instance block check.

* Adding api test.

* Addressing PR comments.
2023-11-09 12:03:25 +01:00
Nutomic aaaf17486d
Dont create auth cookie in backend (#4136) 2023-11-08 07:55:09 -05:00
Dessalines 7a30a75905
Fixing the desktop image on the README. (#4135) 2023-11-07 11:05:12 +01:00
Dessalines 98ed0e51cc
Only check auth secure on release mode. (#4127)
* Only check auth secure on release mode.

* Fixing wrong js-client.

* Adding is_debug_mode var.
2023-11-07 11:03:13 +01:00
Nutomic cb01427dcf
Only keep sent and received activities for 7 days (fixes #4113, fixes #4110) (#4131) 2023-11-06 16:17:53 -05:00
Dessalines 97a4fb9a72
Add UI setting for collapsing bot comments. Fixes #3838 (#4098)
* Add UI setting for collapsing bot comments. Fixes #3838

* Fixing clippy check.
2023-11-06 16:09:12 -05:00
phiresky b9b65c9c18
add federation queue state to get_federated_instances api (#4104)
* add federation queue state to get_federated_instances api

* feature gate

* move retry sleep function

* move stuff around
2023-11-06 16:07:04 -05:00
Nutomic 8c85f35b19
Support signed fetch for federation (fixes #868) (#4125)
* Support signed fetch for federation (fixes #868)

* taplo
2023-11-06 16:02:01 -05:00
Nutomic cf788334aa
Also order reports by oldest first (ref #4123) (#4129) 2023-11-06 05:29:30 -05:00
Dessalines adef3479c0 Version 0.19.0-rc.4 2023-11-03 10:02:30 -04:00
Dessalines eeec56c22d
Adding creator_is_moderator to CommentReplyView and PersonMentionView. (#4126) 2023-11-03 14:41:00 +01:00
Nutomic 1e59e7ab47
Show oldest registration applications first (ref #4122) (#4123)
* Show oldest registration applications first (ref #4122)

* fix tests
2023-11-02 07:38:46 -04:00
Nutomic df53d2a0e8
Change logout endpoint to return SuccessResponse (#4121) 2023-10-31 08:41:52 -04:00
Nutomic 9007d49324
Remove unused deps (#4111)
* Remove unused deps

* Adding cargo-machete to woodpecker.

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-10-31 11:11:12 +01:00
Dessalines c11e9446c6
Fix hot_rank algorithm pushing downvoted content off the feed. (#4085)
* Fix hot_rank algorithm pushing downvoted content off the feed.

- Max hot_rank algorithm now uses max(2, score) rather than greatest(1, score + 3)
- Fixes #4084

* Fixing SQL format.

* Adding 2 to bias the positive scores.
2023-10-30 10:47:57 +01:00
Nutomic 08739e2925
Move usage of env::var to lemmy_utils, simplify db init (ref #4095) (#4108) 2023-10-25 11:34:38 -04:00
Dessalines b63836b31b
Add link to githubs new issue button for security advisories. Fixes #3734 (#4107) 2023-10-25 16:50:56 +02:00
Dessalines 1b751a8cac
Adding cors_origin to settings. Fixes #3665 (#4095)
* Adding cors_origin to settings. Fixes #3665

* Fix result to option.

* Forgot to update config defaults.

* Setting a cors origin doku default.

* Adding comments for CORS.
2023-10-25 16:46:34 +02:00
Dessalines 64b00ee850
Dont allow bots to vote. Fixes #3940 (#4100)
* Dont allow bots to vote. Fixes #3940

* Removing pointless function.
2023-10-25 10:14:12 -04:00
Nutomic 568233b062
Resolve federated objects from other instances via redirect (fixes #3129) (#4073)
* Resolve federated objects from other instances via redirect (fixes #3129)

* restore domain check using library change

* add test case, update apub lib

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-25 07:14:59 -04:00
Nutomic 45bed71c36
Include prometheus in default build, remove build feature (fixes #3558) (#4071)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-25 06:54:58 -04:00
Dessalines 766ca99fd5
Hide private messages from blocked users. (#4102)
- Also fixes the unread count calls for CommentReply and PrivateMessage.
- Fixes #3629
2023-10-25 12:01:40 +02:00
Dessalines bd9739b5b7
Upgrading deps. (#4103) 2023-10-25 05:32:21 -04:00
Dessalines 0b41ddca58
Fix issue with sending private messages to yourself. Fixes #3912 (#4099)
* Fix issue with sending private messages to yourself. Fixes #3912

* Fix clippy.
2023-10-25 05:09:10 -04:00
Dessalines c38dfdcd64
Disable ansi coloring in logs. Fixes #3975 (#4101) 2023-10-25 10:58:55 +02:00
Dessalines c0aee244e7
Hide public rss items for private instance. Fixes #3785 (#4097) 2023-10-25 10:41:52 +02:00
Dessalines 221365bc9a
Fix bug when leaving admin team, setting accepted application as true… (#4090)
* Fix bug when leaving admin team, setting accepted application as true. Fixes #3422

* Addressing PR comments.
2023-10-24 17:30:47 -04:00
Dessalines 2df21b9d83
Dont serialize karma. #3393 (#4089) 2023-10-24 17:26:09 -04:00
Nutomic d55bd2f2bc
Allow Arabic and Cyrillic usernames/community names (fixes #1764) (#4083)
* Allow Arabic and Cyrillic usernames/community names (fixes #1764)

* update comment
2023-10-24 16:25:52 -04:00
HackerNCoder 722d9efc13
Use starts_with for forbidden unicode (Fix #3888) (#4079)
* Use starts_with for forbidden unicode (Fix #3888)

* Require 3 visible chars in display name

* Run cargo fmt and scripts/lint

* Undo invisibly_starts_with_at

* Remove 3 min chars.count() check for display name
2023-10-24 16:57:40 +02:00
Dessalines 09a67472e7
Allow torrent magnet links as post urls. Fixes #3916 (#4092) 2023-10-24 16:48:00 +02:00
Dessalines 053dcf8c10
Fixing matrix id regex. Fixes #3431 (#4091) 2023-10-24 16:47:02 +02:00
Dessalines 5d48ee3dc8
Add creator_is_moderator to Comment and PostViews. Fixes #3347 (#4087)
* Add creator_is_moderator to Comment and PostViews. Fixes #3347

* Fixing community_moderator join.

* Addressing PR comments.
2023-10-24 08:37:03 -04:00
Dessalines 5540257b36
Fixing problem with SaveUserSettings, when either the Person or Local… (#4077)
* Fixing problem with SaveUserSettings, when either the Person or LocalUser update is null.

- Fixes #4076
- Also upgrading api_test deps

* Move function into test.
2023-10-24 11:20:23 +02:00
Dessalines 1596aee724
Adding /version route. Fixes #2914 (#4059)
* Adding /version route. Fixes #2914

* Using a simple version string.

* Use nginx rewriting to solve version.

* Forgot to remove version.

* Using an actix redirect.
2023-10-24 10:49:52 +02:00
Dessalines 5bfa4e9358
Make sure my_vote is consistently missing if not voted. Fixes #3197 (#4075)
* Make sure my_vote is consistently missing if not voted. Fixes #3197

* Fix clippy.

* Fix tests.
2023-10-23 12:40:29 -04:00
Nutomic 6235ff45b5
Return status 401 on logout with invalid auth (fixes #4081) (#4082)
* Return status 401 on logout with invalid auth (fixes #4081)

* format
2023-10-23 12:17:26 -04:00
Nutomic ec0a707110
Avoid using proxy for pictrs requests (fixes #3489) (#4072)
* Avoid using proxy for pictrs requests (fixes #3489)

* fmt
2023-10-20 11:09:34 -04:00
Nutomic dfc74835b1
Hide deleted user accounts, add tests for PersonView (fixes #3811) (#4070)
* Hide deleted user accounts, add tests for PersonView (fixes #3811)

* clippy
2023-10-20 10:01:29 -04:00
Dessalines 6bcb12b14f Version 0.19.0-rc.3 2023-10-19 20:34:48 -04:00
Dessalines 236c7e24fd
Making mark post read fields optional. (#4055)
* Making mark post read fields optional.

* Remove unecessary &

* Fix clippy.

* Addressing PR comments.

* serde(default)

* Revert "serde(default)"

This reverts commit d56afd3075a3baccb2b0eda1cc739406b83963aa.

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
2023-10-19 20:16:23 -04:00
Dessalines cae25486e4
Adding ts-rs directives for login_token. (#4063)
* Adding ts-rs directives for login_token.

* Fixing ts-rs derive.
2023-10-19 20:16:12 -04:00
Dessalines c1db65c6e5
Fix up convert more responses to SuccessResponse (#4066)
* Revert "Convert more responses to SuccessResponse. Fixes #2860 (#4058)"

This reverts commit 8deb4e5752.

* Removing purgeitem and deletecustomemoji response.

* Adding back in utils building.
2023-10-19 20:15:55 -04:00
Dessalines 8deb4e5752
Convert more responses to SuccessResponse. Fixes #2860 (#4058)
* Convert more responses to SuccessResponse. Fixes #2860

* Upgrading lemmy-js-client.
2023-10-19 13:21:05 -04:00
Nutomic 9ef28eb53b
Remove unused static (#4061) 2023-10-19 11:57:39 -04:00
dullbananas a14657d124
Refactor rate limiter and improve rate limit bucket cleanup (#3937)
* Update rate_limiter.rs

* Update mod.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update mod.rs

* Update scheduled_tasks.rs

* Shrink `RateLimitBucket`

* Update rate_limiter.rs

* Update mod.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update mod.rs

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* rerun ci

* Update rate_limiter.rs

* Undo changes to  fields

* Manually undo changes to RateLimitBucket fields

* fmt

* Bucket cleanup loop in rate_limit/mod.rs

* Remove rate limit bucket cleanup from scheduled_tasks.rs

* Remove ;

* Remove UNINITIALIZED_TOKEN_AMOUNT

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* stuff

* MapLevel trait

* fix merge

* Prevent negative numbers in buckets

* Clean up MapLevel::check

* MapLevel::remove_full_buckets

* stuff

* Use remove_full_buckets to avoid allocations

* stuff

* remove tx

* Remove RateLimitConfig

* Rename settings_updated_channel to rate_limit_cell

* Remove global rate limit cell

* impl Default for RateLimitCell

* bucket_configs doc comment to explain EnumMap

* improve test_rate_limiter

* rename default to with_test_config

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2023-10-19 15:31:51 +02:00
Dessalines a675fecacd Version 0.19.0-rc.2 2023-10-17 14:13:44 -04:00
Nutomic 6d27bfed08
Handle invalid ban expires values (fixes #4045) (#4046)
* Handle invalid ban expires values (fixes #4045)

* Adding a few missing expire time checks. Fixing up time conversions. (#4051)

* Adding a few missing expire time checks. Fixing up time conversions.

* Increase settings export wait time.

* get rid of RemoveCommunity.expires

* fmt

* tests

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-17 13:25:35 -04:00
Nutomic d827af725a
List distinguished comments first (fixes #3843) (#4050)
* List distinguished comments first (fixes #3843)

* then_order_by

* Fixing assert.

* move line

* then

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-10-17 13:22:50 -04:00
Nutomic 3a19af5215
Allow marking multiple posts as read in single api call (fixes #3963) (#4048)
* Allow marking multiple posts as read in single api call (fixes #3963)

* cleanup

* limit array length

* fix test

* review

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-17 12:35:51 -04:00
Nutomic 3f62135083
Add validate_auth api endpoint (fixes #3702) (#4049)
* Add validate_auth api endpoint (fixes #3702)

* clippy

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-17 11:25:48 -04:00
SleeplessOne1917 cf1c32d2ab
Enable animated avatars setting (#4040)
* feat: Add user setting for toggling avatar gif animations

* Add forgotten post listing mode option to settings form

* Fix compilation error

* Fix formatting

* Change name of column to be more general purpose

* Fix sql format.

* Fix comments

* Running format.

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-17 10:52:34 -04:00
Nutomic 56322c75f0
Read community follower count from home instance (fixes #1440) (#4013)
* Read community follower count from home instance (fixes #1440)

* fmt

* prettier

* fix tests

* fmt

* rename fn

* fmt

* Run prettier

* increase timeout

* ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-10-17 10:34:38 -04:00
Nutomic 332e698336
Cleanup public api (#4047)
* Convert PersonSortType to purely internal

* Remove hot rank and other db optimizations from public api
2023-10-16 19:37:28 -04:00
Nutomic 6cfbb8fc3b
Remove empty API responses (#3993)
* Remove empty API responses

* also remove change password response

* fix invalidate

* Run clippy.

* Fixing api_test lints.

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-16 12:36:53 -04:00
Nutomic 256ee61908
Ignore activities in remote communities without local followers (#4006)
* Ignore activities in remote communities without local followers (fixes #3568)

* x

* comments

* prettier

* fix api test

* fix test

* cleanup

* fix remaining test

* clippy

* decrease delay
2023-10-16 06:03:49 -04:00
Dessalines 3be56ef2e0
Trying to fix export ci, try 1. (#4038) 2023-10-16 12:01:59 +02:00
Nutomic 9e099726e6
Cleanup checks for community actions (fixes #2858, fixes #2868) (#4028)
* Cleanup checks for community actions (fixes #2858, fixes #2868)

* allow restoring deleted community

* review changes

* remove unneeded sql

* remove joins

* change mod log check
2023-10-13 09:48:18 -04:00
Nutomic 608bb6b1b4
Convert titles for posts from Mastodon to plaintext (fixes #3828) (#4033)
* Convert titles for posts from Mastodon to plaintext (fixes #3828)

* Fix prettier.

* Trigger build

* Convert titles for posts from Mastodon to plaintext (fixes #3828)

* Fix prettier.

* Fix sanizize.

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-10-12 20:36:02 -04:00
Dessalines 645bf21d54
Moving to debian-based docker image. Fixes #3972 (#4004)
* Moving to debian-based docker image. Fixes #3972

* Fix cargo.toml format.

* Try nightly rust for cargo_fmt.

* Trying to fix cargo build.

* Trying to fix cargo build 2.

* Trying to fix federation tests.

* Trying to fix federation tests 2.

* Trying to fix federation tests 3.

* Try to fix aarch 1.

* Try to fix aarch 2.

* Try to fix aarch 3.

* Removing aarch

* Adding tests back in.

* Adding ca-certs, and debian non-root user

* Commenting arm image building.

* Fix platform on runner.

* Version 0.19.0-beta.6
2023-10-11 11:57:05 -04:00
Maxime Poulin 3a1be8c041
Fix legacy pagination for Subscribed feed (#4030)
This is the fix suggested in #4019

I've manually tested both legacy pagination (`page=2&limit=20`) as well as the new pagination (`cursor_next=XXXXXXX&limit=20`) using the same endpoint as #4019, and both methods appear to work as expected.
2023-10-11 16:53:18 +02:00
Nutomic 291ff19718
Only sanitize strings when generating RSS feeds and emails (fixes #4003) (#4024)
* Only sanitize strings when generating RSS feeds and emails (fixes #4003)

* clippy

* fix test
2023-10-11 16:48:19 +02:00
Nutomic 6d7b38f4de
Implement user data import/export (#3976)
* Implement endpoints for user data import/export

* add test

* exclude avatar/banner

* increase import url count, add rate limit

* also export/import saved posts

* rate limit

* rename

* saved posts also exist

* rename routes

* fix test

* error handling

* clippy

* limit parallelism

* clippy

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-11 16:47:22 +02:00
Nutomic 6d1a7c8ae0
Wipe bio when user is banned with remove content (fixes #4012) (#4032) 2023-10-10 11:11:11 -04:00
Hamzah Mansour 6470ea81a7
add keyboard navigation setting (#3569)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-10-10 12:17:27 +02:00
Nutomic dc327652a5
Add db table for login tokens which allows for invalidation (#3818)
* wip

* stuff

* fmt

* fmt 2

* fmt 3

* fix default feature

* use Authorization header

* store ip and user agent for each login

* add list_logins endpoint

* serde(skip) for token

* fix api tests

* A few suggestions for login_token (#3991)

* A few suggestions.

* Fixing SQL format.

* review

* review

* rename cookie

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-09 12:46:12 +02:00
Nutomic b7d570cf35
Make input length checks consistent with HTML maxlength attribute (#4009)
* Make input length checks consistent with HTML maxlength attr (fixes #3688)

* ci

* Extricating min and max length checks (#4018)

* revert string change

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-05 16:39:07 -04:00
Dessalines a5b8583aab Version 0.19.0-beta.7 2023-10-05 16:01:12 -04:00
Nutomic 4bf9947153
Add comment to explain startup server (ref #4005) (#4022)
* Add comment to explain startup server (ref #4005)

* ci
2023-10-05 07:41:05 -04:00
Nutomic 0115613f90
Specify password length limits in error (fixes #3284) (#4007)
* Specify password length limits in error (fixes #3284)

* convert to comment
2023-10-05 07:40:22 -04:00
Nutomic 5ef4807d09
Dont create :latest docker tag (fixes #3996) (#4016)
* Dont create :latest docker tag (fixes #3996)

* ci

* Update .woodpecker.yml

Co-authored-by: Richard Schwab <mail@w.tf-w.tf>

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Richard Schwab <mail@w.tf-w.tf>
2023-10-04 18:34:56 -04:00
Nutomic 6950dd90e5
Return HTTP status 503 to all requests during startup (fixes #3780) (#4005)
* Return HTTP status 503 to all requests during startup (fixes #3780)

* add message

* fmt

* remove err

* dont run startup server if http disabled

* ci
2023-10-04 18:19:58 -04:00
Nutomic 626c7ebc85
Handle empty reason for registration application denial (fixes #3485) (#4008)
* Handle empty reason for registration application denial (fixes #3485)

* clippy

* clippy
2023-10-04 15:20:22 +02:00
Nutomic 50b7322ff3
Mention max length for site name in config (fixes #3006) (#4010)
* Mention max length for site name in config (fixes #3006)

* ci
2023-10-04 15:09:25 +02:00
Dessalines 2dad29106a
Change RELEASES.md to link to join-lemmy.org news (#3997)
* Adding 0.18.5 Release notes.

* Linking to join-lemmy RELEASES dir instead.
2023-10-02 10:55:23 +02:00
Nutomic d45a2a6441
Increase timeout for image upload to 30s (fixes #3920) (#3998) 2023-09-29 11:20:14 -04:00
Nutomic 210c470ebd
Notify admin about registration application after email verification (fixes #3024) (#3995) 2023-09-28 10:06:45 -04:00
Nutomic 9bb99bec5e
Increase default database connections (fixes #3394) (#3994) 2023-09-28 09:56:39 -04:00
Dessalines 9275041f42 Version 0.19.0-rc.1 2023-09-26 23:01:19 -04:00
Nutomic 50589115e0
Fix federation of admin actions (fixes #3980) (#3988)
* Fix federation of admin actions (fixes #3980)

* clippy

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-09-25 21:39:18 -04:00
SleeplessOne1917 9a9ece8fa4
Merge pull request #3982 from SleeplessOne1917/bearer-token
feat: Replace ad hoc auth header with internet standard bearer token auth header
2023-09-26 00:59:55 +00:00
SleeplessOne1917 1032cce065 Fix api test typo 2023-09-25 07:18:06 -04:00
SleeplessOne1917 bee6b7a1bb Update translations 2023-09-25 06:38:23 -04:00
SleeplessOne1917 13b20b0502 Address PR feedback 2023-09-25 06:37:45 -04:00
SleeplessOne1917 ed8dae99f1 Merge branch 'main' into bearer-token 2023-09-24 17:47:17 -04:00
SleeplessOne1917 e181f4f41d
Merge pull request #3965 from SleeplessOne1917/comment-fix
Display deleted or removed comments when they have children
2023-09-24 18:29:40 +00:00
SleeplessOne1917 6387ac07b3 Merge branch 'bearer-token' of https://github.com/SleeplessOne1917/lemmy into bearer-token 2023-09-22 21:48:47 -04:00
SleeplessOne1917 3a76a10931 chore: Run rust format 2023-09-22 21:48:27 -04:00
SleeplessOne1917 37655f0f18 chore: Run rust format 2023-09-22 21:39:03 -04:00
SleeplessOne1917 519e800b33 feat: Replace ad hoc auth header with internet standard bearer token
auth header
2023-09-22 21:26:27 -04:00
Dessalines b16661a17d
Merge branch 'main' into comment-fix 2023-09-21 11:20:49 -04:00
phiresky 24c98a726a
Merge pull request #3960 from LemmyNet/add_federation_worker_index
Fixing high CPU usage on federation worker recheck + fix federation tests. Fixes #3958
2023-09-21 16:40:04 +02:00
phiresky 9bcadadede fix after merge 2023-09-21 12:52:10 +00:00
phiresky fe40adfc39 fix after merge 2023-09-21 12:32:41 +00:00
phiresky 31f3677270 fix after merge 2023-09-21 12:01:22 +00:00
phiresky 5941dc2924 Merge remote-tracking branch 'origin/main' into add_federation_worker_index 2023-09-21 11:57:13 +00:00
phiresky 07ffdc3d53 Revert "Revert "re-remove lemmy logs""
This reverts commit 459d5a3726.
2023-09-21 11:45:43 +00:00
phiresky 2c283d90ca Revert "Revert "re-remove debug comments""
This reverts commit 6d519ef376.
2023-09-21 11:45:33 +00:00
phiresky dec25f9ee8 ensure overlap 2023-09-21 11:11:54 +00:00
phiresky 6d519ef376 Revert "re-remove debug comments"
This reverts commit ae37ca0137.
2023-09-21 11:07:36 +00:00
phiresky 459d5a3726 Revert "re-remove lemmy logs"
This reverts commit ac0c0c8856.
2023-09-21 11:07:20 +00:00
Nutomic f858d8cbce
Remove explicit auth params (#3946)
* Remove explicit auth params (ref #3725)

Only take auth via header or cookie. This requires a new version
of lemmy-js-client for api tests to pass.

* rework api_crud

* remove remaining auth params, move logic to session middleware

* fmt, fix test

* update js client

* remove auth param from api tests

* Pass auth as header

* add !

* url vars, setHeader

* cleanup

* fmt

* update

* Updating for new lemmy-js-client.

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-09-21 06:42:28 -04:00
phiresky 7e8b973128 empty 2023-09-20 21:21:23 +00:00
phiresky f16aa9228d community fix 2023-09-20 21:00:30 +00:00
phiresky 1b7ab96887 wait until ban post removed 2023-09-20 20:26:00 +00:00
SleeplessOne1917 bb552d7659
Merge branch 'main' into comment-fix 2023-09-20 17:38:47 +00:00
phiresky ac0c0c8856 re-remove lemmy logs 2023-09-20 16:07:01 +00:00
phiresky 2dbaf67b7c
Merge branch 'main' into add_federation_worker_index 2023-09-20 18:06:44 +02:00
phiresky ae37ca0137 re-remove debug comments 2023-09-20 15:33:09 +00:00
phiresky a808d3208a use max(id) instead of seq max value to prevent uncommitted transactions from causing skipped activities 2023-09-20 14:57:18 +00:00
Nutomic 22608ae983
Rework the way 2FA is enabled/disabled (fixes #3309) (#3959)
* Rework the way 2FA is enabled/disabled (fixes #3309)

* postgres format

* change algo to sha1 for better compat

* review comments

* review

* clippy

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-09-20 10:49:54 -04:00
phiresky 3d649e1d3e remove synchronous federation flag 2023-09-20 14:22:17 +00:00
phiresky 1a0c866b51 logging temporary 2023-09-20 13:37:18 +00:00
Dessalines 77b2d236b9
Forgot to add ts export to pagination cursor. (#3971) 2023-09-20 15:28:56 +02:00
SleeplessOne1917 a866b3424d
Make local federated instances use comnpose file for build (#3968)
* Make local federated instances use comnpose file for build

* Remove commented out part of script
2023-09-20 09:14:51 -04:00
phiresky a61d564732 fix delete test 2023-09-20 13:07:36 +00:00
phiresky a59a94492d more debug log 2023-09-20 12:30:38 +00:00
phiresky 78a8a7b8b7 clippy 2023-09-20 11:41:34 +00:00
phiresky c792f46c59 more wait for 2023-09-20 11:38:12 +00:00
phiresky ae3b8f4f76 fix 2023-09-20 11:23:02 +00:00
phiresky 2e7d2d1956 wait for post api test function, better announce activity id 2023-09-20 11:23:02 +00:00
Nutomic 50f81cf157
User can block instances (fixes #2397) (#3869)
* User can block instances (fixes #2397)

* update comments

* review comments

* use route

* update

* add api test

* update tests

* fix

* fix test

* ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-09-20 11:56:13 +02:00
Dessalines 89b7c981f5
Fixing GetPostsResponse serialization. (#3967) 2023-09-20 11:49:26 +02:00
SleeplessOne1917 a57b116431 Merge branch 'comment-fix' of https://github.com/SleeplessOne1917/lemmy into comment-fix 2023-09-18 22:10:07 -04:00
SleeplessOne1917 553c5bda88 Update versions to correct version 2023-09-18 22:07:31 -04:00
Dessalines 3812c8bf81 Force update 2 2023-09-18 21:20:06 -04:00
Dessalines dc6dee61b9 Force update 2023-09-18 21:19:08 -04:00
SleeplessOne1917 671676d7e4 Remove unused import 2023-09-18 19:40:01 -04:00
SleeplessOne1917 c471692949
Merge branch 'main' into comment-fix 2023-09-18 19:31:46 -04:00
SleeplessOne1917 be961075c7 Do not filter removed and deleted comments on the backend 2023-09-18 19:31:12 -04:00
Dessalines c25734e4ca
Merge branch 'main' into add_federation_worker_index 2023-09-18 19:19:24 -04:00
Dessalines 8c419103b2 Fixing formatting. 2023-09-18 19:19:13 -04:00
Dessalines 4f85adc393
Merge branch 'main' into add_federation_worker_index 2023-09-18 19:16:49 -04:00
SleeplessOne1917 f93d08a147 Make moderators be able to see removed comments in communities they moderate 2023-09-18 19:09:17 -04:00
phiresky 990445bf84 tmp tail lemmy log 2023-09-18 21:08:17 +00:00
phiresky a19b1d2606 ci 2023-09-18 21:02:52 +00:00
phiresky afde8e7576 tweak more tests 2023-09-18 20:31:12 +00:00
phiresky dff54d5e39 tweak tests more 2023-09-18 19:58:20 +00:00
Apple Sheeple c05458adcd Sanitize registration application answer
Signed-off-by: Apple Sheeple <AppleSheeple@github>
2023-09-18 22:39:29 +03:00
Apple Sheeple 5fff7504e5 Reject registration application if sanitizing the username modifies it
This removes the possibility of using a mix of sanitized and
 non-sanitized values for `username` in code.

Signed-off-by: Apple Sheeple <AppleSheeple@github>
2023-09-18 22:39:20 +03:00
phiresky 7dd857e00b log result 2023-09-18 19:19:40 +00:00
phiresky 2f0ad53b60 wait longer for fed init 2023-09-18 18:39:09 +00:00
phiresky 9868065089 minor test improvement 2023-09-18 18:23:55 +00:00
phiresky d58e2e9db7 minor test improvement 2023-09-18 18:09:18 +00:00
phiresky 007f4f5319 wait on score 2023-09-18 17:30:02 +00:00
phiresky 954b3f443d fix wait 2023-09-18 17:28:23 +00:00
phiresky 9e886fba4a delay shorter 2023-09-18 16:49:55 +00:00
phiresky 88931227b0 Merge remote-tracking branch 'origin/main' into add_federation_worker_index 2023-09-18 16:45:23 +00:00
phiresky 943b960c32 fix waits after all follow actions 2023-09-18 16:29:08 +00:00
phiresky 48496599b2 ci 2023-09-18 15:45:39 +00:00
phiresky 27141553b6 fix after revert 2023-09-18 14:28:49 +00:00
phiresky 08401fc85f Revert "remove synchronous federation"
This reverts commit 2767ab4a6fed9aa8d197eda0c6a25a1d617d192d.
2023-09-18 14:25:35 +00:00
Apple Sheeple b431c9bdf9 Sanitize apub post body
Signed-off-by: Apple Sheeple <AppleSheeple@github>
2023-09-18 16:00:29 +02:00
phiresky 544d30f0d4
Fix Posts List Performance + cursor-based pagination (#3872)
* add token-based pagination + fast subscribed post view

* add migrations

* fix failing heuristic

* revert

* output pagination token as next_page, fix off-by-one, restructure

* more cleanup

* clean

* format sql

* fix comment

* fix tests

* e

* empty

* move last page thing

* restructure a bit for readability

* rename page_cursor

* update for scaled sort

* fix

* sql format

* fix

* get rid of macros

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-09-18 15:44:48 +02:00
SleeplessOne1917 7118200cab Use up to date default UI container for dev 2023-09-18 07:55:38 -04:00
SleeplessOne1917 6d02a9914c Update translation 2023-09-18 07:38:00 -04:00
SleeplessOne1917 05b1ebdc7c Fix comments created by ser not showing up 2023-09-18 02:59:59 -04:00
SleeplessOne1917 eab1862e9a Make deleted and removed comments show when they have childern 2023-09-17 23:38:07 -04:00
phiresky fc1f9c1ec3 ci 2023-09-15 22:06:55 +00:00
phiresky c86173577d fix export location 2023-09-15 15:51:31 +00:00
phiresky 7ee707e78b ci 2023-09-13 11:59:09 +00:00
phiresky b09ffa7197 instead of changing fed delays in debug mode, change them via env variable 2023-09-13 11:23:13 +00:00
phiresky dca43dcfd9 fix a bug where after an hour community follows would be overwritten completely by an incremental upgrade 2023-09-13 10:54:10 +00:00
Dessalines 4f1240487e Fixing high CPU usage on federation worker recheck. Fixes #3958 2023-09-12 15:54:49 -04:00
Alex Roman 6735a98d35
Async scheduler (#3949)
* fix: switch to async scheduler

* fix: pass context to scheduled tasks

* Merge remote-tracking branch 'upstream/main' into async-scheduler

* retrigger ci

* retrigger ci
2023-09-11 11:12:16 +02:00
phiresky 375d9a2a3c
Persistent, performant, reliable federation queue (#3605)
* persistent activity queue

* fixes

* fixes

* make federation workers function callable from outside

* log federation instances

* dead instance detection not needed here

* taplo fmt

* split federate bin/lib

* minor fix

* better logging

* log

* create struct to hold cancellable task for readability

* use boxfuture for readability

* reset submodule

* fix

* fix lint

* swap

* remove json column, use separate array columns instead

* some review comments

* make worker a struct for readability

* minor readability

* add local filter to community follower view

* remove separate lemmy_federate entry point

* fix remaining duration

* address review comments mostly

* fix lint

* upgrade actitypub-fed to simpler interface

* fix sql format

* increase delays a bit

* fixes after merge

* remove selectable

* fix instance selectable

* add comment

* start federation based on latest id at the time

* rename federate process args

* dead instances in one query

* filter follow+report activities by local

* remove synchronous federation

remove activity sender queue

* lint

* fix federation tests by waiting for results to change

* fix fed test

* fix comment report

* wait some more

* Apply suggestions from code review

Co-authored-by: SorteKanin <sortekanin@gmail.com>

* fix most remaining tests

* wait until private messages

* fix community tests

* fix community tests

* move arg parse

* use instance_id instead of domain in federation_queue_state table

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: SorteKanin <sortekanin@gmail.com>
2023-09-09 12:25:03 -04:00
Nutomic 3b67642ec2
Add ts(skip) attributes to fix js client code generation (#3952)
* Add ts(skip) attributes to fix js client code generation

* use feature flag
2023-09-08 08:35:58 -04:00
Dessalines 9785b20843
Adding a scaled sort, to boost smaller communities. (#3907)
* Adding a scaled sort, to boost smaller communities.

- Previously referred to as *best* .
- Fixes #3622

* Fixing scheduled task update.

* Converting hot_rank integers to floats.

* Altering hot_rank psql function to default to zero after a week.

* Setting scaled_rank to zero, where hot_rank is zero.

* Adding image_upload table.
2023-09-06 13:43:27 -04:00
SorteKanin 4121fc4d56
Include domain in errors (#3944) 2023-09-06 13:29:15 -04:00
SorteKanin 722027ce2e
Bump ts_rs version (#3947)
Co-authored-by: Nutomic <me@nutomic.com>
2023-09-06 13:04:24 -04:00
Nutomic 71d61138bc
Replace ammonia lib with manual html escaping (fixes #3774) (#3938)
* Replace ammonia lib with manual html escaping (fixes #3774)

* prettier

* clippy

* remove sanitize unit test

* fix tests

* fix schema
2023-09-06 10:56:26 -04:00
Anon fe3ebea95a
Add logging for pictrs uploads (#3927)
* Add logging for pictrs uploads

* cleanup
2023-09-06 09:13:30 -04:00
Dessalines 797d26fdf4
Change AddAdmin to use person_id instead of local_user_id (#3941)
- Front ends don't have easy access to local_user_id on moddable
  items like comments and posts.
2023-09-06 11:37:03 +02:00
Nutomic a0ea8dbc00
Auto resolve reports trigger (#3871)
* Revert "Automatically resolve report when post/comment is removed (#3850)"

This reverts commit f7f6766650.

* Automatically resolve reports using db trigger

* lint

* use mod log tables

* fix migration

* fix ci

* fix clippy
2023-09-05 05:35:10 -04:00
Nutomic 366d9d1e2e
Get rid of remaining Perform/SendActivity traits (fixes #3670) (#3926)
* Get rid of remaining Perform/SendActivity traits (fixes #3670)

* fix api tests

* ci
2023-09-05 05:33:46 -04:00
dullbananas a1a9c3e4c0
Make use of variables less redundant and inconsistent in distinguish.rs (#3932)
* Make use of variables less redundant and inconsistent in distinguish.rs

* fmt
2023-09-04 11:06:54 +02:00
dullbananas 5b5ac0f37d
Remove left joins and use only one call to select method in post_view.rs (#3865)
* Use same joins for read and list in post_view.rs

* fmt

* rerun ci

* rerun ci

* Update post_view.rs

* rerun ci

* rerun ci

* Update post_view.rs

* Use `exists`

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* rerun ci

* Update post_view.rs

* person_id_join parameter

* rerun ci

* fmt

* Update post_view.rs

* rerun ci

* Update post_view.rs

* rerun ci

* fmt

* Update post_view.rs

* fmt

* Use into_sql

* Update post_view.rs

* Use inferred query source for BoxableExpression

* Update post_view.rs

* Update post_view.rs

* Update community.rs

* Update community.rs

* Update post_view.rs

* fmt

* Update community.rs

* Update community.rs

* Update community.rs

* Update community.rs

* Update community.rs

* Update post_view.rs

* Update community.rs

* fmt

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* fmt

* Update post_view.rs

* Update post_view.rs

* fix

* trigger ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: phiresky <phireskyde+git@gmail.com>
2023-09-04 11:05:00 +02:00
Nick Webster a57658d99c
Adding a new config flag to disable pictrs caching for thumbnails (#3897)
* add logic to prevent downloading remote pictrs images

* apply formatting

* Do not attempt a pictrs fetch if the remote image is also on a pictrs instance

* Do not attempt a pictrs fetch if the remote image is also on a pictrs instance and cache_federated_images is false

* Generalising the no caching option to handle all remote images

* rustfmt

* Return None if the URL is not an image

* Updating defaults.hjson

* fixing typo

* Fixing typo

* Skip cloning the Url unless we need to

* using a HEAD request for checking the content type, saving bandwidth/improving perf

* Removing early returns

* Switching back to GET requests for Content-Type because pictrs does not handle HEAD requests

* Simplifying logic and using metadata_image instead of url if we do not get a pictrs thumbnail

* Removing unused import

* Return None as a thumbnail if caching is disabled

* formatting

---------

Co-authored-by: Djones4822 <david.jones4822@gmail.com>
2023-08-31 10:36:39 -04:00
dullbananas 15930cbf4d
Use Queryable instead of JoinView (#3917)
* Update utils.rs

* Update traits.rs

* Update comment_report_view.rs

* Update comment_view.rs

* Update local_user_view.rs

* Update post_report_view.rs

* Update post_view.rs

* Update private_message_report_view.rs

* Update private_message_view.rs

* Update registration_application_view.rs

* Update site_view.rs

* Update structs.rs

* Update comment_reply_view.rs

* Update community_block_view.rs

* Update community_follower_view.rs

* Update community_moderator_view.rs

* Update community_person_ban_view.rs

* Update community_person_ban_view.rs

* Update community_view.rs

* Update person_block_view.rs

* Update person_mention_view.rs

* Update person_view.rs

* Update structs.rs

* Update admin_purge_comment_view.rs

* Update admin_purge_community_view.rs

* Update admin_purge_person_view.rs

* Update admin_purge_post_view.rs

* Update mod_add_community_view.rs

* Update mod_add_view.rs

* Update mod_ban_from_community_view.rs

* Update mod_ban_view.rs

* Update mod_feature_post_view.rs

* Update mod_hide_community_view.rs

* Update mod_lock_post_view.rs

* Update mod_remove_comment_view.rs

* Update mod_remove_community_view.rs

* Update mod_remove_post_view.rs

* Update mod_transfer_community_view.rs

* Update structs.rs

* Update utils.rs

* Update private_message_view.rs

* Update comment_report_view.rs

* Update registration_application_view.rs

* Update utils.rs

* fix

* fix db_views

* fix

* Update comment_view.rs
2023-08-31 15:26:10 +02:00
Ellie bd3f39973f
Add ARM64 Docker image support (#3810)
* Add ARM64 Docker image support

* Fix

* Fix Docker build

* Fix typo

* Use OpenSSL 3 and PostgreSQL Lib v15 in Docker builder

* Use simple comments in Dockerfile

* Add comment explaining Docker image cross build

* Move docker step above tests for testing

* Move docker build step back to normal position

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-08-31 09:02:59 -04:00
Dessalines 56e26fc3d4
Adding a post_view mode. Fixes #3730 (#3731)
* Adding a post_view mode. Fixes #3730

* Fix test.

* Addressing PR comments.

* Adding a post_view mode. Fixes #3730

* Fix test.

* Addressing PR comments.

* Fixing column order.

* Fix default Ok returns.

* Removing return Err(... where feasible.
2023-08-31 09:01:08 -04:00
Nutomic fed6542055
Implement remote follow (#3738)
* Add remote follow url to webfinger response

* update apub lib
2023-08-31 09:00:41 -04:00
biosfood 384e55f0e4
update moderator view (#3820)
* update api tests for new moderator view

* chage moderator view to be a listing type in get posts

Note: Internally, the listing type is called ListingType.ModeratorView,
but it's called "Moderator View" in the api endpoint

* fix formatting

* add support for moderator view to list comments

* add api test for moderator view when listing comments

* fix api test formatting

* retry tests

* don't filter out blocked users and communities when using moderator view

* fix cargo tests failing

* fix formatting

* fix previous merge

* Adding ModeratorView to listing_type_enums

* Fixing fmt.

* Adding a default to ListingType.

* Upgrading to use new lemmy-js-client.

---------

Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2023-08-31 13:07:45 +02:00
Lukas Trombach c93bde9799
replace `expect` with `ErrorUnauthorized` (#3915)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-08-29 19:08:44 -04:00
Nutomic b2aee565f3
Allow passing auth via header or cookie (#3725)
* Allow passing auth via header or cookie

* revert submodule

* taplo

* fix build

* working

* convert apub api methods

* also set cache-control header

* opt

* clippy

* deduplicate code, ignore invalid auth

* clippy

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-08-29 10:47:57 -04:00
Nutomic 7fd14b3d2a
Make remove content optional during account deletion (fixes #1617) (#3817)
* Make remove content optional during account deletion (fixes #1617)

* simplify purge params by passing context

* update js client

* add delete content

* update woodpecker config

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-08-28 12:23:45 +02:00
Lukas Trombach 26d125cc63
Sitemap - use UTC time (#3914)
* change local filter to use `eq` function

* use Utc time for sitemap
2023-08-28 11:09:20 +02:00
phiresky 514f2222e0
Fix time zone handling (#3496)
* convert naive time to utc time

* compounding fixes

* cargo fmt

* fix the rest

* fix down migration

* fix migrations

* fix after merge

* clippy fix

* ap-fed 0.5.0

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-08-24 11:27:00 -04:00
Nutomic 6047257bfc
Move admin flag from person to local_user (fixes #3060) (#3403)
* Move admin flag from person to local_user (fixes #3060)

The person table is for federated data, but admin flag can only
apply to local users. Thats why it really belongs in the local_user
table. This will also prevent the federation code from accidentally
overwriting the admin flag

* fmt

* try to fix api tests

* lint

* fix person view

* ci

* ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-08-24 05:40:08 -04:00
Freakazoid182 51ccf318e8
Lowercase domain on db query filters (#3849) (#3873)
* Lowercase domain on db query filters (#3849)

* Add test to get a community on different cased domain (#3849)

* Lowercase the identity for webfinger (#3849)

* Lowercase both sides of the domain comparison (#3849)

* Format api_tests (#3849)

* Lowercase domain lookup on Instance and Person (#3849)

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
Co-authored-by: Freakazoid182 <>
2023-08-22 11:10:21 -04:00
Lukas Trombach 28324ad2c8
Sitemap (#3808)
* generate sitemap.xml file

* set up endpoint for sitemap

* Update sitemap generation

- remove sitemap generation from scheduled tasks
- add posts query for sitemap
- create sitemap module in API crate

* remove priority and change freq from sitemap

* add configuration option for number of posts for sitemap

* fix default config

* rate limit sitemap endpoint

* update sitemap query

* update sitemap generation

- remove config value for query limit
- adjust sitemap generation to query changes
- tidy up error handling

* refactor sitemap generation loop

* remove `limit` argument

* refactor `generate_urlset` and add unit test

* change query to only fetch local posts of past 24h

* fix outdated comment and log

* cargo fmt
2023-08-22 10:30:15 -04:00
Alex Roman ab828b81e4
fix: add client connect timeout to scheduled task (#3883) 2023-08-21 10:53:35 +02:00
Freakazoid182 ee7b35a04a
Add person name to PersonIsBannedFromSite error (#3786) (#3855)
* Add person name to PersonIsBannedFromSite error (#3786)

* Log PersonId instead of Person name (#3850)

* Log actor_id for PersonIsBannedFromSite (#3850)

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
2023-08-16 11:36:58 +02:00
Freakazoid182 c8063f3267
Replace Option<bool> with bool for PostQuery and CommentQuery (#3819) (#3857)
* Replace Option<bool> with bool for PostQuery and CommentQuery (#3819)

* Replace Option<bool> from all list queries (#3819)

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
2023-08-11 11:13:14 +02:00
Maarten Vercruysse 9b710a2ed3
Update .woodpecker.yml use steps instead (#3858) 2023-08-10 08:15:30 -04:00
Dessalines 654bc513ea
Fixing woodpecker env var. (#3854) 2023-08-09 11:14:09 +02:00
Dessalines 29869b132c
Adding 0.18.4 Release notes. (#3853) 2023-08-09 11:08:32 +02:00
Nutomic f7f6766650
Automatically resolve report when post/comment is removed (#3850)
* Automatically resolve report when post/comment is removed

* also handle apub removes
2023-08-08 11:19:55 -04:00
Nutomic ae438e148e
Speedup CI (#3852)
* Speedup CI

* run tests in parallel

* restore cp

* main push

* no self update

* parallel format
2023-08-08 10:35:03 -04:00
Nutomic 33b2d67be6
Reorder woodpecker config to avoid ci failures (#3851) 2023-08-08 13:09:27 +02:00
dullbananas 969f8b2ce9
Replace TypedBuilder with Default in update forms (#3814)
* Update comment.rs

* Update community.rs

* Update local_site.rs

* Update local_site_rate_limit.rs

* Update local_user.rs

* Update person.rs

* Update comment.rs

* Update community.rs

* Update local_site.rs

* Update local_site_rate_limit.rs

* Update local_user.rs

* Update post.rs

* Update private_message.rs

* Update site.rs

* Update post.rs

* Update person.rs

* Update private_message.rs

* Update comment.rs

* Update create.rs

* Update leave_admin.rs

* Update update.rs

* Update remove.rs

* Update add_admin.rs

* Update verify_email.rs

* Update mod.rs

* Update mod.rs

* Update undo_delete.rs

* Update undo_delete.rs

* Update utils.rs

* Update feature.rs

* Update delete.rs

* Update lock.rs

* Update create.rs

* Update approve.rs

* Update update.rs

* Update lock_page.rs

* Update block_user.rs

* Update delete.rs

* Update undo_block_user.rs

* Update collection_remove.rs

* Update post.rs

* Update hide.rs

* Update person.rs

* Update remove.rs

* Update post_view.rs

* Update create.rs

* Update remove.rs

* Update collection_add.rs

* Update community.rs

* Update update.rs

* Update post_aggregates.rs

* Update update.rs

* Update comment.rs

* Update code_migrations.rs

* Update registration_application_view.rs

* Update update.rs

* Update ban_person.rs

* Update community.rs

* Update delete.rs

* Update delete.rs

* Update delete.rs

* Update person_aggregates.rs

* Update save_settings.rs

* Update distinguish.rs

* Update mark_read.rs

* Update site_aggregates.rs

* Update create.rs

* Fix

* rerun ci

* Update comment.rs

* rerun ci

* Update create.rs

* Update create.rs

* Update post_view.rs

* rerun ci

* Update undo_delete.rs

* rerun ci
2023-08-08 11:41:41 +02:00
dullbananas a47b12bbde
Reduce amount of columns selected (#3755)
* PostAggregatesNotInPost

* CommentAggregatesNotInComment

* CommunityPersonBanAdditionalInfo (partial)

* Revert "CommunityPersonBanAdditionalInfo (partial)"

This reverts commit 158f7f0cd9a07392fb1f457ac43c8d7c57e4190d.

* Replace some nullable parts of selection with id::nullable().is_not_null()

* CommunityFollower::select_subscribed_type

* WithoutId

* Add WithoutId derives

* Update Cargo.toml

* rerun ci

* Fix syntatx errors

* rerun ci

* Add missing "|" in private_message_report_view.rs

* rerun ci

* cargo fmt

* rerun ci

* Only derive WithoutId for Community with "full" feature

* rerun ci

* Fix attribute filtering in WithoutId macro

* rerun ci

* Update without_id.rs

* rerun ci

* Update without_id.rs

* rerun ci

* Fix errors

* rerun ci

* cargo fmt

* Fix errors

* rerun ci

* Move WithoutId to lib.rs

* rerun ci

* Remove macro_use for paste

* rerun ci

* Update comment_reply_view.rs

* rerun ci

* Update registration_application_view.rs

* rerun ci

* Revert "Update registration_application_view.rs"

This reverts commit 2e98e4bb8385b4630ed2d1dfdd8da9a35c0126b2.

* Revert "Update comment_reply_view.rs"

This reverts commit 857bf9f5a2413ff0e6e6c95e1157e8ce6bf9c0c3.

* Revert "Remove macro_use for paste"

This reverts commit 13247279ed9090f2d3c5c6525b9611529217d605.

* Revert "Move WithoutId to lib.rs"

This reverts commit 0c23e5213be1366bb64029e2007e97194e126676.

* Revert "Fix errors"

This reverts commit a283d155e5622bba0b6df8b07649fc246df8bb77.

* Revert "cargo fmt"

This reverts commit 36a5210352809b3ca417ec3b869ae4baaca17e16.

* Revert "Fix errors"

This reverts commit c9102c14f466a5d6175732625e74183579ee2be5.

* Revert "Update without_id.rs"

This reverts commit 19adb2fcc805f92f6720a439f3b2c80a2b866938.

* Revert "Update without_id.rs"

This reverts commit e26107a2fe30cc2ec81797830e3a34a1676619e4.

* Revert "Fix attribute filtering in WithoutId macro"

This reverts commit acaa4902b0e7e33205c5d287cd22b83732a1a401.

* Revert "Only derive WithoutId for Community with "full" feature"

This reverts commit de0e9c6fdc3c9344998d9d72e5e361a7f009c829.

* Revert "cargo fmt"

This reverts commit 5e1bd1ce58e997e9431f212fd2ee0283faaf6da3.

* Revert "Add missing "|" in private_message_report_view.rs"

This reverts commit c7ae9f1cd50dfead0fbc363d93692f82274ff870.

* Revert "Fix syntatx errors"

This reverts commit d942f099de8128b5a02fe74f5af43a4453a06350.

* Revert "Update Cargo.toml"

This reverts commit 23cdb6f6d3df6d2db06173f066c117a0c96dd8e1.

* Revert "Add WithoutId derives"

This reverts commit 06006d6ad338e946410962f4276f67fe5096ad5a.

* Revert "WithoutId"

This reverts commit 5e86922b0fd5bf08d114a8eee5d1e10b2ea534ee.

* Revert "CommentAggregatesNotInComment"

This reverts commit 603aede7cecacd246664f7f3f0047202f80d9938.

* Revert "PostAggregatesNotInPost"

This reverts commit 1ee3fcaeab8705e4e0e849ae6b93b45716aa9cc0.

* Restore original position of options.saved_only filter

* rerun ci

* Update post_view.rs

* rerun ci
2023-08-08 11:41:10 +02:00
Piotr Juszczyk 2ad3450004
Allow filtering posts and comments by whether they were liked/disliked - fixes #3401 (#3523)
* Allow filtering posts and comments by whether they were liked/disliked

* Switch to 2 args - liked_only, disliked_only - taking bools

* Make liked_only and disliked_only Option<bool>

* Fix unrelated is_profile_view compilation error
2023-08-08 11:40:28 +02:00
Alex Lavallee f9c2ba1cfa
Allow filtering PMs by sender (#3770)
* Allow filtering PMs by sender

* Fix retreiving own messages when filtering pm creator id

* Add tests

* Undo rename

* Fix PM tests

* Fix formatting for PMs

* Fix PM test formatting

* Rename PM creator_id field

* Fix PM formatting
2023-08-08 11:07:41 +02:00
Felix Ableitner 91c024fd98 Revert "Version 0.18.4-rc.2"
This reverts commit 48466b6826.
2023-08-07 17:12:09 +02:00
Felix Ableitner 48466b6826 Version 0.18.4-rc.2 2023-08-07 17:09:10 +02:00
maxime.io d81fb987aa
Fix sanitize_html whitespaces (#3829) 2023-08-07 14:22:52 +02:00
Felix Ableitner bed9474cf0 Revert "Attempt to fix CI building wrong commits (#3830)"
This reverts commit 5e9930bdcc.
2023-08-07 13:19:07 +02:00
dullbananas 5e9930bdcc
Attempt to fix CI building wrong commits (#3830)
* Attempt to fix CI building wrong commits

* Update .woodpecker.yml

* Update .woodpecker.yml
2023-08-07 06:40:50 -04:00
Dessalines 57cb5637fc
Fix ordering when doing a comment_parent type `list_comments` (#3823)
* Fix ordering when doing a comment_parent type GetPost.

* Fix missing options.
2023-08-07 11:11:07 +02:00
Nutomic 66ac8100d9
Remove unused db view options (#3787)
* Remove unused db view options

* fix tests

* ci
2023-08-04 11:36:36 -04:00
Nutomic 2bb24c2859
Remove form_id params (#3812) 2023-08-04 09:22:43 -04:00
Maarten Vercruysse da031a4ce2
Update QUESTION.yml, remove UI (#3807) 2023-08-03 05:12:21 -04:00
Dessalines 70fae9d68d
Fixing broken SQL migration formatting. (#3800)
* Fixing SQL format.

* Fixing clippy lints.

* Fixing clippy lint 2.
2023-08-03 11:07:35 +02:00
Nutomic 2d0f77af59
Dont use sha hash for password reset token (fixes #3491) (#3795) 2023-08-02 13:02:53 -04:00
Nutomic 27be1efb74
Rewrite remaining federation actions, get rid of PerformCrud trait (#3794)
* Rewrite ban actions

* Rewrite delete/remove actions

* Rewrite remove/delete community

* Rewrite report actions

* Rewrite feature/lock post

* Rewrite update community actions

* Rewrite remaining federation actions

* Get rid of PerformCrud trait

* clippy
2023-08-02 12:52:41 -04:00
Dessalines be1389420b
Adding SQL format checking via `pg_format` / pgFormatter (#3740)
* SQL format checking, 1.

* SQL format checking, 2.

* SQL format checking, 3.

* SQL format checking, 4.

* SQL format checking, 5.

* Running pg_format

* Getting rid of comment.

* Upping pg_format version.

* Using git ls-files for sql format check.

* Fixing sql lints.

* Addressing PR comments.
2023-08-02 12:44:51 -04:00
RocketDerp b4380cb548
Do not hide read posts when it is a user profile view (#3791) 2023-08-02 12:31:28 -04:00
Nutomic 58388f2ce8
Only run slow CI checks for actual code changes (attempt 2) (#3759)
* Only run slow CI checks for actual code changes (attempt 2)

* use when path include

* change rust

* update

* x

* y

* zsad

* remove println

* fmt

* readme

* Revert "readme"

This reverts commit d58b6ad9731d8c6009d8680d0126d9e9f0af3103.

* ci

* gitmodules
2023-08-02 12:29:21 -04:00
Louis GERARD 7bc64ab91a
Remove follow community traits (#3737)
* chore(FollowCommunity): remove Perform and Send Activity traits

* chore(FollowCommunity): avoid fetching community and person from db
2023-08-02 11:32:16 +02:00
dullbananas 91834d0d21
Default imprementations for read and delete in Crud trait (#3707)
* h

* Start doing stuff

* Default impl for Crud::read

* Simplify Crud::read lifetimes

* fmt

* Stuff

* Stuff

* Successfully make default read implementation work

* Restore Person::read

* Clean up default Crud::read and rename 'query2

* Replace filter with find

* Attempt default Crud::create

* Change Crud to Crud<'a> (won't compile)

* Revert "Change Crud to Crud<'a> (won't compile)"

This reverts commit 7ed20f5f713600bd48c85aad0848d8dbaae56503.

* Default Crud::delete

* Remove Crud::delete definitions that match default

* Remove commented Site::read

* Insert trait

* Revert "Insert trait"

This reverts commit 9d780c24035d3a9fb12968d3009a28724046dc3a.

* Use non-borrowed forms

* Revert "Use non-borrowed forms"

This reverts commit d2dd4425634b54ef105aab44f1c37cc10a32491e.

* Revert "Revert "Change Crud to Crud<'a> (won't compile)""

This reverts commit 25a27165a8ef56495e9f605ac15c9924b101d1bf.

* Fix lifetime for everything except Crud::delete

* Fix Crud::delete

* Add comment about futures

* Attempt Crud::create

* Attempt separate CrudBounds

* Revert "Attempt separate CrudBounds"

This reverts commit 1b4ca321c3d2a1d045e2f4c542c593582e9c6d80.

* Try to fix Crud::create

* Move lifetime parameters to associated types

* Revert "Move lifetime parameters to associated types"

This reverts commit af1bc858ce5e1dacddc4bbded2da7e4b7237e237.

* Revert "Try to fix Crud::create"

This reverts commit eec238496c38127cbf3d542b7cfd57ec55622d1f.

* Revert "Revert "Attempt separate CrudBounds""

This reverts commit 1ec33ce5022c58a5ad079ed7f5c220fafe5f0a5f.

* Revert "Attempt separate CrudBounds"

This reverts commit 1b4ca321c3d2a1d045e2f4c542c593582e9c6d80.

* Revert "Attempt Crud::create"

This reverts commit 47e8071b6826f27e2a562680b4948c37dffa68cb.

* Revert "Add comment about futures"

This reverts commit b266b1465393995b3be51d5ba207d5249560884f.

* Revert "Fix Crud::delete"

This reverts commit 3abcce2eec55208993dd9c7c3e51cff83412d15a.

* Revert "Fix lifetime for everything except Crud::delete"

This reverts commit c1ad7a161bbc8495dbfb8b52073f35ae88519da6.

* Revert "Revert "Revert "Change Crud to Crud<'a> (won't compile)"""

This reverts commit 3129cd0fc302f34bc0aad59987b9d0eb1139076c.

* Clean up

* Update site.rs
2023-08-01 10:34:10 -04:00
Nutomic d82194cfe9
Rewrite some federation actions to remove Perform/SendActivity (ref #3670) (#3758) 2023-08-01 15:53:36 +02:00
RocketDerp 05a7fced65
Enhanced testing of comments. Validate reply notifications, mentions (#3686)
* shared.ts first test of getReplies

* comment testing now validates reply notifications and mentions, some code comment cleanup in other functions

* comments revised

* first use of getUnreadCount in testing

* test notification of new comment replies, clarify usage of getReplies

* killall moved earlier in bash script

* api-test jest run does not need directory prefix, make consistent with other jest runs

* do not put my testing system password into script

* fix, killall exits script when no process found

* killall now moved to parent script to release locks before database create

* need to run killall a second time, before database drop

* first use of getReplies getPosts saveUserSettings

* accidental duplication of functions, removed

* try to sync shared library with main

* Nutomic feedback: Better to rename the var instead of putting a comment which can easily get outdated.

* Correct logic to meet join-lemmy requirement, don't have closed signups. Allows Open and Applications. (#3761)

Co-authored-by: Josh Bernardini <josh.bernardini@cologix.com>

* Fix fetch instance software version from nodeinfo (#3772)

Fixes #3771

* remove unused code, revert killall change

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: figure-0e <133478007+figure-0e@users.noreply.github.com>
Co-authored-by: Josh Bernardini <josh.bernardini@cologix.com>
Co-authored-by: Denis Dzyubenko <denis@ddenis.info>
Co-authored-by: Felix Ableitner <me@nutomic.com>
2023-08-01 09:14:40 -04:00
Denis Dzyubenko 55e383ae38
Fix fetch instance software version from nodeinfo (#3772)
Fixes #3771
2023-08-01 10:55:28 +02:00
figure-0e 6ed2ddf76d
Correct logic to meet join-lemmy requirement, don't have closed signups. Allows Open and Applications. (#3761)
Co-authored-by: Josh Bernardini <josh.bernardini@cologix.com>
2023-08-01 10:40:42 +02:00
Felix Ableitner 963d04b352 Revert "Only run slow CI checks for actual code changes (#3750)"
This reverts commit a34e0d477e.
2023-07-28 22:44:45 +02:00
Nutomic 543bd99900
Update CODEOWNERS (#3748) 2023-07-28 11:16:18 -04:00
Nutomic 39752fa096
Delete migrations_testing folder (#3751)
Its completely unused as far as I can see
2023-07-28 11:14:26 -04:00
Nutomic e365d48769
Move entry from .rgignore to .gitignore (#3752)
rg command respects gitignore, and sql dumps should be ignored by
git as well. So theres no reason to have a separate file.
2023-07-28 11:11:18 -04:00
Nutomic 37998b3398
Rewrite some API handlers to remove Perform trait (#3735)
* Rewrite some API handlers to remove Perform trait

* Convert CreateComment

* ci
2023-07-28 10:39:38 -04:00
Dessalines db76c5b7ff
Adding 0.18.3 Release notes. (#3753) 2023-07-28 16:33:45 +02:00
Nutomic a34e0d477e
Only run slow CI checks for actual code changes (#3750)
* Only run slow CI checks for actual code changes

Its a waste of time to compile Rust and run tests when only
something like the readme was changed.

* also make cache restore/rebuild conditional

* remove unused condition
2023-07-28 09:33:23 -04:00
Nutomic 0e6fb08284
Restore markdown quotes after sanitize (#3708) (#3749) 2023-07-28 08:23:46 -04:00
dullbananas 9a5a13c734
Use same table join code for both read and list functions (#3663)
* Try stuff

* Revert "Try stuff"

This reverts commit 3da5f83a8b4928368bf58e0061091c270259a226.

* Revert "Revert "Try stuff""

This reverts commit 178bd43cac8c7674d30d2c285ed47ca0493ad659.

* Revert "Revert "Revert "Try stuff"""

This reverts commit b9f9a2316e7cd37082319608c606a1c7db057206.

* Revert "Revert "Revert "Revert "Try stuff""""

This reverts commit ccd498dd7228050ae05d2022e9106034fd4132f8.

* Try more stuff

* Add queries function

* Simplify queries function

* Move aliases to db_schema

* Revert "Move aliases to db_schema"

This reverts commit 69afed05c1807c3fef8d5b5872546fa22e60b4d0.

* Add ReadFuture and ListFuture

* Refactor queries function and add Queries struct

* Box futures in Queries::new

* Use from_tuple

* Add comment_view::queries and improve comment_report_view::queries

* Add local_user_view::queries

* Add post_report_view::queries

* Ad post_view::queries

* Add private_message_report_view::queries

* private_message_view, registration_application_view

* Use 'a in BoxedQuery

* comment_reply_view, community_view

* Change aliases to inline module

* person_mention_view

* person_view

* Use separate community_person_ban joins instead of including boolean literal in join-on clause

* Fix comment_view

* rerun ci
2023-07-28 10:36:50 +02:00
phiresky e315092ee3
remove n^2 part of person triggers, improve community aggregate trigger (#3739)
* remove n^2 part of person triggers, improve community aggregate trigger

* comment out comment_score tests since previously they only accidentally succeeded

* empty
2023-07-27 23:36:51 +02:00
phiresky 1253a2a0d5
remove performance-problematic and buggy duplicate site aggregates (#3732) 2023-07-27 23:35:53 +02:00
Nutomic d909f3455d
Change readme installation link (#3736)
Replaces https://github.com/LemmyNet/lemmy/pull/3551
2023-07-27 09:42:52 -04:00
RocketDerp 21a87ebaf2
Federation tests replication round1 - demonstrate absent replication of comment deletes (#3657)
* more robust test of unlike a comment, confirm replication to instance downstream from community home

* more robust 'delete a comment' test, confirm replication

* Far more robust "Report a comment" test. Many comments about situation, this is currently failing because gamma does not get the report

* typo and actually have Gamma comment check use gamma, not alpha

* prepare-drone-federation-test.sh has some more echo output and note about the LEMMY_DATABASE_URL format (#3651)

* Add http cache for webfingers (#3317)

* Add http cache for webfingers

* Remove the outgoing cache middleware & adjust the cache headers directive

* Use 1h & 3day cache header

* Update routes and adjust the cache headers location

* revert apub caching

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>

* Rewrite activity lists to fix delete federation (fixes #3625)

* Revert "typo and actually have Gamma comment check use gamma, not alpha"

This reverts commit 7dfb6ee0f4885da3a2d10316422f5b510772806c.

* Revert "Far more robust "Report a comment" test. Many comments about situation, this is currently failing because gamma does not get the report"

This reverts commit 7bd3b20ae08a64324029491ddb3ce4295ba16787.

* prettier TypeScript

* revised comments, as ResolveObject isn't using routine replication

* fmt

* fix api tests

* remove comment

---------

Co-authored-by: cetra3 <cetra3@hotmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
2023-07-27 06:17:40 -04:00
Bao 2d7b416652
Omit local instance from federated instances list (#3712)
Co-authored-by: Nutomic <me@nutomic.com>
2023-07-27 12:12:18 +02:00
phiresky 9bfa86d162
add trigram index to search (#3719)
* add trigram index to search

* add community index
2023-07-27 12:11:00 +02:00
Nutomic 3471f3533c
Sanitize html (#3708)
* HTML sanitization in apub code

* Sanitize API inputs

* fmt

* Dont allow html a, img tags

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-26 14:01:15 -04:00
biosfood 2de994797e
Add moderator view parameter to list posts (#3176)
* add option to only show posts from moderated communities

* rename moderated_only to moderator_view and show blocked users in moderator view

* add test for moderator view

* bump lemmy-js-client version for moderation view tests

* fix yarn lockfile

* retry build

* Delete logfile

* retry checks

* remove unused select statement from list posts

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-26 13:51:11 -04:00
Pavlos Smith c890797b37
Add controversial ranking (#3205)
* Added controversy rank property to posts and comments, and ability to sort by it

* Triggers instead of schedules tasks, integer -> double, TODO: comments don't seem to get updated with floats, divide SortTypes

* Created PersonSortType

* PersonSortType::MostComments case

* Removed unused PartialOrd trait

* Added new person sort type mappings

* SortType -> PersonSortType

* fixes

* cargo fmt

* fixes after merge with main

* Fixed bug in controversy rank trigger, removed TopX sorts from PersonSortType and added CommentScore instead

* Uncovered enum case

* clippy

* reset translation changes

* translations

* translations

* Added additional hot ordering on controversial posts and comments

* featured local and featured community added to controversy rank index, additional order_by removed (?), added post_score and post_count to PersonSortType

* Woodpecker rerun

* cargo fmt

* woodpecker rerun

* fixed controversy_rank order

* fix

* Readded migration as latest, removed second update statement for setting controversy rank
2023-07-26 13:07:05 -04:00
marsara9 dc4572460e
Make resolve_object not require auth #3685 (#3716)
* Resolves issue #3685

If user isn't authenticated with resolve_object, only allow a local search instead of possibly making an http request.

* Making sure to validate auth before doing a potential remote lookup.
2023-07-26 12:17:42 -04:00
Nutomic afac3ee7ff
Skip fragile API tests (#3723)
* Skip fragile API tests

These tests fail very often for no reason, eg in #3712 and #3696.
Better to disable them until they can be fixed.

* killall -s1
2023-07-26 12:15:18 -04:00
Domenic Horner f9351b6512
UI Settings - Blur NSFW & Auto Expand (#3377)
* add new flag to api

* add new ui settings for local user

* remove extraneous def

* add props to application reg.

* fix clippy updated these

* re-order db schema entries

* remove dupe

* update lemmy sdk

* update lemmy js client

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-07-26 07:53:45 -04:00
dullbananas 9b123f45ec
Enable gzip for reqwest (#3696)
This will reduce bandwidth used by federation

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-26 12:22:14 +02:00
Into the V0id cf2229d665
Dont authenticate user after successful password reset #3714 (#3715)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-25 13:33:02 -04:00
Freakazoid182 9a1f9aad45
detailed error message for blocked domains (#3698) (#3701)
* detailed error message for blocked domains (#3698)

* Pass the domain as an error param

Not formatting the error message to support i18n

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
2023-07-25 13:26:54 -04:00
Ben Wyatt 95e758e707
Bump version of dependency "webmention" (#3711)
Webmention .4->.5 bumps a few internal dependencies that needed to be upgraded
2023-07-25 13:01:13 -04:00
phiresky 3b09d8c882
prevent ordering by comment path without post filter (#3717) 2023-07-25 12:46:00 -04:00
asimons04 13a866aeb0
Update Dockerfile to run process as non-privileged user. (#3709) 2023-07-24 09:51:51 -04:00
Nutomic 102124b6d2
Change logic for determining comment default language (fixes #3451) (#3672) 2023-07-21 09:08:25 -04:00
Joel Beckmeyer ea7f83c4dc
disable rustfmt feature on rosetta-build (#3679) 2023-07-21 11:50:47 +02:00
Dessalines e17f0097ff
Fix federation test errors with new lemmy-js-client (#3678) 2023-07-21 11:47:56 +02:00
Dessalines 417c4d2311
Adding diesel migration check. Fixes #3676 (#3677)
* Adding diesel migration check. Fixes #3676

* Fixing prettier.
2023-07-21 11:46:10 +02:00
Dessalines 623d81139e
Make sure comments are sorted by hot_rank, then score. (#3667) 2023-07-21 11:44:47 +02:00
Nutomic ccc122100e
Fix process shutdown (#3673)
I noticed that stopping the Lemmy process with ctrl+c wasnt working
because the activity channel isnt properly closed. This is now fixed.

Later we should also move the channel from static into LemmyContext,
Im not doing that now to avoid conflicts with #3670.
2023-07-20 11:36:48 -04:00
Nutomic 1a164a649e
Ignore errors when fetching community mods (fixes #3460) (#3674) 2023-07-20 11:34:07 -04:00
Nutomic 3753a3bf54
Upgrade activitypub library to 0.4.6 (fixes #3222) (#3675) 2023-07-20 11:33:19 -04: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
Dessalines ced3aa5bd8
Fixing hot_ranks and scores to append a published sort. (#3618)
- #3428
2023-07-20 16:44:23 +02:00
Nutomic 047db9ac85
Handle displaying of deleted and removed posts/comments (fixes #2624) (#3286)
* Handle displaying of deleted and removed posts/comments (fixes #2624)

* remove duplicate test

* fix tests

* no show_removed/show_deleted

* merge

* partially fix tests

* fix tests

* clippy

* fix tests

* get rid of build_post_response_deleted_allowed
2023-07-20 16:36:16 +02:00
Sander Saarend d7051c40f8
Use local_site.default_post_listing_type as the initial default listing type for new users (#3666) 2023-07-19 11:04:43 -04:00
Nutomic 5cd4c6c586
Dont publish releases to crates.io (fixes #3272) (#3664)
This is not needed anymore as from scratch installation now uses
`git clone` instead of `cargo install`.

https://github.com/LemmyNet/lemmy-docs/pull/241/files
2023-07-19 10:25:46 -04:00
Nutomic 5d23ef960e
Remove SendActivity and Perform traits, rely on channel (#3596)
* Remove SendActivity and Perform traits, rely on channel

These traits arent necessary anymore now that websocket is removed.
Removing them allows us to use normal actix http handler methods
which are much more flexible, and allow using different middlewares
as well as setting response attributes.

* compiling and create post federating

* clippy

* rename methods, join outgoing activities task

* fix api tests

* no unwrap

* conditional compile

* add back getrandom

* make crates optional

* fmt
2023-07-19 09:49:41 -04:00
Sander Saarend 77a8e3b897
Don't panic when scheduled tasks can't connect to database (#3634)
* Don't panic when scheduled tasks can't connect to database

* Use map & map_err instead of match

* Empty commit for Woodpecker re-run
2023-07-19 15:00:44 +02:00
cetra3 1f21bdb2f9
Add http cache for webfingers (#3317)
* Add http cache for webfingers

* Remove the outgoing cache middleware & adjust the cache headers directive

* Use 1h & 3day cache header

* Update routes and adjust the cache headers location

* revert apub caching

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
2023-07-19 06:09:04 -04:00
RocketDerp 2adf7d5008
prepare-drone-federation-test.sh has some more echo output and note about the LEMMY_DATABASE_URL format (#3651) 2023-07-19 10:28:10 +02:00
RocketDerp 38c6210912
Post remove delete federation outbound fix0 (#3613)
* add new function build_post_response_deleted_allowed

* PostDelete uses new function build_post_response_deleted_allowed

* RemovePost uses new build_post_response_deleted_allowed function

* code comments about mod or admin flag having other use

* reformat "cargo +nightly fmt --all"
2023-07-17 11:07:45 -04:00
Ikko Eltociear Ashimine 0ada7dc889
Add Japanese README (#3620)
* Add Japanese README

* add translate

* fix link

* Update README.ja.md
2023-07-17 11:05:14 -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
dullbananas 88215bfbc9
Remove TypedBuilder from db_views and db_views_actor (#3637)
* change pool fields to parameters for list

* remove my_person_id and admin fields

* Change recipient id to list param

* Remove TypedBuilder from db_views and db_views_actor
2023-07-17 12:20:25 +02:00
Sander Saarend 6688a8a5d4
Optimize hot rank updates (#3617) 2023-07-17 11:05:55 +02: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
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
Nutomic 39f28c1a40
Add dev profile to strip symbols and disable debug info (ref #3610) (#3611)
* Add dev profile to strip symbols and disable debug info (ref #3610)

This significantly speeds up builds:
- with strip symbols and debug 0: 43s
- without: 169s

* add comment, no strip symbols
2023-07-13 14:50:17 -04: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
Manuel Bleichner c0b7865896
Fix wrong SMTP port when TLS is being used (fixes #3574) (#3607)
Co-authored-by: Manuel Bleichner <manuel.bleichner@bvu.de>
2023-07-13 13:10:14 +02:00
Nina Blanson 40ff77eee2
Add workaround for #3102 until cross-compile work complete (#3472)
* Add workaround for #3102 until cross-compile work complete

* Minor cleanup

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-13 13:02:08 +02:00
Jason Grim 8992965c0c
Updated Lemmy Matrix Support link (#3599) 2023-07-13 12:31:35 +02:00
nixoye 6310f55984
Update RELEASES.md (#3593)
replaced the confusing api_key line that's commented out with the line that is now used in the new config.hjson in /lemmy-ansible/examples

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-12 10:48:49 -04:00
Simon Bordeyne 9b5e765364
Add infinite scroll user option (#3572) 2023-07-12 09:12:01 -04:00
Nutomic c060546ffa
Use specific Rust nightly version for CI cargo fmt (fixes #3467) (#3577)
* Use specific Rust nightly version for CI cargo fmt (fixes #3467)

* fix

* fix
2023-07-12 11:15:28 +02: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 48a033b87f4fdc1ce14ff86cc019e1c703cd2741.

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

This reverts commit 773a6d3beba2cf89eac75913078b40c4f5190dd4.

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

This reverts commit d2c6263ea13710177d49b2791278db5ad115fca5.

* 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 2bf8574bc8333d8d34ca542d61a0a5b50039c24d.

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

This reverts commit 3e4059aabbe485b2ff060bdeced8ef958ff62832.

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

This reverts commit 3b02389abd780a7b1b8a2c89e26febdaa6a12159.

* Revert "Fix api_common::utils"

This reverts commit 7dc73de613a5618fa57eb06450f3699bbcb41254.

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

This reverts commit f740f115e5457e83e53cc223e48196a2c47a9975.

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

This reverts commit 2ee206af7c885c10092cf209bf4a5b1d60327866.

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

This reverts commit 96ed8bf2e9dcadae760743929498312334e23d2e.

* 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 acc9ca1aed10c39efdd91cefece066e035a1fe80.

* Revert "Revert "aaaa""

This reverts commit 443a2a00a56d152bb7eb429efd0d29a78e21b163.

* still aaaaaaaaaaaaa

* Return to earlier thing

Revert "Add GetConn trait"

This reverts commit ab4e94aea5bd9d34cbcddf017339131047e75344.

* Try to use DbPool enum

* Revert "Try to use DbPool enum"

This reverts commit e4d1712646a52006b865a1fbe0dcf79976fdb027.

* 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
dullbananas 73492af4b0
Shrink capacity in `RateLimitStorage::remove_older_than` (#3536)
* Shrink capacity in `RateLimitStorage::remove_older_than`

* Update rate_limiter.rs

* rerun ci

* rerun ci

* rerun ci

* Update rate_limiter.rs
2023-07-10 22:52:37 +02:00
Pawan Hegde ef9dc5d0b6
Fix #3366: Wrap plain-text error responses from the API in JSON (#3559)
* Fix #3366: API does return plain HTML errors

* Fix Clippy errors

* Improve api response times by doing send_activity asynchronously (#3493)

* do send_activity after http response

* move to util function

* format

* fix prometheus

* make synchronous federation configurable

* cargo fmt

* empty

* empty

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>

* Updating `login.rs` with generic `incorrect_login` response. (#3549)

* Adding v0.18.1 and v0.18.0 release notes. (#3530)

* Update RELEASES.md (#3556)

added instruction to find the location of your docker directory (especially useful for those who used ansible since they never had to setup docker manually)

* Use async email sender (#3554)

* Upgrade all dependencies (#3526)

* Upgrade all dependencies

* as base64

* Adding phiresky to codeowners. (#3576)

* 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>

* Only update site_aggregates for local site (#3516)

* 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

* Use LemmyErrorType also make error_type compulsory

* Add missing import for jsonify_plain_text_errors

* Fix formatting

* Trying to make woodpecker run again

---------

Co-authored-by: phiresky <phireskyde+git@gmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: rosenjcb <rosenjcb@gmail.com>
Co-authored-by: nixoye <12674582+nixoye@users.noreply.github.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
Co-authored-by: Sander Saarend <sander@saarend.com>
Co-authored-by: Piotr Juszczyk <74842304+pijuszczyk@users.noreply.github.com>
2023-07-10 22:44:14 +02: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
Sander Saarend 651f2747ee
Only update site_aggregates for local site (#3516) 2023-07-10 11:20:39 -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 b50634e2cf
Adding phiresky to codeowners. (#3576) 2023-07-10 16:20:40 +02:00
Nutomic ff26bc21af
Upgrade all dependencies (#3526)
* Upgrade all dependencies

* as base64
2023-07-10 15:00:55 +02:00
dullbananas 934f72511e
Use async email sender (#3554) 2023-07-10 14:04:39 +02:00
nixoye 3dd2fd0f7f
Update RELEASES.md (#3556)
added instruction to find the location of your docker directory (especially useful for those who used ansible since they never had to setup docker manually)
2023-07-10 14:00:00 +02:00
Dessalines 9d52d8bd0b
Adding v0.18.1 and v0.18.0 release notes. (#3530) 2023-07-10 13:51:24 +02:00
rosenjcb e7e60e0514
Updating `login.rs` with generic `incorrect_login` response. (#3549) 2023-07-10 07:27:38 -04:00
phiresky b35757b429
Improve api response times by doing send_activity asynchronously (#3493)
* do send_activity after http response

* move to util function

* format

* fix prometheus

* make synchronous federation configurable

* cargo fmt

* empty

* empty

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-10 12:27:49 +02:00
Dessalines 0c82f4e660 Version 0.18.1 2023-07-07 09:24:49 -04:00
Dessalines c208faf276
Revert "Make sure hot rank sorts for post and community filter by positive hot ranks. (#3497)" (#3521)
This reverts commit 6840fd64f9.
2023-07-07 11:29:07 +02:00
phiresky aa70325c11
Make hot rank not crash on future (#3517)
* make hot rank zero for future

* parallel safe
2023-07-07 11:27:47 +02:00
Nutomic b3dfc3721f
Upgrade crossbeam-channel (#3512) 2023-07-06 14:21:11 -04:00
Dessalines 2a088cf023
Update prettier to 3.0.0 (#3509)
* Update prettier to 3.0.0

* Updating prettier dep.

* Explicity 3.0.0 version.
2023-07-06 15:10:38 +02:00
Felix Ableitner 22cdcc6b60 Version 0.18.1-rc.10 2023-07-06 14:46:46 +02:00
phiresky 922ee6a230
improve admin and mod check to not do seq scans and return unnecessary data (#3483)
* improve admin and mod check

* fix clippy

* move admin index to existing code

* Revert "move admin index to existing code"

This reverts commit d0c58d5f4021e1775d0c1d30d8df6c7df87557c4.

* third attempt at the migration

* fix formatting

* rebuild

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-06 14:44:26 +02:00
Nutomic 00f9f79a44
Only allow http(s) scheme for urls (ref #3505) (#3508)
With this change only http(s) schemes are allowed for post.url
field. This is checked for incoming api and federation requests.
Existing posts in database which are sent to clients are not
checked. Neither does it check urls in markdown.
2023-07-06 08:29:51 -04:00
Nutomic c12fedaf1b
Change security contact mail (#3506)
Old one isnt working apparently
2023-07-06 07:27:47 -04:00
Diamond 084f603745
Allow cross-origin requests (#3421)
Co-authored-by: pfg <pfg@pfg.pw>
2023-07-06 07:25:19 -04:00
Dessalines 6840fd64f9
Make sure hot rank sorts for post and community filter by positive hot ranks. (#3497)
* Make sure hot rank sorts for post and community filter by positive hot ranks.

- Context #2994

* Adding a comment.
2023-07-06 13:22:48 +02:00
Dessalines ef11a6ca37
Fixes wrong community moderator ordering. (#3495) 2023-07-06 12:27:25 +02:00
Nutomic ce1ffebeb0
Use fixed prettier version for CI (#3507)
3.0.0 was pushed to docker hub 2 hours ago, thats probably why
builds are breaking now.
2023-07-06 12:23:51 +02:00
phiresky 2158621bda
upgrade markdown-it to fix panic (#3490)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-05 13:08:53 -04:00
phiresky 45b1a0d4fb
improve performance of community followers inbox query (#3482)
* improve performance of community followers inbox query

* nightly format

* force woodpecker to retry

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-05 11:50:26 -04:00
Nutomic ebaf69bd70
Cache federation blocklist (#3486)
* Cache federation blocklist

* revert submodule change
2023-07-05 11:08:02 -04:00
Andrew Fields 1e99e8b9dc
Add Prometheus endpoint (#3456)
Add a server for serving Prometheus metrics. Include a configuration
block in the config file. Provide HTTP metrics on the API, along with
process-level metrics and DB pool metrics.
2023-07-05 13:25:19 +02:00
Dessalines 657c2e37c0
Adding a person.admin index, and featured_local/community indexes. (#3479) 2023-07-05 13:00:41 +02:00
Lemmus.org ff47d97bd3
Add feature for enabling json logging (#3462) 2023-07-04 07:11:47 -04:00
Louis GERARD 85dab149a9
fix(posts/comments/search): return error on invalid community name (#3418) 2023-07-04 13:04:38 +02:00
Josephos cdc5b47886
Improved validation of display names (Fixes #3436) (#3437)
* Fixed validation of display names

Fixed validation of display names: reject names beginning with invisible unicode characters.

* Formatting

Formatting fix.

* Expanded list of forbidden Unicode characters. Validation now checks for disallowed characters anywhere in the name.

* Formatting

* Added a comment detailing source of the list of invisible chars.
2023-07-04 12:41:58 +02:00
Dessalines 8bcf2ea7c9
Fixing clippy. (#3471) 2023-07-04 12:15:27 +02:00
Piotr Juszczyk bf62fbe644
Remove not needed anymore http-signature-normalization-actix dependency (#3458) 2023-07-04 12:14:37 +02:00
Dessalines f0e487f18a
300 comment limit. (#3306)
* 300 comment limit.

* Another fix.
2023-07-03 18:02:57 -04:00
Dessalines 7a04971ecd Version 0.18.1-rc.9 2023-07-03 17:16:48 -04: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
perillamint 696cca4ce4
Remove excessive content_type header configuration (#3470) 2023-07-03 13:43:45 -04:00
Dessalines 935b0bf048
Adding rest of community sorts. Fixes #3374 (#3376)
* Adding rest of community sorts. Fixes #3374

* Addressing PR comments.
2023-07-03 13:09:15 -04:00
Nutomic e1494d4683
Dont compare db string errors (fixes #1393) (#3424)
* Dont compare db string errors (fixes #1393)

* cargo fmt

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-07-03 11:59:49 -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
David BELEY efe98158c0
Fix awesome-lemmy owner (#3469) 2023-07-03 16:44:55 +02:00
David BELEY 050216eed9
Add awesome-lemmy to LemmyNet? (#3413)
* Add LemmyNet/awesome-lemmy

* Delete other apps/projects from README.md
2023-07-03 15:15:45 +02: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
Nutomic 6405761891
Mark follow as pending when subscribing to remote community (fixes #3384) (#3406) 2023-07-03 12:03:20 +02:00
Felix Ableitner fc60b82f82 Fix formatting for latest nightly (#ref 3467) 2023-07-03 11:45:53 +02:00
Nutomic 3578dab67f
Remove PerformApub trait (#3423)
* Remove PerformApub trait

This is completely useless now that websocket is gone. In the future
I also plan to remove Perform and PerformCrud traits, but it will be
difficult to do that while still compiling crates in parallel.

* params need to use query
2023-07-03 11:01:41 +02:00
drumlinish 682ca55e0c
Fix quoting of max-file in docker-compose.yml (#3442) 2023-07-03 10:59:07 +02:00
phiresky cb28af508d
don't strip, log trace if requested (#3425) 2023-06-30 09:32:43 -04:00
Lemmus.org 810762762f
Update federated posts to not cache sensitive images if not allow by local site (#3253)
* Update federated posts to not cache sensitive images if not allow by local site

* Refactor thumbnail match to simplify logic
2023-06-30 12:42:42 +02:00
Dominic Mazzoni fcc010b5dc
Fix concatenation of audio captcha wav files (#3350)
* Fix concatenation of audio captcha wav files

* Log errors rather than crashing

* Return Result from captcha_as_wav_base64

* Change to return LemmyError

* Check for wav write error, format

* Remove unused import

* Rewrite to avoid clippy warnings
2023-06-30 12:36:38 +02:00
dullbananas 7d3894d5dd
Automatically manage database when running scripts/test.sh (#3389)
* Update .gitignore

* Create start-dev-db.sh

* Rename start-dev-db.sh to start_dev_db.sh

* Update .gitignore

* Update start_dev_db.sh

* Update start_dev_db.sh

* Update start_dev_db.sh

* Update start_dev_db.sh

* h

* Update test.sh

* Update start_dev_db.sh

* made it work

* Make test.sh work when run from scripts dir
2023-06-30 09:50:30 +02:00
Dessalines 3159eedd99 Version 0.18.1-rc.4 2023-06-29 10:45:59 -04:00
Dessalines 6c64cb5233
Fixing release script. (#3398)
* Fixing release script.

* Version 0.18.1-rc.2

* Removing cargo update from release script.

* Fixing topdir location.
2023-06-29 16:17:59 +02:00
Nick Shockey 0464c46d26
Added gitattributes to normalize all files to lf (#3386)
This makes it less annoying to build on windows/mac

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-29 10:16:11 +02:00
Nutomic c216153dfb
Update activitypub-federation crate to 0.4.5 (#3379)
https://github.com/LemmyNet/activitypub-federation-rust/releases/tag/0.4.5
2023-06-28 12:58:23 -04:00
Sander Saarend ec18fd9869
Fix cargo warnings (#3397) 2023-06-28 12:57:49 -04:00
c-andy-candies ffc049078e
Fix missing sorting types (#3370)
* Fix missing sorting types

* Reordered sort_type_enum
2023-06-28 12:44:16 -04:00
Jan Klass 0f91759e4d
docs(api): Add api-common info on generating TypeScript bindings (#3330) 2023-06-28 11:25:46 +02: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
Nutomic e4b739320c
Run cargo update as part of release script (#3369)
To get newest dependency patches and get rid of yanked deps

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-27 08:59:58 -04:00
Dessalines ad6f244b61 Version 0.18.1-rc.1 2023-06-27 08:14:46 -04:00
Nina Blanson e63aa80c3a
Fixes #2900 - Checks slur regex to see if it is too permissive (#3146)
* Fixes #2900 - Checks slur regex to see if it is too permissive along with small validation organization

* Clean up variable names, add handler for valid empty string usecase

* Update tests

* Create validation function and add tests

* Test clean up

* Use payload value vs local site value to prevent stunlocking

* Remove println added while testing

* Fall back to local site regex if not provided from request

* Attempt clean up of flaky comment_view tests

* Pull in latest submodule

* Move application, post check into functions, add more tests and improve test readability

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-06-27 07:03:30 -04:00
Domenic Horner d1d90af0eb
add new flag to api (#3363) 2023-06-27 06:45:26 -04: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
Dessalines 98482b1564
Fixing the release script. (#3295)
* Fixing the release script.

* Updating the submodules.
2023-06-27 10:28:56 +02:00
Sander Saarend 211e76dc27
Batch hot rank updates (#3175) 2023-06-27 10:13:51 +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
Nutomic 50efb1d519
Fetch community outbox and moderators in parallel (#3360)
This will speedup first time fetching of a remote community
2023-06-26 12:14:50 -04:00
Nutomic 8fbc630ce1
Remove networks from docker-compose.yml (#3356) 2023-06-26 12:10:38 -04:00
Simon Lundström c9e9ff46fa
Item URL should point to post URL (#3345)
If the post is an URL post the item link should point to the URL of the
link that is being posted.
2023-06-26 15:11:16 +02:00
Otto Rottier 62c8ac1db5
Site Metadata: resolve relative URLs for embedded images/videos (#3338)
* Site Metadata: resolve relative URLs for embedded images/videos

* api_common: relax version requirement of `webpage` dependency

With this change we opt into next (non breaking) versions of webpage-rs

* cargo +nightly fmt

* Add tests for resolving absolute urls in SiteMetadata
2023-06-26 15:07:57 +02:00
dullbananas b2a9d4a335
Use compression middleware (#3343) 2023-06-26 12:54:41 +02:00
Felix Ableitner 73d2faa9f5 Remove another unused dev dependency 2023-06-26 12:46:44 +02:00
cetra3 9406c3ad2b
Adjust the config check to be a separate faster to compile binary (#3313) 2023-06-26 06:23:21 -04:00
Felix Ableitner a39e948b52 Remove unused actix_rt dependency 2023-06-26 12:14:47 +02:00
wiki-me 83ff9adee5
Add Liftoff to README.md (#3357) 2023-06-26 12:12:38 +02:00
perillamint 3d7d6b2530
Respond with `Content-Type: application/activity+json` (#3353)
As per ActivityPub specification, the return type should be
`application/activity+json`, not `application/json`.
2023-06-26 12:10:04 +02:00
anonion 01dc1efe77
Fix lemmy UI environment variable (#3299) 2023-06-26 06:07:22 -04:00
Peter Dave Hello 2f3d60a63b
Leave no apk cache in Docker image (#3327) 2023-06-26 11:59:02 +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
TKilFree 21d5349785
feat: allow all admins to purge content (#3271) 2023-06-26 10:47:39 +02:00
Neshura 203e35899e
Add separate Post check for is_valid_body_field (#3263)
* Add separate Post check for is_valid_body_field

* Modify is_valid_body_check for posts only

* Fix check var reinit in validation.rs

* Extra empty line to rerun woodpecker with changes

* Change Option to bool, add false to non-post calls

* Woodpecker trick.. again

* Probable rust_fmt fail fixed

* cargo_clippy changes

* Missing space between = and if

* Remove ; after body length checks
2023-06-26 10:47:01 +02:00
Felix Ableitner 206789af67 Merge branch 'vijaykramesh_clear_deleted_posts_comments' 2023-06-26 10:45:49 +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
Dessalines e4d78b0974 Version 0.18.0 2023-06-26 10:45:22 +02:00
Dessalines 3f6e9a7f23 Version 0.18.0-rc.8 2023-06-26 10:45:22 +02:00
Dessalines 37a47de3a8 Revert "feat: re-added captcha checks (#3249)" (#3288)
This reverts commit 8a086c8240.
2023-06-26 10:45:22 +02:00
Dessalines b6cd1bde8e Fixing removed posts showing. Fixes #2875 (#3279)
* Fixing removed posts showing. Fixes #2875

* Fixing clippy.
2023-06-26 10:45:22 +02:00
Kresten Laust aea5f6a38b Reversed requirement question logic (#3283)
* Reversed requirement question logic

* Changed required state to 'true'
2023-06-26 10:45:22 +02:00
TKilFree 9537878519 feat: re-added captcha checks (#3249) 2023-06-26 10:45:22 +02:00
Sander Saarend 6d67f88603
Add support for sslmode=require for diesel-async DB connections (#3189) 2023-06-26 10:25:38 +02:00
cetra3 d7da911a48
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:24:11 +02:00
Dessalines 63d3759c48 Version 0.18.0 2023-06-23 08:41:20 -04:00
Dessalines cb3b9b1a66 Version 0.18.0-rc.8 2023-06-23 07:07:51 -04:00
Dessalines 1f1c0ad17a
Revert "feat: re-added captcha checks (#3249)" (#3288)
This reverts commit 8a086c8240.
2023-06-23 07:02:05 -04:00
Dessalines dce79b83bf
Fixing removed posts showing. Fixes #2875 (#3279)
* Fixing removed posts showing. Fixes #2875

* Fixing clippy.
2023-06-23 12:53:46 +02:00
Kresten Laust 39572e1c3e
Reversed requirement question logic (#3283)
* Reversed requirement question logic

* Changed required state to 'true'
2023-06-23 11:50:35 +02:00
TKilFree 8a086c8240
feat: re-added captcha checks (#3249) 2023-06-23 11:47:12 +02:00
Vijay Ramesh 418bca78e1
Merge branch 'main' into clear_deleted_posts_comments 2023-06-22 09:59:43 -07:00
Dessalines 60baebcb14 Version 0.18.0-rc.6 2023-06-22 08:55:08 -04:00
Nutomic ffce66abb8
Update apub library to 0.4.4 (#3258)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-22 08:35:12 -04:00
kartikynwa 4f2fb68d6b
Add migration to mark local communities as such (#3257) 2023-06-22 07:52:31 -04:00
Nutomic 08e25d0e63
Remove translation part from docs links (#3260)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-22 07:46:37 -04:00
Nutomic 434beadb58
Use Rust 1.70 for Docker and CI (#3265) 2023-06-22 07:46:07 -04:00
ShittyKopper 862ceefc56
docker-compose: Add init to UI (#3248)
* docker-compose: Add init to UI

Prevents waiting 10 seconds to shutdown

* docker-compose: Update to version 3.7
2023-06-22 10:22:15 +02:00
Óliver García Albertos 985359918f
logger: Use forwarded instead of peer IP address (#3223) 2023-06-22 09:34:51 +02:00
Vijay Ramesh 0d576a8f23
Merge branch 'main' into clear_deleted_posts_comments 2023-06-21 13:35:37 -07:00
kartikynwa ef3544bac4
Put /admin/purge routes before /admin routes (#3244) 2023-06-21 22:32:06 +02:00
Bnyro c9d1fec117
docs: Add Lemoa to lemmy projects section (#3247) 2023-06-21 22:15:10 +02:00
Scott da3e3b6d8a
Ensure site can only either be a private instance or federated when creating or editing site (#3237)
* Add site visibility validation

* Fix formatting

* linter changes

* Update error message to match existing check

* Remove existing check

---------

Co-authored-by: Scott Merchant <97430840+scottmerchant@users.noreply.github.com>
2023-06-21 22:14:12 +02:00
Dessalines 289052f261 Version 0.18.0-rc.5 2023-06-21 16:02:42 -04:00
Vijay Ramesh 4db65c191c after 30 days post deletion, replace comment.content and post.body with 'Permanently Deleted' 2023-06-21 12:46:56 -07:00
Dessalines d4f52b78b3
Trying to fix version again. (#3246) 2023-06-21 21:46:32 +02:00
Michał 4cdb9583e9
feat: allow overriding smtp_password with the LEMMY_SMTP_PASSWORD env var (#3154)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-21 13:36:42 -04:00
Dessalines 3775418952 Version 0.18.0-rc.4 2023-06-21 08:05:15 -04:00
Nutomic 8fb4760e02
Dont publish to crates.io (#3239) 2023-06-21 07:57:01 -04:00
Nutomic e3eda68147
Correct error messages if user registers with taken user/email (#3093)
* Correct error messages if user registers with taken user/email (fixes #2955)

* exists
2023-06-21 05:26:07 -04:00
Dessalines 1ef095dd96
Fixing cross_post duplicates. Fixes #3233 (#3234) 2023-06-21 10:56:44 +02:00
JP Moresmau a1beccf353
Add test to check reading and listing posts return my_vote (#3215) 2023-06-21 10:48:39 +02:00
dullbananas 45818fb4c5
Reduce memory usage of rate limiting (#3111)
* Reduce Vec allocations

* Optimize stuff

* Move embedded migrations to separate crate

* Revert "Move embedded migrations to separate crate"

This reverts commit 44b104997016ee2a1f2c0bb735b75e654666860d.

* clippy, fmt

* Shrink rate limit allowance to f32

* Initialize rate limit allowance directly

* Add removal of old rate limit buckets

* Improve readability

* Remove usage of is_okay_and for Rust 1.67 compatibility

* Add dhat-heap feature

* Fix api_benchmark.sh and add run_and_benchmark.sh

* Revert "Fix api_benchmark.sh and add run_and_benchmark.sh"

This reverts commit b4528e5b85dd3f13cea43d72ada9382200c8fc77.

* Revert "Add dhat-heap feature"

This reverts commit 08e835d487b983c44ce2570d8c396d570d426916.

* Manually revert remaining stuff

* Use Ipv6Addr in RateLimitStorage

* Shrink last_checked in RateLimitBucket to 32 bits

* Fix rate_limit::get_ip

* Stuff (#1)

* Update rate_limiter.rs

* Update mod.rs

* Update scheduled_tasks.rs

* Fix rate_limiter.rs

* Dullbananas patch 1 (#2)

* Update rate_limiter.rs

* Update mod.rs

* Update scheduled_tasks.rs

* Fix rate_limiter.rs

* Rate limit IPv6 addresses in groups

* Fmt lib.rs

* woodpicker trigger

* Refactor and comment `check_rate_limit_full`

* Add `test_split_ipv6`

* Replace -2.0 with UNINITIALIZED_TOKEN_AMOUNT

* Add `test_rate_limiter`

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-21 10:28:20 +02:00
Dessalines b214d3dc00
Adding current domain from settings to CORs. (#3231) 2023-06-20 20:29:48 -04:00
Joel Beckmeyer 8179b0daf2
remove debugging println (#3227) 2023-06-20 14:20:20 -04:00
Dessalines 5ff221a2e4
Fixing comment_view unit tests. (#3224) 2023-06-20 14:14:08 -04:00
Sander Saarend 8ed3f3530e
Fix parameter ordering for new_report_subject string (#3210) 2023-06-20 11:24:04 -04:00
Nutomic b37c30ffae
Move cors default to source code (#3219) 2023-06-20 11:19:03 -04:00
Dessalines 154a85cc36
Fixing tag deploys. (#3216)
* Fixing tag deploys.

* Fixing tag deploys 2.

* Try to comment build_args.

* Fixing tag deploys 3.

* Fixing build args again.

* Last fix.
2023-06-20 16:29:24 +02:00
Ivo Barros 4d160461ce
Feature add hours as sorting options backend (#3161)
* add hours as sorting options

* ran cargo +nightly fmt

* woodpicker trigger
2023-06-20 16:05:43 +02:00
kartikynwa dc36d9ed89
Don't check verified email when an admin logs in (#3209)
Workaround for instance admins getting locked out when they turn on
the email verification requirement without having verified their
own email.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-20 08:52:21 -04:00
Andrew DeLisa bfc0c0e7d3
fix: add CORS origin environment variable (#3191)
* fix: add CORS origin environment variable

* chore: formatting

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-20 08:29:38 -04:00
Joel Beckmeyer 06a3f9c5aa
make embedded pict-rs port configurable (#3201) 2023-06-20 13:07:18 +02:00
Dessalines 981c111567
Move connection creation into scheduler. (#3120)
* Move connection creation into scheduler.

- #3076

* Fix clippy.
2023-06-20 11:33:03 +02:00
Felix Ableitner 56de68c77a Update translations 2023-06-20 10:59:27 +02:00
Sander Saarend e23621c2cd
Calculate initial hot_rank and hot_rank_active for posts and comments from other instances (#3131)
* Calculate initial hot_rank when receiving posts and comments from other instances

* Move hot rank update logic into db_schema
2023-06-20 10:52:51 +02:00
ludrol d97ff65fe1
Changed github issue template to align logically with the question asked (#3135) 2023-06-16 11:56:21 -04:00
Chethan bb27339e68
Update README.md (#3137)
The Ace of Spades video linked in the README was private, have replaced it with a public video.
2023-06-16 11:54:12 -04:00
Sander Saarend 007c7d5812
Remove e-mail verification success e-mails (#3124) 2023-06-16 11:53:33 -04:00
Alex Maras becf75d1f9
Fix Hidden communities showing in community list (#3094)
* Only show hidden communities when explicitly searching for them rather then in "all"

* dont set hidden to false when creating and updating - let DB set default

* lint

---------

Co-authored-by: Alex Maras <alexmaras@gmail.com>
2023-06-15 13:39:58 +02:00
Nutomic b5dba17426
Update all dependencies (#3091) 2023-06-15 11:37:05 +02:00
Wyatt Smith 744153eee6
Prevent making an instance private if federation is enabled. (#3074)
* Prevent making an instance private if federation is enabled.

* Added case where federation is enabled, check if the alternative setting is changed

* Merged the error messages for private instance/federation.

---------

Co-authored-by: Wyatt Smith <wys@dropbox.com>
2023-06-15 11:35:09 +02:00
Sander Saarend 68d814b9b1
Handle scheduled task errors (#3090)
* Add --disable-scheduled-tasks CLI flag

* Add error handling for scheduled tasks
2023-06-15 11:29:12 +02:00
Dessalines 5af831c6fa
Fix unapproved users being able to log in after registration mode set to closed. (#3096)
- Fixes #3095
2023-06-14 19:02:17 -04:00
Nutomic ebd8c86f0e
Link tafkars in readme (#3087) 2023-06-14 23:41:20 +02:00
Divided by Zer0 14b990e006
doc: Added pythorhead library in readme (#3114) 2023-06-14 23:40:49 +02:00
adisbladis e0af3a292e
Only create ltree postgres extension in migration if doesn't already exist (#3092) 2023-06-14 17:03:10 -04:00
Raymond Berger 53fe93db47
add issue template yml from lemmy-ui (#3086)
* add issue template yml from lemmy-ui

* prettier

* Empty-Commit for CI

* improve Qs

* add instance question

* delete hexbear

* backend version
2023-06-14 22:21:03 +02:00
Neshura 558035b128
Fix Issue #3075 by using None for local fields instead of Some(false) (#3088)
* Set insert and update form "local" to None

* Extra space to retrigger woodpecker

* Resolve code review request

https://github.com/LemmyNet/lemmy/pull/3088#discussion_r1229336958

* Remove extra space after None,
2023-06-14 08:34:45 -04:00
Charles Hall f43bb454c3
stop requiring superuser to run migrations (#3002)
Fixes <https://github.com/LemmyNet/lemmy/issues/2863>.
2023-06-14 07:54:12 -04:00
Nina Blanson 1c7bfd6be8
Fixes #1884 - Support Spoiler Tags (#3018)
* Fixes #1884 - Switches markdown libraries and creates a custom rule to manage spoiler blocks

* Add tests to cover invalid spoiler input

* Consolidate tests, add comments

* Make immutable, static instance of markdown parser

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-06-14 13:15:59 +02:00
Felix Ableitner f3f95e5d2f Fix compilation 2023-06-14 11:34:29 +02:00
Patrick Roe 87aa0acaf1
Align default DB password with documentation (#3068) 2023-06-13 22:23:07 +02:00
JetpackJackson 91271a7ce4
Update RSS url (#3053)
* Update RSS url

* Fixed next line

* making sure this thing uploads

* Update feeds.rs

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-13 16:17:02 -04:00
Edgar Alvarado c32585b034
Docker yaml anchors and docker logs (#3027)
* Use anchor for duplicated compose properties

* Include docker log max

* Run prettier
2023-06-13 08:37:06 -04:00
Edgar Alvarado 932e65c16d
Fix ports used by docker (#3012)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-12 18:38:27 -04:00
Jared Schneiderman 5f92125e44
Add limit and pagination to feeds (#2980)
* adds limit and pagination to all rss feeds

* consistent ordering

* refactor page and limit and add after

* revert back to using page

* remove offset change

* refactor to impl adding helper methods

* clippy
2023-06-12 17:48:02 -04:00
Nutomic 25275b79ee
Upgrade activitypub-federation to 0.4.1 (#3039)
This improves logging so that its not necessary to enable debug
logs to find out that activity worker count needs to be increased.
2023-06-12 14:12:15 -04:00
Charlie Fish 87634ca206
Adding Lemmy-Swift-Client to README.md (#3026) 2023-06-12 15:31:27 +02:00
Andy Brandt b47ce4c2e6
use usize::MAX for line wrap length, since lettre does it for us (#3034)
fixes #2921
2023-06-12 15:29:15 +02:00
Charles Hall f50325e78a
update doku (#3003)
Fixes malformed documentation generated by previous version.
2023-06-12 05:55:47 -04:00
Nathan Schulzke 3a6f8877c9
Fix contributing link (#3015) 2023-06-12 11:04:47 +02:00
Dessalines ecc9469a02
Better issue templates. (#2991)
* Better issue templates.

* Fixing bug report.
2023-06-09 23:08:27 +02:00
Charles Hall 14c18dbdae
allow specifying db uri in config file (#2956)
* allow specifying db uri in config file

* succumb to a bug in doku

See <https://github.com/anixe/doku/issues/33>.
2023-06-09 08:18:22 -04:00
Dessalines 8cb5939f50
Adding hot_rank columns in place of function sorting. (#2952)
* Adding hot_rank columns in place of function sorting.

- Creates hot_rank columns for post, comment, and community.
- Fixes #2932

* Updating all hot ranks on startup.

* Fixing post.url migration.

* Removing update_instance_software from startup.

* Adding post_rank query
2023-06-08 16:15:15 -04:00
Charles Hall 4e5798852f
make shebangs posix compliant (#2974)
Previously, these scripts wouldn't work on exotic systems such as NixOS.

```
fd '\.sh$' -t f --exec sed -i 's@#!/bin/bash@#!/usr/bin/env bash@'
```
2023-06-08 15:38:26 -04:00
Andy Brandt f98476c5c0
Fix private message e-mail notification subject and body (#2963)
It used to say:

Subject: Private message from [your username]
Body: [your username] - [private message]

It now display the correct username that it's from.
2023-06-08 13:42:32 -04:00
Anon 15c84e2f7b
Add comment depth check (#2940)
* Add comment depth check

* Move comment depth code

* linter fix
2023-06-08 10:31:26 -04:00
Jason Watkins 491e197529
Add `lemmyexternalproxy` to `lemmy` so that it can talk to the internet (#2960)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-08 08:30:16 -04:00
Nutomic 980df7545d
Fix translation build error (fixes #2967) (#2968) 2023-06-08 07:12:40 -04:00
Nutomic 2423b89ced
Activitypub breaking changes for Lemmy 0.18 (#2705)
* Remove deprecated field `group.moderators`

* Drop column local_site.federation_debug

* Remove backwards compatibility code for feature/lock post

https://github.com/LemmyNet/lemmy/pull/2716

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-07 15:18:17 -04:00
Nutomic 1c9f0c2bed
Add db index for post.url column (#2929)
* Add db index for post.url column

As mentioned in https://github.com/LemmyNet/lemmy/issues/2877#issuecomment-1576439829

Not sure if its preferable to do this, or make a combined index
which includes post.nsfw, post.removed, post.deleted

* remove unique
2023-06-07 11:31:24 -04:00
derivator 9419dd7c05
Fall back to String for Comment::path when not using the full feature (#2941) 2023-06-07 09:38:46 -04:00
Carlrs 24323e17b2
update diesel to 2.1.0 and diesel-async to 0.3.0 (issue #2882) (#2895)
* update diesel to 2.1.0 and diesel-async to 0.3.0 (issue #2882)

* get rid of deprecated RawValue type alias usage, explicitly import diesel types instead of using wildcard import

* Update diesel-derive-enum and diesel-derive-newtype libraries

* Revert manual changes to schema.rs

* Update to newer diesel-cli image in CI, run fix-clippy before schema comparison, update schema to one generated with diesel-cli 2.1.0 and clippyfixed

* Remove wildcard import lint, fix diesel schema pipeline

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-07 12:54:40 +02:00
Dessalines af03dcfeac
Fix dev setups. (#2944) 2023-06-06 22:22:21 -04:00
Nutomic e97c30b930
Set version name for crates.io release (#2928)
* Set version name for crates.io release

ref https://github.com/LemmyNet/lemmy-ui/issues/1052

* fix yml

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-06-06 20:24:06 -04:00
vpzomtrrfrt 09099e7b90
Fix handling of follows addressed to single value (#2920)
* Fix handling of follows addressed to single value

* Switch to deserialize_skip_error for Follow to

* Also use deserialize_skip_error for AcceptFollow and UndoFollow

* actually import deserialize_skip_error
2023-06-06 18:33:38 -04:00
Nutomic 3565ad984a
Remove chatserver (#2919)
* Remove chatserver

* fix clippy

* Remove captchas (fixes #2922)

* fix prettier

* fix api_common build

* cargo fmt
2023-06-06 12:27:22 -04:00
Dessalines ef1aa18fd2
Adding taglines to SiteResponse. Fixes #2925 (#2926)
* Adding taglines to SiteResponse. Fixes #2925

* Fixing CI line.
2023-06-06 08:59:34 -04:00
Dessalines bb625c3671
Fix *All* reports not showing. Fixes #2902 (#2903)
* Fix *All* reports not showing. Fixes #2902

* Fix *All* reports not showing. Fixes #2902

* Fixing tests.
2023-06-06 11:01:48 +02:00
Matt Pusch ae88f618fd
README updates (#2913)
* Updated readme to remove unsecure sunchid lemming article - replaced with wikipedia article.

Commented out sponsor list as page DNE.

Commented out Contributing section as all sites DNE. Added simple instructions for git contribution. Cleaned up formatting for Contributing section.

TODO: update join-lemmy.org/docs, uncomment removed lines

* Implemented suggested changes
2023-06-05 11:34:15 -04:00
Nutomic 7248c4a6f4
Filter empty username strings from Mastodon (fixes #2886) (#2887)
* Filter empty username strings from Mastodon (fixes #2886)

* add issue link
2023-06-05 13:56:53 +02:00
Udo dc9ca5768b
Update humane tech badge to point to new repo (#2898) 2023-06-05 12:49:32 +02:00
Justin Gauthier d439bdf8b4
Update to fix nginx proxy config for Docker Installs (#2908)
* Update to fix nginx proxy config

* Update docker-compose.yml - fix type

---------

Co-authored-by: Jax Gauthier <jax@gauthier.id>
2023-06-05 12:43:31 +02:00
Nutomic 1b4f995706
Remove jaeger, opentelemetry from docker-compose (#2894) 2023-06-04 22:16:49 +02:00
Dessalines e363c25521
Replace remmel with Mlem. (#2890) 2023-06-01 22:40:47 +02:00
Dessalines af3eb6e27b
Add CORS support for debug mode. (#2884) 2023-05-29 17:14:00 -04:00
phankydn d30839bea1
Don't filter comments of posts from blocked community when viewing post detail (#2880) 2023-05-29 11:41:47 -04:00
Nutomic 4240af86ca
Remove websocket code (#2878)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-05-29 10:44:20 -04:00
Nutomic a5707328cf
Dont return error in case optional auth is invalid (#2879)
* Dont return error in case optional auth is invalid

* fixes
2023-05-25 10:50:07 -04:00
phankydn 4a70502007
Remove unnecessary clone (#2874)
Co-authored-by: KyP <phanky.vn@proton.me>
2023-05-23 19:00:19 -04:00
Nutomic 82d93da26b
Remove GetCommunityResponse.default_post_language (#2867)
This field is unnecessary because we already set a default language
with the same logic if none is passed in CreatePost. So if the user
doesnt set a post language, it should simply be passed as None. This
also has the advantage that it works with clients that dont support
language tags.

Technically not a breaking change because its optional, but better
be safe.
2023-05-21 11:55:32 -04:00
Nutomic a9d708f494
Merge pull request #2866 from LemmyNet/remove-reqwest-retry
Optimize fetching of post url metadata
2023-05-18 17:19:54 +02:00
Felix Ableitner 436a293f38 Dont refetch post url metadata when post is received again 2023-05-18 16:34:52 +02:00
Felix Ableitner df57795595 Dont retry outgoing HTTP requests (ref #2865) 2023-05-18 16:34:52 +02:00
Nutomic 8410a9696e
Force enable undetermined language (#2851)
* Force enable undetermined language

* update

* fix tests
2023-05-18 16:34:21 +02:00
SleeplessOne1917 e856eda74d
Fix typo that caused error (#2861) 2023-05-14 14:02:05 -04:00
Dessalines 69f179bd33
Prettier check (#2855)
* Adding prettier check to CI.

* Running prettier on codebase.
2023-05-13 16:50:58 -04:00
Nutomic ce5161d997
Downgrade postgres for CI to 15.2 (fixes #2857) (#2859) 2023-05-12 19:08:32 -04:00
SleeplessOne1917 0379c9e4c1
Make volumes used in docker compose work when running on machines with SELinux enabled (#2853)
* Make volumes used in docker compose work when running on machines with SELinux enabled

* Switch lemmy-ui comments

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-05-11 20:15:12 -04:00
Nutomic af5175a282
Set attribute `deny_unknown_fields` for Lemmy config (#2852)
With this attribute, Lemmy will throw an error and exit if any
invalid entry is found in the config file. I think can be useful
to notice typos or keys that were removed or renamed in an upgrade.
Currently you wouldnt notice these at all unless you manually
compare the config file with settings that are listed in documentation.

This should be considered a breaking change.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-05-11 20:12:12 -04:00
Dessalines 32a5567cbf
Fixing empty req issue. (#2849)
* Fixing empty req issue.

* Forgot skip serializing none.
2023-05-11 21:20:45 +02:00
Dessalines d63b1ba935
Upgrade api_test deps (#2850)
* Upgrade api_test deps

* Fix cargo fmt.

* Try to trigger a new format
2023-05-10 16:31:37 -04:00
Dessalines 014c0ad87f
Adding comments to all API related types. Fixes #2846 (#2848) 2023-05-10 21:20:39 +02:00
Dessalines 88a0d2feec
Adding typescript generation for API. Fixes #2824 (#2827)
* Adding typescript generation for API. Fixes #2824

* Try to fix Ltree issue 1.

* Forgot a few types.

* Fixing api tests.

* Removing url_serde line.

* Manually deriving TS for some types.
2023-04-26 00:26:10 -04:00
Dessalines 1b5437cbe3
Addressing slow profile queries. #2777 (#2830)
* Addressing slow profile queries. #2777

* Addressing PR comments.
2023-04-25 19:28:06 -04:00
Dessalines 17527d0e7e
Reverting to older non-multi-arch dockerfile. Fixes #2832 (#2833) 2023-04-25 22:40:58 +02:00
Nutomic a25faf3e97
Add `to` field in follow activities for better compatibility (#2829)
* Add `to` field in follow activities for better compatibility (fixes #2744)

* fix tests
2023-04-24 17:19:08 -04:00
Dessalines a2fb4b8cd0
Use older git clone for woodpecker. (#2831) 2023-04-24 21:40:36 +02:00
Dessalines eb40aeb89b
Remove last Option<Vec.. from API. Fixes #2820 (#2822)
* Remove last Option<Vec.. from API. Fixes #2820

* Add empty allowed_instances check.

* Adding comment for allowed_instances.
2023-04-21 23:41:03 +02:00
Dessalines 1e26709cb4
Adding cross_post fetching to GetPost. Fixes #2127 (#2821) 2023-04-19 22:16:19 +02:00
6543 85ef507ac7
Use Dockerfile.multiarch as Dockerfile (#2818)
* use Dockerfile.multiarch and delete old Dockerfile

* Dockerfile.multiarch -> Dockerfile

* nit
2023-04-18 22:21:31 +02:00
Dessalines d8722b6e91
Adding diesel enums for SortType and ListingType (#2808)
* Adding diesel enums for SortType and ListingType

- Uses diesel-derive-enum.
- Adds diesel.toml , so we can again use the auto-generated schema.rs
- Fixes a lot of DB null issues and column ordering issues.
- Fixes #1136
- Also replaces RegistrationMode boilerplate.

* Fixing unit tests 1.

* Remove comment line.

* Before patch.

* Before again.

* Using patch file to fix diesel_ltree issue with diesel.toml

* Adding some yalc ignores

* Fixing RegistrationMode enums

* Adding woodpecker diesel schema check.

* Try adding openssl 1.

* Try using diesel-cli image 1

* Try using diesel-cli image 2

* Try using diesel-cli image 3

* Try using diesel-cli image 4

* Try using diesel-cli image 5

* Try using diesel-cli image 6

* Try using diesel-cli image 7

* Try using diesel-cli image 8

* Try using diesel-cli image 9

* Try using diesel-cli image 10

* Try using diesel-cli image 11

* Try using diesel-cli image 12

* Try using diesel-cli image 13
2023-04-17 15:19:51 -04:00
SleeplessOne1917 f5511cfd25
Make path to local lemmy-ui use correct relative path (#2817) 2023-04-17 13:38:59 -04:00
SleeplessOne1917 922b50fc7c
Add lemmy-bot to README libraries list (#2816) 2023-04-17 13:21:37 -04:00
Dessalines 33ba1fc623
Separate federated_instances into its own endpoint. Fixes #1931 (#2813) 2023-04-16 17:00:31 -04:00
6543 90c6dc2732
Use official rust image and clean up Dockerfiles (#2804)
* Add docker/Dockerfile.multiarch

* Update normal Dockerfile to be similar to multiarch one

* docker build run on x86 and arm64 now
manifest not needed, its handled by buildx plugin

* Rename Dockerfile.arm To Dockerfile.debian

* Emulate builder on arm target too

* fix misspell

* Improve Dockerfiles

* naming

* undo multiarchbuild settings as its blocked by a dependeny, see #2806

* Delete Dockerfile.debian
2023-04-16 12:56:12 -04:00
Dessalines 3fa713f414
Temporary fix for hiding deleted posts. #2624 (#2811) 2023-04-15 20:23:36 -04:00
Dessalines 148f33def5
Leave modded communities on account deletion. Fixes #2560 (#2810) 2023-04-15 19:41:05 -04:00
Dessalines 38d4429ae7
Adding check to description and body length fields. (#2805)
* Adding check to description and body length fields.

- Also making the checks return `LemmyError`
- Fixes #1747

* Address PR comments.

* PR comments 2
2023-04-15 10:45:11 -04:00
6543 e7a2080f3f
Fix & Optimize CI config (#2802)
* let the clone plugin handle submodules too

* start using yml aliase

* fix publish_to_crates_io

* CI.restart()
2023-04-13 22:33:00 +02:00
Dessalines 63f54a3103
Making the chat server an actor. (#2793)
* Making the chat server an actor.

- Fixes #2778
- #2787

* Forgot to add handlers folder.

* Some cleanup.

* Forgot to remove a comment.

* Address PR comments.

* Using ToString for enum operations.
2023-04-13 06:53:55 -04:00
Nutomic 844cde9db3
Use pretty print for federation json responses (#2801) 2023-04-12 20:17:23 -04:00
Nutomic 9d26ac2c6f
Fix listing type default value (#2796)
* Fix listing type default value

The listing type parameter is only meant for the frontpage, but is
also applied inside of communities. The result is that this call
returns nothing, because it defaults to ListingType::Local:
https://fedibb.ml/api/v3/post/list?community_id=3

It needs to be called like this to get any posts:
https://fedibb.ml/api/v3/post/list?community_id=3&type_=All

This is clearly not expected behaviour, when a community is
specified, the listing type should default to All.

* fix clippy
2023-04-12 10:40:59 -04:00
Dessalines d18bc95b7b
Add woodpecker ci (#2789)
* Adding woodpecker. Try 1

* Adding woodpecker. Try 2

* Adding woodpecker. Try 3

* Adding woodpecker. Try 4

* Adding woodpecker. Try 5

* Adding woodpecker. Try 6

* Adding woodpecker. Try 7

* Adding woodpecker. Try 8

* Adding woodpecker. Try 9

* Adding woodpecker. Try 10

* Adding woodpecker. Try 11

* Adding woodpecker. Try 12

* Adding woodpecker. Try 13

* Adding woodpecker. Try 14

* Adding woodpecker. Try 15

* Adding woodpecker. Try 16

* Adding platform when conditionals.

* Adding platform when conditionals 2.

* Adding woodpecker docker buildx.
2023-04-05 16:29:35 -04:00
Nutomic 3a526b0b7d
Remove unused dependencies (#2795) 2023-04-05 16:29:08 -04:00
Nutomic 165b19e75c
Optimize federated language updates to avoid unnecessary db writes (#2786)
* Optimize federated language updates to avoid unnecessary db writes (fixes #2772)

* fix tests

* fix test, rename functions

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-03-30 11:03:13 -04:00
Helge fdaa2bcf09
Added identifier to context (#2791) 2023-03-26 22:19:10 +02:00
Nutomic 6f513793cb
Activitypub crate rewrite (#2782)
* update activitypub-federation crate to 0.4.0

* fixes

* apub compiles!

* everything compiling!

* almost done, federated follow failing

* some test fixes

* use release

* add code back in
2023-03-21 16:03:05 +01:00
Anon 6bc49bdd70
Add Custom Emojis Support (#2616)
* Add Custom Emojis

* Modify index
2023-03-20 17:32:31 -04:00
Dessalines 66b0ddbbc5
Adding deadpool timeouts. (#2775) 2023-03-03 10:30:03 +01:00
Dessalines 1dba94c9cb
Adding TOTP / 2FA to lemmy (#2741)
* Combine prod and dev docker setups using build-arg

- Fixes #2603

* Dont use cache for release build.

* Adding 2FA / TOTP support.

- Fixes #2363

* Changed name to totp_2fa for clarity.

* Switch to sha256 for totp.
2023-03-02 21:37:41 +01:00
Dessalines 985fe24669
Get rid of Safe Views, use serde_skip (#2767)
* Get rid of Safe Views, use serde_skip

- Also change the ViewToVec, to work with non-vector cases. Might be
  necessary in preparation for #2763
- Fixes #2712

* Forgot one safe

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-03-01 18:19:46 +01:00
Dessalines 48f187188b
Show deleted and removed posts for profile views. Fixes #2624 (#2729)
* Show deleted and removed posts for profile views. Fixes #2624

* Only showing non-deleted/removed posts for creator.

* Add a admin or mod check to views, to show deleted and removed posts.

- Also removed the pointless "blanking" functions

* Fix clippy

* Make hidden posts comment clearer.

* Fixing federation tests.

* Fixing fmt.
2023-02-28 22:46:15 -05:00
Nutomic d9e7f0100a
Dont upsert Instance row every apub fetch (#2771)
This is not necessary because the domain cant change, so we only
need to insert if no row exists for this domain.

Also fetch instance actor when parsing person, not only community

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-02-28 21:36:57 -05:00
Dessalines 3844ac76c3
Fixing broken websockets. (#2770)
* Fixing broken websockets.

* Use cloned() for serde::Value
2023-02-28 21:27:33 -05:00
Nutomic f0e1627824
Ignore undetermined language when calculating post default language (#2769)
This will make it much more likely to successfully get a default,
as most users and communities have undetermined selected.
2023-03-01 01:49:31 +01:00
Dessalines 209c8a9185
Switch from bb8 to deadpool. Fixes #2765 (#2768)
* Switch from bb8 to deadpool. Fixes #2765

* Remove unecessary deadpool dependency.

* Ignoring nodeinfo test.
2023-02-28 22:45:37 +01:00
Dessalines 8c0c1628e0
Adding a vector indexing check to prevent panics. Fixes #2753 (#2754)
* Adding a vector indexing check to prevent panics. Fixes #2753

* Fixing for new clippy lint.

* Externalizing get_top_mod check. Adding get_first clippy lint

* Removing unit tests get(0)s

* Fixing some firsts manually
2023-02-28 12:34:50 +01:00
Dessalines 4c77c84b60
Cleaning up person_view sorts (#2760) 2023-02-24 13:33:54 +09:00
Nutomic 80571567e1
Add default attribute for webfinger properties (fixes #2756) (#2759) 2023-02-23 09:51:33 -05:00
Dessalines 155af88582 Adding 0.17.2 Release notes. 2023-02-22 10:08:41 -05:00
Nutomic 675353d4e9
Include type information with webfinger responses (fixes #2037) (#2746)
So that it is easier to parse for other software
2023-02-22 11:25:26 +09:00
Dessalines cd5c79527a
Fixing issue with saving site language. Fixes #2748 (#2749)
* Fixing issue with saving site language. Fixes #2748

* Add a warning to Site::read
2023-02-22 02:22:54 +01:00
Nutomic a42f7271e6
Proper permission check for federated comment distinguish (#2697)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-02-19 03:57:45 +09:00
Nutomic 62663a9f2e
Implement separate mod activities for feature, lock post (#2716)
* Implement separate mod activities for feature, lock post

Also includes collection for featured posts. Later we also need
to do the same for Comment.distinguished

* some changes

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-02-18 09:50:28 -05:00
Nutomic 8409e50f8c
Fix case in activitypub context (ref #2734) (#2743)
Should be camelCase.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-02-18 09:48:50 -05:00
Dessalines 1917e3d495
Separate comment distinguish (#2740)
* Combine prod and dev docker setups using build-arg

- Fixes #2603

* Dont use cache for release build.

* Separate comment distinguish into its own action.

- Fixes #2708

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-02-18 09:46:34 -05:00
Dessalines 3735c6fabf
Adding instance software and version. Fixes #2222 (#2733)
* Adding instance software and version. Fixes #2222

* Fix clippy.

* Fix clippy 2

* Fixing some more issues.
2023-02-18 09:36:12 -05:00
Dessalines 47f4aa3550
Fixing slow joins to post_read, post_saved, and comment_saved . (#2738)
- Fixes #2445
2023-02-18 09:35:35 -05:00
Dessalines 9b0428bc50
Remove lemmur since its deprecated. (#2742) 2023-02-18 14:23:28 +01:00
Dessalines 993489a80f
Combine prod and dev docker setups using build-arg (#2739)
* Combine prod and dev docker setups using build-arg

- Fixes #2603

* Dont use cache for release build.
2023-02-17 15:29:45 +09:00
Dessalines 36aaa50644
Organize utils into separate files. Fixes #2295 (#2736)
* Organize utils into separate files. Fixes #2295

* Moving tests.

* Fix test.

* Fix test 2
2023-02-16 05:05:14 +01:00
Dessalines 8a27978ee1
Removing checking permissions when editing posts and comments. (#2727)
* Removing checking permissions when editing posts and comments. Fixes #2714

* Running cargo fmt again.

* Adding back in community ban checks.
2023-02-15 11:04:23 +09:00
Dessalines 956d0aa52f
Fixing updated form fields. Fixes #2724 (#2725)
* Fixing updated form fields. Fixes #2724

* Fix import.
2023-02-14 16:41:22 -05:00
Dessalines 9d7009c772
Only let top admin purge. Fixes #2731 (#2732) 2023-02-14 14:31:04 -05:00
Nutomic 25e98064b6
Fix writing of `removeData` in apub context (fixes #2734) (#2735) 2023-02-14 13:40:39 -05:00
Dessalines ddb6268164
Adding a site option to email admins for new reports. (#2730)
- Fixes #2551
2023-02-15 00:57:08 +09:00
Dessalines 166854b37e
Sort community search by active_monthly by default. (#2728)
- Fixes #2678
2023-02-14 15:19:37 +01:00
Nutomic 3bb98fcc64
Fix post titles being cut off (fixes #2718) (#2720)
I didnt notice that this limit would also apply to Lemmy and other
software which has the title field. So gonna change it to be
identical to db limit
2023-02-10 13:35:23 -05:00
Nutomic 3bfa8ab4ff
Improved error message when attempting to fetch non-local object (fixes #2715) (#2717) 2023-02-08 14:45:29 -05:00
Kradyz ab9b60e86d
Convert HTML from titles into markdown (#2709)
Co-authored-by: Kradyz <k@radiz.nl>
2023-02-07 03:27:17 +01:00
Nutomic 7c1a37d584
In apub post receive, check posting restricted to mods (ref #2702) (#2704)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-02-05 12:31:09 -05:00
Nutomic 2891856b48
Fix docker federation setup (#2706) 2023-02-05 12:30:10 -05:00
Nutomic eb78af9b02
Fix data fetching from Peertube (fixes #2689) (#2703)
- Other platforms can support additional language tags. Treat those
as None instead of throwing error
- deserialize_skip_error was implemented incorrectly and failed on
array values (6d9682f4e6)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-02-05 00:38:08 -05:00
Dessalines bc8845391f
Add a ntfy notif on a tag deploy success. (#2701) 2023-02-05 02:51:48 +09:00
Dessalines 0c8fd240a6 Adding 0.17.1 Release notes. 2023-02-03 14:30:26 -05:00
Nutomic 4dddc3f717
Disable pictrs feature in CI to make it faster (#2698) 2023-02-04 03:32:44 +09:00
Dessalines 5ae409d4e4 Version 0.17.1 2023-02-03 09:36:18 -05:00
Dessalines ed95c61bca
Fixing admin application email subject. Fixes #2688 (#2695) 2023-02-03 09:24:19 -05:00
Dessalines b1e121b5ba
Fixing person block views. Fixes #2693 (#2694) 2023-02-03 14:45:32 +01:00
Dessalines d0c94a4f49
Fixing GetPosts active sort index. Fixes #2683 (#2684)
* Fixing GetPosts active sort index. Fixes #2683

* Fixing other sort.
2023-02-02 14:09:32 -05:00
Dessalines 93f2eb4df0 More explicit upgrade instructions. 2023-02-01 09:35:24 -05:00
Dessalines 4dfe4c5579 Fix yerbate.ml -> join-lemmy.org links 2023-02-01 09:34:59 -05:00
Dessalines 41010328c1 Merge branch 'main' of https://github.com/LemmyNet/lemmy 2023-01-31 12:21:34 -05:00
Dessalines 2754bc1d10 Fixing instructions. 2023-01-31 12:21:28 -05:00
Nutomic 36ac1b54c1
Publish without verify (#2681)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-01-31 10:41:48 -05:00
Nutomic 43b94e5f16
Fix paths in release script, update crate versions (#2680) 2023-02-01 00:26:51 +09:00
Dessalines d5368cbba9 Adding 0.17.0 Release notes. 2023-01-31 08:38:41 -05:00
Dessalines 53bc0311b1 Version 0.17.0 2023-01-31 08:30:54 -05:00
Dessalines a9905bf999 Updating translations. 2023-01-31 08:29:31 -05:00
Dessalines a610211557
Fixing `.drone.yml` (#2677)
* Try to fix docker/drone plugin

* Trying to use one rust image.

* Fixing drone 1.

* Fixing drone 2.

* Add drone notify.

* Fixing drone 3.

* Fixing drone 4.

* Fix clippy.

* Remove uninlined format lint.

* Combine all cargo tasks

* Fixing drone 5.

* Fixing drone 6.

* Fixing drone 7.

* Fixing drone 8.

* Fixing drone 9.

* Fixing drone 10.

* Fixing drone 12.

* Fixing drone 13.

* Fixing drone 14.

* Fixing drone 15.

* Fixing drone 16.

* Fixing drone 17.

* Fixing drone 18.

* Fixing drone 19.

* Fixing drone 20.

* Fixing drone 21.

* Fixing drone 22.

* Fixing drone 23.

* Fixing drone 24.

* Fixing drone 25.

* Fixing drone 26.

* Fixing drone 27.

* Fixing drone 28.

* Fixing drone 29.

* Fixing drone 30.

* Fixing drone 31.

* Fixing drone 32.

* Fixing drone 33.

* Fixing drone 34.

* Fixing drone 35.

* Fixing drone 36.

* Fixing drone 37.

* Fixing drone 38.

* Fixing drone 39.

* Fixing drone 40.

* Fixing drone 41.

* Fixing drone 43.

* Fixing drone 44.

* Fixing drone 45.

* Last cleanup.

* Fixing drone 46.

* Separate ci steps (#2679)

* separate ci steps

* fix 1

* add comments

* dont add rustfmt explicitly

* Revert "dont add rustfmt explicitly"

This reverts commit 358ce3302a134b7ac88d90a854079356995e9725.

* dont use all features for tests

---------

Co-authored-by: Nutomic <me@nutomic.com>
2023-01-30 14:17:24 -05:00
Dessalines a8232fe3d6
Use join_all instead of try_join_all. Fixes #2673 (#2674)
* Use join_all instead of try_join_all. Fixes #2673

* Add note about closed connections.
2023-01-30 11:11:11 -05:00
Kradyz c416e4ce14
Update message_id to comply with RFC 2822 (#2668)
The RFC 2822 format standard requires the message ID to be enclosed within angle brackets. If the standard is not followed, SpamAssassin deducts points from the e-mail.

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-01-30 11:10:51 -05:00
Dessalines 70c549dad8
Speeding up comment-ltree migration, fixing index creation. Fixes #2664 (#2670)
* Speeding up comment-ltree migration, fixing index creation. Fixes #2664

* Adding some logging lines, fixing for missing posts.

* Adding more postgres config
2023-01-23 09:59:25 -05:00
Nutomic 1eaf2c8a03
Add feature to embed pictrs in lemmy binary (fixes #2627) (#2633)
* Add feature to embed pictrs in lemmy binary (fixes #2627)

* Add pictrs config

* add protobuf

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-01-20 12:46:49 -05:00
Dessalines 6eb5ed343c
Update post_aggregates indexes to account for featured_local and featured_community columns. (#2661)
- Fixes #2660
2023-01-20 12:44:03 -05:00
Nutomic 7e3d3839b6
Post creation from Mastodon (fixes #2590) (#2651)
* Post creation from Mastodon (fixes #2590)

* better logic for page title

* add deserialize helper

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-01-20 12:43:23 -05:00
Dessalines ac56504291
Upgrade to postgres 15. (#2659) 2023-01-20 18:15:07 +01:00
Dessalines b5d45fa826
Add reddit -> lemmy importer to readme. (#2662) 2023-01-20 03:41:37 +01:00
Nutomic 2ec8bb877c
Some script improvements (#2654)
- Allow specifying which packages should be tested
- Hardcode `lemmy` as db password because thats used in many different places
2023-01-13 00:23:58 +01:00
Nutomic ceff2ec686
Use enum for registration mode setting (#2604)
* Use enum for registration mode setting

* fix tests
2023-01-05 01:42:30 +00:00
Dessalines 0630d214e3
Removing sniptt/monads for lemmy-js-client. (#2644)
* Removing sniptt/monads for lemmy-js-client.

* Fix tests.
2023-01-04 10:59:26 -05:00
Dessalines b7d5b37ac9
Fix historical post fetching. Fixes #2640 (#2643) 2023-01-04 14:58:11 +00:00
Dessalines e567151ec3
Adding the go client. (#2629)
* Adding the go client.

* Adding lemmyBB, and a stub for lemmy-rust-client

* Updating to use api_common readme.
2023-01-03 21:04:22 +00:00
Nutomic dab532f743
Point to !lemmy_support for support questions (#2638) 2023-01-03 03:28:21 -05:00
Nutomic 270f3b781a
Add documentation for using Lemmy API from Rust (#2639) 2023-01-03 03:23:41 -05:00
Nutomic 0d4cdb579c
Improve application question check (#2628)
The check was failing if only require_application was passed
and not application_question, despite application_question
being set in database.
2022-12-23 01:31:39 +00:00
Nutomic 9f52d4ae53
Fix user following (#2623)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-12-19 10:55:26 -05:00
Nutomic c3fbb7702f
Allow embedding Lemmy, fix setup error (#2618)
* Fix error during site creation due to empty LocalSiteRateLimit update

* Move main function into lib.rs, to allow calling from other crates

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-12-19 10:54:42 -05:00
Dessalines 76e0ab934f
Fixing missing forms, incorrect user discussion_languages (#2580)
* Fixing missing forms, incorrect user discussion_languages

* Add discussion_language to CommunityResponse

* Adding discussion_languages to CommunityResponse

* Adding discussion_language logic to community.create
2022-12-19 11:40:22 +00:00
Anon 9dfd819691
Add support for Featured Posts (#2585)
* Add support for Featured Posts

* Fix rebase

* More fixes
2022-12-12 11:17:10 +00:00
Nutomic 0ecf256ce3
Remove federation backwards compatibility with 0.16.x (#2183)
* Breaking: remove compatiblity with page.url field (ref #2182)

* Breaking: change type of Instance to `Application` (ref #2200)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-12-09 11:21:17 -05:00
Nutomic 2732a5bf07
Rework websocket (#2598)
* Merge websocket crate into api_common

* Add SendActivity trait so that api crates compile in parallel with lemmy_apub

* Rework websocket code

* fix websocket heartbeat
2022-12-09 10:31:47 -05:00
Nutomic f02892b23b
Merge pull request #2593 from LemmyNet/refactor-notifications
Refactor crates for parallel build
2022-12-02 11:17:10 +00:00
Felix Ableitner c6c52ab9cc Add SendActivity trait so that api crates compile in parallel with lemmy_apub 2022-12-02 10:46:49 +01:00
Felix Ableitner 201fa97769 Move code to generate apub urls into lemmy_api_common 2022-12-02 10:46:49 +01:00
Felix Ableitner 904d7bec2f Builds lemmy_routes in parallel with lemmy_apub 2022-12-02 10:46:49 +01:00
Felix Ableitner 030afbc2e7 Merge websocket crate into api_common 2022-12-02 10:46:49 +01:00
Nutomic 70e3feb174
Check user accepted before sending jwt in password reset (fixes #2591) (#2597)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-12-01 16:36:03 -05:00
Nutomic ccb6435c1d
Relax honeypot check (fixes #2595) (#2596)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-12-01 16:33:59 -05:00
Nutomic bcf5c91f81
Use audience field to federate items in groups (fixes #2464) (#2584) 2022-12-01 15:52:49 -05:00
Nutomic 41d4852efc
Federate group moderators using attributedTo field (#2588)
* Federate group moderators using attributedTo field

* fix tests

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-25 09:01:58 -05:00
Nutomic 96a2bec691
Set cargo home in ci to avoid redownloading deps between steps (#2587)
* Set cargo home in ci to avoid redownloading deps between steps

* remove protobuf

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-24 23:43:31 -05:00
Nutomic d39bc14c43
Add some more clippy lints (#2586)
* Add some more clippy lints

* restore config

* no allow dirty

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-24 16:38:00 +00:00
Nutomic c3c4508a72
Use release docker image for nightly build (#2583)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-24 08:33:58 -05:00
Nutomic d20d2b9218
Implement federated user following (fixes #752) (#2577)
* Implement federated user following (fixes #752)

* rewrite send_activity_in_community and add docs, remove default for column pending

* improve migration

* replace null values in db migration
2022-11-23 18:40:47 -05:00
Felix Ableitner 4ddca46228 Revert "Test drone (#2582)"
This reverts commit 87c7ee5490.
2022-11-23 21:25:24 +01:00
Nutomic 87c7ee5490
Test drone (#2582) 2022-11-23 15:23:23 -05:00
Nutomic bb1e3bc891
Upgrade activitypub_federation to 0.3.4 (#2581) 2022-11-23 09:06:25 -05:00
Nutomic bc19d94e3c
Upgrade activitypub_federation crate to 0.3.3 (ref #2511) (#2578) 2022-11-22 07:20:31 -05:00
Nutomic 872c60a013
Remove federation settings, rely on sensible defaults instead (#2574)
This affects federation_strict_allowlist and federation_http_fetch_retry_limit
2022-11-21 11:44:34 -05:00
Dessalines 65041a20bb
Fix clippy lints. (#2572)
* Fix clippy lints.

* Fix fmt.

* Dont use cargo-workspaces for fix-clippy script.
2022-11-21 10:21:09 +00:00
Anon c27d2a5687
Add support for Taglines (#2548)
* Add support for Taglines

* recreate migration

* Update content column -> Text

* Optimize replace function

* Change taglines to Option

* Move Ok() call

* Move taglines to GetSiteResponse

* Fix logic

Co-authored-by: layla <layla@chapo.dev>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-19 09:48:29 -05:00
Nutomic 6f3bf4634b
Various pedantic clippy fixes (#2568)
* Various pedantic clippy fixes

* more clippy pedantic fixes

* try to fix ci

* add fix clippy script, use rust 1.65

* fix clippy
2022-11-19 04:33:54 +00:00
Nutomic a39cf31466
Sort vecs before assert to avoid random test failures (#2569)
* Sort language read queries to avoid random test failures

* change sort columns
2022-11-18 20:30:59 -05:00
Nutomic 23d0f3ed3c
Display build status badge from drone.join-lemmy.org (#2564)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-17 18:51:17 +00:00
Nutomic df7809fbbb
Specify dependencies and metadata for entire workspace (#2565)
* Specify dependencies and metadata for entire workspace (fixes #2474)

* building api_common shouldnt depend on diesel

* remove drone task

* try with quotes

* fix clippy

* more clippy
2022-11-17 15:23:01 +00:00
Nutomic 63c237d6df
Use enum_delegate crate (#2554) 2022-11-16 22:51:05 +00:00
Nutomic 24756af84b
Live reload settings (fixes #2508) (#2543)
* Live reload rate limit settings (fixes #2508)

* fix tests
2022-11-16 14:06:22 -05:00
Nutomic b16df59373
Fix activity list test (#2562) 2022-11-15 22:38:26 +00:00
Felix Ableitner 0b86ffbdbd Remove unwrap 2022-11-14 15:30:44 +01:00
Nutomic a0fed24cee
When announcing incoming activities, keep extra fields (#2550) 2022-11-12 08:52:57 -05:00
Nutomic e3bb43542c
Mobilizon federation (#2544)
* Mobilizon federation

* Also accept document attachments from mobilizon
2022-11-12 08:51:08 -05:00
Nutomic 83d2959b4b
Update doku dependency for easier formatting of defaults.hjson (#2553) 2022-11-11 16:01:29 -05:00
ᡥᠠᡳᡤᡳᠶᠠ ᡥᠠᠯᠠ·ᠨᡝᡴᠣ 猫 42674b7abd
Translated README.md to Chinese (#2549)
* Add Mandarin locales

`README.zh.hans.md` for Simplified Chinese, `README.zh.hant.md` for Traditional Chinese

* Fix relative links to README
2022-11-11 10:10:13 +00:00
Dessalines 5d837780f5
Add diesel_async, get rid of blocking function (#2510)
* Moving settings to Database.

- Moves many settings into the database. Fixes #2285
- Adds a local_site and instance table. Fixes #2365 . Fixes #2368
- Separates SQL update an insert forms, to avoid runtime errors.
- Adds TypedBuilder to all the SQL forms, instead of default.

* Fix weird clippy issue.

* Removing extra lines.

* Some fixes from suggestions.

* Fixing apub tests.

* Using instance creation helper function.

* Move forms to their own line.

* Trying to fix local_site_data, still broken.

* Testing out async

* Testing out async 2

* Fixing federation tests.

* Trying to fix check features 1.

* Starting on adding diesel async. 1/4th done.

* Added async to views and schema.

* Adding some more async

* Compiling now.

* Added diesel async. Fixes #2465

* Running clippy --fix

* Trying to fix cargo test on drone.

* Trying new muslrust.

* Trying a custom dns

* Trying a custom dns 2

* Trying a custom dns 3

* Trying a custom dns 4

* Trying a custom dns 5

* Trying a custom dns 6

* Trying a custom dns 7

* Addressing PR comments.

* Adding check_apub to all verify functions.

* Reverting back drone.

* Fixing merge

* Fix docker images.

* Adding missing discussion_languages.

* Trying to fix federation tests.

* Fix site setup user creation.

* Fix clippy

* Fix clippy 2

* Test api faster

* Try to fix 1

* Try to fix 2

* What are these lines about

* Trying to fix 3

* Moving federation test back to top.

* Remove logging cat.
2022-11-09 10:05:00 +00:00
Nutomic ceae0f5993
Use urlencoding for db url params (fixes #2532) (#2537) 2022-11-07 21:29:32 -05:00
Nutomic a0a84d91ce
Dont serve apub json for removed objects (ref #2522) (#2538) 2022-11-04 20:57:28 -04:00
Nutomic 50a2233b52
Fix password length check (#2536) 2022-11-04 20:56:38 -04:00
Nutomic 2207fed0f5
Remove explicit panic from db connection code (fixes #2533) (#2535) 2022-11-04 20:53:46 -04:00
Nutomic 9393195827
Send error message when rate limit is reached (#2527)
* Send error message when rate limit is reached

* l18n key
2022-11-03 18:13:40 +00:00
Nutomic 5e871ca7ba
Mark own private messages as read in api (fixes #2484) (#2531) 2022-11-03 13:41:44 -04:00
Nutomic b5cd732372
Mark objects as not deleted when received via apub (fixes #2507) (#2528) 2022-11-03 09:39:30 -04:00
Dessalines cb753b045f
Group imports dess (#2526)
* Group imports with rustfmt

* Running cargo fmt again.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2022-11-02 15:18:22 -04:00
Nutomic 28eade6168
Fix invalid config in docker/prod (fixes #2520) (#2524) 2022-11-02 18:50:09 +00:00
Dessalines ed9e91345a
Fix local site images. (#2519)
* Fix local site images.

* It should be set up.
2022-11-02 12:10:40 +00:00
sam365724 7aa6d6b3e1
Fix 2455: Check auth for pictrs when instance is private. (#2477)
* Fix 2455: Check auth for pictrs when instance is private.

* Update, no utils function, use of existing get_local_user_view_from_jwt

* rustup toolchain install nightly (ftw)
2022-10-28 10:43:33 -04:00
Nutomic 6aa9bdebae
Fix limit_languages to operate on correct instance (fixes #2496) (#2518)
* Fix limit_languages to operate on correct instance (fixes #2496)

* cargo fmt
2022-10-28 10:42:05 -04:00
Nutomic 3b0be52e67
Image improvements (#2513)
* Image improvements

* remove rate limits
2022-10-28 14:34:40 +00:00
Nutomic b0c3185663
Make verify apub url function async (#2514)
* Make verify apub url function async

* cleanup

* use dep from crates.io

* dont use unwrap
2022-10-28 09:38:22 -04:00
Dessalines 235cc8b228
Moving settings to Database. (#2492)
* Moving settings to Database.

- Moves many settings into the database. Fixes #2285
- Adds a local_site and instance table. Fixes #2365 . Fixes #2368
- Separates SQL update an insert forms, to avoid runtime errors.
- Adds TypedBuilder to all the SQL forms, instead of default.

* Fix weird clippy issue.

* Removing extra lines.

* Some fixes from suggestions.

* Fixing apub tests.

* Using instance creation helper function.

* Move forms to their own line.

* Trying to fix local_site_data, still broken.

* Fixing federation tests.

* Trying to fix check features 1.

* Addressing PR comments.

* Adding check_apub to all verify functions.
2022-10-27 09:24:07 +00:00
Nutomic 276a8c2bd3
Enable lto, strip symbols via cargo.toml (#2512) 2022-10-25 15:10:07 +00:00
Dessalines 9ac13a0891
Fix docker dev build (#2509)
* Fixing docker dev build.

* Remove volume mount files.

* Fixing pictrs.

* Addressing PR comments.
2022-10-21 15:13:24 +00:00
Nutomic aaaea2006c
Federate votes as private (#2501) 2022-10-18 03:13:18 +00:00
Nutomic 74bc1198ce
Dont try to send activities if federation is disabled (fixes #2499) (#2500) 2022-10-17 14:29:18 -04:00
Nutomic 0a60bcb8ee
Return empty vec when reading all languages (fixes #2495) (#2497) 2022-10-17 09:37:22 +00:00
Nutomic 04f0f3af0b
Update clippy to use Rust 1.64 (#2498) 2022-10-14 16:09:37 +00:00
Nutomic 6c3e984ad1
Only allow authenticated users to fetch remote objects (#2493)
* Only allow authenticated users to fetch remote objects

* try to fix api tests
2022-10-13 16:30:31 +00:00
sam365724 cb559178bd
More real-world prod config, separate lemmy config (#2487) 2022-10-10 16:06:52 +00:00
Nutomic ec5e63b5a9
Fix check for federated mod actions (#2489) 2022-10-10 11:20:36 -04:00
sam365724 d2608bb279
Make docker-compose more clear and explicit (#2469)
* Make docker-compose more clear, starting with dev

Explicit networks, not opining ports when not necessary: Confusing for users. All requests go through nginx, so there is no need to open ports directly on pictrs and other services for example. I wasn't sure about jaeger and otel, maybe that can be changed somewhat too. 

Also adding comments and things that are relevant for a prod setup too.

* Update with comments

* Providing dedicated nginx and lemmy conf

* Fix config key for pictrs.

* Fix config key for pictrs.

* updates on naming

* Adding docker compose build info

* Revert to more complete lemmy config

* Test and fix build paths

* Fix otel config

* Delete dev file

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-10-06 19:01:19 +00:00
Nutomic 2ef0f8f5f8
implement language tags for site/community in db and api (#2434)
* implement language tags for site/community in db and api

* add api checks for valid languages

* during db migration, update existing users, sites, communities to have all languages enabled

* init new users/communities with site languages (not all languages)

* federate site/community languages

* fix tests

* when updating site languages, limit community languages to this subset

also, when making a new post and subset of user lang, community lang
contains only one item, use that as post lang

* add tests for actor_language db functions

* include language list in siteview/communityview

* Fix some of the review comments

* Some more review changes

* Add todo about boxed query

* Add default_post_language to GetCommunityResponse
2022-10-06 14:27:58 -04:00
Nutomic 7bb941e546
Change description in readme (#2481)
* Change description in readme

* Replace Mastodon contact link with Lemmy support forum

* update text

* remove part about unstable api
2022-10-05 12:25:17 -04:00
Nutomic 290acf6acc
Use compat mode when signing outgoing activities (fixes #1984) (#2473) 2022-10-03 13:46:42 -04:00
Dessalines 3f8c28b26f
Check to make sure comment isnt deleted / removed for unread count. (#2472)
- Fixes #2471
2022-09-29 20:52:14 +00:00
Dessalines ee41654394
Dont show deleted users or communities on profile page. (#2450)
* Dont show deleted users or communities on profile page.

- Fixes #2448

* Fix missing communities

* Add include_deleted to resolve_actor_identifier.
2022-09-28 20:54:32 +00:00
Dessalines ae95f5928e
Adding email admins for new applications. Fixes #2271 (#2390)
* Adding email admins for new applications. Fixes #2271

* Fix error.

Co-authored-by: Nutomic <me@nutomic.com>
2022-09-27 12:48:44 -04:00
Dessalines 0aeb78b8f3
Showing # of unread comments for posts. Fixes #2134 (#2393)
* Showing # of unread comments for posts. Fixes #2134

* Fix lint.

* Forgot to remove comment list update.

* Fix clippy
2022-09-27 16:45:46 +00:00
Nutomic f2537ba7db
Convert emails to lowercase (fixes #2462) (#2463) 2022-09-27 12:02:04 -04:00
Dessalines 3c5368d8b1
Remove unnecessary show_deleted_and_removed comments for a profile. (#2458) 2022-09-26 20:02:06 +00:00
Dessalines 2dca80d678
Remove pointless language joins. (#2451)
* Remove pointless language joins.

* Fix test
2022-09-26 15:25:18 +00:00
Dessalines 3adb293541
Fix rate limit error messages. Fixes #2428 (#2449)
* Fix rate limit error messages. Fixes #2428

* Simplify
2022-09-26 10:40:42 -04:00
Dessalines 9ce15ed071
Fix missing local user from post queries. (#2447) 2022-09-26 10:39:22 -04:00
Dessalines c9f1407429
Diesel 2.0.0 upgrade (#2452)
* Initial commit to bump diesel to 2.0.0-rc.0 and see what happens

* Add chrono feature from diesel

* db_schema crate is close to building?

* Upgrade diesel-derive-newtype

* Mostly modifying references to connections to be mutable ones; also used
new way to do migrations as suggested by the migration guide; a lot more
compiles now, though I can't figure out this tricky ToSql issue at the
moment

* Running clippy --fix

* Trying to fix drone clippy 1

* Fix clippy

* Upgrade clux-musl

* Trying to fix drone clippy 2

* Trying to fix drone clippy 3

* Trying to fix drone clippy 5

* Adding diesel table aliases, removing sql view hack. Fixes #2101

Co-authored-by: Steven Chu <stevenc1@gmail.com>
Co-authored-by: Nutomic <me@nutomic.com>
2022-09-26 14:09:32 +00:00
kartikynwa 4e6409f325
Allow filtering out of deleted and removed comments when getting person details (#2446)
undefined
2022-09-20 21:33:33 -04:00
Nutomic 004efd5d94
Implement reports for private messages (#2433)
* Implement reports for private messages

* finish private message report view + test

* implement api for pm reports

* merge list report api calls into one, move report count to site

* fix compile error

* Revert "merge list report api calls into one, move report count to site"

This reverts commit 3bf3b06a705c6bcf2bf20d07e2819b81298790f3.

* add websocket messages for pm report created/resolved

* remove private_message_report_view

* add joinable private_message_report -> person_alias_1

* Address review comments
2022-09-19 22:58:42 +00:00
Dessalines 09246a20fb
Check for slurs in account creation. (#2443) 2022-09-19 19:42:42 +00:00
Dessalines 71aed94a00 Merge branch 'main' of https://github.com/LemmyNet/lemmy 2022-09-14 11:30:44 -04:00
Dessalines 553654b8e8 Add 0.16.7 release notes. 2022-09-14 11:30:40 -04:00
Dessalines a93095ed3f
The language id is crucial for front ends. (#2437) 2022-09-13 21:02:37 +00:00
Dessalines 2f0560ca3f
Update docker version to 0.16.6. Fixes #2435 (#2438) 2022-09-12 09:33:49 +00:00
Dessalines eacd4e44cd
Adding job to drop phantom ccnew indexes. Fixes #2431 (#2432) 2022-09-07 12:12:51 +00:00
Dessalines 3f2a689edf
Don't search for community descriptions, search for user display_name. (#2430)
- https://github.com/LemmyNet/lemmy-ui/issues/756
2022-09-07 08:58:41 +00:00
Dessalines 265dc54627
Increase default search rate limit. (#2424) 2022-09-03 11:37:27 +02:00
Felix Ableitner 0a14b17747 fix clippy 2022-09-02 10:49:54 -04:00
Felix Ableitner 3295784ebb dont set default user languages in api code (already done in db) 2022-09-02 10:49:54 -04:00
Felix Ableitner 095591ef69 dont test with all features 2022-09-02 10:49:54 -04:00
Felix Ableitner 5e8a37ac86 clippy fixes 2022-09-02 10:49:54 -04:00
Felix Ableitner d058e2217a api changes for comment language tagging 2022-09-02 10:49:54 -04:00
Felix Ableitner bc7450ae3e add test for comment view languages 2022-09-02 10:49:54 -04:00
Felix Ableitner f5b1ee6c34 fix tests 2022-09-02 10:49:54 -04:00
Felix Ableitner 3d0d8796ad Add language tags for comments 2022-09-02 10:49:54 -04:00
Nutomic a6dc6804aa
Pass LocalUser to PostQuery etc, instead of separate params (#2413) 2022-08-19 10:27:39 -04:00
Nutomic e4a49b6eab
Tag posts and comments with language (fixes #440) (#2269)
* Tag posts and comments with language (fixes #440)

* Untangle PostView tests

* Implement test for PostView language query

* Store languages directly in database

* finish moving languages into db, it compiles

* update post_view

* serde skip Language.id field

* add local_user_language table, other changes suggested in review

* add code for local_user_discussion_language_view

* Remove unnecessary clones in db view converteres

* Fixing up some table and join issues.

* Clearing the current languages.

* Fix formatting.

* update user languages in single transaction

* proper test for user language queries

* Some fixes for all / missing user languages. (#2404)

* Some fixes for all / missing user languages.

* Adding back in transaction.

* fix test

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-08-18 15:11:19 -04:00
Nutomic c89006c94a
Rejected federated pm from blocked users (fixes #2398) (#2408) 2022-08-17 16:53:19 -04:00
Dessalines 870abf8442
Adding distinguish comment. Fixes #2002 (#2391)
* Adding distinguish comment. Fixes #2002

* Adding lemmy:distinguished
2022-08-17 11:38:52 +00:00
Nutomic 583ceb2506
Fix pictrs routing (#2407)
* SUGGESTED FIX TO PICTRS ROUTING 404 ERROR #2359

Removed slashes at "/image" routes.

* cargo fmt

Co-authored-by: Majid  <72635080+umamawme@users.noreply.github.com>
2022-08-16 11:20:41 -04:00
Dessalines f878151648
Add postgres auto-explain for dev testing. (#2399)
* Add postgres auto-explain for dev testing.

* add newline

* fix indent

Co-authored-by: Nutomic <me@nutomic.com>
2022-08-16 12:22:29 +00:00
Anon 21455d6b73
Add Modlog Filters (#2313)
* Fix crash running locally on windows.

* Add support for filtering mod logs

* Refactor cleanup

* Clippy fix

* Condense match statements

* Clippy fix 2
2022-08-16 11:52:04 +00:00
vpzomtrrfrt 08a797c986
Accept Image objects in attachments (#2394) 2022-08-16 10:12:43 +00:00
Dessalines 2f9d8776ac
Tweaking postgres upgrade script (#2389)
* Tweaking postgres upgrade script

* Removing pointless comments.
2022-08-04 22:03:14 +02:00
Nutomic 8a4d9cc1ba
Use typed-builder crate for queries (#2379)
* Use typed-builder crate for PrivateMessageQuery

* derive builder for all queries

* remove unnecessary clones

* fix tests
2022-08-04 15:30:17 -04:00
Nutomic 7094a0c0a4
Use doku release version (ref #2343) (#2386) 2022-08-02 15:38:19 +02:00
Dessalines 9c3efe32e7
First pass at adding comment trees. (#2362)
* First pass at adding comment trees.

- Extracted comment replies into its own table.
- Added ltree column to comment
- Added parent_id param to GetComments to fetch a tree branch
- No paging / limiting yet

* Adding child_count to comment_aggregates.

* Adding parent comment update counts

* Fix unit tests.

* Comment tree paging mostly done.

* Fix clippy

* Fix drone tests wrong postgres version.

* Fix unit tests.

* Add back in delete in unit test.

* Add postgres upgrade script.

* Fixing some PR comments.

* Move update ltree into Comment::create

* Updating based on comments.

* Fix send soft fail.
2022-07-30 05:55:59 +02:00
Nutomic becb8b4f66
Update apub examples to remove `to` field (ref #2380) (#2382) 2022-07-29 13:30:38 -04:00
Nutomic a85334c675
Handle Like, Undo/Like activities from Mastodon, add tests (fixes #2378) (#2380) 2022-07-29 15:32:12 +02:00
Dessalines 8bfeb4b627
Fix a few form options for diesel. Fixes #2287 (#2376)
* Fix a few form options for diesel. Fixes #2287

* Adding TODO comment.
2022-07-29 15:04:21 +02:00
Nutomic 42eac1560f
Remove docker/pleroma/ folder (#2381) 2022-07-29 08:37:23 -04:00
Dessalines 3b86e15399
Remove listing type community. Fixes #2361 (#2377)
* Remove listing type community. Fixes #2361

* Have ListingType::All be the default
2022-07-29 10:57:39 +00:00
Nutomic b78826c2c8
Dont allow login if account is banned or deleted (fixes #2372) (#2374) 2022-07-28 23:14:07 +02:00
Dessalines c62671116c
Send websocket message on accepted follow. Fixes #2369 (#2375) 2022-07-28 15:49:26 +00:00
Nutomic b9f1fc0518
Fix panics in search_by_apub_id() (fixes #2371) (#2373) 2022-07-27 17:03:44 -04:00
Nutomic eee8f467b5
Fix follow being stuck as pending after accept (#2366)
* Fix follow being stuck as pending after accept

* fix api test
2022-07-20 14:10:29 +00:00
Dessalines 767f1aa0de Adding 0.16.6 release 2022-07-19 15:01:15 -04:00
Nutomic 16fe149a6d
Change config pictrs key name (#2360) 2022-07-14 14:25:10 -04:00
Nutomic d0a3d99636
Config changes, remove unused image purge function (#2343)
* Throw error if old pictrs config item is used, make api key optional

* use doku url feature

* fix doku version

* fix clippy

* remove unused image purge function, remove config migration
2022-07-11 16:38:37 -04:00
Nutomic 63fff96275
Fix problem where actors can have empty public key (fixes #2347) (#2348) 2022-07-11 18:25:33 +00:00
Luna e33736ae47
remove parking_lot (#2350) 2022-07-11 17:12:12 +00:00
Dessalines 67a34adf4b
Revert "Use correct url for activitystreams protocol context (#2326)" (#2351)
This reverts commit dc35ab9c2b.
2022-07-08 10:47:40 +00:00
Dessalines ff026dc3ff
Adding check for requests with no id or name, adding max limit. (#2265)
* Adding check for requests with no id or name, adding max limit.

* Consolidating a few functions.

* Fix page min

* Adding more websocket rate limits.

* Add check to GetCommunity

* Use a default message rate limit check.

* Adding a page and limit checker

* Fix clippy

* Fix clippy again

* Adding check for requests with no id or name, adding max limit.

* Consolidating a few functions.

* Fix page min

* Adding more websocket rate limits.

* Add check to GetCommunity

* Use a default message rate limit check.

* Adding a page and limit checker

* Fix clippy

* Fix clippy again

* Fix limit request.

* Move checks to inside limit_and_offset

* Fixing API tests.

* Change NotFound diesel errors to QueryBuilderError
2022-07-08 10:21:33 +00:00
Nutomic 3ef812660c
Dont allow blocking admin (#2340) 2022-07-05 23:02:54 +00:00
Nutomic ddc9763050
Fix wrong clippy warning in ci (#2339) 2022-07-05 17:41:22 -04:00
Nutomic b7a2677b4d
Be more explicit about returning deleted actors or not (#2335)
* Be more explicit about returning deleted actors or not

* simplify db queries
2022-07-05 17:40:44 -04:00
Nutomic 587a0de8f7
Specify minimum Rust version 1.57 (fixes #2333) (#2334)
* Specify minimum Rust version 1.57 (fixes #2333)

* use latest rust for clippy

* use rust 1.60 for clippy

* no add component

* use official rust docker

* comments
2022-06-28 17:44:55 -04:00
Dessalines a745fa6f43
Remove update and read site config. Fixes #2306 (#2329)
* Remove update and read site config. Fixes #2306

* Removing lazy_static, removing Settings::get()
2022-06-22 20:24:54 +00:00
Dessalines 8af913f583
Don't create or initially follow a default community. Fixes #2317 (#2328)
* Don't create or initially follow a default community. Fixes #2317

* Fix unit tests.
2022-06-22 19:38:27 +00:00
Dessalines 40609549d8
Increase RSS fetch limit to 20. Fixes #2319 (#2327) 2022-06-22 12:30:09 +00:00
Dessalines 92d17639cd
Expose pending 2 (#2282)
* Exposing SubscribedType. Fixes #2281

* Fixing other subscribed fields.

* Fix federation tests

* Add comment about follower row.
2022-06-22 12:05:41 +00:00
Nutomic dc35ab9c2b
Use correct url for activitystreams protocol context (#2326) 2022-06-21 15:27:10 -04:00
Nutomic cd4d235171
Move setting http_fetch_retry_limit into federation block (#2314) 2022-06-14 01:20:30 -04:00
Nutomic c78de25652
Fix length of post_report.original_post_name db field (fixes #2311) (#2315) 2022-06-14 01:20:01 -04:00
Dessalines 4e12e25c59
Adding admin purging of DB items and pictures. #904 #1331 (#1809)
* First pass at adding admin purge. #904 #1331

* Breaking out purge into 4 tables for the 4 purgeable types.

* Using CommunitySafe instead in view

* Fix db_schema features flags.

* Attempting to pass API key.

* Adding pictrs image purging

- Added pictrs_config block, for API_KEY
- Clear out image columns after purging

* Remove the remove_images field from a few of the purge API calls.

* Fix some suggestions by @nutomic.

* Add separate pictrs reqwest client.

* Update defaults.hjson

Co-authored-by: Nutomic <me@nutomic.com>
2022-06-13 19:15:04 +00:00
trwnh 5b7376512f
Fix: Use correctly parseable JSON-LD context (#2299)
* Fix: Use correctly parseable JSON-LD context

* Changed: Better ordering for context document

alphabetized properties

* Changed: Use xsd types instead of schema.org types

* Changed: use simple namespacing
2022-06-13 13:26:56 +00:00
Nutomic a29cf04092
Fix lemmy version in prod docker-compose.yml (#2304) 2022-06-08 11:48:36 -04:00
Nutomic fcaf7a084c
Upgrade activitypub_federation to 0.2.0, add setting federation.debug (#2300) 2022-06-08 11:45:39 -04:00
Nutomic 7bc2f9fd6d
Remove unused setup config vars (#2302) 2022-06-08 11:44:53 -04:00
Nutomic c050945b1f
Add pub use for db crates in api_common (#2305) 2022-06-08 11:30:20 -04:00
Nutomic 23819d44f3
Add link to Matrix chat in readme (#2303) 2022-06-08 11:19:12 -04:00
Nutomic 7804a9d893
Accept private like (#1968) (#2301) 2022-06-08 11:14:38 -04:00
Dessalines 916c53ccec
Move different features drone check to below defaults.hjson check. (#2296) 2022-06-06 12:09:43 +00:00
Paolo Barbolini 0a3b69a259
Bump lettre to 0.10.0-rc.7 (#2297) 2022-06-04 22:07:38 -04:00
Nutomic 780832256c
Remove unused cargo.toml files (#2293) 2022-06-03 15:56:33 +00:00
Nutomic 5387c262c1
Forbid outgoing requests in activitypub tests (fixes #2289) (#2294) 2022-06-03 11:31:22 -04:00
Nutomic 339eab01fd
Embed Peertube videos (#2261)
* Use og:video attribute for embeds, change Post.embed_html to embed_url

* fix clippy
2022-06-02 21:44:47 +00:00
Nutomic 9a458d2e4b
Run cargo check for each crate with different features (ref #2284) (#2292) 2022-06-02 18:19:53 +00:00
Nutomic 13ca1111c4
Remove 0.15 federation compat code (#2131) 2022-06-02 13:48:53 -04:00
Nutomic a2a594b763
Extract Activitypub logic into separate library (#2288)
* Create example for apub lib

* some rewriting of apub lib

* Add LocalInstance struct for apub lib to avoid using Lemmy Settings

* Move ActorType trait to lemmy_apub, because its not needed in library

* Use reqwest_retry instead of custom impl, dont specify timeout on every send()

* Some improvements to example

* Moved inbox handling to library

* bug fixes

* Move context and serde helpers into library

* wip: example changes

* Add lemmy_utils feature to build only LemmyError

* Rename to activitypub_federation

* Remove lemmy_utils dep from activitypub_federation using generic error type

* Finish activitypub example

* Cleanup and fix tests

* Reorganize library files

* Remove ApubObject.to_tombstone()

* Extract activitypub library into separate git repository
2022-06-02 16:33:41 +02:00
Dessalines 1bd57ee5ca Version 0.16.5 2022-05-30 18:32:31 -04:00
Dessalines 9b9b7b16c8 Merge branch 'main' of https://github.com/LemmyNet/lemmy 2022-05-27 09:49:40 -04:00
Dessalines 09454f3e49 Update releases.md 2022-05-27 09:48:11 -04:00
Nutomic 205b4a22a8
Merge pull request #2284 from LemmyNet/fix_publish
Fix publish
2022-05-27 11:21:49 +00:00
Dessalines 69106589ba Fix publish 2022-05-26 16:10:36 -04:00
Dessalines eafb3869f2
Revert "Add pending, and change use specific API response for FollowCommunity…" (#2283) 2022-05-26 11:17:04 -04:00
Nutomic 3af4a27a88
Merge pull request #2248 from LemmyNet/expose_pending
Add pending, and change use specific API response for FollowCommunity…
2022-05-20 16:31:56 +00:00
Dessalines 3c111b3062 Dropping default on pending column. 2022-05-20 16:15:14 +00:00
Dessalines d4ee171b08 Making community_follower.pending column not null. 2022-05-20 16:15:14 +00:00
Dessalines 763dc9668c Fix formatting. 2022-05-20 16:15:14 +00:00
Dessalines e6fe9d0325 Fixing unfollow 2022-05-20 16:15:14 +00:00
Dessalines ed9b66541e Fixing API tests. 2022-05-20 16:15:14 +00:00
Dessalines 48f5a2ee5e Add pending, and change use specific API response for FollowCommunity. Fixes #2246 2022-05-20 16:15:14 +00:00
Nutomic 7566f325cd
Downgrade Rust Docker images to 1.59 to fix CI failures (ref #2263) (#2274) 2022-05-20 13:29:04 +00:00
Nutomic 9ef0efa420
Add legal information (fixes #721) (#2273) 2022-05-19 20:32:40 +00:00
Nutomic 60e9586530
Add drone task for nightly build (#2264) 2022-05-19 20:30:16 +00:00
Dessalines be246425f0
Merge pull request #2267 from LemmyNet/update-image
Update image crate
2022-05-17 14:03:07 -04:00
Felix Ableitner 426e1b1e51 Update image crate 2022-05-17 13:48:47 -04:00
Dessalines 144336b8b1
Merge pull request #2263 from LemmyNet/fix-ci-unsafe-repo
Fix CI failures
2022-05-17 13:44:09 -04:00
Felix Ableitner 562b88da9e Remove youtube metadata test 2022-05-17 16:26:36 +02:00
Felix Ableitner 26d5b38115 Fix CI failures 2022-05-16 13:50:41 +02:00
Nutomic 91d1d5f7ff
Merge pull request #2260 from LemmyNet/fix_email_param_order
Fixing malformed rosetta translations. Fixes #2231
2022-05-16 10:58:58 +00:00
Dessalines 5eb0dfdc73 Fixing malformed rosetta translations. Fixes #2231 2022-05-13 12:24:29 -04:00
Nutomic bd9df834f5
Merge pull request #2253 from LemmyNet/optional-opentelemetry
Make opentelemetry dependency optional
2022-05-11 12:54:21 +00:00
Felix Ableitner 80684de7da Make opentelemetry dependency optional 2022-05-11 14:29:01 +02:00
Nutomic f0ec3015cd
Remove check that avatars/banners are locally hosted (fixes #2254) (#2255) 2022-05-10 17:08:13 +00:00
Nutomic 99f3141841
Update to Rust 1.60 (#2247) 2022-05-10 17:04:40 +00:00
Paolo Barbolini ef12cd9588
Bump lettre to 0.10.0-rc.6 (#2250) 2022-05-09 23:08:13 +00:00
Paolo Barbolini 559e43075a
Simplify building plain/html emails (#2251) 2022-05-08 17:00:12 +00:00
Nutomic 7b86441bab
Federate with Peertube (#2244) 2022-05-06 23:53:33 +00:00
Nutomic 3053e14be7
Derive default for api request structs, move type enums (#2245)
* Derive default for api request structs, move type enums

* Simplify api by using enum types directly, instead of string

* Add default and clone for most api structs
2022-05-06 20:55:07 +00:00
Nutomic 3aa3d75a1e
Add cargo feature for building lemmy_api_common with mininum deps (#2243) 2022-05-03 17:44:13 +00:00
Nutomic dd5835fb6e
Add restricted community field to CreateCommunity, UpdateCommunity (ref #2235) (#2242) 2022-04-29 14:01:10 +00:00
Nutomic 7058cfa1cf
Implement restricted community (only mods can post) (fixes #187) (#2235)
* Implement restricted community (only mods can post) (fixes #187)

* review fixes

* fix tests
2022-04-28 20:32:32 +00:00
Rens Groothuijsen 9c1b9ff3cf
Update community statistics after post or comment is deleted by user (#2193)
* Update community statistics after post or comment is deleted by user

* Update triggers for site and person aggregates

* Restore comment counts when post is restored

* Simplify insertion/deletion trigger checks before updating statistics
2022-04-27 16:12:41 +00:00
Nutomic c718882479
Accept comments with hashtags from Friendica (#2236) 2022-04-27 16:12:13 +00:00
Nutomic 2e01e8e42c
Remove unused dependencies (#2239) 2022-04-27 17:56:05 +02:00
Nutomic 56b7030901
Fix link metadata unit test (#2237) 2022-04-27 15:42:10 +00:00
Nutomic 3488b9aeb5
Dont return "admin" for GET user when no id/name is provided (fixes #1546) (#2233) 2022-04-25 21:16:29 +00:00
Nutomic ae84258c41
Federation: dont overwrite local object from Announce activity (#2232)
* Federation: dont overwrite local object from Announce activity (fixes #2143)

* add missing form fields

* refactoring

* add ap_id, updated fields

* fix
2022-04-25 21:11:34 +00:00
Nutomic 7e13406979
Require registration application by default (#2229) 2022-04-19 19:13:20 +00:00
Nutomic 00b0b26dfa
Add default post listing type (fixes #2195) (#2209)
* Add default post listing type (fixes #2195)

* review fixes

* change column type
2022-04-19 19:05:08 +00:00
Dessalines 24be9f2cd5
Show deny reason to users after a failed login. Fixes #2191 (#2206)
* Show deny reason to users after a failed login. Fixes #2191

* Updating translations.

* Adding registration_denied translated string.
2022-04-19 10:48:59 +00:00
Dessalines 0a36b16e29
Fix allowlist / blocklist description location. Fixes #2214 (#2215)
* Fix allowlist / blocklist description location. Fixes #2214

* Fix allowlist check
2022-04-13 18:27:56 +00:00
Nutomic 3951a16447
Split apart api files (#2216) 2022-04-13 18:12:25 +00:00
Nutomic ce4682caa0
Merge pull request #2213 from LemmyNet/change_default_listing_type
Changing default listing type to Local from Subscribed.
2022-04-13 17:48:47 +00:00
Dessalines 0372029e8d Changing default listing type to Local from Subscribed. 2022-04-13 17:35:21 +00:00
Nutomic e0381df88a
Expose remote site info in GetCommunity API (fixes #2208) (#2210)
* Expose remote site info in GetCommunity API (fixes #2208)

* use instance_actor_id_from_url()
2022-04-13 16:37:54 +00:00
Dessalines 3d8709780a
Fixing unstable post sorts. Fixes #2188 (#2204) 2022-04-13 15:33:38 +00:00
Dessalines 0d9b756b75
Adding lemmy_ui_debug for future debug testing. (#2211)
Co-authored-by: Nutomic <me@nutomic.com>
2022-04-13 11:53:21 +00:00
Dessalines 2985e88a49
Fixing generate unique changeme (#2205)
* Fixing generate unique changeme

* Fixing generate unique changeme 2

* Changing link to .invalid domain.

Co-authored-by: Nutomic <me@nutomic.com>
2022-04-13 11:13:29 +00:00
Nutomic bbd739af9b
Change Person, Instance types (#2200) 2022-04-12 17:10:35 +00:00
Nutomic 2180bd0369
Merge pull request #2207 from LemmyNet/clippy_fix_2
Clippy fixes.
2022-04-12 10:16:10 +00:00
Nutomic b47a474863
Merge branch 'main' into clippy_fix_2 2022-04-12 10:03:40 +00:00
Nutomic fed73a72c1
Write mod log for federated sticky/lock post actions (#2203) 2022-04-11 23:03:31 +00:00
Dessalines 0bcdfa8be4 Clippy fixes. 2022-04-11 18:51:11 -04:00
Dessalines a7540bd59f Adding 0.16.3 release. 2022-04-08 13:09:17 -04:00
Dessalines c232564fda Version 0.16.3 2022-04-08 10:20:31 -04:00
Dessalines 4878848955 Version 0.16.3-rc.1 2022-04-08 09:17:00 -04:00
Dessalines 4052900d30 Updating translations 2022-04-08 09:13:46 -04:00
Nutomic 8337eaefdd
Federate user account deletion (fixes #1284) (#2199) 2022-04-07 20:52:17 +00:00
Nutomic 9ac1f46a2b
Dont federate initial upvote (#2196) 2022-04-07 20:46:10 +00:00
Nutomic f9d563d80a
Add missing mod log entries for federated actions (fixes #1489) (#2198) 2022-04-07 20:44:28 +00:00
Nutomic b41f7f3eca
Merge pull request #2192 from LemmyNet/mandatory_questionnaire
Make sure application questionaire is required. Fixes #2189
2022-04-05 10:47:59 +00:00
Nutomic 1e2d2ecbae
Merge branch 'main' into mandatory_questionnaire 2022-04-05 10:36:13 +00:00
Nutomic b5d0a9322a
Merge pull request #2194 from LemmyNet/upgrade_pictrs_8
Upgrading pictrs.
2022-04-05 10:26:00 +00:00
Dessalines ef08870ce5 Upgrading pictrs. 2022-04-04 21:31:17 -04:00
Dessalines 37c834725c Make sure application questionaire is required. Fixes #2189
Also fix local image domain check. Was failing for blank strings /
replaces.
2022-04-04 20:58:50 +00:00
Nutomic 65cac21713
Fix verify_mod_action check for remote admin actions (#2190)
* Fix verify_mod_action check for remote admin actions

* fix federation test
2022-04-04 14:46:49 +00:00
Nutomic c7f5337099
Run cargo upgrade (#2176)
* Run cargo upgrade and cargo update

* Fixing validation (#2179)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-04-01 18:37:51 +00:00
Nutomic bfae246734
Migrate towards using page.attachment field for url (ref #2144) (#2182) 2022-04-01 18:25:19 +00:00
Nutomic 56b275acd4
Exclude removed/deleted posts from community outbox (#2184) 2022-04-01 18:18:25 +00:00
Nutomic 589d952a95
Fetch community outbox in parallel (fixes #2180) (#2181) 2022-04-01 18:06:23 +00:00
Nutomic 4597ea2017
Merge pull request #2178 from LemmyNet/fix_ban_expires
Adding a ban expires update job. Fixes #2177
2022-03-31 12:05:17 +00:00
Dessalines 4cf0da7b60 Clippy fixes. 2022-03-30 10:58:03 -04:00
Dessalines 3ad172e8ed Adding a ban expires update job. Fixes #2177 2022-03-30 09:56:23 -04:00
Nutomic ad7e6d99ed
Add email translations (#2175) 2022-03-29 18:23:03 +00:00
Dessalines 2e65b31aa6
Fix arm submodule (#2174) 2022-03-29 18:05:18 +00:00
Dessalines d5a213760d Version 0.16.2 2022-03-29 12:56:21 -04:00
Dessalines 11b7525c41
Add update translations script. (#2173) 2022-03-29 16:54:16 +00:00
Dessalines f7fa1f10f9 Updating translations. 2022-03-29 12:07:39 -04:00
Dessalines 7bb8069224 Version 0.16.2-rc.3 2022-03-29 11:54:13 -04:00
Nutomic 610120067c
Add test files for Friendica federation (fixes #2144) (#2167) 2022-03-29 15:48:29 +00:00
Dessalines e16821116e
Lowering search rate limit. Fixes #2153 (#2154)
* Lowering search rate limit. Fixes #2153

* Adding a search rate limit.

* Forgot to add the websocket search rate limit

* Fix wrong op
2022-03-29 15:46:03 +00:00
Dessalines f6b543ae0f
Add tag to lemmy-ansible. (#2172) 2022-03-29 15:36:59 +00:00
Dessalines 052e509954
Fixing release script. (#2170) 2022-03-29 15:23:39 +00:00
Dessalines d49565e030
Rate limit ws joins (#2171)
* Removing async on mutex lock fn.

* Removing redundant ip

* Don't check rate limit twice.
2022-03-28 20:31:35 +00:00
Nutomic f21f2fd7b0
Delete unused diesel.toml file (#2166) 2022-03-28 18:29:11 +00:00
Dessalines a11b5b107d Version 0.16.2-rc.2 2022-03-26 21:37:12 -04:00
Dessalines f2a0841586
Rate limit websocket joins. (#2165)
* Rate limit websocket joins.

* Removing async on mutex lock fn.

* Removing redundant ip

* Return early if check fails.
2022-03-27 00:29:05 +00:00
Dessalines 483e7ab168
Doing tests in sequential order. Fixes #2158 (#2163)
* Doing tests in sequential order. Fixes #2158

* Doing tests in sequential order. Fixes #2158

* Fixing order 1
2022-03-25 19:00:33 +00:00
Nutomic a5ff629b24
Dont log errors when rate limit is hit (fixes #2157) (#2161)
* Dont log errors when rate limit is hit (fixes #2157)

* Clone service rather than http request

* some cleanup/refactoring

Co-authored-by: Aode (Lion) <asonix@asonix.dog>
2022-03-25 16:41:38 +01:00
Dessalines c681bb79b1 Version 0.16.2-rc.1 2022-03-24 18:25:21 -04:00
Nutomic e208f0cb4d
Merge pull request #2160 from LemmyNet/rate_limit_websocket_fail
Fix rate limit check for register. Fixes #2159
2022-03-24 21:43:02 +01:00
Dessalines 2da0684e95 Removing check_only 2022-03-24 16:29:08 -04:00
Dessalines ed9f70276d Fix rate limit check for register. Fixes #2159 2022-03-24 16:13:58 -04:00
Nutomic dfb0938738
GNU social compatibility (#2100)
* Use SourceCompat everywhere (better compat with other software)

* Name field should not be mandatory in Group

* also check page.cc field for community id

* add gnu social tests

* better to use option<sourcecompat>

* update gnu social tests, marked vote as "unlisted"
2022-03-24 16:33:42 +00:00
Dessalines 1e9f609cdb
Consolidate and lower reqwest timeouts. Fixes #2150 (#2151) 2022-03-24 16:33:23 +00:00
Nutomic 83e996111e
Check that config is valid before saving (#2152) 2022-03-24 16:23:12 +00:00
Nutomic b406342a14
Dont log error if duplicate activity is received (fixes #2146) (#2148) 2022-03-24 16:05:27 +00:00
Nutomic cb44b14717
WIP: Email localization (fixes #500) (#2053)
* Allow email localization (fixes #500)

* add PersonAggregates::default()

* add lemmy-translations submodule

* fix gitmodules
2022-03-24 15:25:51 +00:00
Nutomic ecd157d4a7
Update pictrs to 0.3.0-rc.7 (#2149) 2022-03-24 01:57:40 +00:00
Nutomic 01cdac012f
Merge pull request #2139 from LemmyNet/add_jerboa_link
Add jerboa link to readme. Fixes #2137
2022-03-23 21:48:25 +00:00
Nutomic 6616e89bcf
Merge branch 'main' into add_jerboa_link 2022-03-23 21:33:07 +00:00
Nutomic 8112816e99
If viewed actor isnt in db, fetch it from other instance (#2145) 2022-03-23 21:27:51 +00:00
Nutomic 0c63dbafb6
Merge pull request #2138 from LemmyNet/rate_limit_algorithm_desc
Show rate limit algorithm. Fixes #2136
2022-03-23 14:48:09 +00:00
Nutomic 0d0772a48a
Merge branch 'main' into rate_limit_algorithm_desc 2022-03-23 14:33:03 +00:00
Nutomic cda93e08d8
Merge branch 'main' into add_jerboa_link 2022-03-23 14:30:06 +00:00
Nutomic 7be5fa4a47
Merge pull request #2147 from LemmyNet/fixing_api_tests_1
Fixing api tests 1
2022-03-23 14:29:46 +00:00
Dessalines 500ca15893 Trying to fix api tests 2 2022-03-22 18:06:59 -04:00
Dessalines 5698dd7771 Trying to fix api tests 1 2022-03-22 15:50:47 -04:00
Dessalines 4e6d901649 Show rate limit algorithm. Fixes #2136 2022-03-22 18:45:14 +00:00
Nutomic a10bf7d410
Adjust retry interval for sending activities (#2141) 2022-03-22 18:40:40 +00:00
Dessalines 5a245659c8 Add jerboa link to readme. Fixes #2137 2022-03-22 18:32:50 +00:00
Dessalines 5265f6100e Restore prod docker-compose.yml 2022-03-19 12:21:07 -04:00
Nutomic bcf7ec6109
Forbid remote URLs for avatars/banners (fixes #1618) (#2132) 2022-03-18 15:46:58 +00:00
Nutomic 611d336f94
Remove docker/prod unused files (fixes #2086) (#2133) 2022-03-17 16:28:35 +00:00
Nutomic 166ec196b0
Rework error handling (fixes #1714) (#2135) 2022-03-16 20:11:49 +00:00
Dessalines d3d4e76a19 Adding release notes. 2022-03-15 17:29:05 -04:00
Dessalines 514e2301b5 Version 0.16.1 2022-03-15 17:23:16 -04:00
Dessalines 9fd6a48e3c Version 0.16.1-rc.1 2022-03-15 16:52:37 -04:00
Nutomic 7d61616dff
Revert "Add logging to debug federation issues (ref #2096) (#2099)" (#2130)
This reverts commit e094989a4c.
2022-03-14 20:18:19 +00:00
Nutomic 550a93aed9
Dont allow admin to add mod to remote community (#2129) 2022-03-14 18:35:57 +00:00
Nutomic f8fb3b41f0
Reject federated downvotes if downvotes are disabled (fixes #2124) (#2128) 2022-03-14 18:20:18 +00:00
Dessalines 71237f1b53 Add Release notes. 2022-03-08 13:54:25 -05:00
Dessalines 05f20da51f Version 0.16.0 2022-03-08 13:45:01 -05:00
Dessalines 82dec1911f Version 0.16.0-rc.4 2022-03-08 08:57:57 -05:00
Nutomic 660efd1549
Correctly read local SiteView (#2122) 2022-03-08 12:52:33 +00:00
Dessalines 15ff832c4a Version 0.16.0-rc.3 2022-03-07 18:59:29 -05:00
Nutomic 3c5275638f
Increase default worker count (#2120) 2022-03-07 22:28:50 +00:00
Dessalines ffd2ba5d90
Fix community rss. Fixes #2116 (#2119)
Co-authored-by: Nutomic <me@nutomic.com>
2022-03-07 21:49:02 +00:00
Nutomic fbadb2d7bd
Try to fix federation test on ci (#2121) 2022-03-07 21:25:34 +00:00
Dessalines aef2abb962 Version 0.16.0-rc.2 2022-03-03 14:40:09 -05:00
Nutomic df757f28b4
Make delete activities backwards compatible with 0.15 (#2114) 2022-03-03 19:37:12 +00:00
Nutomic ef1e164cc5
Make activity queue worker count configurable, log stats (#2113) 2022-03-03 18:54:33 +00:00
Nutomic fa29ffade1
Add timeout for sending activities (#2112)
* Add timeout for sending activities

* Also set request timeouts in utils/src/request.rs
2022-03-03 13:40:10 -05:00
Nutomic 46e937d6e6
Merge pull request #2115 from LemmyNet/fix_tests_1
Fixing unit tests.
2022-03-03 18:13:09 +00:00
Dessalines a5433ebf77 Fixing unit tests. 2022-03-03 12:51:55 -05:00
Nutomic 0d957a2a27
Merge pull request #2111 from robjtede/aw4
Update `actix-*` dependencies to stable v4.
2022-03-02 20:59:51 +00:00
Rob Ede e3153df74d
Remove direct `actix-http` dependency 2022-03-02 18:11:05 +00:00
Rob Ede b06f3eb32e
Update `actix-*` dependencies to stable v4. 2022-03-02 18:00:52 +00:00
Dessalines 1b5037e92d Version 0.16.0-rc.1 2022-03-02 12:41:11 -05:00
dayinjing bc3927a9bd
Show nsfw communities if you are logged in and searching communities (#2105)
* Show nsfw communities in logged in and you've enabled nsfw in your profile atleast

* Reuse existing user check

Co-authored-by: Sun Wukong <monkey@king.com>
2022-03-02 17:39:27 +00:00
Nutomic 63565712ad
Fix resending activities (fixes #1282) (#2109) 2022-03-01 13:40:05 -05:00
Nutomic fb4c47d602
Dont hardcode site id in Site::update (#2110) 2022-03-01 17:01:23 +00:00
RedLobster999 348077c3de
send plain-text in email along with html (#2107)
* send plain text in email along with html

* format the code using "cargo +nightly fmt"

Co-authored-by: kittiphat-kang <kittiphat.nu@easysunday.com>
2022-03-01 14:28:18 +00:00
Nutomic 9f5183fe98
Add site option for default theme (#2104) 2022-02-23 11:40:36 -05:00
dayinjing 7f9b55e793
Hide community v2 (#2055)
* Initial working of hiding communities and adding a db entry for mod log

* Return mod log for hidden communities

* Clean up hidding communities PR

* use lower case like other migration files

* Formatting fix

* pass in admin id to list, make match logic the same in post_view as community_view. Dont force non null for reason

* Clean PR review stuff

* Change person_id to mod_person_id on hide community table

* Make bools optional, add a space for formating

Co-authored-by: Thor Odinson <odinson@asgard.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-02-18 02:30:47 +00:00
Nutomic 762b85b27e
Reorganize federation tests (#2092)
* Reorganize apub protocol tests

* Reorder apub protocol struct members to clarify mandatory/optional fields
2022-02-17 22:04:01 +00:00
Nutomic e094989a4c
Add logging to debug federation issues (ref #2096) (#2099) 2022-02-17 18:48:45 +00:00
Dessalines 81aa39ba68
Adding a reqwest timeout. Fixes #2089 (#2097) 2022-02-15 12:53:57 +00:00
Nutomic 5a8c894359
Upgrade to Rust 2021 edition (#2093)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-02-14 15:34:54 +00:00
Nutomic 788924d7ff
Merge different delete activities for better compatibility (fixes #2066) (#2073) 2022-02-14 10:14:24 -05:00
Nutomic dd865c5af5
Implement instance actor (#1798)
* Implement instance actor

* wip: make site bans federate

* finish implementation and unit tests for federated bans

* start adding api tests

* fix api test

* remve site from GetCommunityResponse

* only federate site bans originating from user's home instance

* dont expose site.private_key in api
2022-02-07 19:23:12 +00:00
Nutomic f1aef63149
Use doku(skip) for opentelemetry_url config value (ref #2085) (#2091) 2022-02-07 10:39:37 -05:00
Riley 51fd3e7f77
Merge pull request #2085 from LemmyNet/asonix/document-opentelemetry-url
Add comment about opentelemetry_url
2022-02-04 21:46:38 -06:00
Riley 6b500f6cf2
Merge branch 'main' into asonix/document-opentelemetry-url 2022-02-04 21:22:27 -06:00
Riley 0f8caac689
Merge pull request #2087 from LemmyNet/asonix/console-feature
Add console feature flag, not default
2022-02-04 21:22:07 -06:00
Aode (Lion) 14b27b8377 Merge remote-tracking branch 'lemmynet/fix_sitemetadata_test' into asonix/console-feature 2022-02-04 20:37:57 -06:00
Aode (Lion) 1546e5fd0d Merge remote-tracking branch 'lemmynet/fix_sitemetadata_test' into asonix/document-opentelemetry-url 2022-02-04 20:37:38 -06:00
Dessalines 609d2b99f7 Fix site metadata test. 2022-02-04 18:22:43 -05:00
Aode (lion) 2e5746b74f Add console feature flag, not default
The most recent tracing-core changed the number of variants on metadata::Kind,
which broke console-api 0.1.1, and no fix has been applied yet. To avoid build
failures, disable console-subscriber for now
2022-02-04 11:31:38 -06:00
Aode (lion) 6058b11f6e Add comment about opentelemetry_url 2022-02-03 17:24:19 -06:00
Dessalines 6b1894faf0
Alpha-ordering community follows. Fixes #2062 (#2079) 2022-02-01 20:00:54 +00:00
Dessalines 2ac6e1a463
Adding a test comment. (#2081) 2022-02-01 18:19:07 +00:00
Dessalines d71e1c06e2
Adding codeowners. (#2080) 2022-02-01 16:37:30 +00:00
Nutomic 2fa47aaef9
Remove commit hook (#2078) 2022-01-31 19:20:31 -05:00
Nutomic 7560e0ec8e
Dont update default config in commit hook (#2075) 2022-01-29 18:50:56 -05:00
Nutomic 545fe8d0dd
Add federation tests for Friendica, improve parsing of source field (fixes #2057) (#2070) 2022-01-28 16:47:34 -05:00
Dessalines a8d17c7847
Update issue templates (#2069) 2022-01-27 16:32:12 -05:00
Dessalines 18f63f0f01 Updating releases.md 2022-01-27 14:11:38 -05:00
Nutomic 4a23ee4d8b
Dont make webfinger request when viewing community/user profile (fixes #1896) (#2049) 2022-01-27 16:39:22 +00:00
Dessalines d83a53e905
Fixing private instance check. Fixes #2064 (#2065) 2022-01-27 16:25:22 +00:00
Kradyz 1c5c02e1bf
Case-insensitive username at login (#2010)
* Case-insensitive username at login

* formatting

Co-authored-by: Kradyz <k@radiz.nl>
2022-01-26 18:05:07 +00:00
Dessalines e36ad9d984
Removing the site creator, adding leave_admin. Fixes #1808 (#2052)
* Removing the site creator, adding leave_admin. Fixes #1808

* Making sure there's at least one admin. Fixing unit tests
2022-01-26 17:57:16 +00:00
Dessalines 1372827b41
Adding starttls support. Fixes #1997 (#2051)
* Adding starttls support. Fixes #1997

* Change name to tls_type, make a string
2022-01-26 16:42:43 +00:00
Nutomic 2544341e47
Put community last in webfinger response (fixes #2037) (#2047) 2022-01-21 21:00:17 +00:00
Nutomic 16f98261f8
Dont check for ban in MarkCommentAsRead (fixes #2045) (#2054) 2022-01-21 14:46:43 -05:00
Dessalines 16271b0a4c
Empty post bodies (#2050)
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.

* Revert "Using .map() instead."

This reverts commit a2f49072095e0c0622c4a7d041dcea81e11fe1dc.
2022-01-21 13:38:01 +00:00
Nutomic f23fed70bc
Add tombstone tests, better test errors (#2046) 2022-01-20 14:13:29 +00:00
vpzomtrrfrt 272dc3e7a6
Accept single object as to for arrays too (#2048) 2022-01-20 14:12:45 +00:00
Dessalines 19ccaf767c
Cleaning optional post bodies. Fixes #2039 (#2043)
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.
2022-01-20 14:04:54 +00:00
Dessalines a212f6b780
Fixing liking comment on blocked person. Fixes #2033 (#2042) 2022-01-19 14:17:18 +00:00
Nutomic eea3308906
Add tests for lotide federation, make lotide groups fetchable (#2035)
* Add tests for lotide federation, make lotide groups fetchable

* Accept posts using Note type (and better error messages for tests)
2022-01-17 09:40:47 -05:00
Riley bc8ed1e6da
Remove unneeded dependency on activitystreams (#2034) 2022-01-13 00:17:00 +00:00
Dessalines 55bb68f6f9 Updating readme. 2022-01-12 09:52:21 -05:00
Dessalines f53902ecff Version 0.15.1 2022-01-12 09:45:29 -05:00
Dessalines 46e6affd54 Adding v0.15.0 release notes. 2022-01-12 09:22:38 -05:00
Dessalines bccb4f068d Version 0.15.0 2022-01-12 08:46:35 -05:00
Marty a860e22b85
uses compatable images - fixes GLIBC_2.29 not found issue on (at least) arm machines (#2028) 2022-01-10 10:48:55 -05:00
Dessalines a24676e629 Version 0.15.0-rc.7 2022-01-09 11:09:03 -05:00
Dessalines e65c45f152
Adding temporary bans. Fixes #1423 (#1999)
* Adding temporary bans. Fixes #1423

* Adding ban_expires to person

* Fix clippy

* Removing ban_expires from federated fields.

* Trying to add expires to blockcommunity apub.
2022-01-08 12:37:07 +00:00
Riley 41b90bb162
Add console-subscriber (#2003)
* Add console-subscriber

* Add larg event buffer capacity

* Add console port to lemmy prod container

* Expose pict-rs console port

* Update pictrs
2022-01-07 09:53:45 -05:00
Riley 3032a2745b
Opentelemetry (#1992)
* Add otlp export

* Add jaeger to dev docker

* More instrument

* Update deps

* Merge from main.

* Add comment about viewing traces

* Fixing reqwest-tracing dep.

* Update pre-commit regex

* Move imports to top

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-01-06 19:10:20 +00:00
Rens Groothuijsen 661f97a073
Use correct encoding when fetching non-UTF-8 site metadata (#2015)
* Use correct encoding when fetching non-UTF-8 site metadata

* Style fixes
2022-01-06 13:13:17 +00:00
Nutomic e864685759
Merge pull request #1927 from LemmyNet/add_banned_persons_endpoint
Adding a banned endpoint for admins. Removing it from GetSite. Fixes …
2022-01-05 14:04:26 +00:00
Dessalines bd31475dba Adding a banned endpoint for admins. Removing it from GetSite. Fixes #1806 2022-01-04 09:50:30 -05:00
Nutomic b733df2903
Merge pull request #2016 from robjtede/aw-b18
Updated actix-web dependency to `4.0.0-beta.18`
2022-01-04 14:40:54 +00:00
Rob Ede 1943bcd7f5
Prevent panic on InboxRequestGuard 2021-12-30 18:41:35 +00:00
Rob Ede f6c13cf313
Updated actix-web dependency to `4.0.0-beta.18` 2021-12-30 18:37:59 +00:00
Dessalines 3065154f4e
Merge pull request #2007 from LemmyNet/another_tokenizer_fix
Trying another tokenizer fix. #1964
2021-12-21 17:24:44 -05:00
Kradyz 9f64872d5a
Case-insensitive webfinger response. Fixes #1955 & #1986 (#2005)
* Make webfinger case insensitive

* Make webfinger case insensitive

* Case insensitive domain name

* Case-insensitive webfinger

* formatting

Co-authored-by: Kradyz <k@radiz.nl>
2021-12-20 17:23:06 -05:00
Dessalines ad4715c2a3 Trying another tokenizer fix. #1964 2021-12-20 16:57:36 -05:00
Dessalines c883a49a40
First pass at invite-only migration. (#1949)
* First pass at invite-only migration.

* Implement email verification (fixes #219)

* remove unwrap

* Adding views and functionality to registration application. #209

* Add private instance site column, and back end checks.

* Adding some message fields to LoginResponse

* Adding private instance to site setup.

* A few additions:

- Add a DeleteAccount response.
- RegistrationApplicationView now has the safe LocalUserSettings.
- Adding VerifyEmail to websocket API, added a proper response type.

* Adding and reorganizing some email helpers.

* A few fixes for private sites:

- Added a check_registration_application function.
- Only send a verification email if its been changed.
- VerifyEmail now returns LoginResponse.
- Deleting the old tokens after a successful email verify.
- If port is missing on email config, display a better error message.

* Version 0.15.0-rc.3

* Adding published to email_verification table.

* Adding fixes from comments.

* Version 0.15.0-rc.4

* Adding modlog private site check.

* Version 0.15.0-rc.6

Co-authored-by: Felix Ableitner <me@nutomic.com>
2021-12-15 14:49:59 -05:00
Dessalines 1410c5659c
Upgrading deps (#1995) 2021-12-14 13:30:37 +00:00
Dessalines 1880d64235
Upgrading pictrs. (#1996) 2021-12-14 13:24:33 +00:00
Dessalines 4a46dc805f
Trying out an upgraded version of html5ever. #1964 (#1991)
* Trying out an upgraded version of html5ever. #1964

* New release of webpage.
2021-12-12 23:49:25 +00:00
Dessalines 161d41999d
Adding min setup password length to the docs. Fixes #1989 (#1990) 2021-12-12 16:42:24 +00:00
Nutomic c6ac606f60
Test pleroma follow (#1988)
* Add test case for Pleroma follow activity (ref #1984)

* Use WithContext in apub tests where possible
2021-12-11 21:39:18 -05:00
Riley 0ed3856ef1
Remove awc (#1979)
* Remove unused awc dep

* Replace awc pict-rs client with reqwest

* Reinstate 30 second pict-rs timeout
2021-12-08 10:56:43 -05:00
Dessalines 7d07bc16ae
Merge pull request #1978 from LemmyNet/asonix/reqwest-middleware
Consolidate reqwest clients, use reqwest-middleware for tracing
2021-12-08 10:51:46 -05:00
Aode (lion) 5b3d707d8f Use from_message for static error string 2021-12-07 17:17:19 -06:00
Aode (lion) 2cf3278724 Update deps 2021-12-06 18:12:04 -06:00
Aode (lion) 97ebf2f6f3 Consolidate reqwest clients, use reqwest-middleware for tracing 2021-12-06 16:54:34 -06:00
Riley 35cbae61bc
Don't drop error context when adding a message to errors (#1958)
* Respond directly with LemmyError

Instrument Perform implementations for more precise traces
Use ApiError to format JSON errors when messages are present
Keep SpanTrace output in LemmyError Display impl

* Hide SpanTrace debug output from LemmyError

* Don't log when entering spans, only when leaving

* Update actix-web

* Update actix-rt

* Add newline after error info in LemmyError Display impl

* Propogate span information to blocking operations

* Instrument apub functions

* Use skip_all for more instrument attributes, don't skip 'self' in some api actions

* Make message a static string

* Send proper JSON over websocket

* Add 'message' to LemmyError display if present

* Use a quieter root span builder, don't pretty-print logs

* Keep passwords and emails out of logs

* Re-enable logging Login

* Instrument feeds

* Emit our own errors

* Move error log after status code recording

* Make Sensitive generic over the inner type

* Remove line that logged secrets
2021-12-06 09:54:47 -05:00
Marcin Wojnarowski 4a541a25ab
Change lemmur repo links (#1977) 2021-12-06 08:17:59 -05:00
Marty 8ce0c6d618
added deps - git and ca-certificates (for federation to work) and changed adduser to useradd so that user can be added non-interactively (#1976) 2021-12-06 01:35:50 +01:00
Dessalines 4e9ecb2632
Allow comment replies from blocked users. Fixes #1793 (#1969)
* Allow comment replies from blocked users. Fixes #1793

* Clearer check block.
2021-12-05 17:45:40 +00:00
Dessalines 040770d7ba
Fix retry infinite loops. Fixes #1964 (#1967)
* Fix retry infinite loops. Fixes #1964

* Moving retry_limit to settings
2021-12-05 10:03:13 -05:00
Nutomic 8bf0f31b0f
Merge pull request #1962 from vpzomtrrfrt/oneormany2
Allow single item for to, cc, and @context
2021-12-03 12:50:52 +00:00
Colin Reeder e2baed9a6d
Add lotide activities to tests 2021-12-02 22:44:52 -07:00
Colin Reeder a91c0c8feb
Allow single item for to, cc, and @context 2021-11-26 21:55:33 -07:00
Dessalines ad76c75821
Trying to add docker:latest. Fixes #1959 (#1960)
* Trying to add docker:latest. Fixes #1959

* Version 0.14.4-rc.3

* Trying to fix clippy on crate build

* Version 0.14.4-rc.4
2021-11-26 12:38:55 +00:00
Dessalines be65b6869f
Merge pull request #1937 from LemmyNet/disable-edit-email-notifications
Dont send email notifications for edited comments (fixes #1925)
2021-11-25 13:00:26 -05:00
Dessalines e765b42d46
Adding a captcha rate limit. Fixes #1755 (#1941)
* Adding a captcha rate limit. Fixes #1755

* Changing to post rate limit.
2021-11-25 13:04:19 +00:00
Felix Ableitner 27a687bcd0 Dont send email notifications for edited comments (fixes #1925) 2021-11-24 22:29:29 +01:00
Dessalines 97b8b9c255 Version 0.14.3 2021-11-23 14:39:55 -05:00
Dessalines 7363b19f01
Merge pull request #1951 from LemmyNet/fix_ap_id_dupes_query
Fix API dupes query. #1878
2021-11-23 14:37:58 -05:00
Dessalines f6b96370b8 Fix API dupes query. #1878 2021-11-23 14:30:16 -05:00
Dessalines 7f01d8cde6 Version 0.14.2 2021-11-23 11:48:49 -05:00
Dessalines b1f7bad0a3 Version 0.14.2-rc.1 2021-11-23 11:12:46 -05:00
Dessalines 46c7429429
Fixing duped report view for admins. Fixes #1933 (#1945)
* Fixing duped report view for admins. Fixes #1933

* Fixing tests.
2021-11-23 15:54:30 +00:00
Dessalines d2e28e5f38
Adding a GetComment endpoint. Fixes #1919 (#1944) 2021-11-23 15:53:48 +00:00
Dessalines 451818749b
Fix min title char count for post titles. Fixes #1854 (#1940)
* Fix min title char count for post titles. Fixes #1854

* Adding more newline checks for actors.

* Adding helper function
2021-11-23 15:52:58 +00:00
Dessalines 86b2901e8c
Adding MarkPostAsRead to API. Fixes #1784 (#1946)
* Adding MarkPostAsRead to API. Fixes #1784

* Adding error
2021-11-23 14:15:43 +00:00
Riley 1579ee566f
background-jobs 0.11 (#1943) 2021-11-23 12:20:01 +00:00
Riley 3fea5645f8
Add tracing (#1942) 2021-11-23 12:16:47 +00:00
Dessalines 88c7b95d03
Remove pointless community follower sort. (#1939) 2021-11-23 12:05:09 +00:00
Dessalines 3e062a9959
Merge pull request #1938 from LemmyNet/once_cell
Use once_cell instead of lazy_static
2021-11-22 14:27:08 -05:00
Felix Ableitner e88106cef4 Use once_cell instead of lazy_static 2021-11-22 19:58:31 +01:00
Dessalines 3d08e6c1fc
Adding unique constraint for activity ap_id. Fixes #1878 (#1935)
* Adding unique constraint for activity ap_id. Fixes #1878

* Removing is_activity_already_known
2021-11-22 18:57:03 +00:00
Nutomic 76c4378011
Merge pull request #1936 from LemmyNet/required_public_key
Making public key required. Fixes #1934
2021-11-22 15:37:05 +00:00
Dessalines 05d43150bc Making public key required. Fixes #1934 2021-11-22 10:10:18 -05:00
Dessalines 209829e1f3
Merge pull request #1926 from LemmyNet/replace-activitystreams-lib
Replace activitystreams crate with activitystreams-kinds
2021-11-22 08:47:46 -05:00
Felix Ableitner afccd5cf69 Replace activitystreams crate with activitystreams-kinds 2021-11-22 14:28:57 +01:00
Nutomic 88e81dce6b
Merge pull request #1921 from LemmyNet/fix_login
Fix login ilike bug. Fixes #1920
2021-11-22 13:05:57 +00:00
Nutomic ae153dc243
Merge pull request #1930 from Minoru/bugfix/nodeinfo-links
Change NodeInfo `links` to an array
2021-11-22 12:45:13 +00:00
Alexander Batischev d53d229c49
Change NodeInfo `links` to an array
NodeInfo spec[1] says that _.well-known/nodeinfo_ is a JSON Resource
Descriptor (JRD) document. That is specified in RFC 7033, where §4.4[2]
mandates that `links` is an array.

1. https://nodeinfo.diaspora.software/protocol.html
2. https://datatracker.ietf.org/doc/html/rfc7033#section-4.4
2021-11-21 20:10:39 +03:00
Dessalines e58c2048ed Fixing fuzzy_search to escape like chars. 2021-11-19 15:07:20 -05:00
Dessalines ffc898a7b8
Merge pull request #1924 from LemmyNet/fix-1914
Fix build error in #1914
2021-11-19 12:42:48 -05:00
Felix Ableitner 3e4fe89a45 Fix build error in #1914 2021-11-19 18:05:23 +01:00
Dessalines 6d35508f08
Merge pull request #1914 from LemmyNet/dont-announce-note
Dont announce comments, edited posts to Pleroma/Mastodon followers
2021-11-19 11:48:47 -05:00
Dessalines 4ce01f8bb4 Fix login ilike bug. Fixes #1920 2021-11-18 20:58:11 -05:00
Dessalines 712dabd16b
Merge pull request #1918 from LemmyNet/fix-smithereen-webfinger
Fix Smithereen webfinger, remove duplicate webfinger impl (fixes #1916)
2021-11-18 14:47:34 -05:00
Dessalines e756e85da7
Merge pull request #1917 from LemmyNet/outbox-announce
Community outbox should only contain activities sent by community
2021-11-18 14:31:47 -05:00
Felix Ableitner da89ea22fb Fix Smithereen webfinger, remove duplicate webfinger impl (fixes #1916) 2021-11-18 19:28:53 +01:00
Felix Ableitner aeb34199f5 Dont announce comments, edited posts to Pleroma/Mastodon followers 2021-11-18 18:41:43 +01:00
Felix Ableitner a2707e1c56 Community outbox should only contain activities sent by community (fixes #1916) 2021-11-18 18:31:50 +01:00
Dessalines 1f03a2d957
Merge pull request #1915 from LemmyNet/remove-http-sig-compat
Remove HTTP signature compatibility mode (its not necessary)
2021-11-18 11:43:32 -05:00
Dessalines a56853be05
Merge pull request #1907 from not-layla/main
Implement rate limits on comments
2021-11-18 11:22:38 -05:00
Felix Ableitner f07aaf417a Remove HTTP signature compatibility mode (its not necessary) 2021-11-18 17:06:10 +01:00
layla 7fe7062c47 Implement rate limits on comments 2021-11-18 13:40:16 +00:00
Nutomic 8fc252ec55
Merge pull request #1911 from LemmyNet/fix_arm_docker
Fixing arm dockerfile.
2021-11-18 11:55:01 +00:00
Dessalines 66ba91de8c Fixing arm dockerfile. 2021-11-17 16:46:05 -05:00
Dessalines f4616789a7 Version 0.14.1 2021-11-17 16:25:50 -05:00
Nutomic 8000ee92e1
Merge pull request #1908 from LemmyNet/upgrade_background_jobs
Upgrade background jobs
2021-11-17 20:46:19 +00:00
Dessalines 4166f30fb4 Upgrading background-jobs-core and actix. #1820 2021-11-17 14:50:25 -05:00
Dessalines 0845d61d2b Fixing release 2021-11-17 13:50:03 -05:00
Dessalines 8b45ca0da2 Fixing prod deploy not adding other docker-compose.yml files. 2021-11-17 12:05:02 -05:00
Dessalines a24683b40c 0.14.0 Release notes. 2021-11-17 12:01:07 -05:00
Dessalines c29366328e Version 0.14.0 2021-11-17 11:28:16 -05:00
Dessalines dc3858c82d Version 0.14.0-rc.2 2021-11-17 09:14:54 -05:00
Dessalines 5f6419ff76
Merge pull request #1897 from LemmyNet/mastodon-compat
Mastodon compat
2021-11-17 09:12:01 -05:00
Felix Ableitner db631005d3 Fix error due to same activity being inserted in database twice 2021-11-16 19:13:05 +01:00
Felix Ableitner 3249060f67 Remove to field from follow activities 2021-11-16 19:13:05 +01:00
Aode (lion) 20cddf5e81 Support mastodon deletes 2021-11-16 18:07:47 +01:00
Felix Ableitner 7f4a773b88 Create and Note always need to tag parent creator, for mastodon notifications 2021-11-16 18:07:47 +01:00
Felix Ableitner c1f1b8aa0f Activities in community should also be sent to actors in cc 2021-11-16 18:07:45 +01:00
Felix Ableitner dc416bf255 Make http signature compatible with mastodon 2021-11-16 18:06:01 +01:00
Nutomic 60f72b2785
Merge pull request #1905 from LemmyNet/fix_comment_report_creator
Fixing comment report creator. Fixes #1904
2021-11-16 17:03:58 +00:00
Felix Ableitner 579ca37ddf Make webfinger standard compliant 2021-11-16 18:03:09 +01:00
Nutomic 3914c6c875
Merge pull request #1903 from LemmyNet/fix_direct_string_apub_serialize_error
Use serde_json::to_value
2021-11-16 17:00:07 +00:00
Dessalines ec40b4f7fb Fixing comment report creator. Fixes #1904 2021-11-16 09:59:52 -05:00
Dessalines 23641fcd06 Use serde_json::to_value 2021-11-15 21:11:44 -05:00
Dessalines 09cd32034b
Fixing activity serialization. Fixes #1900 (#1901) 2021-11-15 20:26:48 +00:00
Dessalines 497564359b Version 0.14.0-rc.1 2021-11-11 14:57:25 -05:00
Dessalines 3bd827c73a
Temporarily disable arm tests (#1895)
* Temporarily disable arm tests

* Disable cargo build
2021-11-11 14:49:48 -05:00
Nutomic 1b9414f292
More federation compat (#1894)
* Make HTTP signatures compatible with Pleroma

* Send Announce/Page, Announce/Note for Pleroma compatibility

* remove unused code
2021-11-11 14:49:15 -05:00
Dessalines dbc92d6ee0
Merge pull request #1888 from LemmyNet/test-pleroma-federation
Add docker setup for testing Pleroma federation
2021-11-11 08:52:26 -05:00
Felix Ableitner 135fd6864b Add docker setup for testing Pleroma federation 2021-11-11 14:26:46 +01:00
Dessalines 8d4c4fdf6c
Adding clippy:unwrap to husky. Fixes #1892 (#1893) 2021-11-11 12:18:08 +00:00
Dessalines 8a108bccae
Merge pull request #1891 from LemmyNet/remove-apub-accept-guard
Remove header guard for activitypub routes
2021-11-10 09:38:50 -05:00
Felix Ableitner 9a1fe154db Remove header guard for activitypub routes 2021-11-10 15:08:33 +01:00
Nutomic 2ed58aeda6
Merge pull request #1889 from LemmyNet/update_docker_images
Updating rust musl images
2021-11-10 13:45:49 +00:00
Dessalines f035af3738 Fixing clippy 2021-11-09 17:31:28 -05:00
Dessalines 5b3be5c102 Updating rust musl images 2021-11-09 17:16:59 -05:00
Dessalines 76220a4523
Fixing clippy lints. (#1885)
* Fixing clippy lints.

* Revert object id display

* Trying to fix clippy again
2021-11-09 18:16:37 +00:00
Dessalines c03689ed4c
Merge pull request #1887 from LemmyNet/federate-smithereen
Add federation test cases for Smithereen and Mastodon
2021-11-09 12:26:41 -05:00
Felix Ableitner 5319046dc7 Add federation test cases for Smithereen and Mastodon 2021-11-09 17:16:58 +01:00
Dessalines 5d321949e6
Merge pull request #1877 from LemmyNet/refactor-apub-2
Refactor apub 2
2021-11-08 10:25:25 -05:00
Felix Ableitner c21c142a9a Include apub context from file, so that it can be embedded in docs 2021-11-08 16:04:02 +01:00
Felix Ableitner 252d87d332 Fix clippy error 2021-11-08 13:16:14 +01:00
Felix Ableitner 888e683856 For verify_is_public() we also need to check cc field 2021-11-06 18:44:34 +01:00
Felix Ableitner a5a674a270 Add method ApubObject.verify() 2021-11-06 18:35:14 +01:00
Felix Ableitner 02ce7bdc7d Remove unused ActorType methods 2021-11-06 15:01:00 +01:00
Felix Ableitner 8ea21c39b7 Reduce stack memory usage in apub code
- use our own, smaller Endpoints struct
- wrap ObjectId.url in Box
- adjust usage of Box in different places
2021-11-06 14:53:39 +01:00
Felix Ableitner c725514841 Change to_apub and from_apub to take by value and avoid cloning 2021-11-06 14:47:58 +01:00
Dessalines 44b5fe0631
Stop using lemmy-ui:dev images (#1880)
* Stop using lemmy-ui:dev images

* Dont publish dev docker images with drone.
2021-11-05 21:49:15 +00:00
Felix Ableitner 2edf8ba157 Move ObjectId to library 2021-11-05 21:37:46 +01:00
Felix Ableitner bd3352423a Remove ActivityFields trait, deserialize into another struct instead 2021-11-05 21:14:19 +01:00
Felix Ableitner 969a7f2d1b Refactoring apub code 2021-11-05 21:12:10 +01:00
Dessalines a83113935d
Check if post or comment are deleted first. Fixes #1864 (#1867)
* Check if post or comment are deleted first. Fixes #1864

* Refactoring delete apub.

* Revert "Refactoring delete apub."

This reverts commit ba2c3d06cfb870efe792f4b2541036265b425156.
2021-11-03 17:47:24 +00:00
Dessalines 1bec551945
Merge pull request #1874 from LemmyNet/protocol-testing
Protocol testing
2021-11-03 11:23:26 -04:00
Felix Ableitner 41f7bcc0d2 Correctly use and document check_is_apub_id_valid() param use_strict_allowlist 2021-11-02 21:39:06 +01:00
Felix Ableitner b396344eae Merge two functions into one 2021-11-02 21:39:06 +01:00
Felix Ableitner 1c6f74cad5 Convert note.content and chat_message.content to html (fixes #1871) 2021-11-02 21:39:02 +01:00
Dessalines d4753049d7
Upgrade background_jobs to 0.9.1 #1820 (#1875) 2021-11-02 20:27:24 +00:00
Dessalines 87bc2763ce
Fix husky fmt hook. (#1868)
* Fix husky fmt hook.

* Change to use default cargo

* Using nightly check
2021-11-02 15:15:19 +00:00
Felix Ableitner 0bde2d595e Add tests for parsing activities and collections 2021-11-02 12:44:51 +01:00
Felix Ableitner aaaf039779 Move apub test files into tree structure 2021-10-29 16:54:19 +02:00
Felix Ableitner 03d8ac75ef Move activity structs to protocol folder 2021-10-29 12:50:32 +02:00
Felix Ableitner 5ff044346f Move object and collection structs to protocol folder 2021-10-29 12:50:32 +02:00
Felix Ableitner 358ef99ea2 Rewrite community followers and user outbox to use our own structs 2021-10-29 12:50:32 +02:00
Felix Ableitner d89156810d Move @context out of object/activity definitions 2021-10-29 12:50:32 +02:00
Felix Ableitner 2d04ff93f5 Change activity.cc to Vec<Url> in public activities 2021-10-29 12:50:32 +02:00
Felix Ableitner 271785b7fb When receiving activity, dont read community from cc (for pleroma compat and better verification) 2021-10-29 12:50:30 +02:00
Felix Ableitner 74523fb534 Make Note.context optional for pleroma compat (hack) 2021-10-29 12:45:54 +02:00
Felix Ableitner 03b8ae7215 Activity.to should always be a vec (and unspecified size for public activities) 2021-10-29 12:45:54 +02:00
Felix Ableitner 614490d29b Fix problem that prevented viewing of pleroma user profiles 2021-10-29 12:45:53 +02:00
Felix Ableitner 0af047dd83 Rewrite community moderators collection 2021-10-29 12:45:53 +02:00
Felix Ableitner 6792e376b4 Rewrite community outbox to use new fetcher 2021-10-29 12:45:53 +02:00
Felix Ableitner bb085189e0 Merge traits ToApub and FromApub into ApubObject 2021-10-29 12:45:53 +02:00
Dessalines b18ea3e0cc
Renaming to slur_filter. Fixes #1773 (#1801)
* Renaming to slur_filter. Fixes #1773

* Fixing config

* Updating doku for slur filter.

* Updating doku for slur filter again.

* Remove comment.
2021-10-28 20:47:25 +00:00
Dessalines f1f7c45017
Three instance inbox bug (#1866)
* 3 instance shared inbox bug test

* Fixing shared inbox bug. Fixes #1865

* A few fixes.
2021-10-28 20:46:24 +00:00
Dessalines 90a5febd38
Remove ansible from this repo. (#1829)
* Remove ansible from this repo.

* Adding a git push.
2021-10-27 12:09:00 -04:00
Nutomic 61189efe72
Rewrite collections to use new fetcher (#1861)
* Merge traits ToApub and FromApub into ApubObject

* Rewrite community outbox to use new fetcher

* Rewrite community moderators collection

* Rewrite tombstone
2021-10-27 12:03:07 -04:00
Dessalines d9ecabee87
Dont blank out post or community info. Fixes #1813 (#1841)
* Dont blank out post or community info. Fixes #1813

* Fix federation tests

* Only blank out info for non-logged in users.

* Remove pointless trait.

* Blank the community if deleted for post

* Fix hook

* Fixing again

* Fixing again

* Fixing again
2021-10-27 13:34:18 +00:00
Dessalines f4bac6a17f Merge remote-tracking branch 'origin/main' 2021-10-22 13:32:17 -04:00
Nutomic 7bfe59a89f
Format config/defaults.hjson before committing (#1860) 2021-10-22 13:29:47 -04:00
Dessalines 40264c17a0 Version 0.13.5-rc.7 2021-10-22 13:26:00 -04:00
Nutomic 149a4e0de8
Breaking apub changes (#1859)
* Remove CommentInReplyToMigration

* Remove compat for RemovePostCommentOrCommunity

* Remove PublicUrlMigration

* Change type of pm to ChatMessage from Pleroma, make pm.to array

* Use person.summary instead of person.content for pleroma compat

* Also change group.content to summary

* Rewrite apub object test json to serve as nice examples

* Also add test case for parsing pleroma private message
2021-10-22 12:21:26 -04:00
Dessalines 23731cd49c
Trying out rust-musl-builder for cargo publish (#1856)
* Trying out rust-musl-builder for cargo publish

* Version 0.13.5-rc.1

* Try rust:nightly

* Version 0.13.5-rc.2

* Try rust slim

* Version 0.13.5-rc.3

* Try rust 1.51

* Version 0.13.5-rc.4

* Trying another nightly

* Version 0.13.5-rc.5

* Trying another fix

* Version 0.13.5-rc.6
2021-10-21 13:26:01 -04:00
Nutomic dd0ba10b44
Pleroma federation2 (#1855)
* Allow fetching person from Pleroma, including test case (ref #1461)

* Added test case for parsing community from apub json

- fixed a bug with objectid (de)serialization
- fixed a bug with outbox fetching (ref #1582)

* Added apub test for post

* Ignore errors when reading community outbox (fixes #1582)

* Dont fetch community outbox/moderators during tests

* added test for lemmy comment

* Added federation test for pleroma comment

* Added html2md crate to parse comment html from pleroma (fixes #1461)

* some fixes for update_apub_test_files.sh

* Add tests for ToApub, private message, remove update script

* Delete objects from db at the end of each test
2021-10-21 13:25:35 -04:00
Nutomic 21304e6751
Create a custom pre-commit hook, generates config/defaults.hjson (#1857)
* Create a custom pre-commit hook, generates config/defaults.hjson (fixes #1836)

* invalid defaults file

* Revert "invalid defaults file"

This reverts commit 76d2c303e293b13d581f9c5aa2944caedb2f530b.
2021-10-21 12:57:09 -04:00
Dessalines 9e0fa99c69
Merge pull request #1850 from LemmyNet/refactor-apub
Refactor apub
2021-10-20 11:01:04 -04:00
Felix Ableitner 1aa0e1997b Major refactor, adding newtypes for apub crate
- this allows moving FromApub/ToApub traits into apub lib
2021-10-20 12:28:09 +02:00
Felix Ableitner f24999027e Merge crates db_schema and db_queries 2021-10-20 12:28:08 +02:00
Felix Ableitner d206aad282 Remove DeletableApubObject trait 2021-10-20 12:20:54 +02:00
Tmpod e9d9bc82d8
Add cargo metadata to all crates (#1853) 2021-10-19 13:03:43 -04:00
Tmpod aef9786fa7
Add both (De)Serialize to all models (#1851) 2021-10-19 12:37:01 -04:00
Dessalines 97aa7268ae
Adding GetUnreadCount to the API. Fixes #1794 (#1842)
* Adding GetUnreadCount to the API. Fixes #1794

* Reordering filters to fix unread replies.
2021-10-16 10:43:41 +00:00
Nutomic 18badcfdb4
Federate reports (#1830)
* Federate reports

* add federation test cases for reports
2021-10-15 10:37:33 -04:00
Dessalines ccb8e4b414
Fix saved posts and hide read posts issue. Fixes #1839 (#1840) 2021-10-14 17:03:12 +00:00
Dessalines 2402515fcc
Dont allow posts to deleted / removed communities. Fixes #1827 (#1828)
* Dont allow posts to deleted / removed communities. Fixes #1827

* Fixing couldnt find community error.

* Adding check in createorupdate post and comment.

* make sure post wasn't deleted or removed.

* Adding a post not deleted or removed check to creatorupdatecomment.

* Using pub(crate)
2021-10-14 16:33:19 +00:00
Dessalines f052e5f1ab 0.13.3 release notes. 2021-10-13 21:28:04 -04:00
Dessalines f526bce618 Update ansible version 2021-10-13 21:18:55 -04:00
Nutomic 8067244765
Dont swallow API errors (fixes #1834) (#1837)
Dont swallow API errors (fixes #1834)
2021-10-13 15:50:21 -04:00
Nutomic d26255957b
Fix federation of initial post/comment vote (fixes #1824) (#1835) 2021-10-13 10:12:41 -04:00
Nutomic f4c783cba5
Fix clippy warnings added in nightly (#1833) 2021-10-12 12:46:26 -04:00
Dessalines 864598908d
Admins can view all reports. Fixes #1810 (#1825) 2021-10-12 12:02:16 +00:00
Dessalines 35d0aba9e6
Adding a message_id to emails. Fixes #1807 (#1826) 2021-10-12 11:38:55 +00:00
Nutomic 454d3987a5
Generate config docs from code (#1786)
* Generate config docs from code

* update library

* move settings comments from config.hjson to code

* updte doku to 0.10

* update doku
2021-10-08 11:07:24 -04:00
Dessalines 53a2b6d013
Trying a background_jobs fix. #1820 (#1822) 2021-10-08 14:36:53 +00:00
Luna e06cd9c0ac
mark parent as read on reply (#1819)
* mark parent as read on reply

* mark as read only if you are the recipient

* mark mentions as read on reply
2021-10-08 10:28:32 -04:00
Nutomic b96ce81f89
Move code to apub library (#1795)
* Remove dependency of apub_lib on LemmyContext

* Move ApubObject trait to library

* Reorganize files in apub lib

* Move ActorType, signatures, activity_queue to apub library
2021-10-06 16:20:05 -04:00
Dessalines fe7c1b300b
Adding honeypot to user and post creation. Fixes #1802 (#1803) 2021-10-01 11:37:39 +00:00
Nutomic a03727e28a
Add database host back into config file (#1805) 2021-09-30 16:45:20 -04:00
Dessalines b6b045bf76 Update releases.md 2021-09-30 09:17:29 -04:00
Dessalines a99ba2de24 Version 0.13.0 2021-09-29 16:16:46 -04:00
Dessalines 9c50cbf431
Adding a user agent. Fixes #1769 (#1800)
* Adding a user agent. Fixes #1769

* Fix client duplicate creation.
2021-09-29 16:05:38 -04:00
Dessalines 5a281445a3
Upgrade deps (#1799)
* Upgrade deps

* Fix web::scope
2021-09-29 14:50:00 -04:00
Nutomic aee48f3f5d
Ansible changes (#1781)
* Use env var for config location when saving (not default location)

* Consistent variable formatting for easy replacement with sed

* Remove unmaintained lemmy_dev and uninstall playbooks

* Simplify lemmy.hjson for ansible

* cleanup ansible playbook

* add separate playbook for updating lemmy config

* Revert "add separate playbook for updating lemmy config"

This reverts commit 0a970ae1da984791958b01b01d35e64d6f6eb98a.
2021-09-28 11:34:18 -04:00
Dessalines 37bd9e0e6c Version 0.13.0-rc.1 2021-09-28 10:59:29 -04:00
Dessalines b18c744f63
Clean up reporting (#1776)
* First untested pass at reporting.

* Adding unit tests for post and comment report views

* Fix clippy

* Adding counts, creator_banned, and unresolved_only

* Adding my_vote to report views

* Fixing unit tests.
2021-09-28 10:36:17 +00:00
Nutomic 240de006db
Implement webmention support (fixes #1395) (#1671)
* Implement webmention support (fixes #1395)

* update

* use post url instead of instance or, better error handling

* update webmention
2021-09-27 10:49:47 -04:00
Felix Ableitner 329a282aac Merge branch 'remove_settings_and_secret_singletons_squashed' 2021-09-27 12:34:41 +02:00
Dessalines 8708ad1b44 Moving settings and secrets to context. 2021-09-27 11:25:26 +02:00
Felix Ableitner cf214ff583 Move jwt secret from config to database (fixes #1728) 2021-09-27 11:25:09 +02:00
Nutomic 527eefbe92
Rewrite fetcher (#1792)
* Use new fetcher implementation for post/comment

* rewrite person fetch to use new fetcher

* rewrite community to use new fetcher

* rename new_fetcher to dereference_object_id

* make ObjectId a newtype

* handle deletion in new fetcher

* rewrite apub object search to be generic

* move upsert() method out of ApubObject trait

* simplify ObjectId::new (and fix clippy)
2021-09-25 11:44:52 -04:00
Nutomic 21346eb786
Merge pull request #1785 from LemmyNet/add_cardano_donation_link
Add cardano donation link
2021-09-20 15:47:43 +00:00
Nutomic 1e7f3a4b23
Merge pull request #1782 from LemmyNet/password_min_length
Set a 10 char minimum password length.
2021-09-20 10:02:30 +00:00
Dessalines 0fbc342fe3 Fix tests 2021-09-19 17:20:47 -04:00
Dessalines 05e91ab9a2 Add cardano donation link 2021-09-19 16:52:16 -04:00
Dessalines 721962589c Clean up. 2021-09-18 19:53:30 -04:00
Dessalines 1033995801 Set a 10 char minimum password length. 2021-09-18 19:43:08 -04:00
Nutomic e84e1193fc
Dont pass accept-encoding header to pictrs (ref #1734) (#1738)
* Allow image upload in docker/dev/ (replaces #1765)

* Dont pass accept-encoding header to pictrs (ref #1734)

* Fix clippy errors
2021-09-17 11:44:20 -04:00
Nutomic 007a43c012
Merge pull request #1775 from LemmyNet/add_pictrs_to_ansible
Add pictrs to ansible.
2021-09-13 10:02:27 +00:00
Dessalines f3af561404 Add pictrs to ansible. 2021-09-07 20:11:36 -04:00
Dessalines 2cb0b6756c Adding 0.12.2 release notes 2021-09-06 11:33:32 -04:00
Dessalines 81c21a5328 Upping ansible version 2021-09-06 11:29:04 -04:00
Nutomic 9a2dc53097
Merge pull request #1770 from LemmyNet/fix/arm_build
Fix/arm build
2021-09-06 11:30:40 +00:00
Dessalines e9891977ee Version 0.12.2-rc.1 2021-09-05 13:59:28 -04:00
Dessalines a9a65a0f4f Try fixing arm build 2021-09-05 13:56:41 -04:00
Dessalines 52e6dcc51c Upping ansible version 2021-09-04 09:50:14 -04:00
Dessalines 9376c67ade Adding v0.12.1 release notes. 2021-09-04 09:33:26 -04:00
Dessalines 0940fb5f00
Fixing some comment websocket issues. (#1768)
- Wasn't correctly getting comment parent user for mark as read. Fixes #1767
- Was using all recipients for simple comment return. Fixes #1766
2021-09-04 08:47:41 -04:00
Dessalines 8b2491ea23 Fix upgrade note. 2021-09-03 10:56:47 -04:00
Dessalines 0b236a2fc2 Adding v0.12.0 release notes. 2021-09-03 09:29:11 -04:00
Dessalines df997dff49 Version 0.12.0 2021-09-03 09:23:50 -04:00
Dessalines 83a035082a Upgrading to lemmy-js-client 0.12.0 2021-09-03 09:21:24 -04:00
Dessalines e19349343a Version 0.12.0-rc.2 2021-09-03 08:28:26 -04:00
Dessalines ed2744201b
Create SECURITY.md (#1758)
Adding a security.md file.
2021-09-02 12:09:48 +00:00
Dessalines c654aa3416
Use more generic docker deps. Fixes #1759 (#1762)
* Use more generic docker deps. Fixes #1759

* Don't use slim
2021-09-02 11:50:20 +00:00
Dessalines c28c1b4bb3
Trying to fix arm builds. (#1761)
* Trying to fix arm builds.

* Adding comment
2021-09-02 11:00:45 +00:00
Dessalines 46b223e3c5
Fixing docker-compose prod (#1741) 2021-08-31 14:01:36 +00:00
Nutomic 2822f5a126
Change public activities to field to array (#1739) 2021-08-27 21:33:38 -04:00
Dessalines 2c8003a9fa
Upgrading deps (#1735) 2021-08-26 08:37:10 -04:00
Dessalines 0a91a28b27
Reindex tables non-concurrently on startup. Fixes #1726 . #1723 (#1736) 2021-08-26 11:49:16 +00:00
Dessalines da5fdae006 Version 0.12.0-rc.1 2021-08-25 17:28:42 -04:00
Dessalines a685e33f20 Merge branch 'main' of https://github.com/lemmynet/lemmy 2021-08-25 17:26:28 -04:00
Dessalines af225a42d0
Fix prod deploy script and clippy (#1724)
* Updating lemmy-js-client.

* Fix prod deploy script and clippy

* Try using buster.

* Using more generic and updated images.

* again.

* again.

* Try alternate env

* again.

* again.

* Version 0.11.4-rc.24

* again.

* Better old_tag

* Version 0.11.4-rc.27

* Updating cargo.lock

* Trying to run a cargo check to update the lock

* Version 0.11.4-rc.28
2021-08-25 17:26:10 -04:00
Dessalines 815b271084 Updating lemmy-js-client. 2021-08-25 13:00:39 -04:00
Dessalines 73449c09a7
Fix image uploads. Fixes #1725 (#1734)
* Fix image uploads. Fixes #1725

* Adding comment on awc dep.
2021-08-25 16:33:45 +00:00
Nutomic e413350be3
Merge pull request #1666 from LemmyNet/resolve-endpoint
Move resolving of activitypub objects to separate api endpoint
2021-08-23 17:06:51 +00:00
Dessalines c23e7cc20d
Fixing ResolveObject API and unit tests (#1713) 2021-08-23 17:25:39 +02:00
Dessalines 1ee0c0c291
Adding more site setup vars. Fixes #678 (#1718) 2021-08-23 09:44:10 +00:00
Nutomic 3b37ea6c8b
Dont append ? to url when cleaning it (#1716) 2021-08-21 09:36:33 -04:00
Felix Ableitner 251e0d3b82 Move resolving of activitypub objects to separate api endpoint (fixes #1584) 2021-08-20 12:35:50 +02:00
Nutomic f6f169b4eb
Rewrite remaining activities (#1712)
* Limit type/method visibility in apub code

* Simplify db_queries traits by removing generics

* Simplify delete activity implementation

* Rewrite delete activities

* Implement helper functions for websocket message sending

* When receiving delete reason as empty string, change to none

* Rewrite remaining activities

* Simplify inbox

* Remove struct ActivityCommonFields, derive ActivityFields trait instead

* Community should announce received activities to followers
2021-08-19 17:24:33 -04:00
Dessalines 2016afc9db
User / community blocking. Fixes #426 (#1604)
* A first pass at user / community blocking. #426

* Adding unit tests for person and community block.

* Moving migration

* Fixing creator_blocked for comment queries, added tests.

* Don't let a person block themselves

* Fix post creator_blocked

* Adding creator_blocked to PersonMentionView

* Moving blocked and follows to MyUserInfo

* Rename to local_user_view

* Add moderates to MyUserInfo

* Adding BlockCommunityResponse

* Fixing name, and check_person_block

* Fixing tests.

* Using type in Blockable trait.

* Changing recipient to target, adding unfollow to block action.
2021-08-19 20:54:15 +00:00
Dessalines 6af75492a9
Swap out iframely (#1706)
* Replace Iframely. Fixes #1681

* Add post_link_tags to nginx

* Adding post_link_tags route

* Cleaning up post_link_tags

* Changing PostLink to SiteMetadata, adding it to the API.

* Fixing issue when local has no openssl certs.

* Fixing an issue with pictrs errors

* Revert "Fixing issue when local has no openssl certs."

This reverts commit dbf7d1b1ee03846e5ef7b7156e618424f1150e1d.

* Add ca-certs to dockerfile for volume mount.

* Cleaning up fetch_pictrs request

* Changing to fetch_site_data
2021-08-19 14:12:49 +00:00
Nutomic 8158966af6
Merge pull request #1710 from LemmyNet/mod_transfer_community
Adding ModTransferCommunity to modlog in API. Fixes #1437
2021-08-18 22:01:09 +00:00
Nutomic d8fafc1b03
Merge pull request #1709 from LemmyNet/upgrade_deps_6
Upgrading deps
2021-08-18 11:46:11 +00:00
Dessalines b241bb9cb7 Adding script to upgrade deps, and check for unused ones. 2021-08-17 19:16:20 -04:00
Dessalines 6910e18a83 Adding ModTransferCommunity to modlog in API. Fixes #1437 2021-08-17 17:52:28 -04:00
Dessalines 1f64db6a33 Upgrading deps 2021-08-17 16:31:16 -04:00
Nutomic 28d6370c35
Rewrite delete activities (#1699)
* Limit type/method visibility in apub code

* Simplify db_queries traits by removing generics

* Simplify delete activity implementation

* Rewrite delete activities

* Implement helper functions for websocket message sending

* When receiving delete reason as empty string, change to none
2021-08-17 14:04:58 -04:00
Dessalines 6fbf6a684c
Make sure bots aren't included in aggregate counts (#1705)
- Fixes #1648
2021-08-16 20:52:24 +00:00
Dessalines 2966203653
Don't allow deleted users to do actions. Fixes #1656 (#1704) 2021-08-16 20:51:08 +00:00
Dessalines 32874163a8
Merge pull request #1703 from shilangyu/patch-1
Update lemmy_api_client status in README
2021-08-15 18:19:23 -04:00
Marcin Wojnarowski fb66b77d67
Update lemmy_api_client status 2021-08-15 22:37:37 +02:00
Dessalines 8a1af056e2
When banning a user, remove communities they've created (#1700)
- Fixes #1659
2021-08-13 17:39:56 +00:00
Nutomic 353a1fe0a0
Rewrite activitypub following, person, community, pm (#1692)
* Rewrite following activities

* Rewrite person apub

* Rewrite community apub

* Rewrite private message activity sending
2021-08-12 08:48:09 -04:00
Dessalines 44716c2f24
Merge pull request #1674 from LemmyNet/crates-io
Distribute Lemmy via crates.io
2021-08-11 15:16:42 -04:00
Felix Ableitner a44b5c9c36 publish to crates.io with normal release script 2021-08-09 18:44:18 +02:00
Felix Ableitner af6aa3c0bf Distribute Lemmy via crates.io 2021-08-09 17:29:32 +02:00
Dessalines 9d936a3d85
Merge pull request #1690 from LemmyNet/comment-reply-migration
Migrate comment inReplyTo field to single value (ref #1454)
2021-08-05 11:19:33 -04:00
Felix Ableitner b2937223df Migrate comment inReplyTo field to single value (ref #1454) 2021-08-05 13:00:29 +02:00
Dessalines 7b8cbbba85
Simplify config using macros (#1686)
Co-authored-by: Felix Ableitner <me@nutomic.com>
2021-08-04 21:13:51 +00:00
Nutomic b8d7f00d58
Rewrite voting (#1685)
* Merge like/dislike activity handlers into vote

* Rewrite vote sending code

* Remove old send_create, send_update functions
2021-08-02 16:33:40 -04:00
Dessalines 1664cb326a
Merge pull request #1677 from LemmyNet/remove-fat-deps
Remove brotli, zstd dependencies
2021-08-02 16:21:33 -04:00
Nutomic 6c9e04583d
Merge pull request #1683 from LemmyNet/fix/comment_count_trigger_issues
Some comment count fixes.
2021-08-02 12:08:15 +00:00
Felix Ableitner abd26aeab2 Remove brotli, zstd dependencies 2021-08-02 14:05:39 +02:00
Dessalines 896ba8451c Some comment count fixes.
- Make sure an update to deleted decreases the count. Fixes #1676
- Don't allow the post creator to comment necro-bump their own post.
  Fixes #1675
2021-08-01 21:07:45 -04:00
Dessalines 224592c547
Merge pull request #1682 from LemmyNet/rewrite-comment
Rewrite comment
2021-08-01 20:02:13 -04:00
Felix Ableitner 6b57d716e1 Rewrite private message apub and merge create/update 2021-07-31 22:58:11 +02:00
Felix Ableitner dc363c8f35 Merge logic for post create and update 2021-07-31 19:26:17 +02:00
Felix Ableitner 3eb46868ff Merge logic for comment create and update 2021-07-31 17:47:08 +02:00
Felix Ableitner 43ad99bbe8 Rewrite apub comment (de)serialization using structs (ref #1657) 2021-07-31 16:57:37 +02:00
Nutomic bb7750d8ee
Merge pull request #1678 from LemmyNet/rewrite-post
Rewrite apub post (de)serialization using structs (ref #1657)
2021-07-31 07:10:56 +00:00
Dessalines 520436cd9a Fix changelog links 2021-07-30 18:59:22 -04:00
Felix Ableitner 433ab1e78b Add docs for MediaType, PublicUrl values 2021-07-30 23:16:33 +02:00
Felix Ableitner 57b6ecaf40 Simplify lemmy_context() function (dont return errors) 2021-07-30 23:16:33 +02:00
Felix Ableitner ff265c7ebc Rewrite apub post (de)serialization using structs (ref #1657) 2021-07-30 23:16:32 +02:00
Dessalines 15a11c13a2 Updating ansible version. 2021-07-30 16:55:04 -04:00
Dessalines 8d2dc76be3 Adding release notes. 2021-07-30 16:50:39 -04:00
Dessalines d85f0d087e
Blank out extra info for deleted or removed content. Fixes #1679 (#1680) 2021-07-30 18:44:15 +00:00
Dessalines 6ffa291ec9
Actor name length config dess (#1672)
* Make length of user/community name configurable (fixes #1306)

* use single config value, fix migrations, increase displayname length

* remove debug statements

* add helper method for setting actor_name_max_length

* move function

* Fixing some defaults

Co-authored-by: Felix Ableitner <me@nutomic.com>
2021-07-22 21:53:44 -04:00
Dessalines fcae2189eb
Add show_new_posts_notifs setting. Fixes #1664 (#1665) 2021-07-22 20:07:40 +00:00
Dessalines 7d3b90d711
Fix issue with protocol string in actor id generation (#1668) 2021-07-20 16:55:04 +00:00
Dessalines 5fe7de2bff
Adding shortname fetching for users and communities. Fixes #1662 (#1663) 2021-07-20 04:29:50 +00:00
Dessalines f18139d06c
Merge pull request #1660 from LemmyNet/merge-apub-crates
Merge apub, apub_receive crates
2021-07-17 13:00:06 -04:00
Felix Ableitner c1db86925f Merge apub, apub_receive crates (fixes #1621) 2021-07-17 18:20:44 +02:00
Nutomic c7de1fcf24
Apub inbox rewrite (#1652)
* start to implement apub inbox routing lib

* got something that almost works

* it compiles!

* implemented some more

* move library code to separate crate (most of it)

* convert private message handlers

* convert all comment receivers (except undo comment)

* convert post receiver

* add verify trait

* convert community receivers

* add cc field for all activities which i forgot before

* convert inbox functions, add missing checks

* convert undo like/dislike receivers

* convert undo_delete and undo_remove receivers

* move block/unblock activities

* convert remaining activity receivers

* reimplement http signature verification and other checks

* also use actor type for routing, VerifyActivity and SendActivity traits

* cleanup and restructure apub_receive code

* wip: try to fix activity routing

* implement a (very bad) derive macro for activityhandler

* working activity routing!

* rework pm verify(), fix tests and confirm manually

also remove inbox username check which was broken

* rework following verify(), fix tests and test manually

* fix post/comment create/update, rework voting

* Rewrite remove/delete post/comment, fix tests, test manually

* Rework and fix (un)block user, announce, update post

* some code cleanup

* rework delete/remove activity receivers (still quite messy)

* rewrite, test and fix add/remove mod, update community handlers

* add docs for ActivityHandler derive macro

* dont try to compile macro comments
2021-07-17 12:08:46 -04:00
Dessalines f4c7c2bf28
Merge pull request #1651 from LemmyNet/upgrade_deps_5
Upgrade api_test deps
2021-07-06 12:13:22 -04:00
Dessalines 904709e3f1 Upgrade api_test deps 2021-07-06 10:57:54 -04:00
Dessalines 9840f5c1c1
Upgrading deps, running clippy fix on nightly 1.55.0 (#1638)
* Upgrading deps, running clippy fix on nightly 1.55.0

* Running clippy --fix

* Trying to fix transform

* Trying to fix another transform

* Upgrading http-signature-normalization-actix

* Fix app_data

* Fix pictrs uploading

* Fix unwrap
2021-07-06 13:26:46 +00:00
Dessalines f54209c451
Running clippy --fix (#1647) 2021-07-05 16:07:26 +00:00
Dessalines 8c957ca939
Merge pull request #1649 from weex/case-insensitive-captcha
make captcha case-insensitive
2021-07-05 09:49:35 -04:00
David Sterry 1b1ebd2f70 make captcha case-insensitive 2021-07-04 17:51:08 -07:00
Dessalines 469a2b5c90
Merge pull request #1637 from LemmyNet/remove-url-tracking-params
Remove tracking params from post url (fixes #768)
2021-06-24 14:54:02 -04:00
Felix Ableitner f289374e70 Remove tracking params from post url (fixes #768) 2021-06-18 20:38:34 +02:00
Aaron DeVore 79ee271a5e
LemmyNet/lemmy#1635: Fix IPv6 port setup for Nginx (#1636) 2021-06-17 17:36:00 +00:00
Dessalines 3022c00a0b Version 0.11.2 2021-06-14 18:14:29 -04:00
Dessalines 1cdc5d662c
Fix --cert-name for certbot. (#1631) 2021-06-13 18:28:32 +00:00
Dessalines 12d50e42b4
Change join.lemmy.ml to join-lemmy.org (#1628) 2021-06-07 21:10:47 +00:00
Dessalines 7fb4508fa1
Upgrade pictrs. Fixes #1599 (#1600) 2021-05-28 15:51:09 +00:00
Dessalines ab2b8df1cb
Invalidate current logins on account deletion. Fixes #1602 (#1603) 2021-05-28 15:50:52 +00:00
Dessalines f196f05f20
Upgrading api test deps (#1608) 2021-05-28 15:46:23 +00:00
Dessalines b95bbe2fae
Fix nsfw posts showing for non-logged in users. Fixes #1614 (#1615) 2021-05-26 18:02:35 +00:00
Pavel Balashov 7008848f9c
Add additional slurs configuration option. Closes #1464. (#1612)
* Actualize a comment about config initialization

* Add additional slurs functionality.

It is possible to additional regex for slurs filtering.
It can be done through `additional_slurs` option in config file.
2021-05-26 13:39:38 +00:00
Dessalines 100a56e8ef Version 0.11.1 2021-05-17 19:15:51 -04:00
Dessalines f67b0e9ff8
Updating to rust 1.51.0 (#1598) 2021-05-03 14:46:12 +00:00
Dessalines 6eed6cf362 Fixing release doc. 2021-05-02 21:19:16 -04:00
Dessalines c1cbcdc253 Version 0.11.0 2021-04-27 10:35:54 -04:00
Dessalines c48c620048 Adding v0.11.0 release notes 2021-04-27 10:34:45 -04:00
Dessalines 0d9dceff88
Merge pull request #1595 from LemmyNet/Nutomic-patch-1
Better slur regex
2021-04-27 09:56:36 -04:00
Nutomic 96488684e6
Better slur regex 2021-04-27 12:32:56 +00:00
Dessalines c864dfadf6
Fixing regex. Fixes #1593 (#1594)
* Fixing regex. Fixes #1593

* Fixing test
2021-04-26 18:18:12 +00:00
Dessalines 1eb7e41674
Merge pull request #1592 from LemmyNet/feature/mark_post_as_read
Add show_read_posts filter. Fixes #1561
2021-04-26 10:57:40 -04:00
Dessalines 880c51687a Merge branch 'main' into feature/mark_post_as_read 2021-04-26 10:44:19 -04:00
Nutomic df0a38e0ba
Merge pull request #1566 from LemmyNet/additional_search_filters
Add creator id to search. Fixes #765
2021-04-26 14:17:21 +00:00
Dessalines 6d3778cafe Changing unwrap_default to unwrap_or(false) 2021-04-26 09:50:34 -04:00
Nutomic dc1a0dcd5e
Fetch git tags manually in CI (#1590)
* Fetch git tags manually in CI

* Dont need espeak in CI anymore
2021-04-26 09:30:30 -04:00
Dessalines 5b2be6f9df Add show_read_posts filter. Fixes #1561 2021-04-24 18:26:50 -04:00
Dessalines ed31deab00 Creator extra search results 2021-04-23 11:54:38 -04:00
Dessalines ef7fe7586b Some formatting 2021-04-23 02:40:10 -04:00
Dessalines 51e181c529 Don't search for communities or users when the id is included. 2021-04-23 02:30:13 -04:00
Dessalines f8cd6fd445 Making more fields optional in the API.
- Fixes #1569
2021-04-23 02:30:13 -04:00
Dessalines c86f5472fb Adding listing_type to search. 2021-04-23 02:13:32 -04:00
Dessalines a42ac3e58a Add creator id to search. Fixes #765 2021-04-23 02:12:29 -04:00
Nutomic db1abff857
Add option to limit community creation to admins only (fixes #1586) (#1587)
* Add option to limit community creation to admins only (fixes #1586)

* address review
2021-04-22 19:42:58 -04:00
Nutomic efee2062dd
Mark accounts as bot nutomic (#1565)
* Mark account as bot. Fixes #1357

* Fix clippy

* Federate bot status using actor `type` field

* fix clippy

Co-authored-by: Dessalines <tyhou13@gmx.com>
2021-04-21 17:41:14 -04:00
Dessalines 9dc5605663
Merge pull request #1588 from LemmyNet/improved-logging
Improved logging
2021-04-21 10:34:47 -04:00
Nutomic 8bb3ba4a16
Add option to disable strict allowlist (fixes #1486) (#1581)
* Add option to disable strict allowlist (fixes #1486)

* adjust docs
2021-04-21 09:36:07 -04:00
Felix Ableitner 78eee7dc9e Improved logging 2021-04-21 14:45:10 +02:00
Nutomic 65a11a7239
Use .map_err in api code (fixes #1573) (#1575)
* Use .map_err in api code (fixes #1573)

* forgot some
2021-04-16 09:10:43 -04:00
Nutomic 03c18ecfbe
Merge pull request #1571 from guland2000/patch-3
Update README.ru.md
2021-04-14 16:10:07 +00:00
Nutomic c9d461ea93
Merge pull request #1570 from guland2000/patch-2
Update README.ru.md
2021-04-14 16:09:59 +00:00
Dessalines b0cef3c76d
Merge pull request #1572 from LemmyNet/feature/federated-mod-community-updates
Remote mods can update/delete/undelete communities
2021-04-14 11:02:36 -04:00
Felix Ableitner c572dc0cc6 Remote mods can update/delete/undelete communities 2021-04-13 15:19:17 +02:00
Andrei Guliaikin 0d01461de4
Update README.ru.md
Missing one letter
2021-04-12 23:16:17 +02:00
Andrei Guliaikin d1b57501bd
Update README.ru.md
Some mistakes... logical ;-)
2021-04-12 23:02:59 +02:00
Dessalines dee02e6642
Merge pull request #1567 from LemmyNet/include-commit-in-version
For untagged commits, include hash in version name (fixes #1563)
2021-04-12 11:40:43 -04:00
Nutomic 198f3073f9
Readme russian (#1568)
* README.ru.md

Russian language is done.

* Some fixes for previous commit

Co-authored-by: Andrei Guliaikin <guland2000@users.noreply.github.com>
2021-04-12 13:08:05 +00:00
Felix Ableitner b7d1d91309 For untagged commits, include hash in version name (fixes #1563) 2021-04-12 13:47:58 +02:00
Nutomic aa79c5131f
Implement federated bans (fixes #1298) (#1553)
* Implement federated bans (fixes #1298)

* mod actions should always be federated to affected user, in addition to followers

* Make Undo/Block work for remote mods

* clippy fix

* fix federation test

* vscodium doesnt auto-save changes...
2021-04-09 11:01:26 -04:00
Nutomic 89dd0f2925
Merge pull request #1564 from LemmyNet/remove_extra_save_user_fields
Forgot to remove extra fields for changepassword.
2021-04-09 14:33:28 +00:00
Dessalines 2e16b11db8 Forgot to remove extra fields for changepassword. 2021-04-08 21:14:26 -04:00
Nutomic b8a6592369
Drone release main (ref #1556) (#1557)
* publish docker images from main

* try with separate step

* redo, lots of boilerplate

* try to fix syntax

* unique step names

* fix docker tags, remove cargo-chef

* only build dev image on main branch

* use `ref` for condition, as `branch` uses the target branch for PRs

* consistent indents

* fix tag

* use lemmy-ui:dev image for `docker/dev` and `docker/federation`
2021-04-08 10:33:58 -04:00
Dessalines c3d64f996e
Removing community.creator column. Fixes #1504 (#1541)
* Removing community.creator column. Fixes #1504

* Fixing unit tests.

* Fixing federation tests.
2021-04-08 11:29:08 +00:00
Dessalines 1a70477fc7
Better DB default fields. (#1560)
* Better DB default fields.

* Fixing clippy
2021-04-08 11:19:58 +00:00
Dessalines 3a01949f81
Fixing volume mount. (#1559)
* Fixing volume mount.

* Remove config line.
2021-04-07 18:41:12 +00:00
Dessalines 0c17668844 Updating releases.md 2021-04-07 14:26:22 -04:00
Dessalines 04a3cb1ee8 Merge branch 'release/v0.10' 2021-04-07 14:23:32 -04:00
Dessalines 831ab76152 Version 0.10.3 2021-04-07 14:23:09 -04:00
Dessalines c30d38829d Version 0.10.3 2021-04-07 13:17:38 -04:00
Dessalines 727fa610d4
Merge pull request #1552 from LemmyNet/feature/1550-optional-config-values
Make some of the database config values optional (fixes #1550)
2021-04-07 13:16:28 -04:00
Dessalines 2452bf8f01
Merge pull request #1558 from LemmyNet/feature/1550-optional-config-values
Make some of the database config values optional (fixes #1550)
2021-04-07 13:16:08 -04:00
Dessalines 7bd474a843
Adding a short site description. Fixes #1496 (#1532)
* Adding a short site description. Fixes #1496

- Renaming old description to sidebar

* Adding a back end site desc length check.
2021-04-07 11:40:35 +00:00
Dessalines 5fff927dc4
Adding matrix id validation check. Fixes #1520 (#1538) 2021-04-07 11:38:00 +00:00
Dessalines 8df102ff4b
Merge pull request #1539 from LemmyNet/change_password_api
Moving ChangePassword to its own API action. Fixes #1471
2021-04-06 12:21:41 -04:00
Dessalines d97129e7ae Merge branch 'main' into change_password_api 2021-04-06 12:09:26 -04:00
Felix Ableitner ccdf117c8f Make some of the database config values optional (fixes #1550) 2021-04-06 14:57:37 +02:00
Nutomic a4c2421e74
Merge pull request #1537 from LemmyNet/add_users_active_monthly_community_sort
Adding users active monthly for community sort. Fixes #1527
2021-04-06 12:03:11 +00:00
Nutomic bcdbced0dd
Merge pull request #1536 from LemmyNet/change_preferred_to_display_name
Changing preferred to display name. Fixes #1211
2021-04-06 12:02:50 +00:00
Nutomic 98216d8a3b
Merge pull request #1535 from LemmyNet/rust_captcha_features
Rust captcha features
2021-04-06 11:58:48 +00:00
Nutomic 7daee06383
Merge pull request #1529 from LemmyNet/show_score_setting
Adding a setting to show / hide scores. Fixes #1503
2021-04-06 11:47:31 +00:00
Dessalines df7fe705eb Updating releases.md 2021-04-05 13:26:24 -04:00
Dessalines 89b96511bf Version 0.10.2 2021-04-05 13:21:08 -04:00
Nutomic 74a63804dc
Fix test failure due to config loading error (#1547)
* Crash if config fails to load

* fix previous commit

* Fix test failure due to config loading error

* Adding test fix to drone.

* Logging line.

* Trying to fix drone 2

* Fixing deploy script.

Co-authored-by: Dessalines <tyhou13@gmx.com>
2021-04-05 13:21:56 -04:00
Dessalines 458767e3a8 Version 0.10.1 2021-04-05 10:29:14 -04:00
Nutomic f0c96c28bf
Crash if config fails to load (#1545)
* Crash if config fails to load

* fix previous commit
2021-04-05 10:23:32 -04:00
Dessalines ebb980eaaf
Fix ansible deploy template. (#1544)
* Fix ansible deploy template.

* Add ansible comment.

* Changing tls to true

* Fixing comment line.
2021-04-05 14:20:40 +00:00
Dessalines a617a6a6d6 Update releases.md 2021-04-05 08:55:38 -04:00
Dessalines ba517249e8 Version 0.10.0 2021-04-05 08:53:28 -04:00
Dessalines f33f763278 Moving ChangePassword to its own API action. Fixes #1471 2021-04-01 17:39:01 -04:00
Dessalines b893085d1f Adding users active monthly for community sort. Fixes #1527 2021-04-01 14:34:27 -04:00
Dessalines 799ab94af3 Don't allow zero-space char in display name. Fixes #1317 2021-04-01 14:09:53 -04:00
Dessalines bf7558830f Changing preferred to display name. Fixes #1211 2021-04-01 13:57:45 -04:00
Dessalines 1ba570092e Adding more rust captcha features. Fixes #1248 2021-04-01 13:30:24 -04:00
mickie fac024b90c
Translated README.md to Spanish (#1525)
* Add menu bar for language selection

* Create README.es.md

* Update README.es.md

* fix minor issues

* Update README.md

* Update and rename README.es.md to readmes/README.es.md

* Update features section.

* Update README.md

* Update README.es.md
2021-03-31 19:02:27 +00:00
Dessalines 2f63fdbde0 Adding a setting to show / hide scores. Fixes #1503 2021-03-31 06:54:46 -04:00
dessalines 1a3a215f59 Merge pull request 'Split lemmy_apub crate into two parts apub and apub_receive' (#190) from split-apub-crate into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/190
2021-03-31 10:36:51 +00:00
Felix Ableitner 722cdb78ba Split lemmy_apub crate into two parts apub and apub_receive 2021-03-30 22:29:16 +02:00
Dessalines 36a79e18cd Version 0.10.0-rc.13 2021-03-29 18:10:04 -04:00
Dessalines 4da6e42fc1 Fix websocket location to /api/vX 2021-03-29 17:48:37 -04:00
Dessalines 4c8f2e976e Merge remote-tracking branch 'yerba/split-api-crate' into test_merge_api_crates_reorg 2021-03-29 16:24:50 -04:00
Felix Ableitner 01fc1228d5 Fix API and clippy warnings 2021-03-29 20:55:08 +02:00
Dessalines 2309088b03 Renaming to api/v3 2021-03-29 11:26:15 -04:00
Dessalines c2f8695c9a Version 0.10.0-rc.12 2021-03-25 15:22:07 -04:00
Felix Ableitner 249fcc5066 Split api crate into api_structs and api 2021-03-25 20:19:40 +01:00
Dessalines 6ee76e9280
Merge pull request #1516 from LemmyNet/move_matrix_and_admin_to_person
Move matrix and admin to person
2021-03-25 11:41:37 -04:00
Dessalines 0b5438d3fd
Merge pull request #1522 from LemmyNet/move_matrix_and_admin_to_person_nutomic
Federate Matrix ID (fixes #1438)
2021-03-24 15:38:57 -04:00
Felix Ableitner 34bdf4c7c5 Federate Matrix ID (fixes #1438) 2021-03-24 17:56:13 +01:00
Dessalines af2f84805a Fixing image locations. 2021-03-24 12:42:34 -04:00
Dessalines 3ca2453fc6 Merge branch 'main' into move_matrix_and_admin_to_person 2021-03-24 11:51:34 -04:00
Dessalines 8a10a9079f Merge remote-tracking branch 'yerba/federated-moderation' 2021-03-24 11:48:02 -04:00
Felix Ableitner c7524d924b Fix federation tests 2021-03-24 16:33:04 +01:00
Dessalines 7051207495 Version 0.10.0-rc.10 2021-03-23 14:46:18 -04:00
Dessalines 8543092b9f Merge branch 'remove_cargo_cache_v2' into move_matrix_and_admin_to_person 2021-03-23 14:46:00 -04:00
Dessalines 6758922a63 Version 0.10.0-rc.9 2021-03-23 14:17:44 -04:00
Dessalines baab2e88a5 Merge branch 'main' into move_matrix_and_admin_to_person 2021-03-23 14:16:54 -04:00
Dessalines 3949b35360
Merge pull request #1517 from LemmyNet/add_saved_only_1
Adding saved_only to GetComments and GetPosts. Fixes #1513
2021-03-22 13:52:04 -04:00
Dessalines b4276341af Adding saved_only to GetComments and GetPosts. Fixes #1513 2021-03-22 10:39:54 -04:00
Dessalines e4ead96d3a Merge branch 'main' into move_matrix_and_admin_to_person 2021-03-22 10:29:10 -04:00
Dessalines eb45bf2d0a Moving admin to person table. Fixes #1515 2021-03-22 10:28:00 -04:00
Felix Ableitner d6bd072ea1 Make federation compatible with Lemmy v0.9.9 2021-03-22 15:08:06 +01:00
Felix Ableitner a5a0d90349 Address review comments 2021-03-22 13:52:00 +01:00
Felix Ableitner e726d1e184 Merge branch 'grishka_fix_ld_context' 2021-03-22 13:12:05 +01:00
Felix Ableitner 459b95bc7e Make previous commit compile 2021-03-22 13:11:32 +01:00
Felix Ableitner 6b5354fb11 Merge branch 'fix_ld_context' of https://yerbamate.ml/grishka/lemmy into grishka_fix_ld_context 2021-03-22 13:08:07 +01:00
Nutomic 8b2b3eef73
Merge pull request #1509 from LemmyNet/fix_deploy_prod_script
Fixing docker deploy script. Fixes #1507
2021-03-22 12:02:41 +00:00
Grishka 115b986edc uh 2021-03-21 04:03:53 +03:00
Grishka c14a505456 Fix JSON-LD contexts 2021-03-21 04:00:32 +03:00
Dessalines c884510173 Creating default DB forms. Fixes #1511 2021-03-20 16:59:07 -04:00
Dessalines 53ea383b4e Forgot to regenerate person_alias views 2021-03-20 16:32:52 -04:00
Dessalines 1745b64ceb Moving matrix_user_id to person table. #1438 2021-03-20 15:21:51 -04:00
Dessalines 77f8dc9675 Fixing docker deploy script. Fixes #1507 2021-03-20 14:49:07 -04:00
Dessalines 4b92e35edc Reverting docker versions until deploy.sh fix. 2021-03-20 11:55:11 -04:00
Dessalines e9eca35816 Version 0.10.0-rc.8 2021-03-19 15:58:24 -04:00
Dessalines ae635c752a Try to remove cargo home changing to fix release. 2021-03-19 15:57:56 -04:00
Felix Ableitner 05b07b8cbb Fix conflicts in docker-compose.yml 2021-03-19 18:09:05 +01:00
Felix Ableitner 4f54108a9c Merge branch 'main' into federated-moderation 2021-03-19 17:11:34 +01:00
Dessalines f55ef1d7ef Version 0.10.0-rc.7 2021-03-19 11:46:46 -04:00
Nutomic 14bc9f0946
Merge pull request #1500 from LemmyNet/jwt_revocation_dess
Jwt revocation dess
2021-03-19 15:43:47 +00:00
Dessalines 493598c1ba A few suggestion fixes. 2021-03-19 10:02:58 -04:00
Nutomic 96efe302ce
Merge pull request #1499 from LemmyNet/strictly_type_db_ids
Strictly type db ids
2021-03-19 13:41:22 +00:00
Nutomic e25bcb35d7
Merge pull request #1428 from LemmyNet/split_user_table
Split user table
2021-03-19 13:20:23 +00:00
Dessalines 05b485b678 Merge branch 'Mart-Bogdan-1462-jwt-revocation-on-pwd-change' into jwt_revocation_dess 2021-03-19 00:31:49 -04:00
Dessalines 360d4ea8d1 Merge branch '1462-jwt-revocation-on-pwd-change' of https://github.com/Mart-Bogdan/lemmy into Mart-Bogdan-1462-jwt-revocation-on-pwd-change 2021-03-18 21:41:00 -04:00
Dessalines c06d612432 Merge branch 'split_user_table' into strictly_type_db_ids 2021-03-18 19:37:54 -04:00
Dessalines c88722983e Merge branch 'main' into split_user_table 2021-03-18 19:36:48 -04:00
Nutomic 33a326854a
Set CARGO_HOME for CI so deps arent redownloaded (#1497)
* Set CARGO_HOME for CI so deps arent redownloaded

* run find on x86

* fix path

* cleanup

* try again

* use mv
2021-03-18 16:35:04 -04:00
Dessalines 9930c7288a Merge branch 'split_user_table' into strictly_type_db_ids 2021-03-18 16:30:42 -04:00
Dessalines 8d9fab0389 Merge branch 'main' into split_user_table 2021-03-18 16:30:29 -04:00
Dessalines c3efb9f7cf Strictly typing DB id fields. Fixes #1498 2021-03-18 16:25:21 -04:00
Felix Ableitner 4f7dca7c2b Fix three federation test cases 2021-03-18 17:02:15 +01:00
Dessalines 5899b89ef2 Adding some comments to notifs. 2021-03-18 10:59:17 -04:00
Dessalines 99e5a4d1c3 Moving send email check inside function. 2021-03-18 10:52:25 -04:00
Felix Ableitner b3a5b4eb82 Refactor activitypub code 2021-03-17 18:12:37 +01:00
Felix Ableitner 71067a8cb5 For FromApub trait, use `is_mod_action: bool` instead 2021-03-16 18:26:19 +01:00
Felix Ableitner be00f63fb2 Allow remot moderators to do Remove/Post and Remove/Comment 2021-03-16 18:06:59 +01:00
dessalines db4fe8031c Merge pull request 'Insert announced activities into DB for fetching (fixes #1494)' (#187) from insert-local-announce into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/187
2021-03-16 13:47:32 +00:00
Dessalines 270ce539bf Removing some TODOS. 2021-03-15 18:18:50 -04:00
Dessalines b9f483bc27 Version 0.10.0-rc.5 2021-03-15 14:50:50 -04:00
Dessalines 8ee624a542 Some changes
- Changing claim name to local_user_id to facilitate logout.
- Changing AddAdmin back to using person_id
2021-03-15 14:02:27 -04:00
Felix Ableitner 621355b6ef Insert announced activities into DB for fetching (fixes #1494) 2021-03-15 13:58:54 +01:00
Nutomic 72b5e0cab5
Merge pull request #1491 from LemmyNet/upgrade_pictrs_3
Upgrading pictrs.
2021-03-15 12:14:31 +00:00
Bogdan Mart 74272ed754 more correct tests 2021-03-13 22:36:40 +02:00
Bogdan Mart 4426c3176d fix timestamp condition #1462 2021-03-13 22:18:26 +02:00
Bogdan Mart 7b0a09e84e Merge remote-tracking branch 'origin/main' into 1462-jwt-revocation-on-pwd-change
* origin/main:
  revert Compose file version from 3.3 to 2.2
  Adding more mem limits
  bump memory limit of iframely
  Remove extra category_id s . Fixes #1429
  Fixing wrong user_ and community icon and banner urls.
  Remove category from activitypub context
  Adding a password length check to other API actions. (#1474)
  Update test script
  Use URL type in most outstanding struct fields (#1468)
  Forbid usage of unwrap
  Upgrade Rust version
  Rewrite settings implementation. Fixes #1270 (#1433)
  Rename `lemmy_structs` to `lemmy_api_structs`

# Conflicts:
#	crates/db_schema/src/source/user.rs
2021-03-13 20:19:55 +02:00
Bogdan Mart ab947f1f08 User token revocation upon password change
Added DB column validator_time and chedking that is is less then token's "Issuead at time"
Wip on #1462
2021-03-13 20:16:35 +02:00
Dessalines 5998c83b2a Only sending private message if its a local user. 2021-03-12 15:18:03 -05:00
Dessalines 434fb53dd1 Trying to fix API tests. 2021-03-12 14:09:03 -05:00
Dessalines 75a95acf04 Change joinuser, sendusermessage to use local_user_id 2021-03-12 10:54:47 -05:00
Felix Ableitner de14636e10 Fix code to allow sticky/lock from remote moderators 2021-03-12 16:46:36 +01:00
dessalines 931a132161 Merge pull request 'Add memory limit for pictrs' (#186) from nutomic-patch-1 into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/186
2021-03-12 15:16:49 +00:00
Dessalines 0a7271a185 Upgrading pictrs. 2021-03-12 10:13:20 -05:00
Felix Ableitner de39d57592 WIP: check that modifications are made by same user, add docs 2021-03-12 14:47:55 +01:00
Dessalines 7c039340ed 2nd pass. JWT now uses local_user_id 2021-03-11 17:47:44 -05:00
Felix Ableitner b1ca85b910 Fix clippy warning 2021-03-11 18:18:01 +01:00
Felix Ableitner 50559de6d2 Add check so only mods can change stickied/locked state of posts 2021-03-11 18:11:59 +01:00
Dessalines 7d04f371a5 fixing tests 3 2021-03-11 12:08:30 -05:00
Dessalines 5d8ccbafe4 Fixing some tests 2 2021-03-11 11:54:03 -05:00
Felix Ableitner 803aad3b3e Add check so only author or mods can edit posts/comments 2021-03-11 17:50:47 +01:00
Dessalines 1a4c8c08ee Fixing some tests 2021-03-11 11:41:04 -05:00
Felix Ableitner a2698dea92 Allow for remote mods to remove posts/comments 2021-03-11 17:21:45 +01:00
Dessalines 9cb4dad4b4 A first pass. 2021-03-10 23:43:11 -05:00
Dessalines ddf4a667b1 ~80% done 2021-03-10 17:33:55 -05:00
nutomic fc74bfeb23 Add memory limit for pictrs 2021-03-10 18:38:00 +00:00
Felix Ableitner 3ffae1f5b8 Allow adding remote users as community mods (ref #1061) 2021-03-09 18:14:15 +01:00
Felix Ableitner dcf40db225 Update activitystreams to 0.7.0-alpha.11 2021-03-09 18:14:15 +01:00
Felix Ableitner 9172eff65a Implemented receiving activities to add/remove remote mods 2021-03-09 18:14:15 +01:00
Felix Ableitner 0c484e8c76 Move moderators collection to separate HTTP endpoint 2021-03-09 18:14:15 +01:00
Felix Ableitner beb8b9fe69 Use collection for moderators, instead of `attributedTo` (ref #1061) 2021-03-09 18:14:15 +01:00
Nutomic 8f6b8895f4
Merge pull request #1485 from PatMulligan/fix-docker-compose-yaml
revert Compose file version from 3.3 to 2.2
2021-03-08 15:41:17 +00:00
Patrick Mulligan a650312858 revert Compose file version from 3.3 to 2.2 2021-03-08 09:23:50 -06:00
Dessalines ff2c71a74a Adding more mem limits 2021-03-04 22:41:08 -05:00
Avery Pierce 126c6a23bb bump memory limit of iframely 2021-03-04 08:58:03 -06:00
Nutomic e0c61c1334
Merge pull request #1478 from LemmyNet/fix_wrong_urls
Fixing wrong user_ and community icon and banner urls.
2021-03-04 12:18:30 +00:00
Nutomic f7aa97d45e
Merge pull request #1479 from LemmyNet/fix_extra_categories
Remove extra category_id s . Fixes #1429
2021-03-04 12:14:25 +00:00
Dessalines a1c7584875 Remove extra category_id s . Fixes #1429 2021-03-03 23:44:07 -05:00
Dessalines 817b4ff08e Fixing wrong user_ and community icon and banner urls.
- Fixes #1477
2021-03-03 23:40:00 -05:00
Dessalines ca3c1269f5 Merge branch 'main' of https://github.com/lemmynet/lemmy 2021-03-02 11:52:46 -05:00
dessalines 0a52396706 Merge pull request 'Forbid usage of unwrap' (#179) from clippy-unwrap into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/179
2021-03-02 16:49:19 +00:00
dessalines 7c4969c92b Merge pull request 'Remove category from activitypub context' (#183) from context-remove-category into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/183
2021-03-02 16:48:24 +00:00
dessalines 45a94203f2 Merge pull request 'Update test script' (#182) from update-test-script into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/182
2021-03-02 16:47:58 +00:00
Felix Ableitner 7189328f80 Remove category from activitypub context 2021-03-02 17:12:45 +01:00
Dessalines 134fece36d
Adding a password length check to other API actions. (#1474)
* Adding a password length check to other API actions.

- Fixes #1473

* Fixing comment.
2021-03-02 10:36:10 -05:00
Felix Ableitner 985dbcaada Update test script 2021-03-02 13:57:06 +01:00
Andrew Yoon e78ba38e94
Use URL type in most outstanding struct fields (#1468)
* Use URL type in most outstanding struct fields

This fixes all known remaining cases where url fields are stored as
plain strings, with the exception of form fields where empty strings
are used as sentinels (see `diesel_option_overwrite_to_url`).

Tested for regressions in the federated docker setup attempting to
exercise all changed fields, including through apub federation.

Fixes #1385

* Add migration to fix blank-string post.url values to be null

This also then fixes #602

* Address review feedback

- Fixed some unwraps and err message formatting
- Bumped the `url` library to 2.2.1 to fix a bug with serde error
  messages
- Add unit tests for the two diesel option override functions
- Fix migration teardown by adding a no-op

* Rename lemmy_db_queries::Url to lemmy_db_queries::DbUrl

* fix compile error

* box PostOrComment variants
2021-03-02 12:41:48 +00:00
Felix Ableitner 7f56281c26 Forbid usage of unwrap 2021-03-01 19:24:34 +01:00
dessalines 45e05dac30 Merge pull request 'Upgrade Rust version' (#181) from upgrade-rust into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/181
2021-03-01 18:02:39 +00:00
Felix Ableitner 66946117e1 Upgrade Rust version 2021-03-01 18:46:56 +01:00
Dessalines 462c4a2954
Rewrite settings implementation. Fixes #1270 (#1433)
* A first attempt at using deser-hjson. Fixes #1270

* Trying to fix tests, try 1

* Trying to fix tests, try 2

* A few fixes to deser_hjson

- Removing unwrap_or_defaults, using impl functions.
- Reorganized settings

* Make clippy happy

* hjson list strings must be quoted.

* Adding support for env vars.

* Moving to structs and defaults file.

* Moving settings default and struct.
2021-03-01 17:24:11 +00:00
dessalines 5ce8adcb13 Merge pull request 'Rename `lemmy_structs` to `lemmy_api_structs`' (#180) from rename-structs into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/180
2021-03-01 15:50:45 +00:00
Felix Ableitner 3bdd78f341 Rename `lemmy_structs` to `lemmy_api_structs` 2021-03-01 14:08:41 +01:00
Dessalines b5aa4cf41a
Merge pull request #1465 from arjenpdevries/patch-2
Update README.md
2021-02-27 18:08:58 -05:00
Arjen P. de Vries a5e2463097
Update README.md
Federation is probably more complete than suggested here.

In response to:
https://github.com/LemmyNet/lemmy/issues/647#issuecomment-787068478
2021-02-27 20:26:30 +01:00
Dessalines a869a2823b Still continuing on.... 2021-02-26 08:49:58 -05:00
dessalines ff3e26452a Merge pull request 'Remove federation backward compatibility code (ref #1220)' (#164) from remove-backwards-compatibility into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/164
2021-02-26 13:23:46 +00:00
dessalines da5b27ecc6 Merge pull request 'Remove code for apub compatibility with Lemmy v0.8.9 and older' (#178) from remove-apub-compat-code into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/178
2021-02-26 13:23:07 +00:00
Felix Ableitner c618b4efaa Remove federation backward compatibility code (ref #1220) 2021-02-26 14:06:26 +01:00
Felix Ableitner 4cc341e4aa Remove code for apub compatibility with Lemmy v0.8.9 and older 2021-02-26 14:03:49 +01:00
Nutomic 82d97cf6de
Merge pull request #1455 from ajyoon/fix-flaky-db-tests
Support plain `cargo test` and disable unused doctests for speed
2021-02-25 22:54:40 +00:00
Andrew Yoon 600ae662a5 Support plain `cargo test` and disable unused doctests for speed
Since DB tests execute diesel migrations automatically, concurrent
execution causes flaky failures from simultaneous migrations. This can
be worked around using `cargo test --workspace -- --test-threads=1`,
which is what the CI config does, but this is not intuitive for
newcomer developers and unnecessarily slows down the test suite for
the majority of tests which are safe to run concurrently. This fixes
this issue by integrating with the small test crate `serial_test` and
using it to explicitly mark DB tests to run sequentially while
allowing all other tests to run in parallel.

Additionally, this greatly improves the speed of `cargo test` by
disabling doc-tests in all crates, since these are aren't currently
used and cargo's doc-test pass, even when no doc-tests exist, has
significant overhead. On my machine, this change significantly
improves test suite times by about 85%, making it much more practical
to develop with tools like `cargo watch` auto-running tests.
2021-02-25 15:44:30 -05:00
Dessalines efc9047f87 Done with user->person migrations, now to code. 2021-02-25 14:04:12 -05:00
Dessalines aba32917bd Merge branch 'main' into split_user_table 2021-02-25 12:34:00 -05:00
Dessalines ea3c0e1772 Merge branch 'main' into remove-integration-tests 2021-02-25 11:37:54 -05:00
Dessalines 058052b46c Merge remote-tracking branch 'yerba/main' 2021-02-25 11:36:08 -05:00
dessalines 7c87da012e Merge pull request 'Remove categories (fixes #1429)' (#176) from remove-categories into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/176
2021-02-25 16:35:07 +00:00
Felix Ableitner bf1e859e72 Remove broken actix_rt test 2021-02-25 17:25:31 +01:00
Felix Ableitner 289cef3101 Remove integration tests (fixes #1449) 2021-02-25 16:31:41 +01:00
Nutomic 085c307b8b
Merge pull request #1451 from LemmyNet/update_cargo_chef
Use more recent version of cargo chef.
2021-02-25 15:19:29 +00:00
Felix Ableitner 72783edb17 In remove categories down migration, add default for category 2021-02-25 16:16:02 +01:00
Felix Ableitner 3141ad31de Remove categories (fixes #1429) 2021-02-25 13:22:37 +01:00
dessalines 40ceec9737 Merge pull request 'Better type safety for activity parsing' (#175) from apub-type-safety into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/175
2021-02-24 22:20:15 +00:00
Dessalines 723ec65ac6 Use more recent version of cargo chef. 2021-02-24 17:10:28 -05:00
Felix Ableitner 3ae62573b7 Better type safety for activity parsing 2021-02-24 20:37:27 +01:00
dessalines 6499709221 Merge pull request 'Dont include community in comment `to` field (fixes #1446)' (#174) from no-community-in-comment-to into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/174
2021-02-24 01:03:07 +00:00
Felix Ableitner 813fcabe13 Fix lemmy_dev ansible playbook 2021-02-23 19:35:09 +01:00
Felix Ableitner 92ea9b97dd Dont include community in comment `to` field (fixes #1446) 2021-02-23 19:00:47 +01:00
dessalines 0c9b109bf7 Merge pull request 'Order outbox by published, not id' (#171) from outbox-order-published into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/171
2021-02-22 20:37:06 +00:00
dessalines 2cbd158a11 Merge pull request 'Use `name` field for post titles instead of `summary` (ref #1220)' (#173) from apub-post-name into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/173
2021-02-22 20:36:22 +00:00
dessalines 7dc3ff4544 Merge pull request 'Fix clippy error upper_case_acronyms' (#172) from fix-clippy into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/172
2021-02-22 20:34:22 +00:00
Felix Ableitner 8d5e9f865c Use `name` field for post titles instead of `summary` (ref #1220) 2021-02-22 19:34:41 +01:00
Felix Ableitner 8096765f0e Fix clippy error upper_case_acronyms 2021-02-22 19:04:32 +01:00
Dessalines 8eb81bb153 Updating release version. 2021-02-19 13:11:16 -05:00
Dessalines c81435c994 Version 0.9.9 2021-02-19 13:10:04 -05:00
Nutomic 7548b44d1b
Merge pull request #1442 from LemmyNet/fix_deploy_version_1
Fixing deploy version.
2021-02-19 18:09:27 +00:00
Dessalines bcc8dae16b Fixing deploy version. 2021-02-19 13:05:42 -05:00
Dessalines b014ac44c8 Adding 0.9.8 release notes. 2021-02-19 12:41:51 -05:00
Dessalines a806493bc2 Version 0.9.8 2021-02-19 11:38:24 -05:00
Felix Ableitner b593047fb1 Order outbox by published, not id 2021-02-19 15:59:06 +01:00
Dessalines 9845366a36 Merge remote-tracking branch 'yerba/main' 2021-02-18 16:19:39 -05:00
dessalines 15d0f54a88 Merge pull request 'Specify order for activities query (fixes #1436)' (#169) from outbox-order into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/169
2021-02-18 21:18:26 +00:00
Dessalines 8088055d38
Fix aggregates time columns 2 (#1427)
* Adding a new comment sort. Fixes #1294

* Fixing a migration comment.

* Adding a comment for newest_comment_time_necro

* Make sure federated items set correct aggregates fields in trigger.

- Fixes #1402
2021-02-18 10:53:04 -05:00
Dessalines 0c4b57a6d0
Adding a new comment sort for posts. Fixes #1294 (#1425)
* Adding a new comment sort. Fixes #1294

* Fixing a migration comment.

* Adding a comment for newest_comment_time_necro
2021-02-18 10:38:25 -05:00
Felix Ableitner d3707ad4ef Fix new compiler warning 2021-02-18 16:16:18 +01:00
Felix Ableitner 13a949d9ec Specify order for activities query (fixes #1436) 2021-02-18 16:15:52 +01:00
Nutomic 6f683682c3
Merge pull request #1435 from LemmyNet/fix_lemmy_prod_open_port
Closing open lemmy-ui prod port. Fixes #1430
2021-02-17 16:42:32 +00:00
Dessalines a920bf768e Closing open lemmy-ui prod port. Fixes #1430 2021-02-17 11:26:03 -05:00
Dessalines a183815870 Adding a few more tables. 2021-02-15 14:34:10 -05:00
Dessalines d0bd02eea0 Starting on user_ to person migration. 2021-02-14 13:46:16 -05:00
Dessalines 37ea778776 Merge remote-tracking branch 'origin/main' 2021-02-11 10:31:10 -05:00
dessalines f37fd0ecfd Merge pull request 'Hide followed communities, except for own user (fixes #1303)' (#168) from hide-followed into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/168
2021-02-11 15:31:04 +00:00
Felix Ableitner 3d400ca21d Hide followed communities, except for own user (fixes #1303) 2021-02-11 14:53:17 +01:00
Nutomic 71aa8f3670
Merge pull request #1426 from LemmyNet/rss_link_post
Change RSS feeds to use lemmy URL for the rss link. Fixes #1378
2021-02-11 14:06:29 +01:00
Dessalines 37ad9e9a09 Change RSS feeds to use lemmy URL for the rss link. Fixes #1378 2021-02-10 15:43:03 -05:00
Dessalines 1af906c224 Merge remote-tracking branch 'origin/main' 2021-02-10 15:13:22 -05:00
dessalines f899831ed3 Merge pull request 'Explicitly mark posts and comments as public (ref #1220)' (#167) from comments-posts-public into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/167
2021-02-10 19:45:36 +00:00
Nutomic 08900b5b94
Merge pull request #1422 from LemmyNet/display_name_limit
Display name limit
2021-02-10 16:13:26 +00:00
Dessalines 5a33fce8bd Listing columns. 2021-02-10 11:05:12 -05:00
Dessalines acadf0289e Fixing reason lengths to char counts. 2021-02-10 10:36:22 -05:00
Dessalines 2e5ccaf7fe Fixing display name limit. Fixes #1421 2021-02-10 10:27:48 -05:00
Felix Ableitner 63d9c0ee46 Explicitly mark posts and comments as public (ref #1220) 2021-02-10 14:01:02 +01:00
dessalines 68edda7bf5 Merge pull request 'Move routes into separate crate to speed up compilation' (#166) from move-routes into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/166
2021-02-09 18:44:45 +00:00
Felix Ableitner 999d9f4d6c Move routes into separate crate to speed up compilation 2021-02-09 19:34:36 +01:00
Dessalines ce00677880 Adding v0.9.7 release notes. 2021-02-08 15:24:51 -05:00
Dessalines 5656db3e3d Version 0.9.7 2021-02-08 15:17:56 -05:00
Dessalines c213edf7ee Adding 0.9.6 release notes. 2021-02-06 11:50:31 -05:00
Dessalines a7540b4947 Fixing build / drone badge. 2021-02-05 23:19:23 -05:00
Dessalines 5f112aad44 Fixing image links. #1355 2021-02-05 23:15:02 -05:00
Dessalines f198f281cf Version 0.9.6 2021-02-05 13:01:29 -05:00
Nutomic bf751dc7ab
Merge pull request #1415 from LemmyNet/fed_inbox_url_fix
Fixing inbox url code migration. Fixes #1414
2021-02-05 17:59:56 +00:00
dessalines 6f364e60fa Merge pull request 'Include object id when logging apub errors' (#165) from log-ids into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/165
2021-02-05 17:52:51 +00:00
Dessalines 2b6df63aee Merge remote-tracking branch 'yerba/main' 2021-02-05 12:50:31 -05:00
dessalines def8af7d8a Merge pull request 'Make apub extension fields optional (ref #1220)' (#163) from optional-apub-extensions into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/163
2021-02-05 17:50:42 +00:00
Dessalines 14465b91b1 Fixing inbox url code migration. Fixes #1414 2021-02-05 12:06:32 -05:00
Nutomic d09df9c02b
Merge pull request #1412 from LemmyNet/fix_search_communities_subscribed
Fixing community search not using auth. Fixes #1411
2021-02-05 16:33:06 +00:00
Felix Ableitner 897263e5a3 Include object id when logging apub errors 2021-02-05 17:15:29 +01:00
Dessalines 4864f80656 Fixing community search not using auth. Fixes #1411 2021-02-05 10:36:28 -05:00
Felix Ableitner 105dfc93f1 Make apub extension fields optional (ref #1220) 2021-02-05 14:23:57 +01:00
Dessalines d5d99fa3b9
Moving docs to join.lemmy.ml . Fixes #1396 (#1410)
* Moving docs to join.lemmy.ml . Fixes #1396

* Removing submodule fetch from drone.
2021-02-05 12:30:49 +00:00
Dessalines 8a7e50381f Version 0.9.5 2021-02-04 22:48:21 -05:00
Dessalines f45f2ec202 Removing old lemmy schema. 2021-02-04 11:35:20 -05:00
nutomic 1a4e35eb50 Store activitypub endpoints in database (#162)
Address review comments

Store Activitypub urls in database (fixes #808)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/162
Co-Authored-By: nutomic <nutomic@noreply.yerbamate.ml>
Co-Committed-By: nutomic <nutomic@noreply.yerbamate.ml>
2021-02-04 16:34:58 +00:00
Dessalines ed8a12f96f Some updates to 0.9.4 release. 2021-02-02 16:01:08 -05:00
Dessalines 525fdcf73c Some updates to 0.9.4 release. 2021-02-02 15:57:45 -05:00
Dessalines 840ab7cba4 Adding pre-release notes. 2021-02-02 15:45:02 -05:00
Dessalines 9415bec557 Version 0.9.4 2021-02-02 15:29:38 -05:00
Dessalines 712d497a2d Merge branch 'main' of https://github.com/lemmynet/lemmy 2021-02-02 11:13:31 -05:00
Nutomic dbc94af51d
Merge pull request #1406 from LemmyNet/upgrade_deps
Trying to upgrade lemmys deps.
2021-02-02 15:17:11 +00:00
Dessalines 86d8c9b18e Adding awesome-humane-tech to readme. #1394 2021-02-02 09:35:56 -05:00
Dessalines 1857f02af8 Moving back tokio and reqwest. 2021-02-01 21:54:23 -05:00
Dessalines 10f0b3b877 Trying to upgrade lemmys deps. 2021-02-01 15:56:37 -05:00
Dessalines 0be9b5bddb
Add allowed and blocked instances to the federated_instances response. (#1398)
- Fixes #1315
2021-02-01 13:11:37 -05:00
Dessalines 6bb4f0b41f
Adding forum sort for post_aggregates. Fixes #1312 (#1400)
* Adding forum sort for post_aggregates. Fixes #1312

* Changing sort name from forum to MostComments.
2021-02-01 11:53:44 -05:00
Dessalines f4d33389a5
Merge pull request #1401 from LemmyNet/non_null_post_view_vote
Post and comment vote views now return 0 instead of null.
2021-02-01 10:43:34 -05:00
Nutomic c8254dc0a8
Merge pull request #1399 from LemmyNet/dont_let_banned_users_follow
Make sure banned users cant subscribe, and the ban unsubs them. Fixes…
2021-02-01 12:19:41 +00:00
Nutomic 6b36bf772e
Merge pull request #1397 from LemmyNet/parent_comment_check
Add check for parent comment. Fixes #1390
2021-02-01 12:13:18 +00:00
Dessalines d2ba2960dd Post and comment vote views now return 0 instead of null.
- Fixes #1389
2021-01-31 10:29:21 -05:00
Dessalines cd08fdf76f Make sure banned users cant subscribe, and the ban unsubs them. Fixes #1324 2021-01-30 23:55:14 -05:00
Dessalines aecb2411d8 Add check for parent comment. Fixes #1390 2021-01-30 23:10:16 -05:00
Nutomic 9609bd99bb
Add readme link to translation instructions for documentation (#1392)
* Add readme link to translation instructions for documentation

* Fix contributing link in readme
2021-01-30 12:00:33 -05:00
Anton Kuzmin 5102cdddc1
rename lemmer to remmel (#1391) 2021-01-30 11:51:38 -05:00
Dessalines 3a05817b41 Version 0.9.3 2021-01-29 14:25:20 -05:00
Dessalines 51465bc0d7 Nodeinfo devs think halfyear is one word. 2021-01-29 14:24:10 -05:00
Dessalines 2322534648 Version 0.9.2 2021-01-29 13:49:43 -05:00
Dessalines 3f23e0e6b9 Adding camelCase to node-info users. 2021-01-29 13:48:59 -05:00
Dessalines e6a16f08a3 Version 0.9.1 2021-01-29 11:43:16 -05:00
Dessalines 0fd0279543
Adding some recurring lemmy tasks. (#1386)
* Adding some recurring lemmy tasks.

- Add active users by day, week, month, and half year to site and
  community. Fixes #1195
- Periodically re-index the aggregates tables that use hot_rank.
  Fixes #1384
- Clear out old activities (> 6 months). Fixes #1133

* Some cleanup, recalculating actives every hour.
2021-01-29 11:38:27 -05:00
dessalines f5e58c8bf5 Merge pull request 'Increase MAX_REQUEST_NUMBER for fetches to 25' (#161) from fetch-limit into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/161
2021-01-29 15:52:23 +00:00
Felix Ableitner 5f59d7ba5f Increase MAX_REQUEST_NUMBER for fetches to 25 2021-01-29 16:45:28 +01:00
Dessalines 62a145d8b3 Merge remote-tracking branch 'yerba/outbox-activities' 2021-01-29 09:17:14 -05:00
Felix Ableitner c09c462a6e Serve activities in community outbox (fixes #1216) 2021-01-29 14:48:42 +01:00
Nutomic 3d578f9df2
Use Url type for ap_id fields in database (fixes #1364) (#1371) 2021-01-27 11:42:23 -05:00
Dessalines 363ceea5c7 Fixing some readme links. Fixes #1382 2021-01-26 14:49:15 -05:00
Felix Ableitner c51f750831 Use Url type for ap_id fields in database (fixes #1364) 2021-01-26 18:52:18 +01:00
Dessalines cf911c023d
Add listing type to list communities (#1380)
* Adding listing type to ListCommunities. Fixes #1379

* Upgrading lemmy-js-client.
2021-01-26 12:18:01 -05:00
Nutomic ea59cf16e8
Merge pull request #1381 from LemmyNet/fix_mod_bans_and_adds
Fixing modlog not showing bans and adds. Fixes #1376
2021-01-26 16:57:49 +00:00
Dessalines 91d210ce79 Fixing modlog not showing bans and adds. Fixes #1376 2021-01-26 11:45:36 -05:00
Dessalines f0dcc3a104 Updating releases.md 2021-01-25 09:44:33 -05:00
Dessalines b2d6b554e8 Fixing release docs location. 2021-01-25 00:10:27 -05:00
Dessalines 1addbe361a Version 0.9.0 2021-01-24 22:43:52 -05:00
Dessalines 97617d699d
Docker manifest arm amd64 deploy (#1367)
* A first try at docker manifest. 1.

* Fixing api version location

* Version 0.9.0-rc.13

* Test docker.

* Test docker 2.

* Test docker 3.

* Test docker 4.

* Test docker 5.

* Test docker 6.

* Test docker 7.

* Test docker 8.

* Test docker 9.

* Test docker 10.

* Test docker 11.

* Test docker 12.

* Version 0.9.0-rc.14

* Test docker 13.

* Test docker 14.

* Version 0.9.0-rc.15

* Test docker 15.

* Version 0.9.0-rc.16

* Test docker 16.

* Version 0.9.0-rc.17
2021-01-24 22:44:35 -05:00
Dessalines ac969dc737 Adding 0.9.0 Release notes. 2021-01-24 22:40:39 -05:00
Dessalines c014bef84d Updating docs locations. 2021-01-23 14:56:41 -05:00
Dessalines f2f9f5776c Merge branch 'uuttff8-main' 2021-01-22 13:35:12 -05:00
Dessalines cb9c354c28 Updating to add lemmer. 2021-01-22 13:34:48 -05:00
Anton Kuzmin b1fb90ff6d add lemmer 2021-01-22 21:32:00 +03:00
Dessalines ee03cf8ae9
Explicit error http status codes (#1362)
* Trying to type specific errors.

* Using @asonix 's downcast method.
2021-01-21 16:32:19 +00:00
dessalines a01af67948 Merge pull request 'Move most code into crates/ subfolder' (#159) from crates-folder into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/159
2021-01-20 15:40:03 +00:00
Felix Ableitner 3b64c58198 Move most code into crates/ subfolder 2021-01-20 16:21:27 +01:00
Dessalines 88284a999e
Merge pull request #1328 from LemmyNet/move_views_to_diesel
Move SQL views to diesel
2021-01-20 10:01:53 -05:00
Dessalines 856802ef35 Version 0.9.0-rc.12 2021-01-19 09:37:26 -05:00
Dessalines 24c78de5f0
Merge pull request #1358 from LemmyNet/v2_api_additions_1
A few API v2 changes based on nutomic's suggestions.
2021-01-19 09:35:43 -05:00
Dessalines 1de8a4606a A few API v2 changes based on nutomic's suggestions.
- Changed `edit_id` s to their type (comment_id)
- Moved websocket actions to their own file in structs and api.
- Got rid of UserViewDangerous, added UserSafeSettings.
  - GetSite now returns UserSafeSettings for `my_user`.
- Got rid of `admin` field in `Register`.
2021-01-18 16:57:31 -05:00
Dessalines 672d4507b2 Removing check documentation build from drone, now that's in lemmy-docs. 2021-01-18 11:08:53 -05:00
Dessalines 25dd1a21e2
Try arm fix (#1356)
* Trying to fix arm build.

* Version 0.9.0-rc.8

* Trying to fix arm build 2.

* Version 0.9.0-rc.9

* Checking time when removing lto.

* Version 0.9.0-rc.10

* Adding back in arm tests.

* Version 0.9.0-rc.11
2021-01-18 13:04:32 +00:00
Dessalines 6f2954dffd Version 0.9.0-rc.7 2021-01-15 13:32:10 -05:00
Dessalines 8cfee9ca7d Trying to fix arm build. 2021-01-15 13:31:10 -05:00
Dessalines b124a29e05 Version 0.9.0-rc.6 2021-01-15 12:44:34 -05:00
Dessalines b3163f99f4
Merge pull request #1344 from LemmyNet/remove_travis_and_federation_docker
Removing docker/federation and docker/travis folders.
2021-01-15 12:40:34 -05:00
Dessalines fe4b516bd9 Adding back in federation docker-compose lemmy-ui writing 2021-01-15 12:38:44 -05:00
Dessalines f0d928a433 Removing tag generation from drone. 2021-01-15 12:28:49 -05:00
Dessalines edf0fd4381 Merge branch 'move_views_to_diesel' into remove_travis_and_federation_docker 2021-01-15 11:28:21 -06:00
Dessalines 1de737b7a3
Merge pull request #1352 from LemmyNet/ci-on-arm
Add drone CI for arm
2021-01-15 12:10:37 -05:00
Dessalines 29ec5d4855
Merge pull request #1353 from LemmyNet/move-coc
Code of conduct moved to documentation
2021-01-15 12:09:26 -05:00
Dessalines 381fd82c13
Merge pull request #1351 from LemmyNet/shorten-slur-filter
Shorten slur filter to avoid false positives (fixes #535)
2021-01-15 12:03:53 -05:00
Dessalines 8f61a148f6 Fixing comment count necro-bump issue. 2021-01-15 11:58:56 -05:00
Felix Ableitner a4f6ca0c9c Code of conduct moved to documentation 2021-01-15 17:49:23 +01:00
Felix Ableitner 15710a0595 Shorten slur filter to avoid false positives (fixes #535) 2021-01-15 17:31:14 +01:00
Felix Ableitner f06b71d961 Add drone CI for arm 2021-01-15 15:24:48 +01:00
Dessalines ccd2b9eb75 Fixing a stackoverflow error with url searching. 2021-01-14 23:56:53 -05:00
Dessalines c8a8670aec Merge branch 'move_views_to_diesel' of https://github.com/lemmynet/lemmy into move_views_to_diesel 2021-01-14 19:16:02 -06:00
dessalines 110167f085 Ensure that comments are always delivered to the parent creator (fixes #1325) (#156)
Don't send activities to ourselves

Ensure that comments are always delivered to the parent creator (fixes #1325)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/156
Co-Authored-By: dessalines <dessalines@noreply.yerbamate.ml>
Co-Committed-By: dessalines <dessalines@noreply.yerbamate.ml>
2021-01-15 01:18:18 +00:00
Dessalines 66102fb2d4
Merge pull request #1349 from LemmyNet/site_counts_local
Report only local counts in site_view.
2021-01-14 16:10:26 -05:00
Dessalines 4fdcb57753 Report only local counts in site_view.
- Move open_registrations under top level.
- Fixes #1340
2021-01-14 15:22:07 -05:00
dessalines 8b4a16a3f3 Merge pull request 'Add compilation benchmark, move scripts into subfolder' (#158) from compilation-benchmark into move_views_to_diesel
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/158
2021-01-14 18:14:09 +00:00
Felix Ableitner 5c198ea85d Add compilation benchmark, move scripts into subfolder 2021-01-14 18:04:01 +01:00
Dessalines 15c5e5c502 Merge branch 'move_views_to_diesel' into remove_travis_and_federation_docker 2021-01-13 14:20:21 -05:00
Dessalines 116d908002 Restoring docker-compose and nginx in federation folder. 2021-01-13 14:18:26 -05:00
Dessalines 0c932e3ace Merge remote-tracking branch 'yerba/move_views_to_diesel' into move_views_to_diesel 2021-01-13 13:16:25 -05:00
dessalines 6a04aaca55 Merge pull request 'Set debug=0 in cargo.toml to speed up builds' (#157) from debug-false into move_views_to_diesel
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/157
2021-01-13 18:17:04 +00:00
Felix Ableitner a10974ed6e Set debug=0 in cargo.toml to speed up builds 2021-01-13 18:10:21 +01:00
Dessalines cd19a72c41 Version 0.9.0-rc.4 2021-01-13 12:05:56 -05:00
Dessalines 36976acb2f Another notifs fix. 2021-01-13 12:04:00 -05:00
Dessalines 4677d3d782 Updating docs. 2021-01-13 12:03:26 -05:00
Dessalines 82227846af Fixing top level replies, and notifs. 2021-01-13 12:01:42 -05:00
Dessalines eafdf3033f Version v0.9.0-rc.2 2021-01-12 19:29:48 -05:00
Dessalines d54be4ed7f Trying autotag 2021-01-12 19:26:32 -05:00
Dessalines a1e5d0fd00 Version v0.9.0-rc.1 2021-01-12 18:59:07 -05:00
Dessalines d4e800175f Merge branch 'move_views_to_diesel' into remove_travis_and_federation_docker 2021-01-12 11:56:24 -05:00
Dessalines 39001af9a0 Merge remote-tracking branch 'yerba/move_views_to_diesel' into move_views_to_diesel 2021-01-12 11:12:54 -05:00
Dessalines c6357f3c86
Deletion on fetch (#1345)
* Delete local object on fetch when receiving HTTP 410, split fetcher (fixes #1256)

* Removing submodules

* Trying to re-init submodule

* Trying to re-init submodule 2

* Trying to re-init submodule 3

* Logging line.

* Removing submodules

* Adding again.

* Adding again 2.

* Adding again 3.

* Adding again 4.

* Adding again 5.

* Adding again 6.

* Adding again 7.

* Adding again 8.

* Adding again 9.

* Add more clippy lints, remove dbg!() statement

* Adding again 10.

* Adding again 11.

* Adding again 12.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2021-01-12 11:12:41 -05:00
dessalines 4eedc31893 Merge pull request 'Include fix for mdbook xss vulnerability' (#155) from mdbook-xss into move_views_to_diesel
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/155
2021-01-12 15:57:27 +00:00
Dessalines 3d4cc32525 Adding back start-local-instances. 2021-01-12 10:42:34 -05:00
Dessalines 7db754e94c Revert "Revert "Removing docker/federation and docker/travis folders.""
This reverts commit e483b6b51f.
2021-01-12 10:40:38 -05:00
Dessalines e483b6b51f Revert "Removing docker/federation and docker/travis folders."
This reverts commit 689f5c1306.
2021-01-12 10:39:15 -05:00
Dessalines 689f5c1306 Removing docker/federation and docker/travis folders. 2021-01-11 20:41:10 -05:00
Felix Ableitner fec77d583f Include fix for mdbook xss vulnerability 2021-01-09 17:54:31 +01:00
Dessalines 7a97fc370b Adding stickied to post_aggregates.
- Added more indexes to account for sorting by stickied first.
- Changed all order bys in the diesel views to use post_aggregates.
2021-01-07 16:22:17 -05:00
Dessalines b9b51c2dfc Fixing some minor websocket things. 2021-01-07 01:17:42 -05:00
Dessalines ceae7eb47a Private message query debugging. 2021-01-06 16:02:08 -05:00
Dessalines 1c113f915e Logging post query. 2021-01-06 13:23:05 -05:00
Dessalines 514f4011ba Adding docs commit. 2021-01-06 00:49:24 -05:00
Dessalines a56977f4c5 Trying to get mdbooks to build. 2021-01-06 00:34:26 -05:00
Dessalines 86dfe456fd Merge branch 'main' into move_views_to_diesel 2021-01-06 00:30:29 -05:00
Nutomic 50e7275c3b
Move docs into submodule (fixes #1342) (#1343) 2021-01-06 00:27:58 -05:00
Dessalines 1e0c32f7a3 Merge branch 'main' into move_views_to_diesel 2021-01-05 23:55:02 -05:00
Dessalines d227000de3 Halfway done with hot rank indexes. 2021-01-05 23:42:48 -05:00
Dessalines 61c6f33103 Trying to fix save user settings. 2021-01-04 14:09:53 -05:00
Felix Ableitner d300968ee8 Return http status code 410 with apub tombstone (ref #1256) 2021-01-04 19:53:15 +01:00
Felix Ableitner 7bc9434596 Fix integration tests (except one) 2021-01-04 18:32:33 +01:00
dependabot[bot] 632d8f384a
Bump node-notifier from 8.0.0 to 8.0.1 in /api_tests (#1332)
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 11:29:04 -05:00
Felix Ableitner bcb0c381e5 Merge remote-tracking branch 'github/main' into main 2021-01-04 17:23:06 +01:00
D.Loh dd069de519
add User_ missing field 'deleted' in tests (#1338)
per rust-analyzer tips
2021-01-04 10:26:43 -05:00
Dessalines 418eb8025c Changing default_sort and listing back to numbers. 2020-12-25 22:22:25 -05:00
Dessalines 9ab3a9d072 Add clippy check tests to drone. 2020-12-23 19:42:42 -05:00
Dessalines 4c681eb48b Merge remote-tracking branch 'origin/split-db-workspace2' into move_views_to_diesel_split_2 2020-12-23 19:09:41 -05:00
Dessalines 58281208b9 Adding community_view to PostResponse.
- Changing to_vec function name.
2020-12-23 16:56:20 -05:00
Felix Ableitner 5a16d43fef Run cargo clippy in CI on whole workspace 2020-12-22 13:03:50 +01:00
Felix Ableitner 95e30f0e08 Split up lemmy_db_views, put lemmy_rate_limit into lemmy_utils 2020-12-22 00:34:54 +01:00
Felix Ableitner d5efebbf47 Split lemmy_db into lemmy_db_queries, lemmy_db_aggregates and lemmy_db_views 2020-12-21 17:39:11 +01:00
Dessalines e5a65d5807 Upgrading deps. 2020-12-21 09:34:59 -05:00
Dessalines 1a0d1f64f0 Merge remote-tracking branch 'origin/split-db-workspace' into move_views_to_diesel_split 2020-12-21 09:28:20 -05:00
Felix Ableitner bd06dd53e3 remove timing files added by accident 2020-12-21 14:53:27 +01:00
Felix Ableitner 5231666465 Move remaining structs from lemmy_db::source to lemmy_db_schema 2020-12-21 14:38:34 +01:00
Felix Ableitner a7e231b35b Move community to lemmy_db_schema 2020-12-21 13:28:12 +01:00
Dessalines e25436576a Fixing some clippy warnings. 2020-12-20 23:00:33 -05:00
Dessalines 8e1f41f1e4 Removing cargo check from drone, clippy already runs check. 2020-12-20 22:50:43 -05:00
Dessalines 04ce64e9b6 Adding to clippy 2020-12-20 22:42:29 -05:00
Dessalines 2aa8de87b2 Trying other drone checks. 2020-12-20 22:37:01 -05:00
Dessalines 929f1d02b5 Fixing integration tests. 2020-12-20 22:27:27 -05:00
Dessalines d767dd998e Merge branch 'drone-io-dess' into move_views_to_diesel_drone 2020-12-20 21:48:29 -05:00
Dessalines 5af8257e19 Changing unit tests to api v2. 2020-12-20 16:16:57 -05:00
Dessalines a27b7f8d1f Fix site aggs. 2020-12-20 00:09:20 -05:00
Dessalines 2d7d9cf7d8 Some API cleanup, adding site_id to site aggregates. 2020-12-19 20:10:47 -05:00
Felix Ableitner f842bbff8d Move user to lemmy_db_schema, create traits for impls 2020-12-18 19:38:32 +01:00
Felix Ableitner 114f3cbfb5 Move comment, post definitions into lemmy_db_schema 2020-12-18 18:27:25 +01:00
Dessalines 3f36730dba Fixing unit tests. 2020-12-18 12:25:27 -05:00
Felix Ableitner 089d812dc8 Split lemmy_db into separate workspaces 2020-12-18 17:17:44 +01:00
Dessalines 9d0709dfe8 Trying again. 2020-12-17 21:55:15 -05:00
Dessalines 2e5297e337 Trying again. 2020-12-17 21:36:59 -05:00
Dessalines 5c266302c5 Adding unfollows. 2020-12-17 21:10:20 -05:00
Dessalines 6cc148f6a6 Trying again. 2020-12-17 16:02:35 -05:00
Dessalines 1607930d07 Trying again. 2020-12-17 16:00:51 -05:00
Dessalines 1a4e2f4770 Trying again. 2020-12-17 15:59:25 -05:00
Dessalines caaf6b178b Trying again. 2020-12-17 15:35:28 -05:00
Dessalines 6d96f105c6 Dropping the unecessary views and table triggers. 2020-12-17 15:29:10 -05:00
Dessalines 583808d5e7 Trying again. 2020-12-17 14:59:53 -05:00
Dessalines 5768a4eda7 Trying again. 2020-12-17 14:36:22 -05:00
Dessalines 4997d4b0b5 Trying again. 2020-12-17 14:23:15 -05:00
Dessalines 179709cc09 Fixing drone tests. 2020-12-17 14:01:33 -05:00
dessalines 44b72ccbd6 Merge pull request 'Create empty inbox collections for actors (ref #1322)' (#151) from actor-inbox into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/151
2020-12-17 14:51:23 +00:00
dessalines 5b2fb07e44 Merge pull request 'Use correct content-type headers for apub inbox (ref #1220)' (#150) from inbox-headers into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/150
2020-12-17 14:44:08 +00:00
Dessalines 4c79e26078 Updating deps. 2020-12-17 09:13:12 -05:00
Felix Ableitner 4bf0ec94c8 Create empty inbox collections for actors (ref #1322) 2020-12-17 14:22:51 +01:00
Dessalines 4f5e51beb5 Removing fast tables and old views. 2020-12-16 22:42:25 -05:00
Dessalines 05c3e471ae Adding report views. 2020-12-16 22:03:03 -05:00
Dessalines 1cf520254d Adding private message view. 2020-12-16 17:16:48 -05:00
Dessalines 313f0467c8 Adding moderator views. 2020-12-16 16:28:18 -05:00
Dessalines bd6a4a54a9 Merge branch 'main' into move_views_to_diesel 2020-12-16 14:01:16 -05:00
Dessalines 57c2f2ef1c Getting rid of terrible boxedjoin types. 2020-12-16 13:59:43 -05:00
Felix Ableitner db0a51de2a Handle long activitystreams header in nginx config (ref #1322) 2020-12-16 18:24:14 +01:00
Dessalines 711db4c790 Removing old user_mention_view. 2020-12-16 11:09:21 -05:00
Felix Ableitner cbd02f2a87 Use correct content-type headers for apub inbox (ref #1220) 2020-12-16 16:30:44 +01:00
eiknat 036161cb38
add on_conflict clauses to common unique constraint failures (#1264)
* add on_conflict clauses to common unique constraint failures

* user mention: change create conflict to do_update
2020-12-16 09:42:57 -05:00
Nutomic c947539301
Add docs for creating custom lemmy frontend (#1319) 2020-12-16 09:03:21 -05:00
Dessalines 471abf7f29 Removing old comment_view. 2020-12-15 14:39:18 -05:00
Dessalines e4714627a4 Beginning to add new comment_view. 2020-12-15 10:28:25 -05:00
Felix Ableitner 998e824bd8 Add IP forwarding headers to nginx config (fixes #1318) 2020-12-15 15:01:37 +01:00
Felix Ableitner e492cce206 Allow running docker-less federation tests locally 2020-12-15 14:58:11 +01:00
Felix Ableitner d5955b60c0 silence lemmy output in federation logs 2020-12-14 18:01:12 +01:00
Felix Ableitner f33577b317 send activities sync for tests 2020-12-14 17:44:27 +01:00
Felix Ableitner a455e8c0ab add pictrs and iframely, read docker hub login from secrets 2020-12-14 17:01:40 +01:00
Dessalines 79a960d8a5 Merge branch 'main' into move_views_to_diesel 2020-12-13 12:07:11 -05:00
Dessalines f456f5da46 Re-organizing source tables into a different folder. 2020-12-13 12:04:42 -05:00
Dessalines ccd26bfcd7 Trying to fix post test again. 2020-12-12 10:45:14 -05:00
Dessalines f6ba6d5590 Trying to fix post test again. 2020-12-12 10:28:28 -05:00
Dessalines dfe17662df Trying to fix post test again. 2020-12-12 09:39:41 -05:00
Dessalines 28c217eb66 Trying to fix post test again. 2020-12-11 23:20:18 -05:00
Dessalines d594005d49 Trying to fix post test again. 2020-12-11 20:20:14 -05:00
Dessalines 4410d2e44d Trying to fix post test again. 2020-12-11 19:59:45 -05:00
Dessalines 5dff60adc5 Trying to fix post test again. 2020-12-11 16:26:44 -05:00
Dessalines 9e5824df85 Trying to fix post test. 2020-12-11 15:24:28 -05:00
Felix Ableitner 543be801ab disable debug log 2020-12-11 20:56:14 +01:00
Felix Ableitner ab6b28ee60 use dash 2020-12-11 20:39:54 +01:00
Dessalines bdd264cd5e Adding tests for post aggregates. 2020-12-11 13:07:27 -05:00
Felix Ableitner 5ae3f59092 fix warning 2020-12-11 18:43:34 +01:00
Felix Ableitner 0c89e9c2d6 use hosts file 2020-12-11 18:22:16 +01:00
Felix Ableitner 30a1a69850 setup db 2020-12-11 18:09:47 +01:00
Felix Ableitner e7a5eff061 try debug build again 2020-12-11 17:58:03 +01:00
Felix Ableitner 446ae301f8 syntax 2020-12-11 17:48:57 +01:00
Felix Ableitner 2dd3eee0dd fix paths, try debug 2020-12-11 17:46:50 +01:00
Felix Ableitner 9c7f2cb0c3 fix bin path 2020-12-11 17:33:55 +01:00
Felix Ableitner b61bfcefa7 find the binary 2020-12-11 17:27:18 +01:00
Felix Ableitner 9cb7680211 fix release build? 2020-12-11 17:20:29 +01:00
Felix Ableitner 20115444b6 syntax 2020-12-11 17:02:24 +01:00
Felix Ableitner 7c12b1026c faster release build 2020-12-11 17:01:05 +01:00
Dessalines 35bf50ab15 Removing old postview. 2020-12-11 10:27:33 -05:00
Felix Ableitner 5b376de5f5 need to use release bin 2020-12-11 16:25:20 +01:00
Felix Ableitner 2259b7ebc2 try release build 2020-12-11 16:15:48 +01:00
Felix Ableitner d859844fea use apk add, remove diesel migrate from test.sh 2020-12-11 15:56:20 +01:00
Felix Ableitner a56db9a47c cargo fmt 2020-12-11 15:45:29 +01:00
Felix Ableitner cbe5cf8ca0 try to run migrations on db connection in tests 2020-12-11 15:41:39 +01:00
Felix Ableitner 6075f7d2f1 try again with full path 2020-12-11 15:31:19 +01:00
Felix Ableitner 55e3f370fd need to use rust image 2020-12-11 15:28:36 +01:00
Felix Ableitner b11b3f4fad set rustfmt path 2020-12-11 15:22:12 +01:00
Felix Ableitner 135d654999 another try 2020-12-11 15:20:15 +01:00
Felix Ableitner 6d1053b8e5 put full path 2020-12-11 15:15:36 +01:00
Felix Ableitner 71d3457b82 try rustfmt 2020-12-11 15:14:17 +01:00
Felix Ableitner 6fec2e56f6 use nightly image for fmt 2020-12-11 15:05:46 +01:00
Felix Ableitner d9f0aa223a need nightly for fmt 2020-12-11 15:02:50 +01:00
Felix Ableitner 8b0374cc4e also check formatting, more extensive cargo check 2020-12-11 14:57:43 +01:00
Felix Ableitner 08748bbede try to init db from lemmy in tests 2020-12-11 14:49:10 +01:00
Felix Ableitner 7e7e27a7eb build diesel cli in same step 2020-12-11 14:28:14 +01:00
Felix Ableitner 77b7511235 try tests without diesel migration run 2020-12-11 14:16:14 +01:00
Felix Ableitner df2ec0aa38 try running federation tests in same alpine version 2020-12-11 14:13:30 +01:00
Dessalines afc79ce0e3 Adding a viewtovec trait. 2020-12-10 20:39:42 -05:00
Dessalines eef93440d0 Starting to add post_view. 2020-12-10 15:53:49 -05:00
Felix Ableitner 4fd6b5f5e1 fix script location 2020-12-10 21:36:50 +01:00
Felix Ableitner 405e7eff27 try to fix federation test 2020-12-10 21:14:05 +01:00
Felix Ableitner 606bfa89b6 add sudo 2020-12-10 21:03:32 +01:00
Felix Ableitner 964332db12 build diesel as root 2020-12-10 20:57:28 +01:00
Felix Ableitner f7cdadc9c2 compile diesel_cli as root (fails for some reason) 2020-12-10 20:51:51 +01:00
Felix Ableitner e64f196c0d try with chown 2020-12-10 20:45:14 +01:00
Felix Ableitner ed29e3d934 enable all steps, add comments 2020-12-10 20:30:02 +01:00
Felix Ableitner a7413723b4 fix 2020-12-10 20:27:38 +01:00
Felix Ableitner 11c9559ef8 check rust version 2020-12-10 20:27:06 +01:00
Felix Ableitner 7af4a60ec4 change dir to read config 2020-12-10 20:19:17 +01:00
Felix Ableitner 7b2c59bd98 use bash, install psql 2020-12-10 20:06:09 +01:00
Felix Ableitner 861e38d157 needs apt-get then 2020-12-10 20:00:27 +01:00
Felix Ableitner 580e397525 dont use alpine for federation test 2020-12-10 19:50:41 +01:00
Felix Ableitner 7717deda0e more debug 2020-12-10 18:57:09 +01:00
Felix Ableitner cdcbef088d more debugging 2020-12-10 18:50:15 +01:00
Felix Ableitner fadb2b46f5 try to run as root 2020-12-10 18:44:43 +01:00
Felix Ableitner a30199d879 ls lemmy bin 2020-12-10 18:38:53 +01:00
Felix Ableitner 6ff7debbdf enable cargo build 2020-12-10 18:32:26 +01:00
Felix Ableitner f8a196faaf use apk 2020-12-10 18:31:28 +01:00
Felix Ableitner 94d6ceb4df install bash and curl 2020-12-10 18:29:13 +01:00
Felix Ableitner 200913f631 try with sh 2020-12-10 18:26:50 +01:00
Felix Ableitner 53c4aab6af execute with bash 2020-12-10 18:23:04 +01:00
Felix Ableitner dd6b539119 ls -la 2020-12-10 18:16:44 +01:00
Felix Ableitner e0bbb58ec5 fix script name 2020-12-10 18:10:29 +01:00
Felix Ableitner 048ada462b fix command 2020-12-10 18:05:53 +01:00
Felix Ableitner e849b22d3c change image for create tags 2020-12-10 18:04:42 +01:00
Felix Ableitner f76f742ba7 implement federation test in bash 2020-12-10 18:03:11 +01:00
Felix Ableitner c939954f84 use node docker image 2020-12-10 17:46:36 +01:00
Felix Ableitner 56bea54536 also install nodejs 2020-12-10 17:37:00 +01:00
Felix Ableitner 9793a0e521 install correct yarn package 2020-12-10 17:33:23 +01:00
Felix Ableitner a8e0eee7df install yarn 2020-12-10 17:28:09 +01:00
Felix Ableitner ad75f9de4b fix syntax again 2020-12-10 17:25:17 +01:00
Felix Ableitner 2c60215156 remove comments 2020-12-10 17:23:14 +01:00
Felix Ableitner def5276f84 fix syntax 2020-12-10 17:22:36 +01:00
Felix Ableitner 6391ec16ed try federation tests 2020-12-10 17:20:44 +01:00
Felix Ableitner a94fd6aaf6 try without auth 2020-12-10 14:05:03 +01:00
Felix Ableitner f9bd72e1ee try docker release build 2020-12-10 13:55:38 +01:00
Felix Ableitner 841ad8476c disable broken tests 2020-12-10 13:47:46 +01:00
Felix Ableitner 4eced2518c try caching 2020-12-10 13:33:24 +01:00
Felix Ableitner 331985f0a0 start postgres later 2020-12-10 13:24:16 +01:00
Felix Ableitner 37fc1d721f use volume for diesel cli 2020-12-10 13:21:34 +01:00
Felix Ableitner 82c3778082 change step order for better caching 2020-12-10 13:14:32 +01:00
Felix Ableitner 2d0bf7d40d full diesel path 2020-12-10 13:11:05 +01:00
Felix Ableitner fc382e20e1 install diesel_cli 2020-12-10 13:06:10 +01:00
Felix Ableitner a2cd1ff367 set DATABASE_URL, run diesel migration, separate steps 2020-12-10 13:00:31 +01:00
Felix Ableitner 2d88dfdaef run a query 2020-12-10 12:34:56 +01:00
Felix Ableitner b5b670b8b9 try db connection with psql 2020-12-10 12:31:59 +01:00
Felix Ableitner e02d0f39ec retry service env 2020-12-10 02:10:17 +01:00
Felix Ableitner 003852f884 try to fix postgres service 2020-12-10 02:03:29 +01:00
Felix Ableitner 69c2fe19e4 remove docker socket mount 2020-12-10 01:44:11 +01:00
Felix Ableitner b79c10c122 apt-get -y 2020-12-10 01:26:45 +01:00
Felix Ableitner 94ab4f6164 apt update 2020-12-10 01:24:28 +01:00
Felix Ableitner af2a27935b add espeak and postgres client 2020-12-10 01:23:47 +01:00
Felix Ableitner 5b34d2be6c fix test, run clippy 2020-12-10 00:55:14 +01:00
Felix Ableitner ec13759ca6 use alt docker image 2020-12-10 00:24:14 +01:00
Felix Ableitner b7563bfbf5 set toolchain 2020-12-10 00:17:55 +01:00
Felix Ableitner 7aa686b650 build as root 2020-12-10 00:16:50 +01:00
Felix Ableitner d0e730fed4 perm issues 2 2020-12-10 00:13:53 +01:00
Felix Ableitner 58850a0b0c permission issues 2020-12-10 00:13:21 +01:00
Felix Ableitner ef22f70e18 syntax again 2020-12-10 00:00:43 +01:00
Felix Ableitner 88cd8b2d74 syntax 2020-12-09 23:59:45 +01:00
Felix Ableitner 84ac188cee cargo test + service 2020-12-09 23:58:50 +01:00
Felix Ableitner cdc7df8625 fix 2020-12-09 23:18:52 +01:00
Felix Ableitner 2d011468b4 remove comment 2020-12-09 23:18:10 +01:00
Felix Ableitner 4557f2b03d make debug build 2020-12-09 23:17:32 +01:00
Felix Ableitner b83cafc454 separate steps 2020-12-09 22:43:32 +01:00
Dessalines dabcfca67b Adding tests for current aggregates. 2020-12-09 11:52:10 -05:00
Felix Ableitner 09212bb6b7 fix docker image 2020-12-09 15:00:31 +01:00
Felix Ableitner d3a89a2a22 trigger another build 2020-12-09 14:58:58 +01:00
Felix Ableitner bfd306e9de add volume back in 2020-12-09 14:56:45 +01:00
Felix Ableitner cb9a06e249 Minor grammar change in docs 2020-12-09 12:34:50 +01:00
Felix Ableitner f9f95a2b92 try plugins/docker image 2020-12-08 21:30:05 +01:00
Felix Ableitner 91be01fd63 docker in docker 2020-12-08 21:27:03 +01:00
Felix Ableitner 04fe7c29cb remove workspace, fix paths 2020-12-08 21:25:24 +01:00
Felix Ableitner df0f609cce log dir 2020-12-08 21:23:54 +01:00
Felix Ableitner e8ffa283f2 fix docker image? 2020-12-08 21:22:36 +01:00
Felix Ableitner b04944d9a5 try manually without sudo 2020-12-08 21:20:23 +01:00
Felix Ableitner eb06bbfef7 run test script 2020-12-08 21:17:11 +01:00
Felix Ableitner 0e364a4efe remove volume 2020-12-08 21:15:04 +01:00
Felix Ableitner d3b2ce7b35 wip: add drone ci, remove travis ci 2020-12-08 21:13:53 +01:00
Dessalines 742b78523a Merge branch 'main' into move_views_to_diesel 2020-12-08 13:31:25 -05:00
Dessalines a432f939b6 Merge remote-tracking branch 'yerba/main' into main 2020-12-08 13:31:09 -05:00
dessalines 6908feb3ba Merge pull request 'Some more minor docs changes' (#149) from more-docs into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/149
2020-12-08 18:31:45 +00:00
Dessalines 46e38bf714 Merge branch 'main' into move_views_to_diesel 2020-12-08 13:17:55 -05:00
Felix Ableitner 5010f693ba Some more minor docs changes 2020-12-08 19:09:11 +01:00
Felix Ableitner 08ab85a9d5 Remove logging to find bug (yerbamate.ml/LemmyNet/lemmy/pulls/146) 2020-12-08 12:48:18 -05:00
Dessalines 16deec7443 Merge remote-tracking branch 'yerba/main' into main 2020-12-08 12:38:21 -05:00
Nutomic 9cc1cfc973
Apub local object handling (#1297)
* Limit visibility of some traits and methods

* WIP: alternative way to handle non-local object parsing

* finish this

* cleanup

* Move check for locked post into Comment::from_apub()

* Mark user as updated after fetching

* Should set last_refreshed_at, not updated

* Add ApubObject trait in DB, with method read_from_apub_id()

* Create shared, generic implementation for `FromApub`, prefer local data

* Check for community ban when parsing post/comment (fixes #1287)

* Fix tests (changes in get_object_from_apub() prevented `Update` from working)

* Support parsing `like.object` either as URL or object

* Send out like.object as URL, instead of full object (fixes #1283)

* add todo
2020-12-08 12:38:48 -05:00
dessalines 860f2f3855 Merge pull request 'Rewrite federation docs' (#145) from federation-docs into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/145
2020-12-08 17:36:37 +00:00
Felix Ableitner 55e03c4eb4 Rewrite federation docs 2020-12-08 14:52:54 +01:00
Dessalines fc1d07fce6 Merge remote-tracking branch 'origin/main' into move_views_to_diesel 2020-12-07 16:22:09 -05:00
Dessalines e371ec1dc4 Adding user aggregates tests. 2020-12-07 15:58:53 -05:00
Nutomic 5e57f1bcad
Merge pull request #1311 from r0qstr/patch-1
Update lemmy_council.md
2020-12-07 12:17:15 +00:00
Dessalines 9884927b8a Adding site aggregates unit test. 2020-12-06 22:17:52 -05:00
Dessalines f5bef3980a Adding hot rank function, possibly fixing views. 2020-12-06 16:44:36 -05:00
Dessalines 36f7b20784 Removing old communityviews 2020-12-06 09:12:51 -05:00
Dessalines 5e510e7a67 Adding other community views. 2020-12-05 23:37:16 -05:00
Dessalines caedb7fcc4 Community view halfway done. 2020-12-05 22:49:15 -05:00
r0qstr 0a12cb0281
Update lemmy_council.md
added myself as a council member
2020-12-05 21:02:19 +01:00
Dessalines 2400a078d7 Merge branch 'main' into move_views_to_diesel 2020-12-05 08:10:25 -06:00
Dessalines 028d1d0efc Userview safe updated. 2020-12-04 23:18:30 -05:00
Dessalines efdcbc44c4 Starting to work on community view, 2 2020-12-04 16:35:46 -05:00
Dessalines cf3a98afcc
Merge pull request #1308 from LemmyNet/update_cargo_deps
Updating cargo deps, fixing image if_some deprecation.
2020-12-04 13:07:43 -05:00
Dessalines 88d7b0a83c Starting to work on community view 2020-12-04 11:29:44 -05:00
Dessalines b92e7eb781 Updating cargo deps, fixing image if_some deprecation. 2020-12-04 09:00:15 -05:00
Dessalines 2d4099577f Removing old user_view. 2020-12-03 19:47:58 -05:00
Dessalines 6d8f93d8a1 More user aggregates. 2020-12-03 13:39:56 -05:00
Dessalines d66f4e8ac0 Finishing up user aggregates. 2020-12-03 10:18:17 -05:00
Dessalines 5d44dedfda Merge branch 'main' into move_views_to_diesel 2020-12-03 09:34:45 -05:00
Dessalines eed7eac10b Version v0.8.10 2020-12-03 08:28:58 -06:00
Dessalines 37e7f1a9a8 Starting to work on user aggs. 2020-12-03 08:27:22 -06:00
Nutomic 4a94d9182e
Merge pull request #1304 from LemmyNet/fix_community_local_filter
Fixing community local filter. #1302
2020-12-03 11:55:16 +00:00
Dessalines 7731479607 Adding SiteAggregates. 2020-12-02 22:39:31 -05:00
Dessalines 8a0336c2ff Fixing community local filter. #1302 2020-12-02 16:04:13 -05:00
Dessalines ca7224c086 Starting on siteview. 2020-12-02 13:32:47 -06:00
Nutomic df8a696bb5
Merge pull request #1300 from Tafiti/patch-1
Added council member
2020-12-02 12:55:46 +00:00
Tafiti d06b59c92b
Added a council member. 2020-12-01 18:22:17 -05:00
Tafiti df913326bd
typo 2020-12-01 18:18:47 -05:00
Dessalines b587e147b0 Version v0.8.9 2020-12-01 12:54:44 -06:00
Dessalines e8116f21cd Merge remote-tracking branch 'yerba/main' into main 2020-12-01 13:29:51 -05:00
nutomic 2b5c69d678 Add check to make sure that inbox doesnt receive local activities (ref #1283) (#147)
Fixed comparison

Add check to make sure that inbox doesnt receive local activities (ref #1283)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/147
2020-12-01 18:30:15 +00:00
Dessalines 4079235b0d
Fix post ranking docs in about guide. Fixes #1294 (#1295)
* Fix post ranking docs in about guide. Fixes #1294

* Shortening lines to refer to not just posts.

* Fixing top line.
2020-12-01 17:54:37 +00:00
Dessalines 45efa94ba4
Making sure image uploads have jwt cookie. Fixes #1291 (#1299) 2020-12-01 17:48:39 +00:00
Dessalines cc8a6bea65 Merge branch 'patch-1' of https://github.com/Whayme/lemmy into Whayme-patch-1 2020-12-01 11:32:27 -06:00
Porrumentzio 4aa3180027
Update lemmy_council.md (#1290)
Removed line saying that council members are administrators on official instances, as it is unclear that currently only https://lemmy.ml is a official instance.
2020-12-01 16:25:04 +00:00
Scarlett 7f1ab6a5cd
Replaced table 2020-11-30 13:53:08 -06:00
Dessalines 3a90f69efc Revert "Short intro explanation, reformatted as a table"
This reverts commit 961fc9d0ce.
2020-11-30 14:24:09 -05:00
Dessalines 2e9164584b Version v0.8.8 2020-11-30 12:56:05 -06:00
dessalines 9435994405 Merge pull request 'Add logging to find bug (ref #1283)' (#146) from debug-1283 into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/146
2020-11-30 18:49:11 +00:00
Felix Ableitner 8d12c77e26 Remove `dbg!` to avoid spamming logs 2020-11-30 18:28:31 +01:00
Felix Ableitner 8fc4e1ecfe Add logging to find bug (ref #1283)
Also simplify check_object_domain()
2020-11-30 18:24:10 +01:00
Dessalines 7d7fe5962a
Merge pull request #1285 from Whayme/patch-1
Short intro explanation, reformatted as a table
2020-11-28 16:16:43 -05:00
Scarlett 961fc9d0ce
Short intro explanation, reformatted as a table
More explanation from someone who understands the benefits of the log scale would be helpful.
2020-11-28 00:29:56 -06:00
nutomic 3ceeecc63e Better account deletion (fixes #730) (#143)
Also clear bio

Better account deletion (fixes #730)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/143
2020-11-27 21:00:18 +00:00
Dessalines 5b66e4860c Merge remote-tracking branch 'yerba/main' into main 2020-11-27 16:00:15 -05:00
Dessalines 5e10cf69b7 Merge remote-tracking branch 'yerba/main' into main 2020-11-27 15:58:22 -05:00
dessalines 050ca88085 Merge pull request 'Set valid context for our extra fields (ref #1220)' (#142) from apub-context into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/142
2020-11-27 20:28:52 +00:00
Dessalines ac330a3f7b
Adding a local RSS feed. Fixes #1279 (#1280)
* Adding a local RSS feed. Fixes #1279

* Shorten get_local_feed and get_all_feed functions

* Making the enum params the same.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2020-11-26 17:26:31 +00:00
Dessalines 01a14e3b3c
Change references of dev.lemmy.ml to lemmy.ml (#1281)
* Change references of dev.lemmy.ml to lemmy.ml

* Remove the dev.lemmy.ml refs in RELEASES.md
2020-11-26 11:47:01 -05:00
Felix Ableitner a30be1ca5d Merge branch 'eiknat-feature/add-reporting-backend' into main 2020-11-26 13:31:25 +01:00
Felix Ableitner 68173914ca Minor cleanup on reports PR 2020-11-26 13:28:58 +01:00
Felix Ableitner f070b1823d Make changes on `content` field backwards compatible 2020-11-26 13:24:14 +01:00
Dessalines 2b5feca806 Trying out cargo chef and a travis docker image cache. (#1238)
* Trying out cargo chef and a travis docker image cache.

* trying to change internal target.

* Use latest cargo-chef with --target

* Remove caching for now.

* Adding back in chowns

* Adding back in cache.

* Remove travis caching.

* Switching dev dockerfile to match prod, using cargo-chef and alpine.

* Make travis happy

* Trying a chown rust.

* Caching cargo-chef first.

* Moving the chowns

* Removing many copy commands.

* Go back to rust 1.47.0 due to config-rs breaking.

* Adding the old volume mount version.

* Adding some script comments.

Co-authored-by: Luca Palmieri <lpalmieri@truelayer.com>
2020-11-26 13:24:13 +01:00
Felix Ableitner d75f621152 Populate `content` with HTML, and `source` with markdown (ref #1220) 2020-11-26 13:24:13 +01:00
Felix Ableitner 8bdbda1db9 Remove clap dependency 2020-11-26 13:24:13 +01:00
Felix Ableitner a2d80d8f2e Generate valid RSS feed (fixes #1274) 2020-11-26 13:24:13 +01:00
Felix Ableitner 8b5289d5c7 Add TODO about populating user outbox 2020-11-26 13:24:13 +01:00
Dessalines 8fe578c958 Version v0.8.7 2020-11-26 13:24:13 +01:00
Dessalines ac75304a09 Version v0.8.6 2020-11-26 13:24:13 +01:00
Felix Ableitner 7fe4558bee Create empty outbox for user (ref #1220) 2020-11-26 13:24:12 +01:00
Dessalines f3eebb1dfc Version v0.8.5 2020-11-26 13:24:12 +01:00
Felix Ableitner 250dcc26be For community_name API parameters, only search locally (fixes #1271) 2020-11-26 13:24:12 +01:00
Felix Ableitner 11fdef56db Dont handle activities twice in inbox 2020-11-26 13:24:12 +01:00
Felix Ableitner d6493f31d9 Reduce visibility of some structs and methods (replaces #1266) 2020-11-26 13:24:04 +01:00
Dessalines 8b8d47f6f5 Version v0.8.4 2020-11-26 13:22:16 +01:00
Felix Ableitner aaa3fc08af Add user_inbox check that activities are really addressed to local users 2020-11-26 13:22:16 +01:00
dessalines 9707de4d4a Merge pull request 'Populate `content` with HTML, and `source` with markdown (ref #1220)' (#141) from apub-media-type2 into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/141
2020-11-25 19:54:52 +00:00
Felix Ableitner a7b72ed5c4 Set valid context for our extra fields (ref #1220) 2020-11-25 18:44:49 +01:00
Felix Ableitner b2288fcb9a Make changes on `content` field backwards compatible 2020-11-25 14:07:04 +01:00
Felix Ableitner e0e23c2f9d Merge branch 'main' into apub-media-type2 2020-11-25 13:15:29 +01:00
Felix Ableitner cd3f20e49b Populate `content` with HTML, and `source` with markdown (ref #1220) 2020-11-24 18:53:43 +01:00
dessalines 1e187ab4f8 Merge pull request 'Remove clap dependency' (#139) from remove-clap2 into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/139
2020-11-23 18:01:39 +00:00
Felix Ableitner aaeb852f23 Remove clap dependency 2020-11-23 18:48:20 +01:00
Dessalines d26a7ad337
Trying out cargo chef and a travis docker image cache. (#1238)
* Trying out cargo chef and a travis docker image cache.

* trying to change internal target.

* Use latest cargo-chef with --target

* Remove caching for now.

* Adding back in chowns

* Adding back in cache.

* Remove travis caching.

* Switching dev dockerfile to match prod, using cargo-chef and alpine.

* Make travis happy

* Trying a chown rust.

* Caching cargo-chef first.

* Moving the chowns

* Removing many copy commands.

* Go back to rust 1.47.0 due to config-rs breaking.

* Adding the old volume mount version.

* Adding some script comments.

Co-authored-by: Luca Palmieri <lpalmieri@truelayer.com>
2020-11-23 10:59:06 -05:00
dessalines 911b26f163 Merge pull request 'Generate valid RSS feed (fixes #1274)' (#136) from valid-rss into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/136
2020-11-20 18:55:11 +00:00
Felix Ableitner 8920f439ce Generate valid RSS feed (fixes #1274) 2020-11-20 15:11:47 +01:00
Felix Ableitner 405ea38959 Add TODO about populating user outbox 2020-11-19 13:50:43 +01:00
Dessalines bffc82f752 Version v0.8.7 2020-11-18 16:18:53 -06:00
Dessalines e2693a4192 Version v0.8.6 2020-11-18 13:12:24 -06:00
Dessalines c7740a7ac5 Merge remote-tracking branch 'yerba/main' into main 2020-11-18 13:12:08 -06:00
dessalines c038acea5b Merge pull request 'Create empty outbox for user (ref #1220)' (#135) from user-outbox into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/135
2020-11-18 19:13:32 +00:00
Felix Ableitner 48f506277a Create empty outbox for user (ref #1220) 2020-11-18 17:04:35 +01:00
Dessalines b8dc3c11c1 Version v0.8.5 2020-11-17 15:11:58 -06:00
dessalines f0e3303aeb Merge pull request 'For community_name API parameters, only search locally (fixes #1271)' (#134) from community-name-local into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/134
2020-11-17 21:07:00 +00:00
Felix Ableitner 1ba1e466f7 For community_name API parameters, only search locally (fixes #1271) 2020-11-17 18:05:25 +01:00
dessalines eb690fc39c Merge pull request 'Dont handle activities twice in inbox' (#133) from inbox-deduplicate-handling into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/133
2020-11-17 15:43:11 +00:00
Felix Ableitner 14bf45d099 Dont handle activities twice in inbox 2020-11-16 21:43:52 +01:00
dessalines eee394cf85 Merge pull request 'Reduce visibility of some structs and methods (replaces #1266)' (#132) from reduce-visibility into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/132
2020-11-16 16:36:30 +00:00
Felix Ableitner 8675fed49c Reduce visibility of some structs and methods (replaces #1266) 2020-11-16 16:44:04 +01:00
Dessalines 0dcff2e647 Version v0.8.4 2020-11-12 11:54:31 -06:00
nutomic 1b8ce33aa4 Merge pull request 'Add user_inbox check that activities are really addressed to local users' (#131) from user-inbox-check into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/131
2020-11-12 12:50:00 +00:00
eiknat a68cff51b1 add doc 2020-11-11 15:41:40 -05:00
eiknat 9e604b4038 update/fix migration, add some doc
also run cargo fmt/clippy
2020-11-11 15:11:52 -05:00
eiknat 438414a64b add more details to the report views 2020-11-11 15:11:52 -05:00
eiknat 30d784c27c add mod room websocket impl 2020-11-11 15:11:52 -05:00
eiknat 070efe72af add current context for reports 2020-11-11 15:11:52 -05:00
eiknat 2cd2a4df45 reports: split post/comment out again, add some other fixes 2020-11-11 15:11:52 -05:00
eiknat e8e0890341 db: fix a few comments i missed 2020-11-11 15:11:52 -05:00
eiknat d6b1c8df2f reports: update db tables, combine api impl 2020-11-11 15:11:52 -05:00
eiknat 6d43202efb reports: initial reports api commit 2020-11-11 15:11:52 -05:00
Dessalines 08b8e9999b Merge remote-tracking branch 'yerba/main' into main 2020-11-11 13:18:42 -06:00
dessalines 15c77f85c1 Merge pull request 'Add pending status for federated follows' (#130) from pending-follow into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/130
2020-11-11 19:18:27 +00:00
Felix Ableitner fb16f47f2f Add user_inbox check that activities are really addressed to local users 2020-11-11 17:40:45 +01:00
Felix Ableitner 964d95de5c Fix unit tests 2020-11-11 17:28:30 +01:00
Dessalines 64ac4e382a Version v0.8.3 2020-11-11 07:57:33 -06:00
Dessalines 4a61758bde
Merge pull request #1261 from LemmyNet/more-tests-2
Adding some more integration tests for locked posts and bans.
2020-11-10 13:39:01 -05:00
Dessalines ff8acfb8de Adding some more integration tests for locked posts and bans. 2020-11-10 10:53:35 -06:00
Felix Ableitner 06e82fe761 Add pending status for federated follows 2020-11-10 16:45:10 +01:00
dessalines 94dd335fac Merge pull request 'Enforce post lock in federation inbox' (#129) from enforce-post-lock into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/129
2020-11-10 13:16:13 +00:00
dessalines 437809d337 Merge pull request 'Separate logic for user and community inbox' (#123) from rewrite-inbox into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/123
2020-11-10 13:14:40 +00:00
Felix Ableitner e1fd614dd1 Fixed bug where comments with mentions were treated as private message 2020-11-09 19:18:23 +01:00
Felix Ableitner 3b4c3ec074 Enforce post lock in federation inbox 2020-11-09 17:06:54 +01:00
Felix Ableitner 8803e7834f Enforce site and community bans for federated users 2020-11-09 15:29:36 +01:00
Felix Ableitner b469b6d8d3 Separate logic for user and community inbox
more refactoring with tons of changes:

- inbox functions return LemmyError instead of HttpResponse
- announce is done directly in community inbox
- reorganized functions for handling inbox activities
- additional checks for private messages
- moved inbox handler functions for post, comment, vote into separete file
- ensure that posts, comments etc are addressed to public (ref #1220)
- probably more
2020-11-09 13:42:08 +01:00
Dessalines 7e13970a4f Version v0.8.2 2020-11-06 07:06:50 -06:00
nutomic 7c51a36012 In activity table, remove `user_id` and add `sensitive` (#127)
Forgot to add migrations

Add `sensitive` column to activities table, so PMs arent served over HTTP

Remove user_id column from actvity table

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/127
2020-11-06 13:06:47 +00:00
Dessalines 405eb15291 Merge remote-tracking branch 'yerba/main' into main 2020-11-06 07:05:22 -06:00
nutomic b7d2dac9bf Fix federation of community removal/deletion, added docs (#125)
Adding a federation test for community deletes / removes.

Add missing docs for community deletion/removal (fixes #1250)

Fix federation of community deletion/removal (fixes #1253)

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/125
2020-11-05 20:19:06 +00:00
Dessalines 76193d37da Merge remote-tracking branch 'yerba/main' into main 2020-11-05 14:17:35 -06:00
dessalines 60517f8471 Merge pull request 'Dont send email notifications to banned users (fixes #1251)' (#126) from dont-email-banned-user into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/126
2020-11-05 19:14:49 +00:00
Felix Ableitner c6c74ab1e3 Also check for ban when sending private message notification 2020-11-05 16:13:01 +01:00
Dessalines 9aa700fb10
Merge pull request #1252 from LemmyNet/yerbamate-change-tld
Change domain of yerbamate.dev to yerbamate.ml
2020-11-05 08:41:12 -05:00
Felix Ableitner d2bea09a60 Dont send email notifications to banned users (fixes #1251) 2020-11-05 13:43:46 +01:00
Felix Ableitner 45dced3fcb Change domain of yerbamate.dev to yerbamate.ml 2020-11-03 22:50:59 +01:00
Dessalines 5e2a5c0266
Upgrading pictrs to v0.2.5 (#1249) 2020-11-02 18:12:21 +00:00
Dessalines 18d9811de7
Merge pull request #1246 from knkski/pictrs-url-variable
Fix hardcoded pictrs URL reference
2020-11-01 22:45:03 -05:00
Dessalines cca0b4c0f9
Merge pull request #1247 from knkski/iframely-url-setting
Add iframely_url setting
2020-11-01 22:44:28 -05:00
Dessalines eab9123b86 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-11-01 21:26:36 -06:00
Dessalines 0ea4095238 Changing docs formattin, running format. 2020-11-01 21:26:00 -06:00
Kenneth Koski b3035e21ef
Parameterize docs directory (#1245)
Adds `docs_dir` setting for configurable documentation location
2020-11-01 22:21:15 -05:00
Kenneth Koski 3d872b03e3
Add iframely_url setting 2020-10-31 17:08:03 -05:00
Kenneth Koski 1ae335e058
Fix hardcoded pictrs URL reference
Reads the URL from Settings instead
2020-10-31 16:52:54 -05:00
Kenneth Koski 09498d8bb3
Update configuration documentation 2020-10-31 16:28:09 -05:00
Kenneth Koski bfd8f52497
Parameterize config file location
Allows `config.hjson` to be located on a configurable path.
2020-10-31 16:25:52 -05:00
eiknat fc36ae22c9
GetUserDetails doesnt return users own email (#1240)
* user: GetUserDetails doesnt return users own email

* user: rename get_user to get_user_dangerous, apply suggested changes
2020-10-30 18:19:47 -04:00
Dessalines 1fd5486def Fixing missing community doc. 2020-10-30 12:46:11 -05:00
Dessalines 7ef044231f
Update cargo deps, upgrading lettre. #789 (#1234)
* Update cargo deps, upgrading lettre. #789

* Adding a comment

* Adding some better expect messages.

* Fixing lettre email.
2020-10-30 13:19:00 -04:00
Dessalines 9e5e0eb9b7
Merge pull request #1242 from ShadowJonathan/patch-1
Update about_features.md
2020-10-30 11:28:53 -04:00
Jonathan de Jong d3b07c8131
Update about_features.md
...in accordance with the readme.
2020-10-30 09:46:30 +01:00
dessalines 3bf885329d Merge pull request 'Ignore incoming activities which have been received before, add `/activities` endpoint' (#118) from activity-checks into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/118
2020-10-27 16:26:16 +00:00
dessalines e95ca66c9f Merge pull request 'In comment create/update, include parent creator in cc (ref #698)' (#122) from comment-parent-cc into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/122
2020-10-27 16:15:20 +00:00
Felix Ableitner 9e24eda752 In comment create/update, include parent creator in cc (ref #698) 2020-10-27 16:57:44 +01:00
Dessalines 77b17c6737 Fixing cache dev dockerfile 2020-10-27 10:57:40 -05:00
Felix Ableitner 91d073c2e8 Use docker cache for docker/dev/ 2020-10-27 13:58:52 +01:00
Dessalines 4c0c558945 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-10-26 19:18:28 -05:00
Dessalines 5b871d3dd8 Merge branch 'prod_dockerfile_update' into main 2020-10-26 19:16:33 -05:00
Dessalines 2e922d602d Trying a target fix. 2020-10-26 17:32:50 -05:00
Dessalines 3100e8bf21 Trying a target fix. 2020-10-26 15:50:37 -05:00
Dessalines b42b461418 Trying a permissions fix. 2020-10-26 13:35:19 -05:00
Dessalines 604d125a55
Simplifying prod build, using musl stable. (#1235) 2020-10-26 17:33:43 +00:00
Dessalines ba0680f5e6 Simplifying prod build, using musl stable. 2020-10-26 12:18:47 -05:00
Dessalines 6eab24270b Merge remote-tracking branch 'yerba/main' into main 2020-10-26 10:34:40 -05:00
dessalines 53c9094d46 Merge pull request 'Limit amount of HTTP requests to handle activities (fixes #1221)' (#117) from request-limit into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/117
2020-10-26 15:35:39 +00:00
dessalines 60bc62932b Merge pull request 'docker/lemmy.hjson is missing field email.use_tls (fixes #1231)' (#120) from lemmy-config-use-tls into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/120
2020-10-26 13:49:05 +00:00
Felix Ableitner 99abc49040 Add /activities endpoint (ref #1220) 2020-10-26 12:54:27 +01:00
Dessalines 6337762ec7
Adding image endpoints to docs. Fixes #1226 (#1232) 2020-10-26 11:07:23 +00:00
Felix Ableitner c33918c71f docker/lemmy.hjson is missing field email.use_tls (fixes #1231) 2020-10-26 11:28:32 +01:00
Dessalines 4f0059198e Updating readme to ref join.lemmy.ml 2020-10-25 10:34:22 -05:00
Dessalines 134d66924e Version v0.8.1 2020-10-24 15:15:48 -05:00
Dessalines 295c209c67 Updating lemmy.hjson config. 2020-10-24 15:14:58 -05:00
Dessalines 5e0562e80e Fix matrix room link. 2020-10-24 15:10:22 -05:00
Dessalines ad1ba85eb9
Merge pull request #1229 from IronOxidizer/fix-docker-dev
Removed docker root prefix, add pictrs dir
2020-10-23 14:04:30 -04:00
Iron Oxidizer ac79496036 Removed docker root prefix, add pictrs dir 2020-10-23 13:14:30 -04:00
Felix Ableitner 6d17d5ead2 Ignore incoming activities which have been received before (ref #1220) 2020-10-23 14:29:56 +02:00
Dessalines cfa60dcb76
Merge pull request #1225 from LemmyNet/fix_remove_icons
Fix invalid url error when removing icons. Fixes #1219
2020-10-22 14:56:55 -04:00
Dessalines 52c679a3cd
Merge pull request #1223 from LemmyNet/remove_cache_headers
Remove cache headers. Fixes #1222
2020-10-22 14:56:43 -04:00
dessalines 73ccbb1bc8 Merge pull request 'Organise activity receive files by object type, not by activity type' (#115) from inbox-refactoring-2 into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/115
2020-10-22 18:55:28 +00:00
dessalines de8d8542b4 Merge pull request 'Dont allow localhost or raw IPs in activitypub IDs (ref #1221)' (#116) from disallow-localhost-urls into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/116
2020-10-22 18:55:11 +00:00
Dessalines a897ec48d2 Merge remote-tracking branch 'yerba/main' into main 2020-10-22 13:55:01 -05:00
Felix Ableitner 3d5647b16f Limit amount of HTTP requests to handle activities (fixes #1221) 2020-10-22 20:27:32 +02:00
Dessalines 18111629fa Fix invalid url error when removing icons. Fixes #1219 2020-10-22 12:23:25 -05:00
Dessalines e7d3905093 Remove cache headers. Fixes #1222 2020-10-22 11:53:53 -05:00
Felix Ableitner b08e0a6415 Dont allow localhost or raw IPs in activitypub IDs (ref #1221) 2020-10-22 18:12:43 +02:00
Dessalines 2527c59e55
Fixing ansible for ubuntu 20.04 (#1218)
* Fixing ansible for ubuntu 20.04

* Changing federation to false.
2020-10-22 14:32:56 +00:00
Felix Ableitner 1a3b96b054 Organise activity receive files by object type, not by activity type 2020-10-21 19:37:50 +02:00
dessalines 3e22c99c96 Merge pull request 'Also return json for long accept header with profile link (ref #1216)' (#114) from json-headers into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/114
2020-10-21 16:33:31 +00:00
Dessalines a62c96f85e Merge remote-tracking branch 'yerba/main' into main 2020-10-21 11:32:25 -05:00
Dessalines 8a6bfa3816
Merge pull request #1217 from lo48576/fix/outdated-readme-link
Fix outdated links in README
2020-10-21 09:55:17 -04:00
Felix Ableitner e8379cb3f7 Also return json for long accept header with profile link (ref #1216) 2020-10-21 15:48:43 +02:00
YOSHIOKA Takuma 8bfd678d49
Fix outdated links in README 2020-10-21 22:23:09 +09:00
Dessalines 1b62e65a5d
Fix IP forwarding headers. Fixes #1214 (#1215) 2020-10-21 09:47:45 +00:00
Dessalines dd99e77881
Upgrade pictrs to v0.2.4-r0 (#1212) 2020-10-20 10:44:55 +00:00
Dessalines 18b3eab909
Merge pull request #1209 from LemmyNet/fix-actor-name-confusion
Swap name and preferredUsername apub fields
2020-10-19 11:52:35 -04:00
Dessalines 7673e60654
Merge pull request #1210 from LemmyNet/apub-code-docs
Create rustdoc for activitypub code
2020-10-19 11:47:17 -04:00
Felix Ableitner 695272f980 Create rustdoc for activitypub code 2020-10-19 16:29:35 +02:00
Felix Ableitner e190ecbefb Make lemmy-ui restart: always 2020-10-19 12:18:05 +02:00
Dessalines 37f616bad2
Adding some comments to defaults.hjson (#1207)
* Adding some comments to defaults.hjson

* Link to docs for allow/blocklist.
2020-10-16 20:46:40 +00:00
Felix Ableitner 06a6bab2c1 Swap name and preferredUsername apub fields 2020-10-16 22:44:40 +02:00
Dessalines cead2a6303 Version v0.8.0 2020-10-16 09:12:54 -05:00
Dessalines 0c4f99b161 Adding to releases.md 2020-10-16 09:10:43 -05:00
Dessalines 815cf60f45 Fixing clippy. 2020-10-16 09:09:37 -05:00
Dessalines 571c71392e
Adding API and APUB URL checks for banners and icons. Fixes #1199 (#1200)
* Adding API and APUB URL checks for banners and icons. Fixes #1199

* Adding a check optional url.

* Missed a few.
2020-10-15 18:23:56 +00:00
Dessalines 24484ed801
Adding references to lemmy types from docs. (#1203)
* Adding references to lemmy types from docs.

* Updating TOC.

* Updating docs.
2020-10-15 17:56:16 +00:00
Dessalines 3e35e4052f
Merge pull request #1206 from LemmyNet/verify-activity-domains2
Verify activity domains 2
2020-10-15 11:18:57 -04:00
Dessalines a2df2b12e2
Merge pull request #1201 from LemmyNet/verify-activity-domains
Add method verify_activity_domains_valid() (ref #1196)
2020-10-15 11:15:25 -04:00
Felix Ableitner fe15ff3c51 Also verify activity domains in shared inbox (fixes #1196) 2020-10-15 15:38:49 +02:00
Felix Ableitner 39cbe5f31f Add method verify_activity_domains_valid() (ref #1196) 2020-10-15 15:38:03 +02:00
Dessalines 23793fe096
Merge pull request #1202 from LemmyNet/pict-rs-v2-dess
Pict rs v2 dess
2020-10-14 15:46:02 -04:00
Dessalines c87a009b37 Altering lemmy pict-rs-v2 forwarding. 2020-10-14 11:48:10 -05:00
Dessalines 9bbacd38f4 Merge branch 'asonix/pict-rs-v2' of https://github.com/asonix/lemmy into asonix-asonix/pict-rs-v2 2020-10-14 10:14:25 -05:00
Dessalines c9c3d94bf9 Merge remote-tracking branch 'yerba/main' into main 2020-10-13 13:30:32 -05:00
dessalines d55e38d4a6 Merge pull request 'Dont include full objects with remove/delete activities' (#113) from delete-with-id into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/113
2020-10-13 18:31:11 +00:00
Felix Ableitner 3f9ede79ed Add domain checks for private message inbox 2020-10-13 18:06:26 +02:00
Felix Ableitner ac0cd7bc68 Dont include full objects with remove/delete activities 2020-10-13 17:47:05 +02:00
Nutomic 56d361eeff
Update activitypub outline (#1183)
* Update activitypub outline

* Various adjustments of apub outline
2020-10-13 09:00:35 -04:00
dessalines 9084a56e36 Merge pull request 'ActivityPub refactoring' (#112) from apub-changes into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/112
2020-10-12 17:28:48 +00:00
Felix Ableitner 7cfcf0acec Change the way that `to` is set in apub 2020-10-12 18:02:28 +02:00
Felix Ableitner 2ad60379e4 Add `to` field for follow, undo follow 2020-10-12 16:45:40 +02:00
Felix Ableitner 0dda2577e1 Refactor apub code, split up large files 2020-10-12 16:10:09 +02:00
Nutomic cc9bb56d2d
Merge pull request #1192 from LemmyNet/fix_fast_triggers_2
Fixing hot_rank_active fast triggers. Fixes #1190
2020-10-12 10:33:46 +00:00
Nutomic f44612970a
Merge pull request #1189 from LemmyNet/fix_search_filter
Fixing post community filter. Fixes #1187
2020-10-12 10:31:15 +00:00
Nutomic 70f7dd876f
Merge pull request #1188 from LemmyNet/fix_blocked_creator_outbox
Fixed an issue with blocked post creators in outbox.
2020-10-12 10:30:48 +00:00
Nutomic b19ac26325
Merge pull request #1191 from LemmyNet/update_deps
Updating deps.
2020-10-12 10:28:32 +00:00
asonix 4010a944a4 Bump pict-rs version 2020-10-11 13:57:35 -05:00
asonix 863a662ec6 Stable release 2020-10-10 20:54:15 -05:00
asonix 08588c873a pict-rs v2 2020-10-10 19:31:56 -05:00
Dessalines a903cae00b Fixing hot_rank_active fast triggers. Fixes #1190 2020-10-09 23:03:38 -05:00
Dessalines 907f8fff4c Updating deps. 2020-10-09 22:51:47 -05:00
Dessalines 1c8913090d Fixing post community filter. Fixes #1187 2020-10-09 13:09:00 -05:00
Dessalines e61c3f0de3
Merge pull request #1185 from LemmyNet/federation-disable-downvotes
Respect disable downvotes setting when federating
2020-10-09 13:58:29 -04:00
Dessalines cb4a3a03a2 Fixed an issue with blocked post creators in outbox.
- Fixes #1186
2020-10-09 12:46:27 -05:00
Felix Ableitner c90c96fbf6 Respect disable downvotes setting when federating 2020-10-09 15:41:40 +02:00
Dessalines 97fc51b0cd Version v0.7.64 2020-10-08 18:34:30 -05:00
Dessalines 0b4ecdfc05 Fixing a bug with stickied order. 2020-10-08 18:33:54 -05:00
Dessalines 875b0e6f01 Version v0.7.63 2020-10-08 17:50:51 -05:00
Dessalines 03b1821586 Version v0.7.62 2020-10-08 15:52:10 -05:00
Dessalines 8d0580461b
Merge pull request #1180 from LemmyNet/no_conflict_triggers
No send blocked and no conflict triggers
2020-10-08 14:51:04 -04:00
Dessalines 7fbad900d7 Addressing a few comments. 2020-10-08 12:38:44 -05:00
Dessalines f5184ce749
Fixing local filter, fixes #1181 (#1182) 2020-10-08 11:10:10 -04:00
Dessalines e9ce14069e Removing some unecessary logging. 2020-10-07 21:55:15 -05:00
Dessalines c08d891742 Merge branch 'main' into no_conflict_triggers 2020-10-07 20:57:29 -05:00
Dessalines b4c730e537 Revert "Removing on_conflict as it may not work with table triggers (user_fast, etc)"
This reverts commit db7027a367.
2020-10-07 19:08:06 -05:00
Dessalines fd257a6d39 Adding no conflict triggers. Fixes #1179 2020-10-07 19:05:46 -05:00
Nutomic 299598f0c4
Remove unused fields on community/user json (#1178) 2020-10-07 14:19:12 -04:00
Dessalines f00cfa005e Adding submodule update --remote 2020-10-07 11:09:56 -05:00
Nutomic 9dc6294065
Explain how federation works for admins, various doc updates (#1176) 2020-10-07 12:08:03 -04:00
Dessalines 9fe3efcb32 Trimming allowed and blocked instances 2020-10-07 09:40:36 -05:00
Dessalines 30431199cf Merge remote-tracking branch 'origin/no-send-blocked' into no-send-blocked-dess 2020-10-06 12:33:18 -05:00
Dessalines db7027a367 Removing on_conflict as it may not work with table triggers (user_fast, etc) 2020-10-06 12:31:16 -05:00
Felix Ableitner 26883208cd Create separate SendActivityTask for each destination 2020-10-06 19:19:53 +02:00
Felix Ableitner 60730e81d9 Avoid duplicate comment send, better activity logging 2020-10-06 18:28:31 +02:00
Dessalines ca4868cefd Adding a boolean check to send_activity_internal 2020-10-06 10:19:01 -05:00
Felix Ableitner 9e84fe20e6 Dont send mentions to inbox of local community
also, dont start SendActivityTask for empty `to`, and remove
useless comment
2020-10-06 14:58:37 +02:00
Nutomic c6c107cad1
Merge pull request #1173 from LemmyNet/password_length_check
Password length check. Fixes #1087
2020-10-05 20:24:07 +00:00
Dessalines 5e92fb47ed Changing one more darkly to browser. #1163 2020-10-05 11:53:13 -05:00
Dessalines 984f1ae7fb Merge remote-tracking branch 'yerba/main' into main 2020-10-05 11:52:04 -05:00
dessalines 38f4c5f310 Merge pull request 'Update lemmy-ui version in docker-compose files on release (fixes #1164)' (#111) from update-lemmy-ui into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/111
2020-10-05 16:49:51 +00:00
Nutomic dc18ec533e
Merge pull request #1174 from LemmyNet/add_community_name_search
Adding optional community_name field to search. Fixes #1057
2020-10-05 15:55:33 +00:00
Nutomic 07ddeef568
Merge pull request #1170 from LemmyNet/improve_admin_docs
Improving administration page docs. Fixes #1160
2020-10-05 15:49:11 +00:00
Nutomic 14c3d10ba9
Merge pull request #1169 from LemmyNet/new_default_theme
Changing default theme to browser from darkly. Fixes #1163
2020-10-05 15:47:26 +00:00
Nutomic 4a925c9e9f
Merge pull request #1172 from LemmyNet/remove_kubernetes
Remove kubernetes. #842
2020-10-05 15:38:51 +00:00
Felix Ableitner 5a56c08c91 Update lemmy-ui version in docker-compose files on release (fixes #1164) 2020-10-05 17:36:53 +02:00
dessalines 75ace1192a Merge pull request 'Only search locally for Community::read_from_name and similar (ref #698)' (#110) from read-only-local into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/110
2020-10-05 15:25:09 +00:00
Dessalines c348e788e4 Adding optional community_name field to search. Fixes #1057 2020-10-04 19:57:35 -05:00
Dessalines 557d476001 Password length check. Fixes #1087 2020-10-04 19:10:15 -05:00
Dessalines 9b69c446e2 Remove kubernetes. #842 2020-10-04 15:44:26 -05:00
Dessalines 4d0365bca3 Replace gitlab with codeberg. Fixes #1171 2020-10-04 14:01:12 -05:00
Dessalines 990987b174 Improving administration page docs. Fixes #1160 2020-10-04 08:42:30 -05:00
Dessalines 04a4624f14 Changing default theme to browser from darkly. Fixes #1163 2020-10-03 11:44:25 -05:00
Dessalines 7cc5f53cad Add line showing default ports for nginx. Fixes #1167 2020-10-03 09:53:48 -05:00
Dessalines 389e929c8e Fixing readme. 2020-10-03 09:51:15 -05:00
Dessalines 048fe287c2 Running cargo fmt. 2020-10-03 09:50:06 -05:00
Dessalines 9fa2092a21 Adding some logging. 2020-10-03 09:47:06 -05:00
Dessalines 2e2b6eacd7 Fixing pretty print again. 2020-10-02 10:15:26 -05:00
Dessalines eef0a5c7e8 Adding pretty print for activities. 2020-10-02 09:21:14 -05:00
Nutomic e596ea6e3a
Add documentation for federation overview (fixes #774) (#1165) 2020-10-02 09:02:16 -04:00
Felix Ableitner 15adc21e1f Only search locally for Community::read_from_name and similar (ref #698) 2020-10-02 14:18:20 +02:00
Dessalines f5b511ccce Merge branch 'main' into no-send-blocked-dess 2020-10-01 15:57:47 -05:00
Dessalines 2ad137c280 Merge branch 'remove-hardcoded-https-dess' into main 2020-10-01 12:56:04 -05:00
Dessalines 3a24adc57f Renaming to sign_and_send 2020-10-01 12:54:20 -05:00
Dessalines 61f013e4cb Trying to fix travis build. 2020-10-01 09:16:56 -05:00
Dessalines 6c8a5723f8 Trying to add some long delays. 2020-10-01 08:32:01 -05:00
Felix Ableitner a4cb067130 Dont send to blocked instances, rewrite activity_sender 2020-09-30 20:35:02 +02:00
Dessalines b074a963fe Version v0.7.61 2020-09-30 20:28:58 +02:00
Dessalines 0ebd830814 More overwriteable fields (#1155)
* Adding more overwriteable fields for user. Fixes #1154

* Adding a note for bio.
2020-09-30 20:28:58 +02:00
Dessalines 4772cbd23f
Merge pull request #1162 from asonix/remove-hardcoded-https
Use http-signature-normalization-reqwest
2020-09-30 09:28:40 -04:00
asonix 1fc21aed1c Use http-signature-normalization-reqwest 2020-09-29 20:08:50 -05:00
Felix Ableitner c1db1042ad Also sign the digest header 2020-09-29 16:46:49 +02:00
Felix Ableitner 0aa0ea19fb Use reqwest to send activities 2020-09-29 15:10:55 +02:00
Dessalines ada82582ef Version v0.7.61 2020-09-25 16:26:19 -05:00
Felix Ableitner 927ab1f040 Remove hardcoded usage of https (fixes #1126) 2020-09-25 17:33:00 +02:00
Dessalines 8bea13d651
More overwriteable fields (#1155)
* Adding more overwriteable fields for user. Fixes #1154

* Adding a note for bio.
2020-09-25 11:16:49 -04:00
Dessalines 10b3d9005f
Merge pull request #1152 from LemmyNet/upgrade_api_test_deps
Upgrade api test deps
2020-09-24 22:50:32 -04:00
Dessalines 5dbb2b45cb Upgrade api test deps. 2020-09-24 13:22:11 -05:00
nutomic bfed8a8be4 Dont federate embeds, but refetch them for security (#106)
Dont federate embeds, but refetch them for security (#ref 647)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/106
2020-09-24 17:43:42 +00:00
Dessalines 4de80dc29d Merge remote-tracking branch 'yerba/main' into main 2020-09-24 09:14:09 -05:00
nutomic 442369a041 Move websocket code into workspace (#107)
Adjust dockerfiles, fix cargo.toml and remove unused deps

Merge branch 'main' into move-websocket-to-workspace

Move api code into workspace

Move apub to separate workspace

Move websocket code into separate workspace

Some code cleanup

Remove websocket dependency on API

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/107
2020-09-24 13:53:21 +00:00
nutomic e8ea0664ef Fix nginx config for local federation setup (#104)
Fix depends_on

Add note about different port for backend in federation docs

Fix nginx config for local federation setup

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/104
2020-09-24 13:50:38 +00:00
Dessalines 698fb20c12
Fixing ansible install. (#1150)
* Fixing ansible install.

* Fixing LEMMY_EXTERNAL_HOST docs.
2020-09-24 09:47:24 -04:00
Dessalines c6888472dc
Add linked instances. (#1149)
* Adding linked instances. Fixes #1147

* Removing current instance, checking for federation enabled.

* Cleaning up.

* Switching to iterator.
2020-09-24 09:46:57 -04:00
Dessalines ab17e0a9f3 Merge branch 'add-view-helper-functions' of https://github.com/eiknat/lemmy into eiknat-add-view-helper-functions 2020-09-23 16:16:18 -05:00
Dessalines b99b62a211 Version v0.7.59 2020-09-23 08:58:30 -05:00
Dessalines 1dcf14289d Removing weblate translations from deploy. 2020-09-23 08:56:32 -05:00
Dessalines 5732fde4d9 Updating issue template to show lemmy-ui. 2020-09-22 14:32:18 -05:00
Nutomic 440dba4372
Merge pull request #1146 from LemmyNet/fix_nginx_docs
Fix nginx docs, fix test deploy.
2020-09-22 19:02:46 +00:00
Dessalines 2bee3ac33b Fix nginx docs, fix test deploy. 2020-09-22 11:28:16 -05:00
Dessalines 2189d15e5b Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-09-22 10:12:36 -05:00
Dessalines 66cf9ff70a Merge remote-tracking branch 'yerba/main' into main 2020-09-22 10:12:26 -05:00
dessalines 8e69801e24 Merge pull request 'Add integration test to ensure that signatures are verified' (#103) from integration-test into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/103
2020-09-22 15:10:28 +00:00
Nutomic b5860a4283
Merge pull request #1145 from LemmyNet/fix_remote_subscribe
Fixing remote subscribe result. Fixes #1144
2020-09-21 19:09:48 +00:00
Felix Ableitner aece5e67b7 Address review comments 2020-09-21 17:24:42 +02:00
Dessalines 9395312079 Fixing remote subscribe result. Fixes #1144 2020-09-21 09:35:13 -05:00
Dessalines 8a7eb57c24
Add openssl (#1143)
* Adding openssl.

* Openssl didnt work, switching to rustls.
2020-09-21 10:08:47 -04:00
Felix Ableitner 12af0f462f Update federation docs 2020-09-21 14:02:40 +02:00
Felix Ableitner db3dcc6fdc Add tests for community_inbox and user_inbox 2020-09-18 17:45:50 +02:00
Felix Ableitner 9d4973829b Add integration test to ensure that signatures are verified 2020-09-18 16:37:46 +02:00
Dessalines 7bdb1abbe6
Published user time (#1141)
* Adding published time to UserForm.

- Federates user creation time. Fixes #1140

* Check the user published time.
2020-09-18 11:04:12 +00:00
dessalines fc525c8144 Merge pull request 'Add tests for avatars, banners and more' (#102) from more-tests into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/102
2020-09-17 18:22:07 +00:00
Felix Ableitner cdb02c992c Add tests for avatars, banners and more 2020-09-17 17:41:51 +02:00
Dessalines 9f4493a0b2 Updating cargo.lock. 2020-09-16 12:37:09 -05:00
Dessalines 397fc74a56 Merge branch 'update-deps' into main 2020-09-16 12:35:37 -05:00
Dessalines 93f681bf7a Turn off email notifications. 2020-09-16 09:24:42 -05:00
Dessalines 96535366c3 Running cargo fmt. 2020-09-16 08:31:30 -05:00
Dessalines 3fbc8b130d Adding site checking. 2020-09-16 08:29:51 -05:00
Dessalines dd93ac49a3 Merge branch 'fix/add-check-to-create-site-endpoint' of https://github.com/eiknat/lemmy into eiknat-fix/add-check-to-create-site-endpoint 2020-09-16 08:13:19 -05:00
Felix Ableitner cf4cda2434 Update deps, remove rustls, dont specify patch version 2020-09-16 14:52:20 +02:00
Felix Ableitner 98c086abb9 Move websocket structs into lemmy_structs (ref #1115) 2020-09-16 13:45:31 +02:00
eiknat d0fefca6f9 api.site: check for existing site before creating 2020-09-15 21:59:59 -04:00
Dessalines 5c6258390c
Isomorphic docker (#1124)
* Adding a way to GetComments for a community given its name only.

* Adding getcomments to api docs.

* A first pass at locally working isomorphic integration.

* Testing out cargo-husky.

* Testing a fail hook.

* Revert "Testing a fail hook."

This reverts commit 0941cf1736.

* Moving server to top level, now that UI is gone.

* Running cargo fmt using old way.

* Adding nginx, fixing up docker-compose files, fixing docs.

* Trying to re-add API tests.

* Fixing prod dockerfile.

* Redoing nightly fmt

* Trying to fix private message api test.

* Adding CommunityJoin, PostJoin instead of joins from GetComments, etc.

- Fixes #1122

* Fixing fmt.

* Fixing up docs.

* Removing translations.

* Adding apps / clients to readme.

* Fixing main image.

* Using new lemmy-isomorphic-ui with better javascript disabled.

* Try to fix image uploads in federation test

* Revert "Try to fix image uploads in federation test"

This reverts commit a2ddf2a90b.

* Fix post url federation

* Adding some more tests, some still broken.

* Don't need gitattributes anymore.

* Update local federation test setup

* Fixing tests.

* Fixing travis build.

* Fixing travis build, again.

* Changing lemmy-isomorphic-ui to lemmy-ui

* Error in travis build again.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2020-09-15 15:26:47 -04:00
eiknat b69524b498
routes.api: fix get_captcha endpoint (#1135) 2020-09-14 21:22:53 -04:00
nutomic 1870dc8cd9 Split lemmy_utils into multiple files (#96)
Update dependencies

Move send_local_notifs into lemmy_api_structs (ref #1115)

Split lemmy_utils into multiple files

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/96
2020-09-14 15:29:50 +00:00
Dessalines 762c1347ed Merge remote-tracking branch 'yerba/main' into main 2020-09-14 09:12:13 -05:00
dessalines 3bf86e4ca0 Merge pull request 'Remove brotli dependency' (#97) from remove-brotli into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/97
2020-09-14 14:12:02 +00:00
Felix Ableitner 29355c749e Remove brotli dependency 2020-09-14 12:23:05 +02:00
eday 26816b9366 db: add utils schema/funcs for view handling qol
Creates a new "utils" db schema with a simple table and two functions under "utils".  The functions take a 'schema' and 'table'- One will get all dependent views and save the ddl, the other will execute stored ddl skipping errors.  Mostly for QOL with testing migrations and making migration files smaller
2020-09-13 22:58:13 -04:00
Marcin Wojnarowski c239b9af83
Api docs corrections (#1131)
* corrected endpoint names/methods

* small typo fix
2020-09-13 11:20:24 -04:00
Dessalines 934a26f1ef Merge remote-tracking branch 'weblate/main' into main 2020-09-12 17:48:24 -05:00
riccardo fbc0c28f5e Translated using Weblate (Italian)
Currently translated at 98.9% (281 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-09-12 02:58:32 +00:00
Rob Ede 986dc3f52c
update actix-web to v3 stable (#1125) 2020-09-11 21:37:25 -04:00
Lee KiWon 8660caae9b Translated using Weblate (Korean)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ko/
2020-09-04 16:43:00 +00:00
kleeon 1a6dc72898 Translated using Weblate (Russian)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-09-04 16:42:59 +00:00
Filip Bengtsson 87cd4712e0 Translated using Weblate (Swedish)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/

Translated using Weblate (Swedish)

Currently translated at 98.5% (280 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-09-04 00:28:35 +00:00
kleeon 361655dd42 Translated using Weblate (Russian)
Currently translated at 98.9% (281 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-09-04 00:28:35 +00:00
Lucy 234411ff9a Translated using Weblate (Irish)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ga/
2020-09-04 00:28:35 +00:00
Lee KiWon 88122e0e76 Translated using Weblate (Korean)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ko/

Translated using Weblate (Korean)

Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ko/
2020-09-04 00:28:35 +00:00
nutomic bd0e69b2bb Various things refactored (#95)
Remove unused derive macros

lemmy_rate_limit doesnt depend on lemmy_api_structs anymore

Dont use "pub extern crate"

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/95
2020-09-03 19:45:12 +00:00
Dessalines af364e7fe0 Version v0.7.57 2020-09-03 09:40:59 -05:00
Dessalines b6eecfd39d Merge remote-tracking branch 'weblate/main' into main 2020-09-03 09:40:57 -05:00
Dessalines 17df0ee6b3 Merge branch 'structs_separate' into main 2020-09-03 09:02:03 -05:00
Dessalines 730cb6ce67 Merge branch 'main' into structs_separate 2020-09-03 09:01:20 -05:00
Dessalines 2aaf4228ac
Local timeline (#1111)
* Adding a local filter. Fixes #1103

* Not showing local if there are no federated instances.
2020-09-03 09:58:33 -04:00
Dessalines 4a4629763e Fixing user search leaking emails. 2020-09-03 08:48:26 -05:00
Dessalines 7101ac1b4b Merge branch 'main' into fix_docker_caching 2020-09-03 08:06:05 -05:00
Dessalines 3a6982e7b2 Adding rate_limiter and api_structs. 2020-09-02 18:17:35 -05:00
Dessalines 88978077b5 Merge branch 'fix_docker_caching' into structs_separate 2020-09-02 16:53:46 -05:00
Dessalines 8015f560d6 Adding in a more reliable docker dev build. (The other wouldn't use buildkit). 2020-09-02 15:41:49 -05:00
Dessalines e3140235de Use romacs cargo-build-deps tool. 2020-09-02 10:42:48 -05:00
Felix Ableitner 353e2e027a Move api structs and rate limit into separate workspaces 2020-09-02 13:27:31 +02:00
Filip Bengtsson b0b93ba1e6 Translated using Weblate (Swedish)
Currently translated at 98.5% (280 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-09-02 03:30:02 +00:00
kleeon 1d156e3854 Translated using Weblate (Russian)
Currently translated at 98.9% (281 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-09-02 03:30:02 +00:00
Lucy b0af949480 Translated using Weblate (Irish)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ga/
2020-09-02 03:30:02 +00:00
Lee KiWon 09535e294a Translated using Weblate (Korean)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ko/

Translated using Weblate (Korean)

Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ko/
2020-09-02 03:30:01 +00:00
Dessalines dfa9cb57aa Running cargo +nightly fmt. 2020-09-01 16:44:56 -05:00
Felix Ableitner 5d64dfd4dc Remove wildcard imports (in particular super::*) 2020-09-01 15:20:22 +02:00
Dessalines dc1bc741b4 Fixing docker caching. 2020-08-31 16:47:31 -05:00
Dessalines 34e539cdc0 Updating dev docker-compose. 2020-08-31 13:39:01 -05:00
dessalines ad7dfb0181 Merge pull request 'Simplify docker federation setup' (#92) from update-docker-federation into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/92
2020-08-31 16:50:43 +00:00
dessalines c4dd28e252 Merge pull request 'Refactor websocket to split it into multiple files' (#91) from refactor-websocket into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/91
2020-08-31 16:43:16 +00:00
Felix Ableitner 147972273a Simplify docker federation setup 2020-08-31 17:32:21 +02:00
Felix Ableitner b15c406924 Refactor websocket to split it into multiple files 2020-08-31 17:20:13 +02:00
nutomic d4dccd17ae implement ActivitySender actor (#89)
Merge pull request 'Adding unique ap_ids. Fixes #1100' (#90) from unique_ap_ids into activity-sender

Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/90

Adding back in on_conflict.

Trying to add back in the on_conflict_do_nothing.

Trying to reduce delay time.

Removing createFakes.

Removing some unit tests.

Adding comment jest timeout.

Fixing tests again.

Fixing tests again.

Merge branch 'activity-sender' into unique_ap_ids_2

Replace actix client with reqwest to speed up federation tests

Trying to fix tests again.

Fixing unit tests.

Fixing some broken unit tests, not done yet.

Adding uniques.

Adding unique ap_ids. Fixes #1100

use proper sql functionality for upsert

added logging

in fetcher, replace post/comment::create with upsert

no need to do an actual update in post/comment::upsert

Merge branch 'main' into activity-sender

implement upsert for user/community

reuse http client

got it working

attempt to use background-jobs crate

rewrite with proper error handling and less boilerplate

remove do_send, dont return errors from activity_sender

WIP: implement ActivitySender actor

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/89
2020-08-31 13:48:02 +00:00
Dessalines 18002bc837 Version v0.7.56 2020-08-29 17:21:40 -04:00
Dessalines 8184c8021a Merge remote-tracking branch 'weblate/main' into main 2020-08-29 17:21:39 -04:00
Dessalines d0ad8022d9 Merge branch 'kartikynwa-webmanifest' into test 2020-08-29 17:00:56 -04:00
Dessalines e8600447ed Merge branch 'webmanifest' of https://github.com/kartikynwa/lemmy into kartikynwa-webmanifest 2020-08-29 17:00:43 -04:00
Dessalines f587008d61 Merge branch 'add-service-worker' of https://github.com/eiknat/lemmy into eiknat-add-service-worker 2020-08-29 09:36:58 -05:00
Dessalines b762760e96 Updating korean translation. 2020-08-29 09:29:49 -05:00
Mostafa Ahangarha 36e4ab00da Translated using Weblate (Persian)
Currently translated at 54.9% (156 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fa/
2020-08-29 08:42:08 +00:00
Lee KiWon 1ef3591e17 Translated using Weblate (Korean)
Currently translated at 100.0% (284 of 284 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ko/
2020-08-29 08:42:08 +00:00
eiknat bebdc851c9 Add service worker 2020-08-28 23:47:15 -04:00
Joshua Thomas 0f8372c0fb
Bugfix: Adds case-insensitive SELECT queries to User_::find_by_username() (#1108) 2020-08-28 20:49:31 -04:00
Dessalines 4819bd5608 Version v0.7.55 2020-08-27 10:38:29 -04:00
Sergio Varela 5e78479371 Translated using Weblate (Spanish)
Currently translated at 98.4% (262 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/

Translated using Weblate (Spanish)

Currently translated at 96.2% (256 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-08-27 14:36:45 +00:00
Panos Alevropoulos d3a00014c9 Translated using Weblate (Greek)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/
2020-08-27 14:36:45 +00:00
Dessalines 3f0b3d7361 Adding korean language template. 2020-08-27 10:34:53 -04:00
Dessalines 2d5a50e80f
Fixing broken websocket sends. Removing WebSocketInfo (#1098) 2020-08-24 11:58:24 +00:00
Dessalines 2080534744
Switch front end to use lemmy-js-client. Fixes #1090 (#1097)
* Switch front end to use lemmy-js-client. Fixes #1090

* Adding an HTTP client. Cleaning up Websocket client.
2020-08-20 10:50:26 -04:00
Dessalines dbf231865d
Adding a few more apub tests. (#1096)
* Adding a few more apub tests.

* Fixing travis build, adding a get_post function.
2020-08-20 12:44:22 +00:00
Dessalines e007006daf Version v0.7.54 2020-08-18 09:43:45 -04:00
nutomic 14f2d190e5 Implement context (#86)
Implement context

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/86
2020-08-18 13:43:50 +00:00
Dessalines 53d449d5d7 Merge branch 'fix-federation-enabled-option' into main 2020-08-18 09:35:27 -04:00
Felix Ableitner fd2291c004 Dont send out any activities if federation is disabled (fixes #1095) 2020-08-18 15:12:03 +02:00
Dessalines 82faea7f85 Version v0.7.53 2020-08-17 16:53:50 -04:00
Dessalines ae39ddf031 Fixing some formatting. 2020-08-17 16:52:01 -04:00
Dessalines 3301e0ba50 Merge remote-tracking branch 'yerba/main' into main 2020-08-17 16:50:21 -04:00
nutomic ed72b096b9 Remove tests for unimplemented Crud::delete functions (#87)
Remove tests for unimplemented Crud::delete functions

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/87
2020-08-17 20:50:44 +00:00
Dessalines c323ab5275
Added option to remove banned user data (posts, comments, communities) (#1093)
- Works for both a site-ban, and a community ban.
- Fixes #557
2020-08-17 18:12:36 +00:00
Dessalines 725e46da4a Version v0.7.52 2020-08-16 11:31:09 -04:00
Dessalines abadc79756 Fix community_view clippy 2020-08-16 11:27:50 -04:00
Dessalines 0a27432b65
Encode crosspost url. Fixes #1083 (#1088) 2020-08-16 11:05:45 -04:00
Dessalines adeba99d38
Allow mods that aren't creators to leave the mod team. Fixes #786 (#1091) 2020-08-16 11:05:32 -04:00
Dessalines 7f97279c48
Fixing community search. Fixes #1084 (#1089) 2020-08-16 11:05:21 -04:00
Dessalines dd0418af18 Version v0.7.50 2020-08-14 16:00:27 -04:00
Dessalines 995e56677a Merge remote-tracking branch 'weblate/main' into main 2020-08-14 16:00:26 -04:00
Felix Ableitner 2a3b475b99 Fix crash in federation tests 2020-08-14 16:50:21 +02:00
Dessalines 6b4eb79237 Merge remote-tracking branch 'yerba/main' into main 2020-08-13 16:26:28 -04:00
nutomic 164a9c29fe Implement instance blocklist (#85)
Implement instance blocklist

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/85
2020-08-13 20:26:49 +00:00
Txopi f566af0c45 Translated using Weblate (Basque)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-08-13 16:08:10 +00:00
Dessalines 8c7c1f204c
Add a fix for double posts / comments. #1080 (#1081)
* Add a fix for double posts / comments. #1080

* Adding a comment.

* Moving upserts to lemmy_db.
2020-08-13 15:48:10 +00:00
Dessalines 1711eb98b4
Removing some unecessary unwrap. Fixes #639 (#1078)
* Removing some unecessary unwrap. Fixes #639

* Changing some location_infos.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2020-08-13 15:46:31 +00:00
Dessalines 91926b2b1c
New post notifs. Fixes #1073 (#1079)
* New post notifs. Fixes #1073

* Some refactoring of browser notifs
2020-08-13 10:42:52 -04:00
nutomic 9a343cfe8b Limit number of items read from community outbox (#84)
Limit number of items read from community outbox

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/84
2020-08-13 13:20:35 +00:00
Felix Ableitner 4981eb38fb
Merge pull request #1075 from LemmyNet/fix_online_counts
Fixing online counts. Fixes #664
2020-08-13 11:41:45 +00:00
Dessalines c19dfdae64 Fix formatting. 2020-08-12 10:45:04 -04:00
nutomic a496d8af65 Implement undo<dislike> for activitypub (#83)
Merge branch 'main' into undo-dislike

Implement undo<dislike> for activitypub

Fix some TODOs in activitypub code

Add post_read back in, do some cleanup

Add some delete functions back in

Merge branch 'main' into remove-dead-code

Replace body of unused db functions with unimplemented!()

Remove dead code

Remove remaining usages of unwrap() from activitypub code

Remove most usage of Option::unwrap() from activitypub code

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/83
2020-08-12 14:43:45 +00:00
Dessalines bb4da4da02 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-08-12 08:35:02 -04:00
Dessalines 8ee6f852cb Some formatting of post.rs 2020-08-12 08:31:05 -04:00
nutomic aace1bd71e Remove dead code (#81)
Add post_read back in, do some cleanup

Add some delete functions back in

Merge branch 'main' into remove-dead-code

Replace body of unused db functions with unimplemented!()

Remove dead code

Remove remaining usages of unwrap() from activitypub code

Remove most usage of Option::unwrap() from activitypub code

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/81
2020-08-12 12:30:52 +00:00
Dessalines 8daeba450c
Removing unnecessary oper struct. Fixes #660 (#1077) 2020-08-12 11:31:45 +00:00
Dessalines d28e5245d2
Don't allow preferred usernames to start with @. Fixes #1058 (#1076)
* Don't allow preferred usernames to start with @. Fixes #1058

* Trim the preferred username.
2020-08-12 11:13:44 +00:00
Dessalines 1c3ed864e7 Fixing online counts. Fixes #664 2020-08-11 17:46:58 -04:00
Dessalines 49892690ff Version v0.7.49 2020-08-11 10:58:40 -04:00
Dessalines bc523abd62
Add a simple linked instances page. Fixes #1070 (#1071)
* Add a simple linked instances page. Fixes #1070

* Changing allowed_instances to federated_instances.
2020-08-11 10:58:32 -04:00
nutomic 3da47352be Remove usage of Option::unwrap() in activitypub code (#80)
Remove remaining usages of unwrap() from activitypub code

Remove most usage of Option::unwrap() from activitypub code

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/80
2020-08-11 14:31:05 +00:00
Felix Ableitner c1f48d6a0e In federation test setup, run yarn build by default 2020-08-11 14:12:05 +02:00
Dessalines 95cd37827d Updating sponsor list. 2020-08-10 20:09:30 -04:00
dessalines 780e7f9497 Merge pull request 'Disable rate limiting for pictrs' (#79) from pictrs-disable-rate-limiting into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/79
2020-08-10 15:46:58 +00:00
Dessalines 0acd0bba3a Version v0.7.48 2020-08-10 11:41:18 -04:00
Felix Ableitner 51b410ce01 Disable rate limiting for pictrs 2020-08-10 14:19:53 +02:00
ernestwisniewski 7bc560b2ec
Community post count fix (#1062)
* User details ui fix

* User details ui fix

* Lang bio, merge

* Community count posts bug #1060
2020-08-09 14:50:27 -04:00
Dessalines 221db1bd1b Add email overwrite on user settings save. Fixes #1069
- Also add get_user_secure to other locations.
2020-08-08 22:36:29 -04:00
Dessalines 52ac4f70e1 Merge branch 'feature/add-user-secure' of https://github.com/eiknat/lemmy into eiknat-feature/add-user-secure 2020-08-08 21:40:47 -04:00
Dessalines 5e9ffde0b1 Version v0.7.47 2020-08-07 23:22:35 -04:00
Dessalines 410edc1df3 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-08-07 23:21:30 -04:00
Dessalines 71a0dd4cc9 Version v0.7.46 2020-08-07 23:21:05 -04:00
Dessalines 9c6673495f Merge branch 'front_end_prettying' into main 2020-08-07 23:20:02 -04:00
Dessalines 992b3ca95b Some UI fixes. 2020-08-07 23:17:37 -04:00
eiknat 492e8ad655 user_view: add fn to return sanitized fields 2020-08-07 22:43:33 -04:00
Dessalines 1d8183fe5f
Remove options for appoint as admin / mod, and transfer site for (#1065)
non-federated users. #647
2020-08-07 13:50:07 -04:00
Dessalines ddefc06fbc Version v0.7.44 2020-08-07 13:23:35 -04:00
Dessalines 84c700eecb Merge remote-tracking branch 'weblate/main' into main 2020-08-07 13:23:34 -04:00
Dessalines 9c3776d034 Removing community and user favicon setting. 2020-08-07 13:22:03 -04:00
Dessalines ded7650a60
Merge pull request #1064 from LemmyNet/apub_security_checks
Apub security checks
2020-08-07 11:33:58 -04:00
Dessalines 4896e7d096 Adding tests for admin remove for posts and comments on different
instances.
2020-08-07 10:51:53 -04:00
Dessalines cabbbf0afd Merge branch 'federation-authorisation' into apub_security_checks 2020-08-07 10:30:57 -04:00
Felix Ableitner 0cc49e6ca9 Merge branch 'main' into federation-authorisation 2020-08-07 15:19:08 +02:00
Felix Ableitner 9b7be1afb6 Some apub fixes 2020-08-07 15:18:06 +02:00
Serge Tarkovski 3cd8ded9d7 Translated using Weblate (Russian)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-08-07 01:45:59 +00:00
Dessalines ce8622b9cd Version v0.7.43 2020-08-06 21:22:15 -04:00
Dessalines 2aa6879a44 Merge branch 'front_end_prettying' into main 2020-08-06 21:19:39 -04:00
Dessalines ad77c3d2d5 Fixed mobile expanding. 2020-08-06 21:19:09 -04:00
Dessalines 3e5d5abd53 Version v0.7.42 2020-08-06 17:37:08 -04:00
Dessalines c5443b6e82 A better mobile view, upgrading darkly theme. 2020-08-06 17:34:45 -04:00
Felix Ableitner 313f315896 Various adjustments after review 2020-08-06 21:44:47 +02:00
Dessalines 7bb546c7c2 Start adding apub security checks. 2020-08-06 14:30:01 -04:00
Felix Ableitner cc2c7db9fe Add security checks and slur checks for activitypub inbox 2020-08-06 15:01:42 +02:00
Dessalines 6fa9dc599c Remove double display name. 2020-08-05 17:24:53 -04:00
Dessalines e645386842 Version v0.7.41 2020-08-05 13:55:14 -04:00
Dessalines 048271f59b Remove allowed thumbnail sizes for now. 2020-08-05 13:53:59 -04:00
Dessalines 88bd368660 Version v0.7.40 2020-08-05 12:41:40 -04:00
Dessalines 0e3f03836a Merge remote-tracking branch 'weblate/main' into main 2020-08-05 12:41:39 -04:00
Dessalines 335ebadbf8 Adding release notes. 2020-08-05 12:39:47 -04:00
Dessalines 464ea862b1
Preferred usernames, banners and icons. (#1055)
* Re-organizing federation tests. #746 #1040

* Adding federation support for user bios. Fixes #992

* Adding icons, banners, and preferred usernames.

- Added optional community icons, and community banners.
- Added user banners.
- Added Site icon and banner, with custom favicon.
- Set up preferred usernames. Fixes #1017
- Added an additional post sort: Active
  - Hot rank now uses the published time.
  - Active uses the most recent comment time, and is default.
- DB Migration was required to add all these fields to the views.
- Added transfercommunity helper function.
- Removed title column from communities page.
- Abstracted an image-upload-form.tsx, and a banner-icon-header.tsx
- Fixes #899

* Some navbar fixes.

* Fixing css

* Some fixes.

- Showing correct user icon and banner after save without page reload.
- Abstracting diesel update overwrite.
- Adding some docs.

* Adding @ when a user doesn't have a preferred username.
2020-08-05 12:03:46 -04:00
nutomic c34fffc2c4 Proxy pictrs requests through Lemmy (fixes #371) (#77)
fix check_only value for image rate limit

Fix image rate limit

Add rate limit for image uploads

Proxy pictrs requests through Lemmy (fixes #371)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/77
2020-08-05 16:00:00 +00:00
Felix Ableitner 81d4922740 Instance shouldnt send Announce activities to itself 2020-08-05 17:41:35 +02:00
riccardo 4fcbc3749c Translated using Weblate (Italian)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/

Translated using Weblate (Italian)

Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/

Translated using Weblate (Italian)

Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-08-05 14:12:53 +00:00
Felix Ableitner 233aa34d54 Verify ID of received apub objects against domain allowlist etc 2020-08-05 14:18:08 +02:00
Dessalines 37b438a77f Adding pointer unselectable to display names. 2020-08-04 17:35:57 -04:00
alisapa 1de22f0f10
Clarify community creation form (#1056)
* Clarify community creation form

* Did requested changes

* Removed div, corrected translation file

* Delete en.ts
2020-08-04 17:35:48 -04:00
Dessalines e9e1497830
Add bio federation. (#1052)
* Re-organizing federation tests. #746 #1040

* Adding federation support for user bios. Fixes #992
2020-08-04 11:06:27 -04:00
Dessalines 6f05d28c56 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-08-04 10:57:41 -04:00
Dessalines e336e5bcc0
Re-organizing federation tests. #746 #1040 (#1047)
* Re-organizing federation tests. #746 #1040

* Add more checks in inbox, plus some refactoring (#76)

Merge branch 'main' into more-inbox-permissions

Move check_community_ban() into helper function

Move slur check into helper functions

Move Claims::decode and site ban check into helper function

Note: this changes behaviour in that site ban is checked in more
places now. we could easily add a boolean parameter
check_for_site_ban to get the previous behaviour back

Rewrite user_inbox and community_inbox in the same way as shared_inbox

Add check against instance allowlist etc in shared_inbox

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/76

* Adding verbose to test results.

Co-authored-by: nutomic <nutomic@noreply.yerbamate.dev>
Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
2020-08-04 10:57:37 -04:00
Dessalines bdb95db5be Merge remote-tracking branch 'yerba/main' into main 2020-08-04 10:39:48 -04:00
nutomic 76cd6ac6bc Add more checks in inbox, plus some refactoring (#76)
Merge branch 'main' into more-inbox-permissions

Move check_community_ban() into helper function

Move slur check into helper functions

Move Claims::decode and site ban check into helper function

Note: this changes behaviour in that site ban is checked in more
places now. we could easily add a boolean parameter
check_for_site_ban to get the previous behaviour back

Rewrite user_inbox and community_inbox in the same way as shared_inbox

Add check against instance allowlist etc in shared_inbox

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/76
2020-08-04 14:39:55 +00:00
Dessalines 97d2584a3b
Update deps (#1049) 2020-08-03 10:38:36 +00:00
Dessalines ce874e183b Version v0.7.39 2020-08-02 10:52:42 -04:00
Dessalines 089aefc7af Hide navigation warnings on markdown textarea for site-form and user bios. Fixes #1051 2020-08-02 10:41:17 -04:00
Dessalines fbd9adb135 Fix user settings sort not working. Fixes #1050 2020-08-02 10:33:14 -04:00
Dessalines 5b23595710 Version v0.7.38 2020-08-01 23:53:32 -04:00
Dessalines c76e72b747 Fixing an issue with comments clearing out forms. Fixes #1045 2020-08-01 23:52:38 -04:00
Dessalines dee5c302a8 Version v0.7.37 2020-08-01 20:04:14 -04:00
Dessalines 942e75fa28 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-08-01 20:03:46 -04:00
Dessalines ad44b7da9c Fix user bio bug. 2020-08-01 20:03:29 -04:00
alltheseteeth 4acd3c5bd2
added trailing slash fix to every nginx conf I could find (#1046) 2020-08-01 19:33:39 -04:00
Dessalines 1a0f70450c Version v0.7.36 2020-08-01 19:17:53 -04:00
Dessalines 701abfa548 Merge remote-tracking branch 'weblate/main' into main 2020-08-01 19:17:52 -04:00
Dessalines 7938e8f5c8 Some front end fixes. 2020-08-01 19:14:54 -04:00
Dessalines 0fccb22cd7 Merge branch 'main' into front_end_prettying 2020-08-01 18:05:30 -04:00
Felix Ableitner e4d5614f3f Merge remote-tracking branch 'github/main' into main 2020-08-01 17:42:33 +02:00
dessalines f190b272b9 Merge pull request 'Update activitystreams to 0.7.0-alpha.3 (from crates.io)' (#75) from update-activitystreams into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/75
2020-08-01 15:30:04 +00:00
andor0 b6411aba7a
Migrate from failure to anyhow and thiserror (#1042)
* Migrate from failure to anyhow and thiserror

* Replace 'format_err!' to 'anyhow!'
2020-08-01 14:04:42 +00:00
Felix Ableitner 9a004c4535 Update activitystreams to 0.7.0-alpha.3 (from crates.io) 2020-08-01 15:25:17 +02:00
Dessalines 78603e7e31 Update inferno-i18next. 2020-07-31 11:59:46 -04:00
Azriel Lector 1acb51105a
Add user bios (#1043)
* Add user bios

* Version v0.7.35

* Add domain name change instructions to docs. (#1044)

* Add domain name change instructions to docs.

* Changing docker execs to docker-compose execs

* Set maxLength to user bio and render as md

* Fix bio updating after SaveUserSetting

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2020-07-30 21:08:13 -04:00
Monday Tuesday 1e75e6591a Translated using Weblate (German)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/

Translated using Weblate (Polish)

Currently translated at 92.1% (245 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pl/
2020-07-30 21:37:32 +00:00
Dessalines 90ae426e24 Some small fixes. 2020-07-30 14:25:01 -04:00
Dessalines e31f74c3ad
Add domain name change instructions to docs. (#1044)
* Add domain name change instructions to docs.

* Changing docker execs to docker-compose execs
2020-07-30 15:51:28 +00:00
Dessalines dc4ac6345c Version v0.7.35 2020-07-29 22:36:27 -04:00
Dessalines f0ce7b0e0f Merge remote-tracking branch 'yerba/main' into main 2020-07-29 22:35:50 -04:00
Dessalines c24a619594 Minor syntax fix. 2020-07-29 22:35:08 -04:00
Dessalines 25e61b276a Version v0.7.34 2020-07-29 22:30:38 -04:00
Dessalines 58b2dff0cd Merge remote-tracking branch 'weblate/main' into main 2020-07-29 22:30:37 -04:00
Dessalines d14bc121c0 Fixing language setting issue. Fixes #1041 2020-07-29 22:29:41 -04:00
Monday Tuesday 9ddc6659ec Translated using Weblate (Polish)
Currently translated at 92.1% (245 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pl/
2020-07-29 22:06:21 +00:00
Lucy d2074cb669 Translated using Weblate (Irish)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ga/
2020-07-29 22:06:20 +00:00
nutomic 6d8e1a7ab5 Merge pull request 'Add community outbox' (#74) from community-outbox into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/74
2020-07-29 20:51:54 +00:00
Felix Ableitner 678e1fa927 Add community outbox (ref #1018) 2020-07-29 22:49:52 +02:00
Felix Ableitner 705e74f4b9 Federate sticky flag (ref #1018) 2020-07-29 19:15:30 +02:00
nutomic f5211aab2a Merge pull request 'Refactor inbox, simplify and split into multiple files' (#72) from inbox-refactoring into main
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/72
2020-07-29 17:13:13 +00:00
Felix Ableitner cee72065e9 Merge branch 'main' into inbox-refactoring 2020-07-29 15:41:05 +02:00
Dessalines 04cb1e0161 Version v0.7.33 2020-07-29 09:06:26 -04:00
Dessalines 35e6aa0d94 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-07-29 09:06:04 -04:00
Dessalines 19db9dea30 Fix an issue with user language setting. 2020-07-29 09:05:46 -04:00
Dessalines 49bd28e2d4
Adding visual captchas for register and login. (#1027)
* Adding visual captchas for register and login.

* Adding audio wav file for Captcha using espeak.

* Lots of captcha fixes.

- Removed login captchas.
- Added settings to disable captchas, and change difficulty.
- Captchas can only be checked / used once, front end gives a new one on
  failure.
- Added front end button for regenerating captcha.
- Added a disabled / pause button audio playing.

* Some more fixes.
2020-07-29 09:02:46 -04:00
Felix Ableitner 8ad4378960 Disable ID domain check in FromApub until we figure it out properly 2020-07-29 13:58:39 +02:00
Felix Ableitner a85873d294 Take correct community uri in shared_inbox, rename fetch_remote* methods 2020-07-29 13:46:11 +02:00
Dessalines 5dd0efb280 Version v0.7.32 2020-07-29 00:29:56 -04:00
Dessalines 2d00b1d0fb Using full community title as document.title 2020-07-29 00:29:19 -04:00
Dessalines ff7e0c72f9 Merge branch 'Axighi-master' into front_end_prettying 2020-07-29 00:24:49 -04:00
Dessalines ae78b3473f Some more prettifying, cleaning up community and main.tsx 2020-07-29 00:23:24 -04:00
Azriel Lector 75fe38ab08 Remove `/u/` and `/c/` schemes from UI 2020-07-29 11:16:27 +08:00
Dessalines 52b221e3c9 Version v0.7.31 2020-07-28 21:20:19 -04:00
Dessalines abeefc95bb Merge remote-tracking branch 'weblate/main' into main 2020-07-28 21:20:17 -04:00
Dessalines b2d2553305 Adding a unit test for a federated comment like. 2020-07-28 19:37:19 -04:00
Dessalines ced3cbde73 Merge branch 'main' into inbox-refactoring-dessalines 2020-07-28 18:55:50 -04:00
Dessalines ceb18b528a Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-07-28 18:18:33 -04:00
Dessalines 28faf170e9 Adding a sponsor. 2020-07-28 18:06:10 -04:00
Felix Ableitner 494fcfdb8f Add helper function to generate proper activity IDs 2020-07-28 19:23:16 +02:00
Lucy 1982fd630d Translated using Weblate (Irish)
Currently translated at 99.2% (264 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ga/

Translated using Weblate (Irish)

Currently translated at 62.4% (166 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ga/
2020-07-28 17:04:21 +00:00
Ron cafa164f60 Translated using Weblate (Russian)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-07-28 17:04:21 +00:00
Serge Tarkovski 4915c31b03 Translated using Weblate (Russian)
Currently translated at 99.6% (265 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-07-28 17:04:21 +00:00
Dessalines 8d1ec88195
Enforce rustfmt +nightly for consistent rust imports. (#1035) 2020-07-28 12:42:14 -04:00
Felix Ableitner be2d9f0427
Merge pull request #1033 from LemmyNet/post_thumbnail_url_fixes
Fix post thumbnail_url to use full urls. Fixes #632
2020-07-28 18:22:24 +02:00
Dessalines e605d58888 Merge branch 'main' into inbox-refactoring-merge 2020-07-28 12:08:28 -04:00
Dessalines 1ed63e99d9 Fix post thumbnail_url to use full urls. Fixes #632 2020-07-28 11:42:40 -04:00
Felix Ableitner 1ed7c59491 Refactor inbox, simplify and split into multiple files 2020-07-28 14:41:15 +02:00
ernestwisniewski aaa4361158
User details ui fix (#1032)
* User details ui fix

* User details ui fix
2020-07-27 20:05:29 -04:00
Dessalines 5ada39f39c
Admin-settings page fix. (#1031) 2020-07-27 11:54:59 -04:00
Dessalines 6e4599411b
Adding inferno-helmet to fix page titles. Fixes #1028 (#1030) 2020-07-27 11:54:42 -04:00
Dessalines 80943a65e6
Upgrade front deps. (#1029)
* Adding a sponsor.

* Upgrade some front end deps.
2020-07-27 11:42:31 -04:00
Dessalines c066915b8e
Federate sticky flag dessalines (#1021)
* Federate sticky flag (ref #1018)

* Adding tests for federated sticky and lock.

* Changing test to make sure it returns the correct locked error.

Co-authored-by: Felix Ableitner <me@nutomic.com>
2020-07-27 11:42:15 -04:00
Dessalines d1342afe93
Remove extra jwt claims (for user settings) (#1025)
* Remove extra jwt claims (for user settings)

- The JWT token only contains the issuer, and your user id now.
- Now only a page refresh is necessary to pick up your settings on all
  clients, including theme, language, etc.
- GetSiteResponse now gives you your user and settings if logged in.
- Fixes #773

* Remove extra comment line, I tested nsfw

* Adding a todo to add a User_::readSafe()
2020-07-27 09:23:08 -04:00
Dessalines 571d0a6500 Adding a sponsor. 2020-07-26 17:46:27 -04:00
Dessalines 617d636432 Version v0.7.30 2020-07-25 10:43:42 -04:00
Dessalines 978a86cdaa Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-07-25 10:43:11 -04:00
Dessalines eb6df560d8 Only deploy on tags. 2020-07-25 10:41:55 -04:00
Dessalines c335069310
Add Apps / Clients section to readme. (#1019)
* Add Apps / Clients section to readme.

* Separating apps and libraries.
2020-07-25 11:29:24 +00:00
Dessalines 0ff9af5ba5 Version v0.7.29 2020-07-24 22:06:16 -04:00
Dessalines cd01c7ebd7 Merge remote-tracking branch 'weblate/main' into main 2020-07-24 22:06:14 -04:00
Dessalines edb2e40383
Automated travis docker testing and deploys. (#1023)
* Testing out a travis 1.

* Testing out a travis 2.

* Testing out a travis 3.

* Testing out a travis 4.

* Testing out a travis 5.

* Testing out a travis 6. Trying a failing test

* Testing out a travis 7. Trying to cache the docker images.

* Testing out a travis 8. Still not correctly failing.

* Trying full path for docker_images dir.

* Fixing test again, trying a dockerhub deploy.

* Fixing test again, trying a dockerhub deploy 2.

* Remove caching.

* Trying to fix docker deploy.

* Try using the travis tag

* Using dessalines/lemmy:travis

* Try using the prod dockerfile now.

* Update http sigs dependency

* Finally getting this mostly working.

Co-authored-by: asonix <asonix@asonix.dog>
2020-07-24 22:06:00 -04:00
Riley ceaa485f06
Update http sigs dependency (#1022) 2020-07-24 19:57:13 -04:00
Filip Bengtsson 70aa9531ef Translated using Weblate (Swedish)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-07-24 22:11:34 +00:00
Txopi 394c8e8037 Translated using Weblate (Basque)
Currently translated at 100.0% (266 of 266 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-07-24 22:11:34 +00:00
Dessalines 255068f52d Merge remote-tracking branch 'weblate/main' into main 2020-07-23 23:38:12 -04:00
Ron d8005f455c Translated using Weblate (Russian)
Currently translated at 99.2% (253 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-07-24 01:21:50 +00:00
Dessalines 036c76798b Adding to sponsors list. 2020-07-23 14:40:05 -04:00
Dessalines edfd10262f Version v0.7.28 2020-07-23 09:48:39 -04:00
Dessalines afea72133a Merge remote-tracking branch 'weblate/main' into main 2020-07-23 09:48:05 -04:00
Dessalines 76fec39670 Adding a lot of front end prettying.
- Re-did litely theme.
- Increased spacing.
- Fixed up navbar to not full width.
- Made login/sign up stand out.
- Made thumbnails have a light background.
- Removed btn-sm, made almost all buttons bigger.
- Made all badges lighter.
- Made card backgrounds transparent.
- Fixes #888
2020-07-23 02:10:22 -04:00
Dessalines 01cc8654e2
Fixing config_file env to use defaults instead (since its required). (#970)
* Fixing config_file env to use defaults instead (since its required). Fixes #764

* Changing the read / write to the custom config file one

* Adding a config note.
2020-07-22 20:17:41 -04:00
Ron f5f7325ce3 Translated using Weblate (Russian)
Currently translated at 98.8% (252 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-07-22 23:15:38 +00:00
Ady Nemo a49172877d Translated using Weblate (French)
Currently translated at 99.6% (254 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-07-22 23:15:38 +00:00
Ruan Bahia db02e2b29d Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 98.8% (252 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-07-22 23:15:38 +00:00
riccardo b364f4a1be Translated using Weblate (Italian)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-07-22 23:15:38 +00:00
Felix Ableitner 227f397d5e
Merge pull request #997 from LemmyNet/api_edit_separation
Api edit separation.
2020-07-22 22:33:39 +02:00
Dessalines 59da2976ab Some more API cleanup.
- Extracted methods for is_mod_or_admin, and is_admin.
- Removed admins from GetPostResponse and GetCommunityResponse.
- Some cleanup.
2020-07-22 14:20:08 -04:00
Dessalines b6a6d52a92 Merge branch 'main' into api_edit_separation 2020-07-22 13:47:52 -04:00
Dessalines db0d213710 Version v0.7.26 2020-07-22 09:56:15 -04:00
Dessalines 5d0e7663b8 Merge remote-tracking branch 'weblate/main' into main 2020-07-22 09:56:14 -04:00
Felix Ableitner 3f00140f5d Use activitystreams from yerbamate.dev mirror (fixes #1012) 2020-07-22 00:07:09 +02:00
Dessalines 5e5063cbdd Adding some helper functions. 2020-07-21 13:52:57 -04:00
Felix Ableitner bbcb782b33 Remove proxy_cache from nginx config 2020-07-21 18:10:53 +02:00
Dessalines f81a7ad9ab Adding form_id to comment creates and edits.
- This adds a form_id to CreateComment, EditComment, and CommentResponse
- This is so any front end clients can add a randomly generated string,
  and know which comment they submitted, is the one they're getting
  back.
- This gets rid of all the weird complicated logic in handleFinished(),
  and should stop the comment forms getting cleared once and for all.
2020-07-21 10:56:41 -04:00
Dessalines 4b6a762a56 Added an is_mod_or_admin function to Community 2020-07-21 10:15:17 -04:00
Dessalines 55ce7b1339
Adding version to GetSite. Fixes #1001 (#1002)
* Adding version to GetSite. Fixes #1001

* Removing version.ts file
2020-07-21 13:20:23 +00:00
Ady Nemo cac4abbe1b Translated using Weblate (French)
Currently translated at 99.6% (254 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-07-21 10:51:22 +00:00
Ruan Bahia 44897067ea Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.8% (252 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-07-21 10:51:22 +00:00
riccardo 981efde3ff Translated using Weblate (Italian)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-07-21 10:51:22 +00:00
Filip Bengtsson 30a2a6662f Translated using Weblate (Swedish)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-07-21 10:51:22 +00:00
Dessalines f93f2fe03c Changing location of sub and superscript buttons. 2020-07-20 23:58:58 -04:00
Dessalines 662efbcb68 Merge branch 'main' of https://github.com/commagray/lemmy into commagray-main 2020-07-20 23:51:44 -04:00
Dessalines 2eac037408 Adding post delete, remove, lock, and sticky. 2020-07-20 23:46:36 -04:00
Dessalines fd96dfdb5e Added comment delete, remove, read. 2020-07-20 21:37:44 -04:00
Coma Grayce 020cb77613
Add buttons. 2020-07-21 02:40:01 +03:00
Coma Grayce cbed6547e2
Again, ooops. 2020-07-21 01:19:11 +03:00
Coma Grayce cd0f1a8eb2
Ooops. 2020-07-21 01:08:59 +03:00
Coma Grayce 6fbfb69ee4
Add sub and sup Markdown tags. 2020-07-21 01:06:22 +03:00
Dessalines ca7d2feedb Some GetUserDetails cleanup. 2020-07-20 15:32:15 -04:00
Dessalines 613b462662 Merge branch 'main' into api_edit_separation 2020-07-20 14:41:20 -04:00
Dessalines ef35971dfb Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-07-20 14:41:12 -04:00
Dessalines 9bc6698f58 Added community delete and remove. 2020-07-20 13:37:39 -04:00
Felix Ableitner d2f015d5d0
Merge pull request #994 from LemmyNet/community_user_actor_id_dupes
Community user actor id dupes
2020-07-20 17:37:46 +02:00
Dessalines a67f46bec5 EditUserMention changed to MarkUserMentionAsRead. 2020-07-20 10:56:40 -04:00
jcfrancisco 1a421e96d7
📝 Add macOS-specific instructions for local development. (#996)
* 📝 Add macOS-specific instructions for local development.

* 📝 Remove extra 'git' package installation instruction
2020-07-20 10:03:15 -04:00
Dessalines 52810aa626 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-07-20 10:02:58 -04:00
Dessalines 0a28ffb9c4 Private message delete and read extracted. 2020-07-20 00:29:44 -04:00
Dessalines dca38d10eb Merge branch 'community_user_actor_id_dupes' into api_edit_separation 2020-07-19 17:03:27 -04:00
Dessalines 8940ce7dbb Merge remote-tracking branch 'weblate/main' into main 2020-07-19 16:43:21 -04:00
Dessalines 2ff7acf207 Moving dupe checking to before new actor_id generation. 2020-07-19 13:32:50 -04:00
Dessalines 87202b4915 Fixing duplicate actor_id for community and user. Fixes #957 2020-07-19 13:12:42 -04:00
Dessalines b03a2d7995 Ran cargo fmt. 2020-07-19 12:26:23 -04:00
Dessalines f0a223f337 Choices.destroy isnt working properly. 2020-07-18 19:36:45 -04:00
Filip Bengtsson d23a596c3d Translated using Weblate (Swedish)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-07-18 06:16:27 +00:00
Dessalines 3342a6a910 Version v0.7.25 2020-07-17 18:54:34 -04:00
Dessalines 598e23622e Merge remote-tracking branch 'weblate/main' into main 2020-07-17 18:54:33 -04:00
eiknat 03758a4f92
validate post URLs on the backend (#990)
* added serverside url validation

* api.post: use if let instead of is_some

also add "invalid_url" to en.json

Co-authored-by: John Doe <dhas8m@protonmail.com>
2020-07-17 18:46:59 -04:00
nutomic 77a2a5eb01 Update activitystreams library to latest version (#71)
Merge branch 'main' into more-upgrade-apub-3

Update activitystreams library to latest version

Remove remaining usages of old activitystreams library

Migrate community inbox and user inbox

Migrate private message

Migrate post

Migrate community activities

Migrate extensions to new activitystreams library

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/71
2020-07-17 21:11:07 +00:00
Filip Bengtsson 845482a623 Translated using Weblate (Swedish)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-07-17 20:31:57 +00:00
Ady Nemo 57db25e4a6 Translated using Weblate (French)
Currently translated at 99.2% (253 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-07-17 20:31:57 +00:00
Tirifto 8f781c4757 Translated using Weblate (Esperanto)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/

Translated using Weblate (Esperanto)

Currently translated at 99.6% (254 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/
2020-07-17 20:31:57 +00:00
Dessalines 09f892a7fa Adding to sponsors list. 2020-07-17 15:27:06 -04:00
Dessalines 3b6b2c274d
Better user page loading indicators. Fixes #986 (#989) 2020-07-17 15:25:59 -04:00
Dessalines 7fdd41697e
Un-expand image when receiving new post. Fixes #979 (#988) 2020-07-17 15:25:52 -04:00
Dessalines aaa850c6c9 Better user page loading indicators. Fixes #986 2020-07-17 11:48:06 -04:00
Dessalines 2a206e1b4d Version v0.7.24 2020-07-16 21:17:34 -04:00
Dessalines c4d54fc427 Updating deploy to use weblate/main 2020-07-16 21:16:32 -04:00
Dessalines a9b180bf6f Merge remote-tracking branch 'weblate/main' into main 2020-07-16 21:15:51 -04:00
Dessalines a9de6b6d00 Merge branch 'main' of https://github.com/lemmynet/lemmy into main 2020-07-16 21:15:43 -04:00
Dessalines 1e30fcf235 Version v0.7.23 2020-07-16 21:13:18 -04:00
Dessalines 56741fcea5
Adding markdown buttons. Fixes #977 (#984) 2020-07-16 21:12:51 -04:00
Filip Bengtsson 3030d24f74 Translated using Weblate (Swedish)
Currently translated at 100.0% (255 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-07-16 21:11:40 +00:00
Tirifto f2508753b1 Translated using Weblate (Esperanto)
Currently translated at 99.6% (254 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/
2020-07-16 21:11:39 +00:00
Jon Snow 5222f0a8a7 Translated using Weblate (Russian)
Currently translated at 98.0% (250 of 255 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-07-16 21:11:39 +00:00
Felix Ableitner 2d4c41d2be Convert comments to new apub lib (including comment activities) 2020-07-15 18:26:37 +02:00
Felix Ableitner ef8118f40f migrate post to new apub lib 2020-07-15 18:03:09 +02:00
Dessalines f69f044aaa Version v0.7.22 2020-07-15 10:16:31 -04:00
Dessalines 9f36fd50b4
GetSite fixes. Fixes #975 (#978) 2020-07-15 10:00:55 -04:00
Dessalines fc15276c10
Don't allow duplicate community names in API. #957 (#974) 2020-07-15 09:55:38 -04:00
Rynach e440357bec
Update Finnish translation (#976)
Added several new lines to the translation file. In several existing lines I made the wording less janky.
2020-07-15 09:54:47 -04:00
Dessalines 78cb306c07
Don't allow community name editing. Fixes #964 (#973) 2020-07-15 09:53:52 -04:00
Felix Ableitner e04d014a3a
Merge pull request #972 from LemmyNet/master_to_main
Changing references from master to main. #820
2020-07-15 00:44:31 +02:00
Dessalines 2f5e191b2d Changing references from master to main. #820 2020-07-14 13:30:36 -04:00
Dessalines 2c0928efe0 Change styling on comment-form no login-alert. 2020-07-14 13:21:31 -04:00
Dessalines 7d6985647f Some password reset UI fixes. Fixes #955 2020-07-14 13:17:51 -04:00
Dessalines 70f15ffd6f Version v0.7.21 2020-07-14 12:12:13 -04:00
Dessalines da14612049 Merge remote-tracking branch 'weblate/master' 2020-07-14 12:12:11 -04:00
Dessalines cc0ae6343c
Fixing user mention reading. (#968) 2020-07-14 12:12:04 -04:00
Dessalines 2f32d3e6df A few fixes. 2020-07-14 11:59:15 -04:00
riccardo 073ab0aac0 Translated using Weblate (Italian)
Currently translated at 100.0% (250 of 250 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-07-14 15:54:37 +00:00
Dessalines d6fdfe0b6d Merge branch 'fix_frontend_duplicate_requests' of https://github.com/masterstur/lemmy into masterstur-fix_frontend_duplicate_requests 2020-07-14 11:26:16 -04:00
Dessalines 5ccf81349e Version v0.7.20 2020-07-14 09:17:36 -04:00
ryexandra 29037b4995
Security/fix permission bugs (#966)
* secure the `EditPost` API endpoint

* Check user is moderator in BanFromCommunity

* secure the `EditComment` API endpoint

* pass orig `read` prob when not explicitly updating it.

* Block random users from adding mods.

* use cleaner logic from `EditPost`

* prevent editing a community by a mod from transfering ownership to them

* secure `read` action in `EditPrivateMessage`

* Add check in UserMention

* only let the indended recipient mark as read

* simplify booleans to satisfy clippy

* requested changes + cargo +nightly fmt

* fix to pass federation tests for deleting comments and posts

Co-authored-by: chiminh <chiminh.tutanota.com>
Co-authored-by: Hex Bear <buildadangtrain@protonmail.com>
2020-07-14 09:17:25 -04:00
derek ef62f4698a ui.components: fix ts types, move user pagination to user details 2020-07-14 01:13:43 -04:00
derek 563a66b053 ui.components.sort-select: always parse to number 2020-07-13 20:14:01 -04:00
derek 602993ac76 ui.components.main: simplify url update logic 2020-07-13 20:14:01 -04:00
derek 47548905ce ui.components: fix selector components to work with browser buttons
Use getDerivedState to set state and only send back props
2020-07-13 20:14:01 -04:00
derek 195bf022bb ui.components.communities: deprecate componentWillReceiveProps 2020-07-13 20:14:01 -04:00
derek 5aa2a682ff ui.components.community: fix duplicate requests
Deprecate componentWillReceiveProps for getDerivedStateFromProps
2020-07-13 20:14:01 -04:00
derek af2141417a ui.components.search: fix duplicate requests
Deprecate componentWillReceiveProps for getDerivedStateFromProps
2020-07-13 20:14:01 -04:00
derek 2640efb3f0 ui.components.main: fix duplicate requests
Deprecate componentWillReceiveProps for getDerivedStateFromProps
2020-07-13 20:14:01 -04:00
derek f1d01f4fa0 ui.components: split user component up to fix duplicate requests
Replace componentWillReceiveProps with getDerivedState and pass state as props to new component
2020-07-13 20:14:01 -04:00
derek d71897620c Merge remote-tracking branch 'LemmyNet/master' 2020-07-13 20:09:39 -04:00
Dessalines 52983907c4 Version v0.7.19 2020-07-13 15:21:16 -04:00
Dessalines 23688f17bb Making chat only sortable by new. 2020-07-13 15:20:46 -04:00
Dessalines abe7a41f58 Version v0.7.18 2020-07-13 13:32:01 -04:00
Dessalines 22a33929e2
Adding docker workspace caching. Fixes #940 (#958) 2020-07-13 12:31:06 -04:00
Dessalines ac56b57faa Merge branch 'fix-migrate-apub-lib' 2020-07-13 11:57:39 -04:00
Dessalines e5d3e3a9c3
Adding a configurable config location through an env var. (#960)
* Adding a configurable config location through an env var.

- Its `LEMMY_CONFIG_LOCATION`
- Fixes #764

* Using a static for CONFIG_FILE again.

* Make clippy happy
2020-07-13 11:33:48 -04:00
Dessalines ea0881f87e Using community-link instead. 2020-07-13 10:39:15 -04:00
Dessalines 1b7a4ac090 Merge branch 'add_post_title_to_comments_view' of https://github.com/makigi-io/makigi into makigi-io-add_post_title_to_comments_view 2020-07-13 09:57:37 -04:00
Felix Ableitner bb3e29e5c4 Make reads from activitypub objects immutable 2020-07-13 15:56:58 +02:00
Riley 8f745b80d3
Wrap each inbox route individually (#954) 2020-07-13 09:55:55 -04:00
Dessalines 7556f8615f
Adding a community_name option to GetPosts /post/list . Fixes #800 (#942) 2020-07-13 09:50:13 -04:00
Dessalines a7c1c472fe
Fixing admin and mod sort order. Fixes #939 (#941) 2020-07-13 09:42:03 -04:00
Ernest 9ad0a8825a Merge remote-tracking branch 'upstream/master' into add_post_title_to_comments_view 2020-07-13 08:45:57 +02:00
Ernest e06d9a620c Add post title to user comments inbox view, comment_view, user_mention_view 2020-07-13 08:18:11 +02:00
Dessalines f0357bc988 Version v0.7.17 2020-07-12 16:16:43 -04:00
Dessalines 85fd1d6d04 Merge remote-tracking branch 'weblate/master' 2020-07-12 16:16:42 -04:00
Ernest 82dcaa4545 Migration fix 2020-07-12 20:27:21 +02:00
Dessalines c72acfd282 Fixing offset for mobile reflow. 2020-07-12 14:10:38 -04:00
Ernest a5454fe82d Add post title to user overview and user comment list 2020-07-12 19:02:38 +02:00
Ernest b037ff922c Add post title to comments view #948 2020-07-12 17:26:10 +02:00
Dessalines ff2f70b1de Moving recent comments into main view as a chat select. Fixes #943 2020-07-12 00:58:42 -04:00
Dessalines 74655de618
Comment box focus (#947)
* Add fallback url to fuse devserver(closes #945)

* Only focus on reply commentform textareas. Fixes #944

Co-authored-by: Justin Hernandez <jmarthernandez@gmail.com>
2020-07-11 21:47:38 -04:00
Dessalines f3dbfcd37b Adding number of comments for user search. 2020-07-11 19:25:17 -04:00
Dessalines f3119b5b3a Merge branch 'remove-karma-from-search' of https://github.com/jmarthernandez/lemmy into jmarthernandez-remove-karma-from-search 2020-07-11 19:16:44 -04:00
Dessalines 60288b2d06 Merge branch 'master' into jmarthernandez-remove-karma-from-search 2020-07-11 19:12:56 -04:00
Justin Hernandez 1b9f2fa5f7
Add fallback url to fuse devserver(closes #945) (#946) 2020-07-11 19:03:23 -04:00
Justin Hernandez f03161b7f9 Remove karma count from search results(fixes #853) 2020-07-11 15:57:13 -05:00
Txopi 4b124b9381 Translated using Weblate (Basque)
Currently translated at 100.0% (250 of 250 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-07-11 17:58:33 +00:00
Dessalines d63eb7c8f5 Version v0.7.16 2020-07-11 10:14:04 -04:00
ernestwisniewski 4b30b6d764
Redirect error on create_post page for not logged in users. #937 (#938) 2020-07-11 10:13:45 -04:00
Dessalines cb77339370 Version v0.7.15 2020-07-10 21:38:24 -04:00
Dessalines 8952cf659b Merge remote-tracking branch 'weblate/master' 2020-07-10 21:38:22 -04:00
Filip Duricic 9c7c7b06df
Don't show cake day indicator on the same year / day of user registration, instead show it the following years (#936) 2020-07-10 21:38:01 -04:00
Tony Antonov 8d24659892
Forbid users to use empty titles for posts (#930)
- Add a regex that checks if string contains anything but whitespace
- Check for whitespace-only titles on post creation and edit
- Trim whitespace from titles before saving
- Add frontend validation to title
2020-07-10 21:15:53 -04:00
Dessalines 7a9a973c89 Fix .travis.yml 2020-07-10 14:45:34 -04:00
Dessalines ea5276ad7f Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-07-10 14:18:46 -04:00
Dessalines 181374d2cc Fixing travis, adding a test.sh script. 2020-07-10 14:16:42 -04:00
nutomic 80aef61aed Split code into cargo workspaces (#67)
More fixes

- fixed docker builds
- fixed mentions regex test
- fixed DATABASE_URL stuff
- change schema path in diesel.toml

Address review comments

- add jsonb column back into activity table
- remove authors field from cargo.toml
- adjust LEMMY_DATABASE_URL env var usage
- rename all occurences of LEMMY_DATABASE_URL to DATABASE_URL

Decouple utils and db

Split code into cargo workspaces

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/67
2020-07-10 18:15:41 +00:00
Dessalines 8e96507cb1
Replacing selectr with choices.js for community searching. (#932)
- Fixes #839
- Fixes #847
2020-07-10 14:01:45 -04:00
Txopi 4d82e23861 Translated using Weblate (Basque)
Currently translated at 99.6% (249 of 250 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-07-10 15:27:42 +00:00
Sergio Varela b0dd8ec729 Translated using Weblate (Basque)
Currently translated at 99.6% (249 of 250 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-07-10 15:27:42 +00:00
Dessalines debbd316c2 Version v0.7.14 2020-07-09 20:16:39 -04:00
Dessalines 1377238950 Merge remote-tracking branch 'weblate/master' 2020-07-09 20:16:28 -04:00
Dessalines d271ae67aa Merge branch 'master' into remove_twemoji 2020-07-09 20:11:05 -04:00
Dessalines 961d65c0ee
Remove button for avatars. Fixes #755 (#924) 2020-07-09 20:04:09 -04:00
Dessalines 50e6d81d0b
Redirect to login page for votes, comments, pages, etc. Fixes #849 (#926) 2020-07-09 20:03:47 -04:00
Dessalines 85c07e7154
Correctly hide next / prev in paginators. Fixes #914 (#927) 2020-07-09 20:03:33 -04:00
Dessalines d222c60cef A few cake day fixes. #916 2020-07-09 19:59:02 -04:00
Filip Djuricic 5b719a03bf Translated using Weblate (Serbian (latin))
Currently translated at 26.8% (67 of 250 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sr_Latn/
2020-07-09 20:32:44 +00:00
Dessalines db09730d5f Removing twemoji, and the massive emoji picker. Fixes #895 2020-07-09 13:32:23 -04:00
Filip785 7c35fc546b Create new migration to add `creator_published` field to the `post_view` and `comment_view` 2020-07-09 17:19:30 +02:00
Filip785 10a946cab3 Merge remote-tracking branch 'upstream/master' into cake-day 2020-07-09 17:12:43 +02:00
Dessalines 20f9bde88f Making comment collapse and lightning buttons not spans. Fixes #884 2020-07-09 10:44:05 -04:00
Dessalines 558644b8b3 Adding lemmy's devs / contributors to the sidebar. Fixes #743 2020-07-09 10:15:12 -04:00
Kartik Singh 3663cb5ad5 Add webmanifest file, icons. Add manifest to index.html 2020-07-09 19:45:11 +05:30
Dessalines 75251f6e78 Adding select quoting of text for comments. Fixes #790 2020-07-09 09:47:26 -04:00
derek e7b9ab1b3a Merge remote-tracking branch 'LemmyNet/master' 2020-07-08 20:25:13 -04:00
Dessalines 3f34e5dadf Adding some languages for weblate. 2020-07-08 17:52:41 -04:00
Filip785 abdbd50f5e Merge remote-tracking branch 'upstream/master' into cake-day 2020-07-08 22:15:34 +02:00
Dessalines 32d43b85b9 Blocking page refresh when forms are filled. Fixes #671 2020-07-08 14:32:37 -04:00
Filip785 8fe8836bc2 Updates to PR as requested 2020-07-08 19:46:18 +02:00
Filip785 1b351e08aa Merge remote-tracking branch 'upstream/master' into cake-day 2020-07-08 19:30:13 +02:00
Dessalines d720993141 Merge branch 'master' into migrate-apub-lib 2020-07-08 12:13:17 -04:00
Felix Ableitner c9338027f2 Migrate user and group to new activitystreams library 2020-07-08 18:01:04 +02:00
Filip785 e7b7b0dee3 Merge remote-tracking branch 'upstream/master' into cake-day 2020-07-08 17:21:44 +02:00
Dessalines cd5f500d11 Version v0.7.13 2020-07-08 09:14:25 -04:00
Dessalines 1271c3e7cd Merge remote-tracking branch 'weblate/master' 2020-07-08 09:14:24 -04:00
Dessalines 118f197961 Merge branch 'html_titles' 2020-07-08 09:13:17 -04:00
Pierce 2f01e15cae
Fixes regression from #848
The api for actix_web::dev::ConnectionInfo changed from 2.0.0 to 3.0.0. The equivalent of 2.0.0's remote() in 3.0.0 is realip_remote_addr(), not remote_addr().

https://docs.rs/actix-web/2.0.0/actix_web/dev/struct.ConnectionInfo.html#method.remote
https://docs.rs/actix-web/3.0.0-alpha.3/actix_web/dev/struct.ConnectionInfo.html#method.realip_remote_addr
2020-07-08 02:20:08 -04:00
Dessalines cd4e0ab3c2 HTML title bugs.
- Fixing HTML titles for some pages. Fixes #801
- Removing WebSocketService.Instance.site, fetching site on demand now.
2020-07-08 01:02:14 -04:00
Filip785 68e9755e59 Add cake day display in user page & posts/comments #682 2020-07-08 02:28:47 +02:00
Isak Alexander 60a1bbeb70 Translated using Weblate (Swedish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sv/
2020-07-07 16:54:35 +00:00
Cee 4575cd4e58 Translated using Weblate (Chinese (Simplified))
Currently translated at 98.7% (246 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-07-07 16:54:34 +00:00
5HT b407e6fffe Translated using Weblate (Catalan)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ca/
2020-07-07 16:54:34 +00:00
Adolfo Jayme Barrientos edf1aed369 Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-07-07 16:54:34 +00:00
Sergio Varela fd28f1730e Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-07-07 16:54:34 +00:00
Ady Nemo ab174dc678 Translated using Weblate (French)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-07-07 16:54:34 +00:00
Adolfo Jayme Barrientos c4e25c8d9c Translated using Weblate (Catalan)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ca/

Translated using Weblate (Spanish)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/

Translated using Weblate (Catalan)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ca/
2020-07-07 16:54:33 +00:00
Tërë Rërë b6be84c909 Translated using Weblate (Albanian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/
2020-07-07 16:54:33 +00:00
Dessalines 8fda7d00d5 Version v0.7.12 2020-07-07 11:07:51 -04:00
Dessalines 382325ca47 Merge remote-tracking branch 'weblate/master' 2020-07-07 11:07:50 -04:00
Dessalines f4565d0603
Remove materialized views. (#908)
* One pass at materialized views, only about 30% faster, not good.

* Before merging master to test out bans.

* DB Rework working, still need more testing.

* Fixing accidental addadmin bug from asonix async merge.

* Fixing the comment delete trigger

* Some more DB additions.

- Adding a hot_rank desc, published desc index to post_aggregates_fast.
- Removed WITH CTE queries in favor of direct selects (since CTEs cant
  use indexes)

* Removing some unecessary indexes.

* Some more DB optimizings

- Changing the fast_id pkeys to just ids on the fast tables.
- Removing the private_message_fast, since the view contains no aggregates.
- Comment and post voting now no longer pull from the views, they update the counts directly.

* Adding community_agg_view and post_agg_views Credit: eiknat.

* Adding user and comment_view migrations. (comment_view still broken)

* Adding more views. Credit Eiknat.
2020-07-07 10:54:44 -04:00
Felix Ableitner aaa536b454 Merge branch 'improve-council-rules' 2020-07-07 14:00:43 +02:00
Felix Ableitner 6122fb9f73 Improve council rules 2020-07-07 13:54:01 +02:00
Dessalines cf13f11107 Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-07-06 11:42:00 -04:00
Dessalines b9d16d7cd0 Fixing some typos. 2020-07-06 11:39:31 -04:00
Felix Ableitner d03c435563 Revert "Verify activitypub payload digests (#885)"
This reverts commit 916592944a.
2020-07-06 14:20:29 +02:00
5HT cb73a7ae0e Translated using Weblate (Catalan)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ca/
2020-07-06 11:27:57 +00:00
Adolfo Jayme Barrientos 6a5e82ba3b Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-07-06 11:27:56 +00:00
Sergio Varela 3050183ea9 Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-07-06 11:27:56 +00:00
Ady Nemo 94b4c0b2de Translated using Weblate (French)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-07-06 11:27:56 +00:00
Adolfo Jayme Barrientos 9ce4c26c75 Translated using Weblate (Catalan)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ca/

Translated using Weblate (Spanish)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/

Translated using Weblate (Catalan)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ca/
2020-07-06 11:27:56 +00:00
Tërë Rërë ba348e5af4 Translated using Weblate (Albanian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/
2020-07-06 11:27:56 +00:00
Dessalines bf69d595b4 Adding to sponsors list. 2020-07-05 16:01:41 -04:00
Riley ce8e22ae3b
Improve import script UI, errors (#887)
* Improve import script UI, errors

* Fix jq check

* Add space between ! and which
2020-07-05 16:01:21 -04:00
Mischa Spiegelmock 3e6508f484
Fix capitalization of Ukrainian language (#910) 2020-07-05 09:07:43 -04:00
Dessalines 6780855b1f Version v0.7.11 2020-07-04 11:37:04 -04:00
Dessalines de63ff6d2a Some navbar fixes. 2020-07-04 11:35:38 -04:00
Dessalines fa0b0b68ca Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-07-04 07:59:54 -04:00
Paul Tötterman c51c5b3c44
Fix version_compare to version for ansible 2.9 (#902) 2020-07-04 11:46:08 +00:00
Dessalines bca62cbf0f Version v0.7.10 2020-07-04 07:42:29 -04:00
Dessalines a850b287b2 Merge remote-tracking branch 'weblate/master' 2020-07-04 07:42:19 -04:00
Dessalines 9530dba2c2 Update issue templates 2020-07-04 07:38:20 -04:00
ButterflyOfFire f8789689f8 Translated using Weblate (Arabic)
Currently translated at 75.1% (187 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ar/
2020-07-04 09:17:24 +00:00
Cee cc438980d1 Translated using Weblate (Chinese (Simplified))
Currently translated at 98.7% (246 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/

Translated using Weblate (Chinese (Simplified))

Currently translated at 98.7% (246 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-07-04 09:17:24 +00:00
Tërë Rërë 00870dfb5e Translated using Weblate (Albanian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/

Translated using Weblate (Albanian)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/

Translated using Weblate (Albanian)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/

Translated using Weblate (Albanian)

Currently translated at 55.8% (139 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/
2020-07-04 09:17:24 +00:00
Dessalines 1bd7218a7e Adding an issue template. 2020-07-03 23:39:43 -04:00
Dessalines e95992b704 Version v0.7.9 2020-07-03 22:26:49 -04:00
Dessalines 8ca9025311 Merge remote-tracking branch 'weblate/master' 2020-07-03 22:14:12 -04:00
Dessalines 69df9cecca Adding a search icon, and a faster transition. 2020-07-03 22:00:51 -04:00
Dessalines b1b755713e Merge branch 'master' into arrudaricardo-issue-#814 2020-07-03 21:51:42 -04:00
Dessalines 4822a53f06 Merge branch 'issue-#814' of https://github.com/arrudaricardo/lemmy into arrudaricardo-issue-#814 2020-07-03 19:31:50 -04:00
Dessalines aab68f0baf Adding to sponsors list. 2020-07-03 17:56:50 -04:00
Ricardo de Arruda 2f54532be0 Modify search button to be expandable.
*  Accordingly issue#814.

*  Input contract if un-focus input element

* Search text data persisted when contracted/expanded
2020-07-03 23:20:44 +03:00
ButterflyOfFire 1f1ea68f45 Translated using Weblate (Arabic)
Currently translated at 75.1% (187 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ar/
2020-07-03 18:21:26 +00:00
Cee f074e23c80 Translated using Weblate (Chinese (Simplified))
Currently translated at 98.7% (246 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/

Translated using Weblate (Chinese (Simplified))

Currently translated at 98.7% (246 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-07-03 18:21:25 +00:00
Tërë Rërë e0b2789840 Translated using Weblate (Albanian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/

Translated using Weblate (Albanian)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/

Translated using Weblate (Albanian)

Currently translated at 55.8% (139 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/
2020-07-03 18:21:25 +00:00
Dessalines 284f00249a
Going back from jolt to dogbin iframely. jolt one had problems. (#900) 2020-07-03 18:19:24 +00:00
Dessalines 8aa9cc11eb
Fixing federation testing docs. Fixes #878 (#879)
* Fixing federation testing docs. Fixes #878

* Removing extra clone.
2020-07-03 18:17:21 +00:00
Riley 916592944a
Verify activitypub payload digests (#885) 2020-07-03 13:22:39 -04:00
Paul Tötterman 0350f4bbeb
Fix ansible for Ubuntu 20.04 Focal (#856)
* Fix ansible for Ubuntu 20.04 Focal

* Use proper version comparison

* Changes based on feedback
2020-07-03 10:08:01 +00:00
Dessalines 1710844a1b Merge branch 'remove-karma-from-search' of https://github.com/jmarthernandez/lemmy into jmarthernandez-remove-karma-from-search 2020-07-02 11:41:48 -04:00
Justin Hernandez 08b953c0aa Remove karma count from search results 2020-07-01 22:01:48 -05:00
Dessalines 3f87b55a52 Adding to sponsors list. 2020-07-01 22:54:52 -04:00
Dessalines a6ec9dc666 Adding to sponsors list. 2020-07-01 22:50:55 -04:00
Dessalines 9e1e12f6ce Version v0.7.8 2020-07-01 21:54:36 -04:00
Dessalines 27cb9c433d Merge remote-tracking branch 'weblate/master' 2020-07-01 21:54:22 -04:00
Dessalines d22152eefd Adding a math check for logins (until we get a proper captcha). 2020-07-01 21:48:29 -04:00
Tërë Rërë 96b73cca51 Translated using Weblate (Albanian)
Currently translated at 34.1% (85 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/sq/
2020-07-02 01:23:43 +00:00
Tirifto 605ded9c73 Translated using Weblate (Esperanto)
Currently translated at 95.5% (238 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/

Translated using Weblate (Esperanto)

Currently translated at 93.9% (234 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/

Translated using Weblate (Esperanto)

Currently translated at 76.3% (190 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/
2020-07-02 01:23:43 +00:00
Dessalines 8d49dc958e Version v0.7.7 2020-07-01 20:39:51 -04:00
Dessalines c345489923 Merge remote-tracking branch 'weblate/master' 2020-07-01 20:39:50 -04:00
Dessalines db8753631c Merge branch 'dev' 2020-07-01 20:39:34 -04:00
Dessalines 2e886ce4e6 Nother fix for comment box bug. #861 2020-07-01 20:38:11 -04:00
Dessalines 52fcda96e1
Adding IP to the rate limit request line. (#882)
* Adding IP to the rate limit request line.

* Adding IP to the rate limit request line.
2020-07-01 18:54:46 -04:00
Tirifto fee0a0c867 Translated using Weblate (Esperanto)
Currently translated at 93.9% (234 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/

Translated using Weblate (Esperanto)

Currently translated at 76.3% (190 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/
2020-07-01 22:53:10 +00:00
Dessalines 360e7aec42 Adding Albanian for weblate. 2020-07-01 18:50:38 -04:00
Felix Ableitner 42c5c9fd65
Merge pull request #880 from LemmyNet/more_slurs
Adding \b before a slur.
2020-07-01 17:03:27 +02:00
Dessalines 1c0cc78f3f Adding \b before a slur. 2020-07-01 10:45:56 -04:00
Dessalines dbeb8d8da4 Merge branch 'federation' 2020-07-01 09:05:25 -04:00
Dessalines cd007febef Merge branch 'master' into federation 2020-07-01 09:04:26 -04:00
Riley a074564458
Federation async (#848)
* Asyncify more

* I guess these changed

* Clean PR a bit

* Convert more away from failure error

* config changes for testing federation

* It was DNS

So actix-web's client relies on TRust DNS Resolver to figure out
where to send data, but TRust DNS Resolver seems to not play nice
with docker, which expressed itself as not resolving the name to
an IP address _the first time_ when making a request. The fix was
literally to make the request again (which I limited to 3 times
total, and not exceeding the request timeout in total)

* Only retry for connecterror

Since TRust DNS Resolver was causing ConnectError::Timeout,
this change limits the retry to only this error, returning
immediately for any other error

* Use http sig norm 0.4.0-alpha for actix-web 3.0 support

* Blocking function, retry http requests

* cargo +nightly fmt

* Only create one pictrs dir

* Don't yarn build

* cargo +nightly fmt
2020-07-01 08:54:29 -04:00
Felix Ableitner fb2b8994c7 Improve comments in ansible inventory 2020-07-01 14:51:52 +02:00
Paul Tötterman 95f59a0272
Put Lemmy in /srv/lemmy instead of /lemmy as recommended by FHS (#857)
* Put Lemmy in /srv/lemmy instead of /lemmy as recommended by FHS

* Extract lemmy_base_dir

* Complain if lemmy_base_dir not set
2020-07-01 12:44:56 +00:00
Dessalines 5c03e9e9ee Version v0.7.6 2020-07-01 08:25:55 -04:00
Dessalines 1d10b19176 Merge remote-tracking branch 'weblate/master' 2020-07-01 08:25:07 -04:00
Dessalines e0aaa3b162 Merge branch 'ban_user_bug' 2020-07-01 08:23:59 -04:00
Dessalines c239a5f0e5 Fixing ban user bug. Fixes #876 2020-07-01 08:22:41 -04:00
Panos Alevropoulos 0d53c8dd0e Translated using Weblate (Greek)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/
2020-07-01 10:28:59 +00:00
Dessalines e8fe8d832d Merge branch 'issue-#814' of https://github.com/arrudaricardo/lemmy into arrudaricardo-issue-#814 2020-06-30 21:42:04 -04:00
Ricardo de Arruda e41117c878 Replace search button to input field at navbar.
* Search input not rendered at /search path.

* Navbar wrapped with withRouter for accessing history props.

* Flex-grow/shrink control the width of the input element dynamically.
2020-07-01 00:30:23 +03:00
Ihor Horobets 6d70067b1a
Update uk.json 2020-06-30 19:43:02 +03:00
Andy Coupe 587731583f
improve lighthouse best practices audit (#863)
* improve safety of cross origin links

* add additional safety for cross origin links

* remove duplicates
2020-06-30 09:40:57 -04:00
Dmytro Kyrychuk 09a05f72e3 Translated using Weblate (Ukrainian)
Currently translated at 29.7% (74 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/uk/
2020-06-30 13:20:59 +00:00
riccardo afb7e055e1 Translated using Weblate (Italian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-06-30 13:20:59 +00:00
yes 92b0536520 Translated using Weblate (German)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/
2020-06-30 13:20:59 +00:00
Dessalines c0b11d4fa3
Replacing dogbin/iframely docker image with jolt one. (#869)
* Replacing dogbin/iframely docker image with jolt one.

* Replacing dogbin/iframely docker image with jolt one.
2020-06-30 11:11:36 +00:00
Dessalines eded51aab6 Version v0.7.5 2020-06-29 21:05:38 -04:00
Dessalines 15ea264fcf Version v0.7.4 2020-06-29 21:02:02 -04:00
Dessalines 80bca8610e Revert "Remove mat views, no fast tables or caching added yet."
This reverts commit 97e088dcbf.
2020-06-29 21:00:28 -04:00
Dessalines c10a05cb68 Version v0.7.3 2020-06-29 20:14:16 -04:00
Dessalines 47a66df802 Merge remote-tracking branch 'weblate/master' 2020-06-29 20:13:44 -04:00
Dessalines 97e088dcbf Remove mat views, no fast tables or caching added yet. 2020-06-29 20:02:38 -04:00
Sergio Varela 3aff621478 Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-06-29 21:40:49 +00:00
Gert 3d746fc99a Translated using Weblate (Dutch)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/
2020-06-29 21:40:49 +00:00
bertol f3e3847e0a Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:40:48 +00:00
Sergio Varela 22abcb79e4 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:40:48 +00:00
Sunur Efe Vural 05ae51291c Translated using Weblate (Turkish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/tr/
2020-06-29 21:40:47 +00:00
bertol 4f40fa1ad8 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:34:24 +00:00
Sergio Varela 0dedbc7256 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:34:24 +00:00
bertol 6ece596135 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:33:45 +00:00
Sergio Varela f7dfe6abb8 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:33:44 +00:00
bertol e8e5d409f9 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:30:51 +00:00
Sergio Varela 18a38b0b11 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:30:50 +00:00
bertol 6fa358c093 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:27:25 +00:00
Sergio Varela 97a42011bb Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:27:25 +00:00
bertol 81142d3ffe Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:25:47 +00:00
Sergio Varela a106f1bcf9 Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:25:47 +00:00
bertol f5cd97e07d Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:23:59 +00:00
Sergio Varela a28788488f Translated using Weblate (Basque)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 21:23:58 +00:00
Dessalines 15af11da98 Changing front end hot reload testing to 8536 2020-06-29 16:55:14 -04:00
Dessalines be6e95e564 Merge remote-tracking branch 'yerba/master' 2020-06-29 13:24:29 -04:00
Sunur Efe Vural f12a637cdb Translated using Weblate (Turkish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/tr/
2020-06-29 17:24:09 +00:00
dessalines dcd664e61b Merge pull request 'council_admin_add' (#65) from council_admin_add into master
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/65
2020-06-29 17:24:02 +00:00
dessalines 485feecf10 Merge branch 'master' into council_admin_add 2020-06-29 17:23:51 +00:00
Sunur Efe Vural 5c8e2b5bae Translated using Weblate (Turkish)
Currently translated at 98.7% (246 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/tr/
2020-06-29 17:19:44 +00:00
Dessalines 9cf58a74d1
Merge pull request #859 from LemmyNet/adding_ansible_comment_line
Adding ansible comment line.
2020-06-29 13:09:47 -04:00
Dessalines 82419a08c2 Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-06-29 09:56:00 -04:00
Dessalines 997e373bf9 Adding ansible comment line. 2020-06-29 09:55:23 -04:00
Dessalines effd08c98a Adding some sponsors 2020-06-29 09:38:50 -04:00
Felix Ableitner c2f7db9f76
Merge pull request #854 from LemmyNet/more_slurs
Slur additions.
2020-06-29 12:55:40 +02:00
Fabio Ferrari 4a43dcc373 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-06-29 02:07:02 +00:00
Sergio Varela 309620ebbc Translated using Weblate (Basque)
Currently translated at 74.6% (186 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/

Translated using Weblate (Basque)

Currently translated at 72.6% (181 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/

Translated using Weblate (Basque)

Currently translated at 72.2% (180 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-29 02:07:01 +00:00
Panos Alevropoulos ace5b71536 Translated using Weblate (Greek)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/

Translated using Weblate (Greek)

Currently translated at 89.9% (224 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/

Translated using Weblate (Greek)

Currently translated at 64.2% (160 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/

Translated using Weblate (Greek)

Currently translated at 64.2% (160 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/
2020-06-29 02:07:01 +00:00
Dessalines 022fd31b66 Slur additions. 2020-06-28 19:41:00 -04:00
Dessalines c1b3711090 Adding line for council admins. 2020-06-28 19:23:24 -04:00
Dessalines d1f7363779 Merge remote-tracking branch 'weblate/master' 2020-06-28 13:46:29 -04:00
Dessalines 0112d0d955 Fixing test deploy, adding a rate limiter to ansible nginx config. 2020-06-28 13:44:42 -04:00
Dessalines 6672cbc253
Merge pull request #852 from edneville/noun_correction
Minor correction of nouns in README.md
2020-06-28 13:30:54 -04:00
Sergio Varela 7d861404ce Translated using Weblate (Basque)
Currently translated at 72.2% (180 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/
2020-06-28 17:01:14 +00:00
Panos Alevropoulos c293c278bf Translated using Weblate (Greek)
Currently translated at 64.2% (160 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/

Translated using Weblate (Greek)

Currently translated at 64.2% (160 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/el/
2020-06-28 17:01:14 +00:00
ed neville a804926c35 Minor correction of nouns in README.md
'Reddit' and 'Lemmy' are used as nouns so they should be title-cased.

Signed-off-by: ed neville <ed@s5h.net>
2020-06-28 10:49:35 +01:00
Dessalines 4c1cb5999c Fixing some scripts for the federation-test 2020-06-27 14:54:42 -04:00
Dessalines e517de5480 Merge branch 'master' into federation 2020-06-27 10:54:08 -04:00
Dessalines bd3051e058 Merge branch 'master' into improve-config 2020-06-27 10:09:16 -04:00
Dessalines b6fc1959e6 Merge branch 'improve-config' of https://yerbamate.dev/LemmyNet/lemmy into improve-config 2020-06-27 10:08:09 -04:00
Dessalines fab33d678b Merge remote-tracking branch 'yerba/test-docs' 2020-06-27 09:44:56 -04:00
Felix Ableitner afe3b6b2fc Add docs for testing (fixes #841) 2020-06-27 15:28:45 +02:00
Dessalines da2bb724e9 Version v0.7.2 2020-06-27 09:28:28 -04:00
Dessalines 10acb79040 Merge remote-tracking branch 'weblate/master' 2020-06-27 09:27:01 -04:00
Dessalines 208c17dcc8 Fixing comment edits stalling. Fixes #846 2020-06-27 09:03:34 -04:00
Dessalines 86dc50f9f0 Some fixes to federation.
- Advanced code migrations now disable then re-enable triggers.
  Brings run time down to < 15 seconds, no need to thread them.
- Changing ap_ids and actor_ids in migrations to a fake url,
  so it doesn't break XsdAnyUri in activitystreams.
2020-06-26 21:12:41 -04:00
maxigaz cbeb56adc6 Translated using Weblate (Hungarian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-26 22:42:45 +00:00
skrlet13 74dac13399 Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-06-26 22:42:40 +00:00
Felix Ableitner 0c89de8065 Fix previous comment, also fix link in docs 2020-06-26 19:16:41 +02:00
maxigaz 365e93125d Translated using Weblate (Hungarian)
Currently translated at 81.9% (204 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-26 00:57:47 +00:00
Dessalines 6df13643c3 Fixing link to defaults.hjson 2020-06-25 16:22:05 -04:00
maxigaz 52e66d4819 Translated using Weblate (Hungarian)
Currently translated at 77.5% (193 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-25 20:17:54 +00:00
Dessalines 3928556033 Merge branch 'master' into improve-config 2020-06-25 16:16:16 -04:00
Dessalines 7d1c6e9a40 Switching back to isahc. 2020-06-25 15:36:03 -04:00
maxigaz 3c43f5af1c Translated using Weblate (Hungarian)
Currently translated at 75.1% (187 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-25 17:33:16 +00:00
maxigaz 9306050b9a Translated using Weblate (Hungarian)
Currently translated at 63.0% (157 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-25 10:47:46 +00:00
Nikolay Korotkiy 6a428da11d Translated using Weblate (Russian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/

Translated using Weblate (Esperanto)

Currently translated at 66.6% (166 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eo/
2020-06-24 21:40:06 +00:00
maxigaz 57c8e98292 Translated using Weblate (Hungarian)
Currently translated at 58.2% (145 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-24 21:40:06 +00:00
Ady Nemo fae52848e3 Translated using Weblate (French)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/

Translated using Weblate (French)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-06-24 21:40:05 +00:00
riccardo 6bf5e573e3 Translated using Weblate (Italian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/

Translated using Weblate (Italian)

Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-06-24 21:40:05 +00:00
Felix Ableitner 96f133750d Merge branch 'fruechtchen/lemmy:master' 2020-06-24 21:04:55 +02:00
fruechtchen a774e0a2a1 update lemmy council memberlist 2020-06-24 21:03:50 +02:00
Dessalines 6e736e1f1e Version v0.7.1 2020-06-24 13:29:44 -04:00
Dessalines 2233c2a76d Merge remote-tracking branch 'weblate/master' 2020-06-24 13:29:39 -04:00
Dessalines e3860b8e97 Upgrading litely to have better vote colors. 2020-06-24 13:29:13 -04:00
Dessalines 00e2d546bf Making max markdown image height smaller. Fixes #836 2020-06-24 13:18:53 -04:00
maxigaz d9cac4ce8e Translated using Weblate (Hungarian)
Currently translated at 58.2% (145 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-24 16:11:49 +00:00
Ady Nemo d3dc5bf7c1 Translated using Weblate (French)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-06-24 16:11:49 +00:00
Riccardo Mazzon 254200f8dc Translated using Weblate (Italian)
Currently translated at 100.0% (249 of 249 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-06-24 16:11:49 +00:00
Felix Ableitner a9d98fd09b Improve config files by adding documentation and removing some fields 2020-06-24 16:09:52 +02:00
Dessalines b94d380729 Adding timeouts to message and delete picture notifications. #834 2020-06-23 21:40:59 -04:00
Dessalines dc94e58cbf Merge branch 'master' into federation_merge_from_master_2 2020-06-23 21:11:38 -04:00
Dessalines 790b944031 Changing to new lemmynet repo location. 2020-06-23 13:47:02 -04:00
Dessalines 0680dd2398 Version v0.7.0 2020-06-23 12:55:16 -04:00
Dessalines 41777ad51c Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-06-23 12:53:47 -04:00
Dessalines 4c582cf1b6 Making sure new comments don't clear out your current textarea.
- Making a better random string generator.
- Doing better incoming comment checking.
- Fixes #769
2020-06-23 12:52:07 -04:00
Dessalines 43905a041b Litely update. 2020-06-23 12:50:48 -04:00
Felix Ableitner e015424a83 Improve release notes for 0.7.0 2020-06-23 16:11:04 +02:00
Dessalines 84ed1ecdfd Fixing docker install instructions for pictshare. #831 2020-06-23 09:37:16 -04:00
Dessalines 27f2fd352a Version v0.6.85 2020-06-22 23:04:28 -04:00
Dessalines eb6b7bca20 Better fonts. 2020-06-22 23:02:34 -04:00
Dessalines 5d1212b83c Version v0.6.84 2020-06-22 22:43:57 -04:00
Dessalines 416344b361 Making a better light theme, litely. #822 2020-06-22 22:42:27 -04:00
Dessalines 11f771469f Version v0.6.83 2020-06-22 22:01:45 -04:00
Dessalines e3484de3b8 Merge branch 'master' into iav-arm-musl-dessalines 2020-06-22 20:35:09 -04:00
Dessalines bca76f1f2f Adding pict-rs to release notes. 2020-06-22 20:30:26 -04:00
Dessalines 54c735841e Version v0.6.82 2020-06-22 19:32:30 -04:00
Dessalines 318b8c691a Coerce empty post form to undefined. Fixes #602 2020-06-22 19:27:42 -04:00
Dessalines be3a375cae Instant mark all as read. Fixes #830 2020-06-22 19:21:13 -04:00
Dessalines 63fbf70eaa Disable submit when loading. Fixes #706 2020-06-22 19:05:55 -04:00
Dessalines c1dbeb43c9 Making comment, post, and message preview a card. Fixes #817 2020-06-22 18:50:06 -04:00
Dessalines ef2adcc95d Increasing comment margins. Fixes #826 2020-06-22 18:44:06 -04:00
Dessalines 1777070b46 Changing edit to save for some forms. Fixes #829 2020-06-22 18:33:51 -04:00
Dessalines 9dfdf78697 Moving save behind more menu. Fixes #827 2020-06-22 18:29:08 -04:00
Dessalines c9dcb2662c Version v0.6.81 2020-06-22 17:53:47 -04:00
Dessalines 234be6fb09 Changing to prod_lemmy:latest 2020-06-22 17:52:39 -04:00
Dessalines 32d1f42626 Version v0.6.80 2020-06-22 16:15:31 -04:00
Dessalines 1b38e33bd3 Fixing deploy script. 2020-06-22 16:13:02 -04:00
Dessalines 132e3534de Removing some commented lines from the dockerfile. 2020-06-22 15:12:37 -04:00
Dessalines 983a45e178 Merge branch 'master' into iav-arm-musl-dessalines 2020-06-22 14:57:55 -04:00
Dessalines 96c9f801a9 Merge branch 'master' of https://github.com/makigi-io/makigi into makigi-io-master 2020-06-22 14:52:46 -04:00
Dessalines 040bd4361f Fixing nginx.conf, adding nginx config update to releases.md. 2020-06-22 14:48:46 -04:00
Dessalines a4d2c2ab71 Upping thumbnail size. 2020-06-22 13:45:16 -04:00
Dessalines cbed185040 Version v0.6.79 2020-06-22 12:56:48 -04:00
Dessalines 186e261fc0 Fixing docker-compose to rely on pictrs 2020-06-22 12:53:39 -04:00
Dessalines 1fa7d17e35 Version v0.6.78 2020-06-22 12:51:18 -04:00
Dessalines f21e694907 Merge remote-tracking branch 'weblate/master' 2020-06-22 12:47:00 -04:00
Dessalines b161cad982 Fixing up the migration script some more. 2020-06-22 12:43:09 -04:00
Dessalines 4332828dd7 Fixing some things in the pictrs upgrade script. 2020-06-22 12:04:28 -04:00
Dessalines 5872658f8c Checking for imagemagick install. 2020-06-22 10:54:33 -04:00
Dessalines cb128256ed Updating nginx.conf, upgrading pict-rs 2020-06-22 08:31:15 -04:00
Ernest 8e1e9a521a Edit community name validation, translations #823 2020-06-22 09:23:54 +02:00
Ernest 4247df4295 Community name validation 2020-06-20 11:33:23 +02:00
Dessalines ceb1284f27 Fixing deploy.sh 2020-06-17 22:32:18 -04:00
Dessalines 207caeda5b Version v0.6.77 2020-06-17 22:20:30 -04:00
Dessalines 294acfe412 Version v0.6.76 2020-06-17 22:18:47 -04:00
Dessalines 0782377ae3 Version v0.6.75 2020-06-17 22:11:48 -04:00
Dessalines fd6a040568 Changing another blacklisted to blocklisted. 2020-06-17 21:29:10 -04:00
Cee 22c6cb1f99 Translated using Weblate (Chinese (Simplified))
Currently translated at 98.3% (242 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-06-17 20:25:57 +00:00
skrlet13 032af0f687 Translated using Weblate (Spanish)
Currently translated at 100.0% (246 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-06-17 20:25:57 +00:00
glorfindel 6aa65a917f Translated using Weblate (French)
Currently translated at 100.0% (246 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-06-17 20:25:57 +00:00
maxigaz 13760647f0 Translated using Weblate (Hungarian)
Currently translated at 39.8% (98 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-17 20:25:57 +00:00
Felix Ableitner 68bcc26ff6 Fix community description federation (ref #647)
Also disable the actor refetch interval in debug builds.
2020-06-16 13:35:26 +02:00
Felix Ableitner 325ed2ec3b Rename "instance_whitelist" config option to "allowed_instances" 2020-06-16 12:49:51 +02:00
Felix Ableitner 9f50432999 wip: Add migration script from pictshare to pictrs 2020-06-15 19:46:57 +02:00
Dessalines bda657b638 Some reorg of Dockerfiles. 2020-06-14 16:36:18 -04:00
Igor Velkov 6f58be9493 dockerfile for x64 and arm building with musl 2020-06-14 01:28:50 +03:00
Dessalines 6dea945a3a Pictshare image redirect. 2020-06-13 15:24:53 -04:00
Dessalines 5594bed6a8 Merge branch 'master' into use-pictrs-1 2020-06-12 17:51:37 -04:00
Dessalines f647f2ae6c Blocking pict-rs import location 2020-06-12 17:05:19 -04:00
Dessalines 7cb7c1f0f9 Adding lld to docker builds. #810 2020-06-12 16:17:01 -04:00
Dessalines da6de03536 Merge branch 'build-optimizations' of https://yerbamate.dev/LemmyNet/lemmy into build-optimizations 2020-06-12 15:53:06 -04:00
Felix Ableitner 4ea6c4ad5d Various build optimizations 2020-06-12 21:45:23 +02:00
Dessalines cddc23494d Upgrading pict-rs for working gifs. 2020-06-12 09:48:51 -04:00
Felix Ableitner 5a6f39dae4 Various build optimizations 2020-06-12 15:29:50 +02:00
Dessalines cfa40e482a
Parse out in reply to field. Fixes #694 (#799)
- When a comment or post doesn't exist locally, yet we receive
  an activitypub with it (for example, a nested comment update,
  for a community we just subscribed to, also with a post we
  don't have...), then fetch it.
2020-06-11 11:16:33 -04:00
Dessalines 1b0212377d Version v0.6.74 2020-06-11 10:28:21 -04:00
Dessalines 74c5380975 Merge branch 'master' into use-attohttpc 2020-06-11 09:53:18 -04:00
Dessalines 80992aa5ba Merge branch 'master' into local-dev-docs 2020-06-11 09:50:18 -04:00
Felix Ableitner de0fb631df Improve documentation for local development 2020-06-11 15:04:20 +02:00
Felix Ableitner 831680d27e Remove unneeded config dependencies 2020-06-11 13:09:51 +02:00
Dessalines 4cf1f080bf Adding delete picture via pict-rs delete tokens. Fixes #505 2020-06-10 22:47:06 -04:00
Dessalines 2fbd44c59d Adding pictrs thumbnail caching for urls and embeds. 2020-06-10 18:22:57 -04:00
Felix Ableitner be84c7b977 Replace isahc with attohttpc to remove curl (fixes #798) 2020-06-10 17:42:20 +02:00
Dessalines 043f484693 Version v0.6.73 2020-06-10 11:27:12 -04:00
kartikynwa 36e8ce624c
Change "Forgot Password" button's type to "button" (#797) 2020-06-10 11:12:53 -04:00
Lorenz Schmidt 13771d56cd
Add default themes with media queries (#796)
* Indicate unstable API in README and mdbook

* Support user preference for light and dark theme

* Add default themes and load them in `setTheme`

* Fixes #758
2020-06-10 11:11:51 -04:00
Dessalines 46bb3064ed Version v0.6.72 2020-06-09 22:49:42 -04:00
Dessalines def3bb4729 Merge remote-tracking branch 'weblate/master' 2020-06-09 22:49:41 -04:00
Dessalines da2229a303 Merge branch 'master' into dev 2020-06-09 22:43:28 -04:00
Dessalines 2e4c725647 Fixing toast background for all but i386. Fixes #794 2020-06-09 22:41:04 -04:00
Dessalines bd26e4e9c1 Fixing some front end pictshare to pictrs conversions. 2020-06-09 17:17:24 -04:00
maxigaz 7bc601ad3b Translated using Weblate (Hungarian)
Currently translated at 5.6% (14 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/

Translated using Weblate (Hungarian)

Currently translated at 2.4% (6 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hu/
2020-06-09 13:34:11 +00:00
Ady Nemo d8859001a7 Translated using Weblate (French)
Currently translated at 100.0% (246 of 246 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-06-09 13:34:11 +00:00
Felix Ableitner 0f1a8ec928 Merge branch 'master' into federation 2020-06-09 14:01:26 +02:00
Felix Ableitner e583e45d9a Use pictrs instead of pictshare 2020-06-08 19:52:32 +02:00
Dessalines 5c6601cb2a Merge branch 'activitystreams-new' into federation 2020-06-07 09:12:15 -04:00
Dessalines a13e9fe395 Adding galician, turkish, hungarian, and ukrainian languages. 2020-06-07 07:51:36 -04:00
ernestwisniewski c1421c9c44
Adding Polish language (#784) 2020-06-07 07:34:15 -04:00
Dessalines 55f179bf33 Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-06-06 21:23:45 -04:00
Dessalines c7b861e0ba Updating sponsor list. 2020-06-06 21:22:39 -04:00
Dessalines fe56da1654 Merge remote-tracking branch 'yerba/limit-memory' 2020-06-05 13:05:14 -04:00
Lorenz Schmidt a3a55dd195
Indicate unstable API in README and mdbook (#781) 2020-06-05 12:03:01 -04:00
Dessalines 63ca6e1e24 Version v0.6.71 2020-06-05 11:49:36 -04:00
Dessalines 9bf444e93a Removing webp for now. 2020-06-05 11:45:04 -04:00
Felix Ableitner 8257b040be Limit memory usage for pictshare and iframely 2020-06-05 17:07:38 +02:00
Dessalines 7c0ea6cfa7 Version v0.6.70 2020-06-04 21:42:08 -04:00
Dessalines ee32072489 Fixing webp issue for safari. 2020-06-04 21:40:57 -04:00
Dessalines f40f74b20d Adding additional 3-instance integration test for community announce. 2020-06-03 17:55:32 -04:00
Felix Ableitner c1ef766125 migrate follow 2020-06-03 21:44:14 +02:00
Dessalines 2e882f75f2 Version v0.6.69 2020-06-03 12:11:52 -04:00
Dessalines 9a9a0b9735 Changing cache to 1 hour until we can figure out caching issue. 2020-06-03 12:11:40 -04:00
Dessalines 361cf995da Version v0.6.68 2020-06-03 11:46:09 -04:00
Dessalines 686f1d57cb Merge branch 'dev' 2020-06-03 11:42:06 -04:00
Dessalines 2deb0b3d7f Adding webp for pictshare images / avatars. Fixes #772 2020-06-03 11:41:22 -04:00
Felix Ableitner 3999e0485e migrate tombstone 2020-06-03 17:10:16 +02:00
Felix Ableitner b2a7ce834d Enable gzip compression for .svg 2020-06-03 11:59:39 +02:00
Dessalines 59d22ef775 Version v0.6.67 2020-06-02 19:59:49 -04:00
Dessalines b1b9568c96 Adding text-body class to message toast. Fixes #736 2020-06-02 19:58:28 -04:00
Dessalines 1e88b815da Updating pictshare docker image. 2020-06-02 19:29:29 -04:00
Dessalines 998b9454b2 Version v0.6.66 2020-06-02 14:05:17 -04:00
Dessalines d5b97c74f8 Merge remote-tracking branch 'weblate/master' 2020-06-02 14:04:54 -04:00
Dessalines a8160288ae Merge remote-tracking branch 'yerba/cache-control' 2020-06-02 14:03:38 -04:00
Felix Ableitner 21e913192a Add cache-control header to HTTP responses based on mime 2020-06-02 19:22:00 +02:00
PifyZ 16144c7be6 Translated using Weblate (French)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-06-01 21:32:00 +00:00
odamite 865185efad Translated using Weblate (Finnish)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fi/

Translated using Weblate (Finnish)

Currently translated at 93.4% (228 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fi/
2020-06-01 21:32:00 +00:00
bertol 4148280a8e Translated using Weblate (Basque)
Currently translated at 25.0% (61 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/eu/

Translated using Weblate (Spanish)

Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-06-01 21:32:00 +00:00
Felix Ableitner 1aa30d855e address review comments 2020-06-01 16:48:07 +02:00
Felix Ableitner f3aba6da92 fix comment notifications 2020-05-30 20:05:42 +02:00
Felix Ableitner c34cc46c2d get it working (mostly) 2020-05-30 19:44:50 +02:00
Felix Ableitner 52206998aa more fixes 2020-05-30 15:38:01 +02:00
Dessalines 0c2905fd2d Merge branch 'dev' 2020-05-29 13:03:44 -04:00
Dessalines 445f38eb3c More clear remove / delete translations. #712 2020-05-29 13:03:39 -04:00
Dessalines 847e19f22d Version v0.6.65 2020-05-28 14:13:47 -04:00
Dessalines ef7d10262a Merge remote-tracking branch 'weblate/master' 2020-05-28 14:13:44 -04:00
Felix Ableitner d6e2119277 make comments work (more or less) 2020-05-28 20:09:37 +02:00
Dessalines 29fc3681b9
Validate register usernames on the back-end. Fixes #716 (#750)
* Validate register usernames on the back-end. Fixes #716

* Changing name to is_valid_username
2020-05-28 14:07:36 -04:00
Dessalines 871f09d109 Changing meaning to with in sponsors message. 2020-05-28 13:58:17 -04:00
Dessalines d9ec95ab5b For top-bar post creation, dont select a default community. Fixes #729 2020-05-28 12:55:18 -04:00
Dessalines dd5cedcfea Remove only show scrollbar on hover, change to auto. Fixes #734 2020-05-28 11:37:23 -04:00
Felix Ableitner 8f9bd1fef7 get some more things working 2020-05-28 15:20:12 +02:00
Felix ce0a37cdf1 get it working (mostly) 2020-05-28 13:51:48 +02:00
Felix cac7011d53 move logic to sharedinbox 2020-05-28 13:44:52 +02:00
Felix 5753c4feaa Let community announce posts 2020-05-28 13:15:51 +02:00
Anthony Ettinger b08574fd57 fix dimensions 2020-05-28 12:45:50 +02:00
Anthony Ettinger baa402f82f add icon 2020-05-28 12:45:50 +02:00
T 1b132b5780 Translated using Weblate (German)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/

Translated using Weblate (German)

Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/

Translated using Weblate (German)

Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/

Translated using Weblate (German)

Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/

Translated using Weblate (German)

Currently translated at 98.3% (240 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/

Translated using Weblate (Dutch)

Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/

Translated using Weblate (Dutch)

Currently translated at 99.1% (242 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/

Translated using Weblate (Dutch)

Currently translated at 94.2% (230 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/

Translated using Weblate (Dutch)

Currently translated at 93.8% (229 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/

Translated using Weblate (Dutch)

Currently translated at 90.1% (220 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/nl/
2020-05-28 10:15:06 +00:00
Dessalines 80653a5317
Remove federation option from master. (#745) 2020-05-25 18:48:24 -04:00
Dessalines a9af247f1e Merge branch 'federated_embeds' into federation 2020-05-25 16:15:23 -04:00
Dessalines e54eac6227 Adding use_tls to lemmy.hjson for email config. 2020-05-24 18:31:17 -04:00
Dessalines 4f518a5d92 Version v0.6.64 2020-05-24 13:25:50 -04:00
Dessalines 0a167a7bc7 Merge remote-tracking branch 'weblate/master' 2020-05-24 13:25:49 -04:00
Dessalines 7f58ea2725 Updating federation dev branch. 2020-05-24 13:25:29 -04:00
ButterflyOfFire 8ec2dcc633 Translated using Weblate (Arabic)
Currently translated at 76.2% (186 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ar/
2020-05-22 15:24:40 +00:00
Adam Adamsky 67d3595880 Translated using Weblate (Polish)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pl/
2020-05-22 15:24:40 +00:00
diorama 6034303b24 Translated using Weblate (Italian)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-05-22 15:24:40 +00:00
Dessalines ed553aa9f0 Updating sponsor link. 2020-05-21 21:15:39 -04:00
Felix d1aca27126 Use activitystreams-ext 2020-05-18 18:15:26 +02:00
Dessalines 18d0edd4eb Version v0.6.63 2020-05-18 09:53:02 -04:00
Dessalines 679aa5d073 Merge remote-tracking branch 'weblate/master' 2020-05-18 09:53:01 -04:00
Dessalines 7bc9bc962a Merge branch 'dev' 2020-05-18 09:52:41 -04:00
Dessalines b5c1fec845 Fixing issue with empty crossposts. 2020-05-18 09:50:05 -04:00
diorama bccca4e710 Translated using Weblate (Italian)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-05-18 11:58:46 +00:00
Riccardo Mazzon e664d7f5b9 Translated using Weblate (Italian)
Currently translated at 95.0% (232 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-05-18 11:58:46 +00:00
ButterflyOfFire 879048983c Translated using Weblate (French)
Currently translated at 100.0% (244 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-05-18 11:58:46 +00:00
diorama 96f6c1913f Translated using Weblate (Italian)
Currently translated at 95.0% (232 of 244 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-05-18 11:58:46 +00:00
Dessalines 106ce6096b Version v0.6.62 2020-05-17 18:46:15 -04:00
Dessalines 99e4551cf6 Simplify cross-posts. Fixes #727 2020-05-17 18:39:15 -04:00
Dessalines f5e96d9372 Version v0.6.61 2020-05-17 16:53:56 -04:00
Dessalines 6fe3d43049 Adding a sponsor. 2020-05-17 16:49:34 -04:00
Dessalines 6fe4184f72 Adding Greek and Basque languages for weblate. 2020-05-16 22:52:28 -04:00
Dessalines f15c3b4e1e Merge branch 'yerba_rework-imports' into federation 2020-05-16 21:09:26 -04:00
Felix 9e61c3be94 Rework imports 2020-05-16 20:04:17 +02:00
Dessalines f88180650d Adding federated embeds via the preview field. 2020-05-15 23:40:36 -04:00
Dessalines 020b9b8cdd Post thumbnail and user icons federating. 2020-05-15 20:23:20 -04:00
Dessalines 940dc73f28 Federated mentions. Fixes #681 (#717)
* Federated mentions. Fixes #681

* Changing some todos, adding comments.
2020-05-15 12:36:11 -04:00
Dessalines d2e38b1062 Updating docs to setup lemmy.hjson beforehand. 2020-05-15 10:21:37 -04:00
Dessalines 3a4973ad68 Merge branch 'federation' into yerba_refactoring 2020-05-14 18:35:29 -04:00
Felix 0fb8450e56 Simplify community_inbox 2020-05-14 17:44:01 +02:00
Felix 13ca47a3b4 Use ActorType for sign/verify, instead of passing raw privatekey/actor_id 2020-05-14 17:17:40 +02:00
Felix 11acc7225e Add helper function for Activity::create() 2020-05-14 14:26:44 +02:00
Felix a1ad21ec56 remove outdated comments 2020-05-14 13:23:56 +02:00
Felix bb1b4ee33e Comment search and apub endpoint 2020-05-14 12:42:26 +02:00
Dessalines 155b99b64e Version v0.6.60 2020-05-12 15:27:28 -04:00
Dessalines 4d02e4c021 Merge branch 'fix_password_autocomplete_fields' 2020-05-12 15:26:54 -04:00
Dessalines f971e31171 Changing image_content_type function to Result. (#711)
* Changing image_content_type function to Result.

* Changing image to image/
2020-05-12 15:23:48 -04:00
Dessalines 913383ca75 Removing autocomplete for register and user settings password fields.
- Fixes #708
2020-05-12 14:36:22 -04:00
Dessalines c22310bdaf Version v0.6.59 2020-05-11 19:08:28 -04:00
Dessalines eb72ace854 Pictshare only cache image content types. Fixes #709 2020-05-11 19:06:12 -04:00
Dessalines cb88510964 Version v0.6.58 2020-05-11 14:04:23 -04:00
Dessalines 88b86721c6 Merge remote-tracking branch 'weblate/master' 2020-05-11 14:04:21 -04:00
Dessalines f7c947888f Removing 2nd match. 2020-05-11 14:01:10 -04:00
Dessalines 2719daffb0 Merge branch 'thumbnail-outsourced' of https://github.com/AndreVallestero/lemmy into AndreVallestero-thumbnail-outsourced 2020-05-11 13:20:03 -04:00
Richie Zhang d17316508c Improve shell scripts (#705)
* Improve init-db.sh

Allow custom database parameters.
Abstract common functionality.

* Improve install.sh

Abstract common functionality.
Ask to automagically reload the project when source files are changed.
2020-05-11 13:16:08 -04:00
Andre Vallestero 9155469e8a Removed redundant erroneous check 2020-05-11 11:29:35 -04:00
Richie Zhang c76b91d595 Translated using Weblate (French)
Currently translated at 97.9% (238 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/

Translated using Weblate (German)

Currently translated at 98.3% (239 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/
2020-05-10 14:29:49 +00:00
Eugeny ade1d35463 Translated using Weblate (Russian)
Currently translated at 96.7% (235 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/

Translated using Weblate (Russian)

Currently translated at 95.4% (232 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-05-10 14:29:49 +00:00
Dessalines b83aae0b57 Version v0.6.57 2020-05-08 14:08:35 -04:00
Dessalines df23bf7141 Merge remote-tracking branch 'weblate/master' 2020-05-08 14:08:34 -04:00
Dessalines a6d9a9e1a8 Merge branch 'dev' 2020-05-08 14:03:05 -04:00
Dessalines e6717c86ac Adding support for webp images on the front end. Fixes #703 2020-05-08 14:02:42 -04:00
Dessalines 9bc45def17 Removing button wrapper for comment context. Fixes #702 2020-05-08 14:02:29 -04:00
Dessalines 2db6f35b7c Removing button wrapper for comment context. Fixes #702 2020-05-08 13:36:52 -04:00
Nika Tskhakaia f3fa6c1fc0 Translated using Weblate (Georgian)
Currently translated at 90.9% (221 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ka/
2020-05-08 15:35:19 +00:00
6r6 c836fa6912 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-05-08 15:35:19 +00:00
Nishant Aswani a267443777 Translated using Weblate (Hindi)
Currently translated at 25.1% (61 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hi/
2020-05-08 15:35:19 +00:00
Sylvia Ji 2fab9b5b9b Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-05-08 15:35:19 +00:00
Andre Vallestero 38381ba287 Removed hardcoded thumbnail value 2020-05-07 21:33:47 -04:00
Andre Vallestero ffcbb7613e Added additional check for pictshare thumbnail 2020-05-07 21:30:23 -04:00
Andre Vallestero bc8ad12b04 Added externally hosted UI thumbnail support 2020-05-07 21:26:08 -04:00
Andre Vallestero 243dda543c Removed debug line 2020-05-06 20:46:00 -04:00
Andre Vallestero d96c66ba9f Thumbnail generation for iframely incompatible sources 2020-05-06 20:40:36 -04:00
Dessalines 66142c546b Merge branch 'federated_private_messages' into federation 2020-05-06 13:51:39 -04:00
Dessalines 15f1920b25 Federated private messages. 2020-05-05 22:06:24 -04:00
Felix dfd6629a6f Federate community category and nsfw 2020-05-05 16:30:13 +02:00
Dessalines 21407260a4 Merge branch 'yerba_page_extension' into federation 2020-05-04 21:24:53 -04:00
Dessalines f1692a07fc Adding a comment on what comment.read is. 2020-05-04 21:14:24 -04:00
Felix 7485f1a5b4 Federate nsfw/locked info for posts 2020-05-05 02:09:27 +02:00
Dessalines b177cbce1d Renaming ignore to unfollow in followable trait. 2020-05-04 14:26:16 -04:00
Dessalines b8b2398d32 Adding undo follow community. 2020-05-03 22:41:45 -04:00
Dessalines fab22e3d8a Add federated comment and post undo like. 2020-05-03 20:34:04 -04:00
Dessalines 88e1251d6b Version v0.6.56 2020-05-03 17:27:25 -04:00
Dessalines e7a33f4988 Merge remote-tracking branch 'weblate/master' 2020-05-03 17:27:23 -04:00
Dessalines 2f7a4ecdb2 Updating Cargo deps. Fixes #666 2020-05-03 17:25:55 -04:00
Dessalines dfc9637230 Merge branch 'federation' into federated_remove_actions 2020-05-03 13:27:53 -04:00
Dessalines 2c22e413eb Merge branch 'federation' into federated_remove_actions 2020-05-03 13:22:32 -04:00
Dessalines 67d4daa7a1 Merge pull request #687 from LemmyNet/undo_delete_community
Undo delete for community, comment, and post.
2020-05-03 13:21:01 -04:00
Nishant Aswani 0d08cf36f8 Translated using Weblate (Hindi)
Currently translated at 16.8% (41 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hi/

Translated using Weblate (Hindi)

Currently translated at 4.5% (11 of 243 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/hi/
2020-05-03 17:03:25 +00:00
Dessalines 211ef795e9 Some additional notes, reorg. 2020-05-03 10:22:25 -04:00
Dessalines a09c818746 Adding federated mod remove actions. 2020-05-03 10:00:59 -04:00
Dessalines 8c765b25bc Merge branch 'master' of https://github.com/lemmynet/lemmy 2020-05-01 21:53:47 -04:00
Dessalines 51eb538631 Merge remote-tracking branch 'weblate/master' 2020-05-01 21:53:34 -04:00
dessalines 915fe79d7a Added translation using Weblate (Hindi) 2020-05-02 01:52:15 +00:00
Sylvia Ji ec087ce28a Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-05-02 01:52:15 +00:00
Dessalines 43592c32d9 Adding hindi template. 2020-05-01 21:51:04 -04:00
Dessalines 5366797a4b Add undos for delete community, post, and comment. 2020-05-01 15:01:29 -04:00
Dessalines 75c6c8521b Merge branch 'shorthand_apub_id_searching' into federation 2020-05-01 10:34:41 -04:00
Richie Zhang 8d4ab4555c Improve the yes/no prompt in install.sh (#683)
* Improve the yes/no prompt in install.sh

The old implementation used a feature only present on Bash version 4, which not all systems have. The new version should work on all bash shells.

* Update install.sh
2020-05-01 10:33:28 -04:00
Dessalines d5f62e1355 Merge pull request #684 from pfcoder/fix-dbinit
fix shell quotation error of server db-init.sh
2020-05-01 10:31:55 -04:00
Dessalines 2f1cd9976d Adding federated community, comment, and post deletes.
- Unit tests added too.
- No undeletes working yet.
2020-05-01 10:07:38 -04:00
pfcoder 6d73b16716 fix shell quotation error of server db-init.sh 2020-05-01 21:58:52 +08:00
Felix 461114c143 update activitystreams lib 2020-04-30 18:30:01 +02:00
Dessalines 38cdfdf7e0 Changing federated community and user links and searching.
- Search: !community@instance, @user@instance
- Representation: community@instance, user@instance
2020-04-30 11:45:12 -04:00
Dessalines 9b93d4c098 Better private-message form. Fixes #652 2020-04-29 17:52:18 -04:00
Felix 770dcbdc49 wip: add former_type to tombstone 2020-04-29 21:10:50 +02:00
Dessalines ee4f923f60 Fix search form clearing out. 2020-04-29 13:05:38 -04:00
Dessalines 8cd68f56aa Adding shorthand federated object searching. 2020-04-29 12:55:54 -04:00
Felix c43f06124a Address comments, implement delete for posts and comments 2020-04-29 16:51:25 +02:00
Felix 0c0c683986 Implement deleting communities 2020-04-28 19:46:25 +02:00
Dessalines 36d0e34668 Fix federated community link on search page. 2020-04-28 11:53:05 -04:00
Dessalines 59bba148ff Merge branch 'federation' into add_federated_post_likes 2020-04-28 10:12:07 -04:00
Dessalines b60c7bbae7 Merge branch 'federation' into add_activity_table 2020-04-28 10:10:05 -04:00
Dessalines 07a9d84ed0 Removing some comments. 2020-04-28 09:57:28 -04:00
Dessalines 3b62f58dd2 Adding federated post and comment likes. 2020-04-28 00:16:02 -04:00
Dessalines 6eaa06ab02 Merge branch 'shared_inbox_1' into add_federated_post_likes 2020-04-27 22:48:20 -04:00
Dessalines 9721b77317 1/3rd done with post likes 2020-04-27 22:47:26 -04:00
Dessalines 4b741c3759 Adding a better switching for activity kinds for the shared inbox. 2020-04-27 19:21:41 -04:00
Dessalines 59852d6899 Merge branch 'nyu-ossd-s20-link_images' 2020-04-27 18:22:10 -04:00
Dessalines 2f47ea2228 Merge branch 'link_images' of https://github.com/nyu-ossd-s20/lemmy into nyu-ossd-s20-link_images 2020-04-27 18:20:58 -04:00
Dessalines 70060c27b2 Adding activity table inserts. 2020-04-27 18:17:02 -04:00
niniack 09d4bf1d7a swap imgur links for github links 2020-04-27 16:22:56 -04:00
Dessalines 9c30b37d57 Merge branch 'federation' into shared_inbox_1 2020-04-27 13:01:45 -04:00
Dessalines 10877fd45f Merge pull request #663 from LemmyNet/federation_changes_1
Federation changes.
2020-04-27 13:00:21 -04:00
Dessalines 22abbebd41 Lots of additions to federation.
- Added a shared inbox.
- Added federated comments, comment updates, and tests.
- Abstracted ap object sends into a common trait.
2020-04-27 12:57:00 -04:00
Dessalines 66134823bf Version v0.6.55 2020-04-27 09:07:31 -04:00
Dessalines 72433b37c4 Adding a sponsor. 2020-04-27 08:55:31 -04:00
Dessalines 82941001e8 Fixing sponsor issue. 2020-04-26 19:09:47 -04:00
Dessalines 3ce0618362 Making a trait function for follow and accept. 2020-04-26 13:20:42 -04:00
Dessalines 92e4edf9b7 Version v0.6.54 2020-04-26 10:57:27 -04:00
Dessalines f4b5c1f27b Adding sponsor. 2020-04-26 10:56:53 -04:00
Dessalines 610cce4162 Hide online counts for now. #664 2020-04-26 10:51:59 -04:00
Nishant Aswani 674e221335 added main_screen and chat_screen (#665) 2020-04-26 10:01:21 -04:00
Dessalines 079ac091eb Adding back in post fetching. 2020-04-25 11:49:15 -04:00
Dessalines b5a5b307a0 Adding get_public_key_ext() to ActorType trait. 2020-04-24 22:34:51 -04:00
Dessalines df9135f410 Removing run-tests TODO. 2020-04-24 22:02:12 -04:00
Dessalines 8a25f0f816 Use an associated type instead of Generic. 2020-04-24 17:30:27 -04:00
Dessalines 33c5c21a57 Merge remote-tracking branch 'yerba/federation' into federation_changes_1 2020-04-24 15:57:48 -04:00
Dessalines d846740839 Some more cleanup. 2020-04-24 15:55:54 -04:00
Felix c3ac1649f2 Implement integration test for federation 2020-04-24 18:30:31 +02:00
Dessalines 66a2c4a2c3 Some fed fixes. 2020-04-24 10:04:36 -04:00
Dessalines e5497edd5c Adding some more API testing examples. 2020-04-23 14:13:22 -04:00
Dessalines ce800f75ad Adding a test bed for API testing. #658 2020-04-23 11:34:32 -04:00
Felix b8aaf5c1f1 Also use correct header in fetcher.rs 2020-04-23 13:42:09 +02:00
Dessalines 28ca7a727c Merge branch 'master' of https://github.com/dessalines/lemmy 2020-04-22 16:52:50 -04:00
Dessalines d448bc6f9a Adding code mirror section to readme. 2020-04-22 16:52:24 -04:00
Nishant Aswani d0fa235e84 Updated ranking algorithm graph in docs (#654)
* Regraphed ranking algorithm demo with seaborn plot

* use imgur mirror for ranking algo image
2020-04-22 15:38:51 -04:00
Felix 70816a4779 Fix header guard for apub responses 2020-04-22 20:56:31 +02:00
Dessalines c22090c602 Version v0.6.53 2020-04-22 00:30:43 -04:00
Dessalines 313d023eef Changing wait to spawn in websocket. 2020-04-22 00:29:25 -04:00
Dessalines b2a89cd217 Version v0.6.52 2020-04-21 20:43:38 -04:00
Dessalines b92b8a9e15 Merge remote-tracking branch 'weblate/master' 2020-04-21 20:43:35 -04:00
Dessalines 92e30311ce Merge branch 'federation' of https://yerbamate.dev/LemmyNet/lemmy into federation 2020-04-21 20:41:50 -04:00
Dessalines 0425e8b114 Fixing nodeinfo error type. 2020-04-21 20:34:37 -04:00
Dessalines 18e570b021 Merge branch 'master' into merge_master_2 2020-04-21 20:29:52 -04:00
Dessalines 4abca69328 Merge branch 'routes_web_block' 2020-04-21 20:28:44 -04:00
Dessalines 6b58080067 Adding websocket blocking. 2020-04-21 17:57:20 -04:00
Dessalines 809cc1049e Fixing closures. 2020-04-21 16:48:54 -04:00
Felix 957e4a2611 Change apub IDs to be consistent with html urls 2020-04-21 22:45:01 +02:00
Dessalines 01b7ac5fb9 Merge branch 'master' into routes_web_block 2020-04-21 16:41:07 -04:00
Dessalines d98c936295 Adding web::blocks to routes. 2020-04-21 16:40:03 -04:00
Felix 4e80543edb Update test_deploy.sh, supporting different branches 2020-04-21 19:19:10 +02:00
Felix Ableitner a90b16a72c Merge pull request #649 from LemmyNet/federation_merge_from_master_1
Federation merge from master 1
2020-04-21 16:29:30 +00:00
Dessalines f0026065f5 Merge branch 'master' into federation_merge_from_master_1 2020-04-21 10:25:29 -04:00
Dessalines 2f4b3a4f83 Merge branch 'remove_username_lower_unique' into federation 2020-04-21 09:25:02 -04:00
Dessalines 697c62fb64 Change local unique username constraints. 2020-04-21 09:21:29 -04:00
Felix 1e7c3841b2 Update federation dev instructions 2020-04-21 13:24:08 +02:00
Sylvia Ji ec23de7e33 Translated using Weblate (Japanese)
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-04-21 11:02:26 +00:00
Dessalines b98fa12741 Version v0.6.51 2020-04-20 15:40:56 -04:00
Dessalines bd12070467 Merge remote-tracking branch 'weblate/master' 2020-04-20 15:40:54 -04:00
Dessalines 217a9b00b8 Merge branch 'abstract_websocket_sends' 2020-04-20 15:39:34 -04:00
Dessalines c0f4d5260f Merge branch 'asonix-abstract_websocket_sends' into abstract_websocket_sends 2020-04-20 15:03:32 -04:00
Dessalines 0d4679a37b Making websocket create community do register rate limit. 2020-04-20 14:55:37 -04:00
asonix 05b961a90a Remove unused methods 2020-04-20 13:09:10 -05:00
asonix d11af012fc post -> register 2020-04-20 13:05:07 -05:00
asonix d058db95e5 Use get_ip in ratelimit middleware 2020-04-20 13:02:25 -05:00
asonix 4df2031ae0 Give ratelimit fields explicit names 2020-04-20 12:51:42 -05:00
asonix 904ebf34a5 Guard CreateCommunity, represent impossible error with Infallible 2020-04-20 12:31:22 -05:00
asonix db4454b52b Add websockets into the api scope 2020-04-20 10:25:47 -05:00
Dessalines c18fa5a38e Changing warn to debug for rate limiting message. 2020-04-20 10:45:14 -04:00
Fenglei Gu 7ce845cde6 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-04-20 08:02:06 +00:00
Sylvia Ji dc5636c6c1 Translated using Weblate (Japanese)
Currently translated at 99.1% (235 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-04-20 08:02:06 +00:00
asonix 217efdd706 Allow rustfmt on api config 2020-04-19 23:47:20 -05:00
asonix 4712ae4eb0 appease clippy 2020-04-19 23:43:30 -05:00
asonix ac43b86b60 Change RateLimit to act as a middleware 2020-04-19 22:59:07 -05:00
Dessalines 41a168ff29 Merge branch 'dev' 2020-04-19 20:03:05 -04:00
Dessalines fa8fcb0f8b Adding to sponsors list. 2020-04-19 20:01:58 -04:00
Dessalines 5e64df220c Merge branch 'nyu-ossd-s20-apache_benchmark_check' 2020-04-19 20:01:20 -04:00
Dessalines f300c67a4d Adding websocket notification system.
- HTTP and APUB clients can now send live updating messages to websocket
  clients
- Rate limiting now affects both HTTP and websockets
- Rate limiting / Websocket logic is now moved into the API Perform
  functions.
- TODO This broke getting current online users, but that will have to
  wait for the perform trait to be made async.
- Fixes #446
2020-04-19 18:08:25 -04:00
Felix 7117b5ce32 Verifyt http signatures 2020-04-19 19:35:40 +02:00
Felix 5284dc0c52 Simplify signing code 2020-04-19 13:44:44 +02:00
Felix 8daf72278d Add http signature to outgoing apub requests 2020-04-18 20:54:20 +02:00
Felix 0199b5f169 Use debug logging 2020-04-18 17:24:55 +02:00
Felix a49bd1d42a Fix bug in whitelist implementation 2020-04-18 17:17:25 +02:00
Felix b1b97db11a Implement instance whitelist 2020-04-17 19:34:18 +02:00
Felix c5ced6fa5e Added documentation for most functions 2020-04-17 17:33:55 +02:00
Felix 8908c8b184 Some code cleanup and better logging 2020-04-17 16:55:28 +02:00
Felix 9c974fbe50 Remove instance follows 2020-04-17 16:39:03 +02:00
Felix 86f172076b Implement search for activitypub IDs 2020-04-17 15:46:08 +02:00
Felix 9a85f1b25f Send activities to correct inbox, seperate community/user inboxes 2020-04-15 20:12:25 +02:00
Dessalines a941c20024 Adding yarn run to run-federation-test.bash script. 2020-04-15 14:06:17 -04:00
charleshthomasiii 09836bffef Add apache benchmark installation check 2020-04-15 13:52:46 -04:00
Dessalines be6a7876b4 Version v0.6.50 2020-04-14 19:38:20 -04:00
Dessalines a32935fbe6 Merge remote-tracking branch 'weblate/master' 2020-04-14 19:38:18 -04:00
Dessalines 7ba6ee8714 Redundant to_owned 2020-04-14 19:25:58 -04:00
Dessalines fcf1c65fc1 Front end federation names and links for users, posts, and communities. 2020-04-14 19:18:13 -04:00
Dessalines 1336b4ed60 Merge branch 'dev' into federation 2020-04-14 16:07:20 -04:00
Dessalines 641e4c5d96 Merge branch 'admin_settings' into dev 2020-04-14 15:45:49 -04:00
Dessalines f040dac647 Initial post-listing community non-local. 2020-04-14 15:43:58 -04:00
Dessalines 26ad37a8c0 Updating views to add apub actor_id and local columns. 2020-04-14 15:12:19 -04:00
Dessalines 16005a0c05 Updating front end packages. 2020-04-14 12:34:52 -04:00
Dessalines 5c83cbc1ac Fixing .dockerignore. 2020-04-14 12:27:38 -04:00
Dessalines 9878a58452 Fixing unwrap crash with site_view.rs 2020-04-14 12:24:05 -04:00
Felix 9d2046d5a2 Disable nginx access logs for docker/federation/ 2020-04-14 17:47:55 +02:00
Felix 19c8461397 Implemented follow/accept 2020-04-14 17:37:23 +02:00
Dessalines 6d5518cbd4 Merge branch 'dev' into admin_settings 2020-04-14 10:54:04 -04:00
Dessalines b9aef5891f Fixing test deploy. 2020-04-14 10:07:40 -04:00
Kitaiti Makoto abbce23b18 Translated using Weblate (Japanese)
Currently translated at 85.6% (203 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/
2020-04-14 00:53:45 +00:00
Sylvia Ji 6bbd238d25 Translated using Weblate (Chinese (Simplified))
Currently translated at 69.1% (164 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/zh_Hans/
2020-04-14 00:53:45 +00:00
Felix 13e6c98e47 Auto-configure federation test instances during initial start 2020-04-13 19:55:43 +02:00
Dessalines 567a9aa131 Adding another sponsor. 2020-04-13 12:42:16 -04:00
Felix fdaf0b3364 Get inbox working properly 2020-04-13 15:06:41 +02:00
Felix fac1cc7e1d Use summary field for post title 2020-04-13 14:13:06 +02:00
Dessalines 8192f69584 Version v0.6.49 2020-04-12 14:57:37 -04:00
Dessalines 676690097f Use twemoji style for emoji picker. 2020-04-12 14:55:52 -04:00
Dessalines a26bff6921 Version v0.6.48 2020-04-12 14:08:02 -04:00
Dessalines 0b8369be23 Updating federation docker volumes ignores. 2020-04-12 14:07:22 -04:00
Dessalines 5afaab7083 Merge remote-tracking branch 'weblate/master' 2020-04-12 13:09:03 -04:00
Dessalines aa5db37bda Add open collective (#637)
* Add Emoji Picker for comments and post body.

- Fixes #634

* Make sure typing dropdown uses twemojis.

* Adding opencollective links. Fixes #636
2020-04-12 12:54:49 -04:00
Dessalines fd76c5d9ec Merge branch 'emoji_picker' 2020-04-12 12:51:30 -04:00
Dessalines d6d040f5da Add Emoji squashed commit. 2020-04-12 12:47:48 -04:00
Dessalines 2096bacd34 Make sure typing dropdown uses twemojis. 2020-04-12 11:45:44 -04:00
Felix fc951d9295 Added comments about how to federate additional post/user fields 2020-04-12 16:53:55 +02:00
Dessalines e9535cd01d Add Emoji Picker for comments and post body.
- Fixes #634
2020-04-11 23:22:46 -04:00
Dessalines c92201a674 Removing redundant to_owned 2020-04-11 14:10:33 -04:00
Dessalines 61815bce2e Adding live reloading of config.hjson changes through UI.
- https://stackoverflow.com/questions/61159698/update-re-initialize-a-var-defined-in-lazy-static/61161271#61161271
- https://stackoverflow.com/questions/29654927/how-do-i-assign-a-string-to-a-mutable-static-variable/47181804#47181804
2020-04-11 14:06:04 -04:00
Dessalines bb287cbd07 Adding an admin settings page.
- Fixes #620
- Adding a UserListing component. Fixes #627
2020-04-10 16:55:57 -04:00
nick t 450a53d552 Translated using Weblate (Georgian)
Currently translated at 84.3% (200 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ka/
2020-04-10 14:40:20 +00:00
Nika Tskhakaia 7edfccee49 Translated using Weblate (Georgian)
Currently translated at 67.5% (160 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ka/

Translated using Weblate (Georgian)

Currently translated at 62.8% (149 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ka/
2020-04-10 14:40:20 +00:00
Felix 17d3d2492c Federate actor public keys 2020-04-10 15:50:40 +02:00
Felix 5e3902a3bc more todos 2020-04-10 14:45:48 +02:00
Felix 509005fa0c Rename federation-test to federation, puller.rs to fetcher.rs 2020-04-10 13:37:35 +02:00
Felix 492625f6d6 Add to/cc (and a bunch of todo) 2020-04-10 13:26:06 +02:00
Dessalines ed264aba3c Updating code url references to https://github.com/LemmyNet/lemmy 2020-04-09 16:11:11 -04:00
Felix 483d11e772 Minor code cleanup 2020-04-09 21:26:22 +02:00
Felix 0b617377df Implement create activity 2020-04-09 21:04:31 +02:00
Felix Ableitner f5b58bcdaf Simplify fetch_posts code 2020-04-08 18:39:45 +02:00
Felix Ableitner 5706b533fd Use instance struct instead of raw string 2020-04-08 18:22:44 +02:00
Felix Ableitner 6962b9c433 Use Url instead of String 2020-04-08 14:37:05 +02:00
Felix Ableitner edd0ef5991 Some refactoring of puller.rs 2020-04-08 14:08:33 +02:00
Felix Ableitner d2bad5f79e Improve error handling 2020-04-08 13:23:59 +02:00
Felix Ableitner 61c560c12c Get users federated 2020-04-07 23:02:32 +02:00
Felix Ableitner d3bd7771d2 remove debug log for post creation 2020-04-07 19:13:33 +02:00
Felix Ableitner b7103a7e14 Store remote communities/posts in db, federate posts! 2020-04-07 18:47:19 +02:00
Felix Ableitner 1b0da74b57 Revert apub endpoint change (again) 2020-04-07 17:34:44 +02:00
Felix Ableitner 095ccae616 Merge branch 'federation_add_fed_columns' of https://yerbamate.dev/dessalines/lemmy into federation 2020-04-07 17:33:50 +02:00
Felix Ableitner 17bf6baa25 Set accept header and timeout for outgoing apub requests 2020-04-07 17:29:23 +02:00
Dessalines 56947e7710 Removing community name unique constraint. Removing useless fedi_name column from user_table. 2020-04-07 10:54:15 -04:00
Felix 4fadc4d072 Revert apub endpoint url changes 2020-04-07 13:21:30 +02:00
Dessalines 221e35ec38 Try to fix post creation bug. 2020-04-05 10:11:16 -04:00
Dessalines 85ea1046f0 Adding post and comment ap_id columns. 2020-04-03 20:04:57 -04:00
Dessalines cb49a7e790 Version v0.6.45 2020-04-03 14:44:30 -04:00
Dessalines 6e5729c660 Fixing deploy script. 2020-04-03 14:44:10 -04:00
Dessalines 522299ea9e Adding docs for DB Backup / Restore. Fixes #619 2020-04-03 14:37:44 -04:00
Dessalines 0ca385deaf Adding a text body preview and icon for posts with a body. Fixes #617 2020-04-03 13:46:25 -04:00
Felix Ableitner cb7059f832 Move and rename some functions 2020-04-03 18:32:09 +02:00
dessalines a497a568db Translated using Weblate (French)
Currently translated at 94.0% (223 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/

Translated using Weblate (Spanish)

Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/es/
2020-04-03 14:14:05 +00:00
Nika Tskhakaia d1cda51e80 Translated using Weblate (Georgian)
Currently translated at 29.9% (71 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ka/
2020-04-03 14:14:05 +00:00
Felix Ableitner c16458b728 Avoid using database views in federation code 2020-04-03 11:00:24 +02:00
Felix Ableitner 6a7a262912 Merge branch 'federation_add_fed_columns' of https://yerbamate.dev/dessalines/lemmy into federation 2020-04-03 07:24:46 +02:00
Felix Ableitner 96c3621a80 Share list of communities over apub, some refactoring 2020-04-03 07:02:43 +02:00
Dessalines 9197b39ed6 Federation DB Changes.
- Creating an activity table.
- Adding some federation-related columns to the user_ and community
  tables.
- Generating the actor_id and keys in code, updating the tables.
2020-04-03 00:12:05 -04:00
Dessalines 32b0275257 Merge branch 'nutomic-federation' into federation 2020-04-02 15:15:44 -04:00
Dessalines 31f835db86 Merge branch 'master' into federation 2020-04-02 15:11:11 -04:00
Dessalines 9ea104b165 Merge remote-tracking branch 'weblate/master' 2020-04-01 13:29:08 -04:00
Dessalines 1e0f5cfcea Add georgian language for weblate. 2020-04-01 13:22:44 -04:00
Dessalines ef564b0a93 Merge branch 'dev' 2020-04-01 12:18:21 -04:00
Dessalines 0b467cfeed Browser notification as plain markdown. Fixes #618 2020-04-01 11:31:24 -04:00
olivia maia 0f8be8d6db Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-04-01 13:15:16 +00:00
Adam Adamsky d7b730d8e0 Translated using Weblate (Polish)
Currently translated at 100.0% (237 of 237 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pl/
2020-04-01 13:15:15 +00:00
dessalines fb21f9c22f Merge pull request 'Improve installation docs' (#29) from nutomic/lemmy:improve-docs into master 2020-03-31 21:18:28 +00:00
Dessalines 4aec451584 Merge branch 'master' into dev 2020-03-31 16:31:44 -04:00
Dessalines a006f498b1 Merge branch 'nutomic-auto-setup' into dev 2020-03-31 16:29:57 -04:00
Felix 3c2a2a0adf Improve installation docs 2020-03-31 02:06:31 +02:00
Felix 76bf71162e Automatic instance setup based on config variables (fixes #404) 2020-03-29 00:13:13 +01:00
Dessalines bd09fe9556 Testing out another travis build. #397 2020-03-28 18:21:10 -04:00
Dessalines 36312e91e4 Revert "Deploy multiple Lemmy instances to the same server (ref #474)"
This reverts commit aa341933da.
2020-03-28 18:18:20 -04:00
Dessalines aab556bf77 Merge branch 'master' into dev 2020-03-28 18:11:30 -04:00
Dessalines 9becced985 Merge branch 'nutomic-rss-improvements' 2020-03-28 18:04:12 -04:00
Dessalines 1571a4acd4 Changing markdown parser to comrak. Moving crate imports to lib.rs. 2020-03-28 18:02:49 -04:00
Dessalines 9fd95a4415 Merge branch 'nutomic-federation-dev-docs' 2020-03-28 15:46:39 -04:00
Dessalines a789e4db2a Adding a resource to docs. 2020-03-28 15:43:56 -04:00
Dessalines 5ca466117d Merge branch 'master' into federation 2020-03-28 15:41:42 -04:00
Felix 0d369e6019 Get image uploads working for federation-test 2020-03-28 17:30:59 +01:00
Felix bafc2fc7ac Convert md to html for feeds, try to deduplicate code 2020-03-28 16:56:20 +01:00
Felix 4796f890fb Add documentation for contributing to federation development 2020-03-26 15:45:56 +01:00
Dessalines 945fd8331b Merge branch 'nutomic-federation' into federation 2020-03-24 15:18:08 -04:00
Dessalines 83c7d82fce Changing post voting arrows. 2020-03-24 14:41:46 -04:00
Dessalines ac6dc65342 Version v0.6.44 2020-03-24 10:47:38 -04:00
Dessalines a8ab7864ae Making vote buttons bigger. 2020-03-24 10:46:39 -04:00
Dessalines 3b632c9501 Add some docs. 2020-03-24 09:58:01 -04:00
Dessalines 0414edeade Hide toast on click. 2020-03-21 11:21:15 -04:00
Dessalines ef9ae09c2b Version v0.6.43 2020-03-21 10:38:42 -04:00
Dessalines f1ddf09cae Adding flex-wrap. 2020-03-21 10:20:03 -04:00
Dessalines 32c85599b6 Changing comment actions to flex row. Fixes #611 2020-03-21 00:15:45 -04:00
Dessalines 1f0439badd Adding showContext for comments to more places by default. 2020-03-20 22:24:27 -04:00
Dessalines a03b9d8f02 Changing rust logging to error on ansible and prod. 2020-03-20 22:22:53 -04:00
Dessalines da36f1dacc Version v0.6.42 2020-03-20 19:33:11 -04:00
Dessalines adde3375e5 Merge branch 'dev' 2020-03-20 19:03:26 -04:00
Dessalines bde422ab30 Changing to btn-outline-light 2020-03-20 18:52:45 -04:00
Dessalines 0050ae74a4 Switch to radios for user and inbox pages for clarity. Fixes #608 2020-03-20 18:41:42 -04:00
Dessalines 4949ab973b Fixing navbar bell padding. 2020-03-20 17:20:59 -04:00
Dessalines f76c3af557 Adding clearer goto context.
- Adding context props.
- Making link / context the first selectable on user and inbox page.
- Making icons a little bigger.
- #609
2020-03-20 16:55:59 -04:00
Dessalines 522649d9d3 Notification improvements.
- Adding a navbar notification icon for mobile.
- Adding an in-app notification toast. To be improved later.
- Fixes #607
2020-03-20 16:13:54 -04:00
Felix Ableitner 4354f868fd Merge branch 'federation' of ssh://yerbamate.dev:222/nutomic/lemmy into federation 2020-03-20 10:47:46 +01:00
Dessalines b3066db08b Adding score spacing, hiding user tags on thin screen. 2020-03-19 20:56:21 -04:00
Felix bf52bc22e4 Replace reqwest with chttp 2020-03-20 01:42:07 +01:00
Felix Ableitner 875545f7e1 Adjust for updated Rust version 2020-03-19 19:01:01 +01:00
Felix Ableitner 672798e711 Populate post data from apub 2020-03-19 17:27:13 +01:00
Dessalines 807f33f748 Version v0.6.41 2020-03-19 12:17:26 -04:00
Dessalines f96a1eaae5 Adding polish translation file. 2020-03-19 12:11:41 -04:00
Dessalines da8756ed0a Merge branch 'dev' 2020-03-19 11:46:31 -04:00
Dessalines 47dd8acf54 Adding loading indicators to save and mark as read. #519 2020-03-19 11:45:23 -04:00
Dessalines ed00fe46e2 Fix ansible deploy. 2020-03-19 11:43:14 -04:00
Dessalines 10b0667764 Version v0.6.40 2020-03-19 00:53:34 -04:00
Dessalines dd54a4f728 Merge remote-tracking branch 'weblate/master' 2020-03-19 00:53:33 -04:00
Dessalines d690e9a73b Changing comment action button size. Adding comment dividers. Fixes #604 2020-03-19 00:52:08 -04:00
Dessalines d2cf36bf02 Updating chttp to isahc. 2020-03-18 23:11:37 -04:00
Dessalines f85242af28 Merge branch 'nutomic-multiple-instances' into dev 2020-03-18 22:37:33 -04:00
Dessalines dc14719b08 Updating rust, rust deps, yarn deps. Fixes #605 2020-03-18 22:30:16 -04:00
nutomic 875ed79f3f Merge pull request 'Update to latest activitystreams' (#1) from asonix/lemmy:federation into federation 2020-03-19 01:23:15 +00:00
asonix 20a06ce3f2 Merge branch 'federation' of https://yerbamate.dev/nutomic/lemmy into federation 2020-03-18 20:16:40 -05:00
asonix cfe0d9c9c2 Upgraded to latest activitystreams 2020-03-18 20:16:17 -05:00
Dessalines 231f782260 Adding repos to contributing main page. 2020-03-18 19:59:34 -04:00
Felix Ableitner 33cce05300 Merge branch 'master' into federation 2020-03-18 22:51:34 +01:00
Felix Ableitner 390b204272 Rewrite federation settings 2020-03-18 22:09:00 +01:00
Felix Ableitner bd030470b1 Read remote nodeinfo before doing anything 2020-03-18 16:08:08 +01:00
Serge Tarkovski b131c5bf94 Translated using Weblate (Russian)
Currently translated at 87.2% (206 of 236 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-03-17 01:06:47 +00:00
olivia maia 2f59a8027e Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (236 of 236 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-03-17 01:06:47 +00:00
Kitaiti Makoto cc8144ac3c Translated using Weblate (Japanese)
Currently translated at 85.5% (202 of 236 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/
2020-03-17 01:06:46 +00:00
Felix Ableitner 5043a52b88 Serve post data in apub format, some cleanup 2020-03-16 19:19:04 +01:00
Felix Ableitner 05735b31c0 Remove boilerplate code 2020-03-16 18:30:25 +01:00
Dessalines ed0dd3b8c0 Merge branch 'dev' 2020-03-15 13:05:50 -04:00
Dessalines 1a7c6fbd32 Add theming guide. Fixes #596 2020-03-15 13:02:14 -04:00
Felix Ableitner 8ebcc7ac02 Implemented basics for post federation, plus a bunch of other stuff 2020-03-14 22:03:05 +01:00
Felix Ableitner 5896a9d251 Move apub related code from websocket into api package 2020-03-14 13:15:23 +01:00
Felix Ableitner b01f4f75d6 WIP: federate posts between instances 2020-03-14 01:05:42 +01:00
dependabot[bot] 74eae88e37 Bump acorn from 5.7.3 to 5.7.4 in /ui
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-13 23:05:52 +00:00
Dessalines 054dd186d6 Merge branch 'master' into dev 2020-03-13 11:11:32 -04:00
Dessalines 62ab68d317 Adding full logging. 2020-03-13 11:08:42 -04:00
Felix 8f67a3c634 Cleanup gitignore and dockerignore files 2020-03-12 20:25:14 +01:00
Felix Ableitner 063811cb60 Merge branch 'master' into federation 2020-03-12 12:34:37 +01:00
Felix Ableitner ef6df1339f Proper error logging for websocket 2020-03-12 12:03:04 +01:00
Felix 27c07f1f84 Federate follower count, use string id for community 2020-03-12 03:35:32 +01:00
Felix 54172bd322 updated to activitystreams 0.4.0-alpha.3 2020-03-12 01:01:25 +01:00
Dessalines f36aa1f40d Show full scores on hover for posts and comments. Fixes #592 2020-03-11 19:10:10 -04:00
Felix 8867fa1d52 use urls for id again, more comments 2020-03-11 18:26:58 +01:00
Felix Ableitner 18be8b10f5 improved community federation (wip) 2020-03-11 12:29:10 +01:00
Felix 6c31a1f9cc Deploy multiple Lemmy instances to the same server (ref #474) 2020-03-11 01:05:50 +01:00
Dessalines 4fbf55d79e Fix issue with preview mode not resizing comment-form. 2020-03-10 10:23:16 -04:00
Dessalines 0637ccc1bc Merge branch 'master' into dev 2020-03-09 23:38:28 -04:00
Dessalines 87db5ab64d Adding volumes to dockerignore. 2020-03-09 23:37:39 -04:00
Dessalines 62679090a3 Version v0.6.39 2020-03-09 23:26:15 -04:00
Dessalines edb7ab2638 Version v0.6.38 2020-03-09 23:24:06 -04:00
Dessalines 8989aa1714 Version v0.6.37 2020-03-09 23:22:24 -04:00
Dessalines 450ebf4e38 Version v0.6.36 2020-03-09 23:21:24 -04:00
Dessalines d7ff72a538 Version v0.6.35 2020-03-09 23:20:13 -04:00
Dessalines 7d7beca9dc Merge remote-tracking branch 'weblate/master' 2020-03-09 23:20:11 -04:00
Dessalines 5427c4a230 Version v0.6.34 2020-03-09 23:16:19 -04:00
Dessalines a823084947 Adding key to comment-node to not clear out form. Fixes #588 2020-03-09 21:38:10 -04:00
olivia maia be0c6819ab Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (234 of 234 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-03-09 17:49:23 +00:00
Weblate admin 3246e4719e Translated using Weblate (German)
Currently translated at 98.2% (230 of 234 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/de/
2020-03-09 17:49:22 +00:00
Dessalines d1ee0d7af7 Merge branch 'yerba_master' 2020-03-09 12:54:22 -04:00
Dessalines d333651b9d Merge branch 'master' of https://github.com/dessalines/lemmy 2020-03-09 12:50:50 -04:00
nutomic bf1db428f6 Move volumes into subfolder (ref #474) (#23)
Change ports and container names

Move volumes into subfolder (ref #474)

Merge pull request #587 from StaticallyTypedRice/patch-2

Clarify that content violating this code of conduct will likely be removed.
Clarify that content violating this code of conduct will likely be removed.

Lemmy has a general policy of removing any content that violates the rules whenever possible, which is typically a good thing, and I felt it important to mention that in the code of conduct.

Co-authored-by: Felix <me@nutomic.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com>
2020-03-09 16:50:28 +00:00
Dessalines 4a1f744211 Adding community title and description searching. Fixes #589 2020-03-08 19:14:52 -04:00
Dessalines 134e8c1c94 Hover on upvote / downvote on post-listing scores. 2020-03-08 18:54:52 -04:00
Dessalines cd99b1bc1e Adding comment loading indicator. #519 2020-03-08 18:47:27 -04:00
Dessalines 9c510adc31 Merge pull request #587 from StaticallyTypedRice/patch-2
Clarify that content violating this code of conduct will likely be removed.
2020-03-08 18:36:34 -04:00
Richie Zhang 2ac0b4f5ab Clarify that content violating this code of conduct will likely be removed.
Lemmy has a general policy of removing any content that violates the rules whenever possible, which is typically a good thing, and I felt it important to mention that in the code of conduct.
2020-03-08 12:51:07 -07:00
Dessalines f8ea6a527d Hide user karma on details page. Fixes #585 2020-03-08 14:33:04 -04:00
Dessalines cf516fcc83 Show ago for user details. Fixes #586 2020-03-08 14:29:17 -04:00
Dessalines 2eb681413d Version v0.6.33 2020-03-08 00:46:15 -05:00
Dessalines 559ccf0264 Line break pre / view_source blocks. 2020-03-08 00:45:59 -05:00
Dessalines 7bb18bf73c Add icons for private message actions. Fixes #582 2020-03-08 00:27:58 -05:00
Dessalines 63051717d7 Version v0.6.32 2020-03-07 22:02:25 -05:00
Dessalines 5b2b433613 Merge remote-tracking branch 'weblate/master' 2020-03-07 22:02:20 -05:00
Dessalines 54762b601d Iframely card now opens embed on title if available. 2020-03-07 20:01:31 -05:00
Dessalines 5396cb2f5c Running cargo update. 2020-03-07 19:52:00 -05:00
Dessalines ac280782b2 Iframely and pictshare backend mostly done. 2020-03-07 18:31:13 -05:00
Kitaiti Makoto 667dfb5d69 Translated using Weblate (Japanese)
Currently translated at 85.4% (200 of 234 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/
2020-03-07 21:38:39 +00:00
Dessalines 496c4e523c Version v0.6.31 2020-03-06 15:08:04 -05:00
Dessalines a67a69f95e Ask for confirmation on leaving pages with incomplete forms. Fixes #529 2020-03-06 14:57:52 -05:00
Dessalines 0708a6d665 Adding a sorting help. Fixes #532 2020-03-06 14:18:40 -05:00
Dessalines 970e0b5185 Version v0.6.30 2020-03-06 13:24:12 -05:00
Dessalines d5d77f1738 Merge remote-tracking branch 'weblate/master' 2020-03-06 12:49:21 -05:00
Dessalines e0ac4ad040 Merge branch 'icons' into dev 2020-03-06 12:48:57 -05:00
Dessalines a3b6118927 Reordering activitypub resources. 2020-03-06 12:48:51 -05:00
Dessalines 4e5d7b6e84 Adding post listing separators. Hiding full score unless downvotes. 2020-03-06 11:51:25 -05:00
Dessalines 08af66ba28 Some comment-node additions
- Hiding extra vote counts if no downvotes.
- Showing numbers on actions if there are.
2020-03-06 09:57:15 -05:00
Policarp ab2012d12c Translated using Weblate (Russian)
Currently translated at 87.3% (201 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ru/
2020-03-06 10:58:36 +00:00
ButterflyOfFire b9ab38bdab Translated using Weblate (Arabic)
Currently translated at 77.3% (178 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ar/
2020-03-06 10:58:36 +00:00
olivia maia e902ecab36 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (230 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-03-06 10:58:36 +00:00
Riccardo Mazzon 548c6697d0 Translated using Weblate (Italian)
Currently translated at 91.7% (211 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/it/
2020-03-06 10:58:36 +00:00
Felipe Forte 6af8186e77 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (230 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 99.5% (229 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/pt_BR/
2020-03-06 10:58:36 +00:00
Dessalines 15e91e4b4c Merge branch 'dev' into icons 2020-03-05 15:48:14 -05:00
Dessalines 876d311706 Remove email from GetUserDetails when not same user. Fixes #579 2020-03-05 15:46:33 -05:00
Dessalines 858366c57b Proper comment-node depth coloring. 2020-03-05 15:10:46 -05:00
Dessalines 25fa97a20a Thinner blockquotes. Corrected user on private messaging. 2020-03-05 10:18:48 -05:00
Felix 34a827a270 comment 2020-03-05 16:02:53 +01:00
Dessalines 1a9c1677d3 Adding hr separator for top level comment groups on mobile. 2020-03-05 10:02:23 -05:00
Felix 91ae9a9d49 Revert "pull in activitypub library"
This reverts commit a52a954eb4.
2020-03-05 11:32:29 +01:00
Dessalines 6fe4cc3fd0 Change post-listing vote colors. 2020-03-05 00:39:22 -05:00
Dessalines 2a775cf960 Changing user names to bold text-body. Removing color lines on first comment. 2020-03-05 00:02:08 -05:00
Dessalines eeef752a5c Adding left border color, removing indent. 2020-03-04 23:36:42 -05:00
Dessalines c999579c05 Better tippy loading. Fixes #577 2020-03-04 22:35:55 -05:00
Dessalines d14504763a Adding separators for comment node title line. 2020-03-04 14:25:23 -05:00
Dessalines 6495cd2f65 Removing suffix on from now. 2020-03-04 14:24:45 -05:00
Dessalines 43f783db42 Removing comment node other score colors for clarity. 2020-03-04 14:18:13 -05:00
Dessalines f601d6cd03 Switching from heart to zap symbol for points. 2020-03-04 14:13:08 -05:00
Dessalines 7c274fdd35 Add score color to bar 2020-03-04 14:06:03 -05:00
Dessalines 2c2918cc9e Moving comment voting to action bar. Adding plurals. 2020-03-04 13:52:11 -05:00
Dessalines fb35518848 Fixing post sorting by stickied on front end. Fixes #575 2020-03-04 11:46:34 -05:00
Dessalines 8855b91d0c Fixing select alignment. 2020-03-04 09:42:50 -05:00
Dessalines d8bcfd7d44 Changing view source icon. 2020-03-04 09:37:19 -05:00
Dessalines 5b2383fa50 Adding icons to stickied, deleted, and locked. 2020-03-04 09:30:49 -05:00
Dessalines 107005c474 Adding icon-plus and minus-square. 2020-03-03 19:14:36 -05:00
Dessalines 30165ebd15 Updating tributejs 2020-03-03 17:37:27 -05:00
Dessalines a5331bce77 Only show tribute menu after a minlength of 3 characters.
- Fixes #562
2020-03-03 16:36:11 -05:00
Dessalines 0aec31328d Removing icon-inline from message icon. 2020-03-03 11:46:29 -05:00
Dessalines 48594537c0 Change action sizes. Add better tippy updating. 2020-03-03 11:07:07 -05:00
Dessalines b3b4b79775 More additions to icons.
- Adding edit and trash icons for sidebars
- Adding pencil edit instead of modified.
2020-03-03 10:14:50 -05:00
Dessalines fe5bd0341a Merge branch 'dev' into icons 2020-03-03 09:24:24 -05:00
Dessalines ade334b251 Add Lemmy Council governance document. 2020-03-03 09:23:43 -05:00
Dessalines 7d602c26f8 Some formatting. 2020-03-03 09:16:36 -05:00
Dessalines 44bbc45973 A first pass at adding icons, and tippy tooltips.
- Adding icons for post-listing, comment-node, and navbar.
- Adding html titles.
- Updating moment expand to use users locale.
2020-03-03 02:29:45 -05:00
Dessalines 5f6f51b549 Moving link out of more menu. 2020-03-02 11:01:00 -05:00
Dessalines a8303940df Upgrading inferno. 2020-03-02 11:00:34 -05:00
Dessalines 0bf4a6a6b5 Fix image expand width on mobile. 2020-03-02 10:48:06 -05:00
Dessalines aff1ed95e9 Merge branch 'patch-1' of https://github.com/BoFFire/lemmy into BoFFire-patch-1 2020-03-01 18:36:35 -05:00
Dessalines 80f9003135 Version v0.6.29 2020-03-01 18:26:17 -05:00
Dessalines 5705839861 Merge branch 'dev' 2020-03-01 18:22:31 -05:00
Dessalines 9c50d5f073 Fix weblate deploy. 2020-03-01 18:21:52 -05:00
Dessalines 76b10d01ff Changing mobile columns. 2020-03-01 18:19:48 -05:00
Dessalines 85dd01ab6d Fixing weblate. 2020-03-01 18:19:05 -05:00
Felix Ableitner d71145bc6e remove utm parameter 2020-03-01 19:29:20 +00:00
Kitaiti Makoto 67d1c72a59 Translated using Weblate (Japanese)
Currently translated at 85.2% (196 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ja/
2020-03-01 18:20:22 +00:00
ButterflyOfFire 063b0e6f16 Update README.md
Adding translation widget %
2020-03-01 10:59:08 +01:00
ButterflyOfFire b5d3859adc Translated using Weblate (Arabic)
Currently translated at 61.7% (142 of 230 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ar/
2020-03-01 09:20:29 +00:00
Dessalines 6c6e7aa872 Version v0.6.28 2020-02-29 22:24:00 -05:00
ButterflyOfFire e638aeb778 Translated using Weblate (Arabic)
Currently translated at 55.0% (126 of 229 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/ar/
2020-03-01 03:22:50 +00:00
ButterflyOfFire c15ac96053 Added translation using Weblate (Arabic) 2020-03-01 03:22:50 +00:00
ButterflyOfFire ee10798178 Translated using Weblate (French)
Currently translated at 100.0% (229 of 229 strings)

Translation: Lemmy/lemmy
Translate-URL: http://weblate.yerbamate.dev/projects/lemmy/lemmy/fr/
2020-03-01 03:22:50 +00:00
ButterflyOfFire dd5be6d7d2 Translated using Weblate (French)
Currently translated at 100.0% (229 of 229 strings)

Translation: Lemmy/lemmy
Translate-URL: http://127.0.0.1/projects/lemmy/lemmy/fr/
2020-03-01 03:22:50 +00:00
Dessalines 59391b2369 Moving view source. 2020-02-29 22:16:52 -05:00
Dessalines 399be2370d Adding more for advanced actions on comments and posts.
- Fixes #561
2020-02-29 22:06:42 -05:00
Dessalines 93cb0892ae Some fixes for mobile view. 2020-02-29 21:04:42 -05:00
Dessalines 7680971b89 Increasing mini-overlay size. #564 2020-02-29 17:16:42 -05:00
Dessalines f893fb1614 Merge branch 'master' into dev 2020-02-29 16:53:47 -05:00
Dessalines 565524a80b Adding git add to deploy. 2020-02-29 15:49:09 -05:00
Dessalines f607e98565 Version v0.6.27 2020-02-29 15:28:30 -05:00
Dessalines adba6b056f Translation additions.
- Adding Japanese. Fixes #566
- Adding some German translations. Fixes #567
- Fixing pt-br
2020-02-29 15:18:56 -05:00
Dessalines 4005fab006 Merge branch 'proper-i18next' 2020-02-29 14:41:08 -05:00
Dessalines 300828808d Adding generate report for yarn start. 2020-02-29 14:40:27 -05:00
Felix Ableitner b713ee0ec5 remove translation report from readme 2020-02-29 20:35:25 +01:00
Felix Ableitner ee7949a0fc update deploy script to pull translations from weblate 2020-02-29 20:25:35 +01:00
Dessalines 898971cf15 Changing to a better discussion icon. 2020-02-29 13:21:11 -05:00
Felix d7f49cea9a generate typescript during compilation 2020-02-29 19:16:23 +01:00
Dessalines 8ed1610f48 Version v0.6.26 2020-02-29 13:10:28 -05:00
Felix 51653015a0 Make i18n compatible with weblate (ref #387) 2020-02-29 19:08:59 +01:00
Felix c0802c7fa2 make i18n compatible with weblate 2020-02-29 19:08:19 +01:00
Dessalines 434bf35a55 Refactoring thumbnails. Fixes #564
- Adding a default discussion thumbnail
- Adding a cropping max-height, and consistent width.
- Getting rid of hover overlays, in favor of top right content-type icon.
2020-02-29 13:03:41 -05:00
Felix 1f29e91796 Various minor federation improvements 2020-02-29 18:38:47 +01:00
Felix 7cdf167e4b pull in activitypub library 2020-02-29 12:42:44 +01:00
Felix b854d8f3a0 Some federation improvements 2020-02-29 03:11:39 +01:00
Felix f9443dfbd3 Merge branch 'master' into federation 2020-02-29 00:47:37 +01:00
Dessalines a215076358 Merge branch 'master' into dev 2020-02-28 14:40:25 -05:00
Dessalines da7429f0f6 Add line for private messaging support. 2020-02-28 14:40:12 -05:00
Dessalines 70040e186e Adding thumbnail class. 2020-02-28 13:03:16 -05:00
Dessalines 3d649756ec New nsfw posts. 2020-02-27 16:24:27 -05:00
Dessalines eead117d6b Fix image testing regex. 2020-02-27 15:00:41 -05:00
Dessalines 862321aa39 Check for pictshare status ok. 2020-02-27 14:06:29 -05:00
Dessalines 72c5bdbf9e Version v0.6.25 2020-02-27 13:16:30 -05:00
Dessalines fb32acb1ed Use image thumbnails from pictshare. Fixes #555 2020-02-27 12:55:23 -05:00
Dessalines aa94f11a2c Merge branch 'master' of https://github.com/dessalines/lemmy 2020-02-24 17:42:15 -05:00
Dessalines 788ecf9055 Adding missing image thumbnail. Fixes #553 2020-02-24 17:38:05 -05:00
Dessalines 62199492ba Merge pull request #552 from MyNameIsTroll/patch-2
Translation error in the FR version
2020-02-21 21:57:39 -05:00
MyNameIsTroll b684260926 Translation error in the FR version
I corrected Reddit by Lemmy.
2020-02-21 18:44:38 +01:00
Dessalines 2dec9b5b10 Adding a link overlay. Fixes #549 2020-02-21 11:26:42 -05:00
Dessalines 883c8decde Version v0.6.24 2020-02-19 13:35:58 -05:00
Dessalines f36f44df74 Don't show post url if its local. 2020-02-19 13:35:15 -05:00
Dessalines 08be1c97db Merge branch 'master' of https://github.com/dessalines/lemmy 2020-02-18 12:43:27 -05:00
Dessalines f15dcc54be Merge pull request #548 from AndreVallestero/master
Fixed incorrect keys
2020-02-18 12:41:39 -05:00
Dessalines b18c87b9c4 Version v0.6.23 2020-02-18 12:37:35 -05:00
Andre Vallestero 7d577f137f Fixed incorrect keys 2020-02-18 10:18:50 -05:00
Dessalines 59ab341a28 Fix iframely always refetching bug. 2020-02-18 09:00:17 -05:00
Dessalines 2062d07eb7 Fixing about guide. 2020-02-17 20:54:45 -05:00
Dessalines 29822c13af Add a user guide. Fixes #543 2020-02-17 20:48:17 -05:00
Dessalines 022d632e40 Updating translation report. 2020-02-17 18:26:39 -05:00
Dessalines ed7208d04e Merge pull request #546 from AndreVallestero/master
Fixed french translations and password change text
2020-02-17 18:24:13 -05:00
Andre Vallestero dd28e6fbeb Corrections made, added text for password change 2020-02-17 17:30:42 -05:00
Andre Vallestero 9ab038d273 Corrected show_avatar to show_avatars 2020-02-17 17:20:25 -05:00
Dessalines fd82487ab5 Version v0.6.22 2020-02-17 16:11:49 -05:00
Dessalines 05648173ae Fix dynamic post url changing issue. 2020-02-17 16:09:05 -05:00
Dessalines 1e5d93d9bb Version v0.6.21 2020-02-17 14:38:16 -05:00
Dessalines 2fbcb2b23f Removing images from iframely cards. 2020-02-17 14:37:36 -05:00
Dessalines 702b55d16b Add oembed to readme. 2020-02-17 14:06:19 -05:00
Dessalines cf9d287b23 Merge branch 'AndreVallestero-master' 2020-02-17 14:05:25 -05:00
Dessalines 9147675e60 Merge branch 'master' of https://github.com/AndreVallestero/lemmy into AndreVallestero-master 2020-02-17 14:04:41 -05:00
Andre Vallestero d26557fac3 Completed french translations, verified syntax 2020-02-17 13:54:22 -05:00
Dessalines 50600938cb Version v0.6.20 2020-02-17 13:04:53 -05:00
Dessalines 35e05d250b Remove the responsive bootstrap utils. 2020-02-17 12:55:43 -05:00
Dessalines 6c28851fe8 Only show it if it has a title. 2020-02-17 12:45:08 -05:00
Dessalines 30e1456ac0 Merge branch 'master' into iframely 2020-02-17 11:31:57 -05:00
Dessalines ce8fadae52 Merge branch 'master' of https://github.com/dessalines/lemmy 2020-02-17 11:21:04 -05:00
Dessalines 55f91ac5dc First pass at adding oembeds / iframely. 2020-02-17 11:18:01 -05:00
Dessalines 0dcb935161 Merge pull request #537 from AndreVallestero/master
Added french translation for general sponsors
2020-02-16 19:54:54 -05:00
Andre Vallestero ebff00e057 Added french translation for sponsor message 2020-02-16 16:04:30 -05:00
Dessalines b6ce26023e Version v0.6.19 2020-02-16 14:26:39 -05:00
Dessalines 4b0a55144f Some front end fixes. 2020-02-15 20:29:57 -05:00
Dessalines 83d17b2643 Fix minor issue with selector. Fix issue with truncate wrapping. 2020-02-15 16:09:53 -05:00
Dessalines 845c2b70a5 Adding an external link icon. #530 2020-02-14 22:29:17 -05:00
Dessalines f9bd19ae94 Merge pull request #534 from richardj/feature/permissions-db-init
changed permissions from db-init.sh to be able to run
2020-02-14 15:32:45 -05:00
Richard ed07e98bff changed permissions from db-init.sh to be able to run 2020-02-14 21:30:06 +01:00
Dessalines 91649d21ae Version v0.6.18 2020-02-14 10:12:40 -05:00
Dessalines 177c462b40 Making links go to post page. 2020-02-14 10:02:37 -05:00
Dessalines a27badefba Fix minor loading bug. 2020-02-13 12:35:22 -05:00
Dessalines 7275e127cc Merge branch 'dev' 2020-02-12 12:16:33 -05:00
Dessalines 0b69974e49 Add community refine by searching on new post creation. Fixes #521 2020-02-12 12:12:19 -05:00
Dessalines 4fa7392205 Merge branch 'dev' 2020-02-11 10:22:44 -05:00
Dessalines 774518e4fe Fixing unread indicator on link click. Fixes #527 2020-02-11 10:14:09 -05:00
Dessalines fbab5db85a Fixing ansible certbot renew. 2020-02-10 14:45:50 -05:00
Dessalines 1d824ee293 Merge branch 'dev' into federation 2020-02-10 11:52:32 -05:00
Dessalines f1392dc9a7 Version v0.6.17 2020-02-09 15:08:51 -05:00
Dessalines 9c8fe0379f Adding instant voting / vote animations. Fixes #526 2020-02-09 15:04:41 -05:00
Dessalines be539e3353 Merge branch 'tech_debt' into dev 2020-02-09 11:45:46 -05:00
Dessalines fd8814677e Live post and comment resorting. Fixes #522
- Moving sorting to utils.
2020-02-09 11:44:24 -05:00
Dessalines d422da3f4b Merge branch 'master' into dev 2020-02-08 23:32:48 -05:00
Dessalines 58c7f23621 Merge pull request #525 from StaticallyTypedRice/minor_changes
Add an option to initialize the database from install.sh
2020-02-08 23:30:10 -05:00
Dessalines 56cd103209 Fixing some technical debt. Fixes #524 2020-02-08 23:20:11 -05:00
Richie Zhang a8126b33bb Add line breaks after user prompts in install.sh 2020-02-08 13:02:40 -08:00
Richie Zhang 15ef4a7122 Add a semicolon. 2020-02-08 12:56:13 -08:00
Richie Zhang 186ad57858 Fix a user prompt in install.sh 2020-02-08 12:54:41 -08:00
Richie Zhang 8871dcef7d Add an option to initialize the database from install.sh 2020-02-08 12:53:46 -08:00
Richie Zhang 633568da03 Merge pull request #5 from StaticallyTypedRice/master
Merge upstream
2020-02-08 12:17:02 -08:00
Richie Zhang abee6b8b49 Merge pull request #4 from dessalines/master
Merge upstream
2020-02-08 12:15:30 -08:00
Dessalines 8baa483c89 Version v0.6.16 2020-02-08 11:44:16 -05:00
Dessalines 4b0227c45e Change post sorting hot rank to use newest comment time. Fixes #517 2020-02-08 11:16:58 -05:00
Dessalines 41d8642bf5 Version v0.6.15 2020-02-07 23:50:33 -05:00
Dessalines ecd10482a6 Add new comments views to main and community pages. Fixes #480 2020-02-07 23:05:15 -05:00
Dessalines 8130535af4 Merge branch 'dev' into federation 2020-02-07 12:34:14 -05:00
Dessalines 779a72581c Version v0.6.14 2020-02-07 11:28:20 -05:00
Dessalines b6fceec6dd Adding post body searching. Fixes #507 2020-02-07 11:17:15 -05:00
Dessalines 214c1d3fd1 Fix issue with post creating redirecting other posts. Fixes #520 2020-02-07 10:12:05 -05:00
Dessalines be77e30110 Version v0.6.13 2020-02-06 23:02:26 -05:00
Dessalines 218653c52f Fixing rate limiting. 2020-02-06 22:48:43 -05:00
Dessalines c84a2d6b1e Fix expanded image height. Fixes #455 2020-02-06 22:24:23 -05:00
Dessalines b7a332ff3c Minor fixes to docs. 2020-02-06 16:26:03 -05:00
Dessalines cd4001b2ef Merge branch 'minor_changes' of https://github.com/StaticallyTypedRice/lemmy into StaticallyTypedRice-minor_changes 2020-02-06 16:23:35 -05:00
Dessalines 1c030d1fb6 Version v0.6.12 2020-02-06 16:16:51 -05:00
Dessalines 94b1bbe5aa Merge branch 'post_title_length' into rate_limit_fixes 2020-02-06 16:10:19 -05:00
Dessalines 1369ad1fbc Fixing rate limit checking to only ping after a success. Fixes #516 2020-02-06 16:07:59 -05:00
Richie Zhang 33563c3e9f Implement password verification in db-init.sh. 2020-02-06 13:07:34 -08:00
Richie Zhang 9b6f8ec207 Add instructions for unning db-init.sh to administration_configuration.md 2020-02-06 12:26:01 -08:00
Richie Zhang 12c7633380 Add instructions for unning db-init.sh to contributing_local_development.md 2020-02-06 12:25:13 -08:00
Dessalines 65a6e7731c Increasing post title length limit to 200. Fixes #515 2020-02-06 13:10:43 -05:00
Dessalines 898ea8d3ca Merge branch 'master' into dev 2020-02-06 11:27:02 -05:00
Dessalines d15212448e Merge branch 'master' of https://github.com/dessalines/lemmy 2020-02-06 11:26:56 -05:00
Dessalines e4526e8eaf Merge branch 'master' into dev 2020-02-06 11:26:49 -05:00
Dessalines 894a80eb88 Reworking README.md. Fixes #513. 2020-02-06 11:26:11 -05:00
Dessalines e12f911352 Merge pull request #511 from StaticallyTypedRice/StaticallyTypedRice-translations
Translate support_on_liberapay
2020-02-06 09:43:43 -05:00
Dessalines 1ffd7b33fa Merge pull request #510 from StaticallyTypedRice/StaticallyTypedRice-FUNDING.yml
Add liberapay to FUNDING.yml
2020-02-06 09:42:56 -05:00
Richie Zhang da6cdb7c26 Create db-init.sh 2020-02-05 18:15:28 -08:00
Richie Zhang f21c32d0df Translate support_on_liberapay to Brazilian Portuguese. 2020-02-05 17:44:52 -08:00
Richie Zhang 5338faf46f Translate support_on_liberapay to Dutch. 2020-02-05 17:42:38 -08:00
Richie Zhang 1132c9eeb1 Translate support_on_liberapay to Italian 2020-02-05 17:41:43 -08:00
Richie Zhang 35400aeb16 Translate support_on_liberapay to French 2020-02-05 17:40:43 -08:00
Richie Zhang daafcc230e Translate support_on_liberapay to Spanish. 2020-02-05 17:38:04 -08:00
Richie Zhang 2654aab3d9 Translate support_on_liberapay to Chinese 2020-02-05 17:36:22 -08:00
Richie Zhang dc81d932ed Translate support_on_liberapay to German 2020-02-05 17:35:09 -08:00
Richie Zhang 307c4f25dc Merge pull request #2 from dessalines/master
Merge upstream
2020-02-05 17:30:47 -08:00
Richie Zhang d2b5125004 Add liberapay to FUNDING.yml 2020-02-05 17:23:07 -08:00
Richie Zhang d6b4ab8abb Merge pull request #1 from dessalines/master
Merge upstream
2020-02-05 17:11:18 -08:00
Dessalines f247b28262 Merge branch 'dev' into federation 2020-02-05 16:57:20 -05:00
Dessalines 716ce0f779 Adding if found to catch errors. 2020-02-05 14:24:35 -05:00
Dessalines ac4a62636b Merge branch 'dev' into federation 2020-02-05 14:19:25 -05:00
Dessalines 8405f0ee53 Adding Liberapay. 2020-02-05 14:14:05 -05:00
Dessalines 2968dfb49c Merge branch 'nyex-pt_trans' into dev 2020-02-05 13:12:44 -05:00
Dessalines 5f93598bf1 Adding language and etc for pt-br. 2020-02-05 13:12:13 -05:00
Dessalines 02511eefb9 Fix i18n issue with no communities. 2020-02-05 12:56:01 -05:00
Dessalines d932acad16 Merge branch 'federation' into dev_1 2020-02-05 12:51:03 -05:00
olivia maia 74e7870cde added Portuguese translation 2020-02-05 14:16:01 -03:00
Dessalines 420fb5a847 Version v0.6.11 2020-02-04 19:48:11 -05:00
Dessalines 52f54b92d8 Forgot to add cross-posted to, to i18n. 2020-02-04 16:37:52 -05:00
Dessalines d4bc70b61e Merge branch 'websocket_reconnect_reload' into dev 2020-02-04 12:21:49 -05:00
Dessalines b0b50098a4 Websocket reconnect reload page data. Fixes #504 2020-02-04 11:19:05 -05:00
Felix eaf548b5db Merge branch 'master' into federation 2020-01-14 16:30:54 +01:00
Felix 35489a706b Faster Docker build directly on host 2020-01-10 19:04:58 +01:00
Felix Ableitner e09a035373 Merge branch 'master' into federation 2020-01-02 19:22:23 +01:00
Felix Ableitner 581f36d6ef Implementing very basic federation including test setup 2019-12-30 13:31:54 +01:00
1298 changed files with 107398 additions and 42413 deletions

View File

@ -1,4 +1,8 @@
ui/node_modules # build folders and similar which are not needed for the docker build
ui/dist target
server/target docker
.git api_tests
ansible
tests
*.sh
pictrs

4
.gitattributes vendored
View File

@ -1,2 +1,2 @@
* linguist-vendored # Normalize EOL for all files that Git considers text files.
*.rs linguist-vendored=false * text=auto eol=lf

3
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,3 @@
* @Nutomic @dessalines @phiresky @dullbananas @SleeplessOne1917
crates/apub/ @Nutomic
migrations/ @dessalines @phiresky @dullbananas

1
.github/FUNDING.yml vendored
View File

@ -1,3 +1,4 @@
# These are supported funding model platforms # These are supported funding model platforms
patreon: dessalines patreon: dessalines
liberapay: Lemmy

70
.github/ISSUE_TEMPLATE/BUG_REPORT.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: "\U0001F41E Bug Report"
description: Create a report to help us improve lemmy
title: "[Bug]: "
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
Found a bug? Please fill out the sections below. 👍
Thanks for taking the time to fill out this bug report!
For front end issues, use [lemmy](https://github.com/LemmyNet/lemmy-ui)
- type: checkboxes
attributes:
label: Requirements
description: Before you create a bug report please do the following.
options:
- label: Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
required: true
- label: Did you check to see if this issue already exists?
required: true
- label: Is this only a single bug? Do not put multiple bugs in one issue.
required: true
- label: Do you agree to follow the rules in our [Code of Conduct](https://join-lemmy.org/docs/code_of_conduct.html)?
required: true
- label: Is this a backend issue? Use the [lemmy-ui](https://github.com/LemmyNet/lemmy-ui) repo for UI / frontend issues.
required: true
- type: textarea
id: summary
attributes:
label: Summary
description: A summary of the bug.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to Reproduce
description: |
Describe the steps to reproduce the bug.
The better your description is _(go 'here', click 'there'...)_ the fastest you'll get an _(accurate)_ resolution.
value: |
1.
2.
3.
validations:
required: true
- type: textarea
id: technical
attributes:
label: Technical Details
description: |
- Please post your log: `sudo docker-compose logs > lemmy_log.out`.
- What OS are you trying to install lemmy on?
- Any browser console errors?
validations:
required: true
- type: input
id: lemmy-backend-version
attributes:
label: Version
description: Which Lemmy backend version do you use? Displayed in the footer.
placeholder: ex. BE 0.17.4
validations:
required: true
- type: input
id: lemmy-instance
attributes:
label: Lemmy Instance URL
description: Which Lemmy instance do you use? The address
placeholder: lemmy.ml, lemmy.world, etc

View File

@ -0,0 +1,56 @@
name: "\U0001F680 Feature request"
description: Suggest an idea for improving Lemmy
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Have a suggestion about Lemmy's UI?
For backend issues, use [lemmy](https://github.com/LemmyNet/lemmy)
- type: checkboxes
attributes:
label: Requirements
description: Before you create a bug report please do the following.
options:
- label: Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
required: true
- label: Did you check to see if this issue already exists?
required: true
- label: Is this only a feature request? Do not put multiple feature requests in one issue.
required: true
- label: Is this a backend issue? Use the [lemmy-ui](https://github.com/LemmyNet/lemmy-ui) repo for UI / frontend issues.
required: true
- label: Do you agree to follow the rules in our [Code of Conduct](https://join-lemmy.org/docs/code_of_conduct.html)?
required: true
- type: textarea
id: problem
attributes:
label: Is your proposal related to a problem?
description: |
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like.
description: |
Provide a clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered.
description: |
Let us know about other solutions you've tried or researched.
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: |
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.

17
.github/ISSUE_TEMPLATE/QUESTION.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: "? Question"
description: General questions about Lemmy
title: "Question: "
labels: ["question", "triage"]
body:
- type: markdown
attributes:
value: |
Have a question about Lemmy?
Please check the docs first: https://join-lemmy.org/docs/en/index.html
- type: textarea
id: question
attributes:
label: Question
description: What's the question you have about Lemmy?
validations:
required: true

34
.gitignore vendored
View File

@ -1,6 +1,36 @@
# local ansible configuration
ansible/inventory ansible/inventory
ansible/passwords/ ansible/passwords/
# docker build files
docker/lemmy_mine.hjson docker/lemmy_mine.hjson
docker/dev/env_deploy.sh docker/dev/env_deploy.sh
build/ volumes
.idea/
# ide config
.idea
.vscode
# local build files
target
env_setup.sh
query_testing/**/reports/*.json
# API tests
api_tests/node_modules
api_tests/.yalc
api_tests/yalc.lock
api_tests/pict-rs
# pictrs data
pictrs/
# The generated typescript bindings
bindings
# Database cluster and sockets for testing
dev_pgdata/
*.PGSQL.*
# database dumps
*.sqldump

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "crates/utils/translations"]
path = crates/utils/translations
url = https://github.com/LemmyNet/lemmy-translations.git
branch = main

7
.rustfmt.toml Normal file
View File

@ -0,0 +1,7 @@
tab_spaces = 2
edition = "2021"
imports_layout = "HorizontalVertical"
imports_granularity = "Crate"
group_imports = "One"
wrap_comments = true
comment_width = 100

View File

@ -1,35 +0,0 @@
language: rust
rust:
- stable
matrix:
allow_failures:
- rust: nightly
fast_finish: true
cache: cargo
before_cache:
- rm -rfv target/debug/incremental/lemmy_server-*
- rm -rfv target/debug/.fingerprint/lemmy_server-*
- rm -rfv target/debug/build/lemmy_server-*
- rm -rfv target/debug/deps/lemmy_server-*
- rm -rfv target/debug/lemmy_server.d
- cargo clean
before_script:
- psql -c "create user lemmy with password 'password' superuser;" -U postgres
- psql -c 'create database lemmy with owner lemmy;' -U postgres
- rustup component add clippy --toolchain stable-x86_64-unknown-linux-gnu
before_install:
- cd server
script:
# Default checks, but fail if anything is detected
- cargo build
- cargo clippy -- -D clippy::style -D clippy::correctness -D clippy::complexity -D clippy::perf
- cargo install diesel_cli --no-default-features --features postgres --force
- diesel migration run
- cargo test
env:
global:
- DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
- RUST_TEST_THREADS=1
addons:
postgresql: "9.4"

312
.woodpecker.yml Normal file
View File

@ -0,0 +1,312 @@
# TODO: The when: platform conditionals aren't working currently
# See https://github.com/woodpecker-ci/woodpecker/issues/1677
variables:
- &rust_image "rust:1.77"
- &rust_nightly_image "rustlang/rust:nightly"
- &install_pnpm "corepack enable pnpm"
- &slow_check_paths
- event: pull_request
path:
include: [
# rust source code
"crates/**",
"src/**",
"**/Cargo.toml",
"Cargo.lock",
# database migrations
"migrations/**",
# typescript tests
"api_tests/**",
# config files and scripts used by ci
".woodpecker.yml",
".rustfmt.toml",
"scripts/update_config_defaults.sh",
"diesel.toml",
".gitmodules",
]
- install_binstall: &install_binstall
- wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
- tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz
- cp cargo-binstall /usr/local/cargo/bin
- install_diesel_cli: &install_diesel_cli
- apt update && apt install -y lsb-release build-essential
- sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
- apt update && apt install -y postgresql-client-16
- cargo install diesel_cli --no-default-features --features postgres
- export PATH="$CARGO_HOME/bin:$PATH"
steps:
prepare_repo:
image: alpine:3
commands:
- apk add git
- git submodule init
- git submodule update
when:
- event: [pull_request, tag]
prettier_check:
image: tmknom/prettier:3.0.0
commands:
- prettier -c . '!**/volumes' '!**/dist' '!target' '!**/translations' '!api_tests/pnpm-lock.yaml'
when:
- event: pull_request
toml_fmt:
image: tamasfe/taplo:0.8.1
commands:
- taplo format --check
when:
- event: pull_request
sql_fmt:
image: backplane/pgformatter
commands:
- ./scripts/sql_format_check.sh
when:
- event: pull_request
cargo_fmt:
image: *rust_nightly_image
environment:
# store cargo data in repo folder so that it gets cached between steps
CARGO_HOME: .cargo_home
commands:
- rustup component add rustfmt
- cargo +nightly fmt -- --check
when:
- event: pull_request
cargo_machete:
image: *rust_nightly_image
commands:
- <<: *install_binstall
- cargo binstall -y cargo-machete
- cargo machete
when:
- event: pull_request
ignored_files:
image: alpine:3
commands:
- apk add git
- IGNORED=$(git ls-files --cached -i --exclude-standard)
- if [[ "$IGNORED" ]]; then echo "Ignored files present:\n$IGNORED\n"; exit 1; fi
when:
- event: pull_request
# make sure api builds with default features (used by other crates relying on lemmy api)
check_api_common_default_features:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- cargo check --package lemmy_api_common
when: *slow_check_paths
lemmy_api_common_doesnt_depend_on_diesel:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- "! cargo tree -p lemmy_api_common --no-default-features -i diesel"
when: *slow_check_paths
lemmy_api_common_works_with_wasm:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- "rustup target add wasm32-unknown-unknown"
- "cargo check --target wasm32-unknown-unknown -p lemmy_api_common"
when: *slow_check_paths
check_defaults_hjson_updated:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- export LEMMY_CONFIG_LOCATION=./config/config.hjson
- ./scripts/update_config_defaults.sh config/defaults_current.hjson
- diff config/defaults.hjson config/defaults_current.hjson
when: *slow_check_paths
check_diesel_schema:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
commands:
- <<: *install_diesel_cli
- diesel migration run
- diesel print-schema --config-file=diesel.toml > tmp.schema
- diff tmp.schema crates/db_schema/src/schema.rs
when: *slow_check_paths
check_db_perf_tool:
image: *rust_image
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
RUST_BACKTRACE: "1"
CARGO_HOME: .cargo_home
commands:
# same as scripts/db_perf.sh but without creating a new database server
- export LEMMY_CONFIG_LOCATION=config/config.hjson
- cargo run --package lemmy_db_perf -- --posts 10 --read-post-pages 1
when: *slow_check_paths
cargo_clippy:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- rustup component add clippy
- cargo clippy --workspace --tests --all-targets --features console -- -D warnings
when: *slow_check_paths
cargo_build:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
commands:
- cargo build
- mv target/debug/lemmy_server target/lemmy_server
when: *slow_check_paths
cargo_test:
image: *rust_image
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
RUST_BACKTRACE: "1"
CARGO_HOME: .cargo_home
commands:
- export LEMMY_CONFIG_LOCATION=../../config/config.hjson
- cargo test --workspace --no-fail-fast
when: *slow_check_paths
check_diesel_migration:
# TODO: use willsquire/diesel-cli image when shared libraries become optional in lemmy_server
image: *rust_image
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
RUST_BACKTRACE: "1"
CARGO_HOME: .cargo_home
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
PGUSER: lemmy
PGPASSWORD: password
PGHOST: database
PGDATABASE: lemmy
commands:
# Install diesel_cli
- <<: *install_diesel_cli
# Run all migrations
- diesel migration run
# Dump schema to before.sqldump (PostgreSQL apt repo is used to prevent pg_dump version mismatch error)
- apt update && apt install -y lsb-release
- sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
- apt update && apt install -y postgresql-client-16
- psql -c "DROP SCHEMA IF EXISTS r CASCADE;"
- pg_dump --no-owner --no-privileges --no-table-access-method --schema-only --no-sync -f before.sqldump
# Make sure that the newest migration is revertable without the `r` schema
- diesel migration redo
# Run schema setup twice, which fails on the 2nd time if `DROP SCHEMA IF EXISTS r CASCADE` drops the wrong things
- alias lemmy_schema_setup="target/lemmy_server --disable-scheduled-tasks --disable-http-server --disable-activity-sending"
- lemmy_schema_setup
- lemmy_schema_setup
# Make sure that the newest migration is revertable with the `r` schema
- diesel migration redo
# Check for changes in the schema, which would be caused by an incorrect migration
- psql -c "DROP SCHEMA IF EXISTS r CASCADE;"
- pg_dump --no-owner --no-privileges --no-table-access-method --schema-only --no-sync -f after.sqldump
- diff before.sqldump after.sqldump
when: *slow_check_paths
run_federation_tests:
image: node:20-bookworm-slim
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
DO_WRITE_HOSTS_FILE: "1"
commands:
- *install_pnpm
- apt update && apt install -y bash curl postgresql-client
- bash api_tests/prepare-drone-federation-test.sh
- cd api_tests/
- pnpm i
- pnpm api-test
when: *slow_check_paths
federation_tests_server_output:
image: alpine:3
commands:
# `|| true` prevents this step from appearing to fail if the server output files don't exist
- cat target/log/lemmy_*.out || true
- "# If you can't see all output, then use the download button"
when:
- event: pull_request
status: failure
publish_release_docker:
image: woodpeckerci/plugin-docker-buildx
secrets: [docker_username, docker_password]
settings:
repo: dessalines/lemmy
dockerfile: docker/Dockerfile
platforms: linux/amd64, linux/arm64
build_args:
- RUST_RELEASE_MODE=release
tag: ${CI_COMMIT_TAG}
when:
- event: tag
nightly_build:
image: woodpeckerci/plugin-docker-buildx
secrets: [docker_username, docker_password]
settings:
repo: dessalines/lemmy
dockerfile: docker/Dockerfile
platforms: linux/amd64,linux/arm64
build_args:
- RUST_RELEASE_MODE=release
tag: dev
when:
- event: cron
# using https://github.com/pksunkara/cargo-workspaces
publish_to_crates_io:
image: *rust_image
commands:
- <<: *install_binstall
# Install cargo-workspaces
- cargo binstall -y cargo-workspaces
- cp -r migrations crates/db_schema/
- cargo workspaces publish --token "$CARGO_API_TOKEN" --from-git --allow-dirty --no-verify --allow-branch "${CI_COMMIT_TAG}" --yes custom "${CI_COMMIT_TAG}"
secrets: [cargo_api_token]
when:
- event: tag
notify_on_failure:
image: alpine:3
commands:
- apk add curl
- "curl -d'Lemmy CI build failed: ${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci"
when:
- event: [pull_request, tag]
status: failure
notify_on_tag_deploy:
image: alpine:3
commands:
- apk add curl
- "curl -d'lemmy:${CI_COMMIT_TAG} deployed' ntfy.sh/lemmy_drone_ci"
when:
- event: tag
services:
database:
image: postgres:16-alpine
environment:
POSTGRES_USER: lemmy
POSTGRES_PASSWORD: password

View File

@ -1,35 +0,0 @@
# Code of Conduct
- We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
- Please avoid using overtly sexual aliases or other nicknames that might detract from a friendly, safe and welcoming environment for all.
- Please be kind and courteous. Theres no need to be mean or rude.
- Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
- Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
- We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term “harassment” as including the definition in the Citizen Code of Conduct; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we dont tolerate behavior that excludes people in socially marginalized groups.
- Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the Lemmy moderation team immediately. Whether youre a regular contributor or a newcomer, we care about making this community a safe place for you and weve got your back.
- Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
[**Message the Moderation Team on Mastodon**](https://mastodon.social/@LemmyDev)
[**Email The Moderation Team**](mailto:contact@lemmy.ml)
## Moderation
These are the policies for upholding our communitys standards of conduct. If you feel that a thread needs moderation, please contact the Lemmy moderation team .
1. Remarks that violate the Lemmy standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
3. Moderators will first respond to such remarks with a warning.
4. If the warning is unheeded, the user will be “kicked,” i.e., kicked out of the communication channel to cool off.
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, in private. Complaints about bans in-channel are not allowed.
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.
In the Lemmy community we strive to go the extra step to look out for each other. Dont just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if theyre off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you couldve communicated better — remember that its your responsibility to make others comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
The enforcement policies listed above apply to all official Lemmy venues; including git repositories under [github.com/dessalines/lemmy](https://github.com/dessalines/lemmy) and [yerbamate.dev/dessalines/lemmy](https://yerbamate.dev/dessalines/lemmy), the [Matrix channel](https://matrix.to/#/!BZVTUuEiNmRcbFeLeI:matrix.org?via=matrix.org&via=privacytools.io&via=permaweb.io); and all instances under lemmy.ml. For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
Adapted from the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct), which is based on the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).

View File

@ -1,4 +0,0 @@
# Contributing
See [here](https://dev.lemmy.ml/docs/contributing.html) for contributing Instructions.

7046
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

210
Cargo.toml Normal file
View File

@ -0,0 +1,210 @@
[workspace.package]
version = "0.19.4-rc.2"
edition = "2021"
description = "A link aggregator for the fediverse"
license = "AGPL-3.0"
homepage = "https://join-lemmy.org/"
documentation = "https://join-lemmy.org/docs/en/index.html"
repository = "https://github.com/LemmyNet/lemmy"
[package]
name = "lemmy_server"
version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
homepage.workspace = true
documentation.workspace = true
repository.workspace = true
publish = false
[lib]
doctest = false
[lints]
workspace = true
[profile.release]
debug = 0
lto = "thin"
strip = true # Automatically strip symbols from the binary.
opt-level = "z" # Optimize for size.
# This profile significantly speeds up build time. If debug info is needed you can comment the line
# out temporarily, but make sure to leave this in the main branch.
[profile.dev]
debug = 0
[features]
embed-pictrs = ["pict-rs"]
# This feature requires building with `tokio_unstable` flag, see documentation:
# https://docs.rs/tokio/latest/tokio/#unstable-features
console = [
"console-subscriber",
"opentelemetry",
"opentelemetry-otlp",
"tracing-opentelemetry",
"reqwest-tracing/opentelemetry_0_16",
]
json-log = ["tracing-subscriber/json"]
default = []
[workspace]
members = [
"crates/api",
"crates/api_crud",
"crates/api_common",
"crates/apub",
"crates/utils",
"crates/db_perf",
"crates/db_schema",
"crates/db_views",
"crates/db_views_actor",
"crates/db_views_actor",
"crates/routes",
"crates/federate",
]
[workspace.lints.clippy]
cast_lossless = "deny"
complexity = { level = "deny", priority = -1 }
correctness = { level = "deny", priority = -1 }
dbg_macro = "deny"
explicit_into_iter_loop = "deny"
explicit_iter_loop = "deny"
get_first = "deny"
implicit_clone = "deny"
indexing_slicing = "deny"
inefficient_to_string = "deny"
items-after-statements = "deny"
manual_string_new = "deny"
needless_collect = "deny"
perf = { level = "deny", priority = -1 }
redundant_closure_for_method_calls = "deny"
style = { level = "deny", priority = -1 }
suspicious = { level = "deny", priority = -1 }
uninlined_format_args = "allow"
unused_self = "deny"
unwrap_used = "deny"
[workspace.dependencies]
lemmy_api = { version = "=0.19.4-rc.2", path = "./crates/api" }
lemmy_api_crud = { version = "=0.19.4-rc.2", path = "./crates/api_crud" }
lemmy_apub = { version = "=0.19.4-rc.2", path = "./crates/apub" }
lemmy_utils = { version = "=0.19.4-rc.2", path = "./crates/utils", default-features = false }
lemmy_db_schema = { version = "=0.19.4-rc.2", path = "./crates/db_schema" }
lemmy_api_common = { version = "=0.19.4-rc.2", path = "./crates/api_common" }
lemmy_routes = { version = "=0.19.4-rc.2", path = "./crates/routes" }
lemmy_db_views = { version = "=0.19.4-rc.2", path = "./crates/db_views" }
lemmy_db_views_actor = { version = "=0.19.4-rc.2", path = "./crates/db_views_actor" }
lemmy_db_views_moderator = { version = "=0.19.4-rc.2", path = "./crates/db_views_moderator" }
lemmy_federate = { version = "=0.19.4-rc.2", path = "./crates/federate" }
activitypub_federation = { version = "0.5.6", default-features = false, features = [
"actix-web",
] }
diesel = "2.1.6"
diesel_migrations = "2.1.0"
diesel-async = "0.4.1"
serde = { version = "1.0.202", features = ["derive"] }
serde_with = "3.8.1"
actix-web = { version = "4.6.0", default-features = false, features = [
"macros",
"rustls",
"compress-brotli",
"compress-gzip",
"compress-zstd",
"cookies",
] }
tracing = "0.1.40"
tracing-actix-web = { version = "0.7.10", default-features = false }
tracing-error = "0.2.0"
tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
url = { version = "2.5.0", features = ["serde"] }
reqwest = { version = "0.11.27", features = ["json", "blocking", "gzip"] }
reqwest-middleware = "0.2.5"
reqwest-tracing = "0.4.8"
clokwerk = "0.4.0"
doku = { version = "0.21.1", features = ["url-2"] }
bcrypt = "0.15.1"
chrono = { version = "0.4.38", features = ["serde"], default-features = false }
serde_json = { version = "1.0.117", features = ["preserve_order"] }
base64 = "0.22.1"
uuid = { version = "1.8.0", features = ["serde", "v4"] }
async-trait = "0.1.80"
captcha = "0.0.9"
anyhow = { version = "1.0.86", features = [
"backtrace",
] } # backtrace is on by default on nightly, but not stable rust
diesel_ltree = "0.3.1"
typed-builder = "0.18.2"
serial_test = "3.1.1"
tokio = { version = "1.37.0", features = ["full"] }
regex = "1.10.4"
once_cell = "1.19.0"
diesel-derive-newtype = "2.1.2"
diesel-derive-enum = { version = "2.1.0", features = ["postgres"] }
strum = "0.26.2"
strum_macros = "0.26.2"
itertools = "0.13.0"
futures = "0.3.30"
http = "0.2.12"
rosetta-i18n = "0.1.3"
opentelemetry = { version = "0.19.0", features = ["rt-tokio"] }
tracing-opentelemetry = { version = "0.19.0" }
ts-rs = { version = "7.1.1", features = [
"serde-compat",
"chrono-impl",
"no-serde-warnings",
] }
rustls = { version = "0.23.8", features = ["ring"] }
futures-util = "0.3.30"
tokio-postgres = "0.7.10"
tokio-postgres-rustls = "0.12.0"
urlencoding = "2.1.3"
enum-map = "2.7"
moka = { version = "0.12.7", features = ["future"] }
i-love-jesus = { version = "0.1.0" }
clap = { version = "4.5.4", features = ["derive", "env"] }
pretty_assertions = "1.4.0"
[dependencies]
lemmy_api = { workspace = true }
lemmy_api_crud = { workspace = true }
lemmy_apub = { workspace = true }
lemmy_utils = { workspace = true }
lemmy_db_schema = { workspace = true }
lemmy_api_common = { workspace = true }
lemmy_routes = { workspace = true }
lemmy_federate = { workspace = true }
activitypub_federation = { workspace = true }
diesel = { workspace = true }
diesel-async = { workspace = true }
actix-web = { workspace = true }
tracing = { workspace = true }
tracing-actix-web = { workspace = true }
tracing-error = { workspace = true }
tracing-log = { workspace = true }
tracing-subscriber = { workspace = true }
url = { workspace = true }
reqwest = { workspace = true }
reqwest-middleware = { workspace = true }
reqwest-tracing = { workspace = true }
clokwerk = { workspace = true }
serde_json = { workspace = true }
tracing-opentelemetry = { workspace = true, optional = true }
opentelemetry = { workspace = true, optional = true }
console-subscriber = { version = "0.1.10", optional = true }
opentelemetry-otlp = { version = "0.12.0", optional = true }
pict-rs = { version = "0.5.14", optional = true }
tokio.workspace = true
actix-cors = "0.7.0"
futures-util = { workspace = true }
chrono = { workspace = true }
prometheus = { version = "0.13.4", features = ["process"] }
serial_test = { workspace = true }
clap = { workspace = true }
actix-web-prom = "0.8.0"
[dev-dependencies]
pretty_assertions = { workspace = true }

208
README.md
View File

@ -1,80 +1,101 @@
<p align="center">
<a href="https://dev.lemmy.ml/" rel="noopener">
<img width=200px height=200px src="ui/assets/favicon.svg"></a>
</p>
<h3 align="center">Lemmy</h3>
<div align="center"> <div align="center">
![GitHub stars](https://img.shields.io/github/stars/dessalines/lemmy?style=social) ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/LemmyNet/lemmy.svg)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/810572?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@LemmyDev) [![Build Status](https://woodpecker.join-lemmy.org/api/badges/LemmyNet/lemmy/status.svg)](https://woodpecker.join-lemmy.org/LemmyNet/lemmy)
[![Matrix](https://img.shields.io/matrix/rust-reddit-fediverse:matrix.org.svg?label=matrix-chat)](https://riot.im/app/#/room/#rust-reddit-fediverse:matrix.org) [![GitHub issues](https://img.shields.io/github/issues-raw/LemmyNet/lemmy.svg)](https://github.com/LemmyNet/lemmy/issues)
![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/dessalines/lemmy.svg)
[![Build Status](https://travis-ci.org/dessalines/lemmy.svg?branch=master)](https://travis-ci.org/dessalines/lemmy)
[![GitHub issues](https://img.shields.io/github/issues-raw/dessalines/lemmy.svg)](https://github.com/dessalines/lemmy/issues)
[![Docker Pulls](https://img.shields.io/docker/pulls/dessalines/lemmy.svg)](https://cloud.docker.com/repository/docker/dessalines/lemmy/) [![Docker Pulls](https://img.shields.io/docker/pulls/dessalines/lemmy.svg)](https://cloud.docker.com/repository/docker/dessalines/lemmy/)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/dessalines/lemmy.svg) [![Translation status](http://weblate.join-lemmy.org/widgets/lemmy/-/lemmy/svg-badge.svg)](http://weblate.join-lemmy.org/engage/lemmy/)
![GitHub repo size](https://img.shields.io/github/repo-size/dessalines/lemmy.svg) [![License](https://img.shields.io/github/license/LemmyNet/lemmy.svg)](LICENSE)
[![License](https://img.shields.io/github/license/dessalines/lemmy.svg)](LICENSE) ![GitHub stars](https://img.shields.io/github/stars/LemmyNet/lemmy?style=social)
[![Patreon](https://img.shields.io/badge/-Support%20on%20Patreon-blueviolet.svg)](https://www.patreon.com/dessalines) <a href="https://endsoftwarepatents.org/innovating-without-patents"><img style="height: 20px;" src="https://static.fsf.org/nosvn/esp/logos/patent-free.svg"></a>
</div> </div>
--- <p align="center">
<span>English</span> |
<p align="center">A link aggregator / reddit clone for the fediverse. <a href="readmes/README.es.md">Español</a> |
<br> <a href="readmes/README.ru.md">Русский</a> |
<a href="readmes/README.zh.hans.md">汉语</a> |
<a href="readmes/README.zh.hant.md">漢語</a> |
<a href="readmes/README.ja.md">日本語</a>
</p> </p>
[Lemmy Dev instance](https://dev.lemmy.ml) *This data is being backed up, and once federation is working, it will be the basis for a main instance.* <p align="center">
<a href="https://join-lemmy.org/" rel="noopener">
<img width=200px height=200px src="https://raw.githubusercontent.com/LemmyNet/lemmy-ui/main/src/assets/icons/favicon.svg"></a>
This is a **very early beta version**, and a lot of features are currently broken or in active development, such as federation. <h3 align="center"><a href="https://join-lemmy.org">Lemmy</a></h3>
<p align="center">
A link aggregator and forum for the fediverse.
<br />
<br />
<a href="https://join-lemmy.org">Join Lemmy</a>
·
<a href="https://join-lemmy.org/docs/index.html">Documentation</a>
·
<a href="https://matrix.to/#/#lemmy-space:matrix.org">Matrix Chat</a>
·
<a href="https://github.com/LemmyNet/lemmy/issues">Report Bug</a>
·
<a href="https://github.com/LemmyNet/lemmy/issues">Request Feature</a>
·
<a href="https://github.com/LemmyNet/lemmy/blob/main/RELEASES.md">Releases</a>
·
<a href="https://join-lemmy.org/docs/code_of_conduct.html">Code of Conduct</a>
</p>
</p>
Front Page|Post ## About The Project
---|---
![main screen](https://i.imgur.com/kZSRcRu.png)|![chat screen](https://i.imgur.com/4XghNh6.png)
[Lemmy](https://github.com/dessalines/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), [Raddle](https://raddle.me), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). | Desktop | Mobile |
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| ![desktop](https://raw.githubusercontent.com/LemmyNet/joinlemmy-site/main/src/assets/images/main_screen_2.webp) | ![mobile](https://raw.githubusercontent.com/LemmyNet/joinlemmy-site/main/src/assets/images/mobile_pic.webp) |
[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse).
For a link aggregator, this means a user registered on one server can subscribe to forums on any other server, and can have discussions with users registered elsewhere. For a link aggregator, this means a user registered on one server can subscribe to forums on any other server, and can have discussions with users registered elsewhere.
The overall goal is to create an easily self-hostable, decentralized alternative to reddit and other link aggregators, outside of their corporate control and meddling. It is an easily self-hostable, decentralized alternative to Reddit and other link aggregators, outside of their corporate control and meddling.
Each lemmy server can set its own moderation policy; appointing site-wide admins, and community moderators to keep out the trolls, and foster a healthy, non-toxic environment where all can feel comfortable contributing. Each Lemmy server can set its own moderation policy; appointing site-wide admins, and community moderators to keep out the trolls, and foster a healthy, non-toxic environment where all can feel comfortable contributing.
Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Inferno](https://infernojs.org), [Typescript](https://www.typescriptlang.org/) and [Diesel](http://diesel.rs/). ### Why's it called Lemmy?
- [Documentation](https://dev.lemmy.ml/docs/index.html) - Lead singer from [Motörhead](https://invidio.us/watch?v=3mbvWn1EY6g).
- [Releases / Changelog](/RELEASES.md) - The old school [video game](<https://en.wikipedia.org/wiki/Lemmings_(video_game)>).
- [Contributing](https://dev.lemmy.ml/docs/contributing.html) - The [Koopa from Super Mario](https://www.mariowiki.com/Lemmy_Koopa).
- The [furry rodents](http://sunchild.fpwc.org/lemming-the-little-giant-of-the-north/).
## Repository Mirrors ### Built With
- [GitHub](https://github.com/dessalines/lemmy) - [Rust](https://www.rust-lang.org)
- [Gitea](https://yerbamate.dev/dessalines/lemmy) - [Actix](https://actix.rs/)
- [GitLab](https://gitlab.com/dessalines/lemmy) - [Diesel](http://diesel.rs/)
- [Inferno](https://infernojs.org)
- [Typescript](https://www.typescriptlang.org/)
## Features ## Features
- Open source, [AGPL License](/LICENSE). - Open source, [AGPL License](/LICENSE).
- Self hostable, easy to deploy. - Self hostable, easy to deploy.
- Comes with [Docker](#docker), [Ansible](#ansible), [Kubernetes](#kubernetes). - Comes with [Docker](https://join-lemmy.org/docs/administration/install_docker.html) and [Ansible](https://join-lemmy.org/docs/administration/install_ansible.html).
- Clean, mobile-friendly interface. - Clean, mobile-friendly interface.
- Only a minimum of a username and password is required to sign up! - Only a minimum of a username and password is required to sign up!
- User avatar support. - User avatar support.
- Live-updating Comment threads. - Live-updating Comment threads.
- Full vote scores `(+/-)` like old reddit. - Full vote scores `(+/-)` like old Reddit.
- Themes, including light, dark, and solarized. - Themes, including light, dark, and solarized.
- Emojis with autocomplete support. Start typing `:` - Emojis with autocomplete support. Start typing `:`
- User tagging using `@`, Community tagging using `#`. - User tagging using `@`, Community tagging using `!`.
- Integrated image uploading in both posts and comments. - Integrated image uploading in both posts and comments.
- A post can consist of a title and any combination of self text, a URL, or nothing else. - A post can consist of a title and any combination of self text, a URL, or nothing else.
- Notifications, on comment replies and when you're tagged. - Notifications, on comment replies and when you're tagged.
- Notifications can be sent via email. - Notifications can be sent via email.
- Private messaging support.
- i18n / internationalization support. - i18n / internationalization support.
- RSS / Atom feeds for `All`, `Subscribed`, `Inbox`, `User`, and `Community`. - RSS / Atom feeds for `All`, `Subscribed`, `Inbox`, `User`, and `Community`.
- Cross-posting support. - Cross-posting support.
- A *similar post search* when creating new posts. Great for question / answer communities. - A _similar post search_ when creating new posts. Great for question / answer communities.
- Moderation abilities. - Moderation abilities.
- Public Moderation Logs. - Public Moderation Logs.
- Can sticky posts to the top of communities. - Can sticky posts to the top of communities.
@ -86,70 +107,26 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern
- NSFW post / community support. - NSFW post / community support.
- High performance. - High performance.
- Server is written in rust. - Server is written in rust.
- Front end is `~80kB` gzipped.
- Supports arm64 / Raspberry Pi. - Supports arm64 / Raspberry Pi.
## Why's it called Lemmy? ## Installation
- Lead singer from [Motörhead](https://invidio.us/watch?v=pWB5JZRGl0U). - [Lemmy Administration Docs](https://join-lemmy.org/docs/administration/administration.html)
- The old school [video game](<https://en.wikipedia.org/wiki/Lemmings_(video_game)>).
- The [Koopa from Super Mario](https://www.mariowiki.com/Lemmy_Koopa).
- The [furry rodents](http://sunchild.fpwc.org/lemming-the-little-giant-of-the-north/).
## Install ## Lemmy Projects
### Docker - [awesome-lemmy - A community driven list of apps and tools for lemmy](https://github.com/dbeley/awesome-lemmy)
Make sure you have both docker and docker-compose(>=`1.24.0`) installed:
```bash
mkdir lemmy/
cd lemmy/
wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/lemmy.hjson
# Edit lemmy.hjson to do more configuration
docker-compose up -d
```
and go to http://localhost:8536.
[A sample nginx config](/ansible/templates/nginx.conf) (Image uploading won't work without this), could be setup with:
```bash
wget https://raw.githubusercontent.com/dessalines/lemmy/master/ansible/templates/nginx.conf
# Replace the {{ vars }}
sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf
```
#### Updating
To update to the newest version, run:
```bash
wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
docker-compose up -d
```
### Ansible
First, you need to [install Ansible on your local computer](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) (e.g. using `sudo apt install ansible`) or the equivalent for you platform.
Then run the following commands on your local computer:
```bash
git clone https://github.com/dessalines/lemmy.git
cd lemmy/ansible/
cp inventory.example inventory
nano inventory # enter your server, domain, contact email
ansible-playbook lemmy.yml --become
```
## Support / Donate ## Support / Donate
Lemmy is free, open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project. Lemmy is free, open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project.
Lemmy is made possible by a generous grant from the [NLnet foundation](https://nlnet.nl/).
- [Support on Liberapay](https://liberapay.com/Lemmy).
- [Support on Patreon](https://www.patreon.com/dessalines). - [Support on Patreon](https://www.patreon.com/dessalines).
- [List of Sponsors](https://dev.lemmy.ml/sponsors). - [Support on OpenCollective](https://opencollective.com/lemmy).
- Soon to add either liberapay or opencollective. - [List of Sponsors](https://join-lemmy.org/donate).
### Crypto ### Crypto
@ -157,36 +134,31 @@ Lemmy is free, open-source software, meaning no advertising, monetizing, or vent
- ethereum: `0x400c96c96acbC6E7B3B43B1dc1BB446540a88A01` - ethereum: `0x400c96c96acbC6E7B3B43B1dc1BB446540a88A01`
- monero: `41taVyY6e1xApqKyMVDRVxJ76sPkfZhALLTjRvVKpaAh2pBd4wv9RgYj1tSPrx8wc6iE1uWUfjtQdTmTy2FGMeChGVKPQuV` - monero: `41taVyY6e1xApqKyMVDRVxJ76sPkfZhALLTjRvVKpaAh2pBd4wv9RgYj1tSPrx8wc6iE1uWUfjtQdTmTy2FGMeChGVKPQuV`
## Translations ## Contributing
If you'd like to add translations, take a look at the [English translation file](ui/src/translations/en.ts). Read the following documentation to setup the development environment and start coding:
- Languages supported: Catalan, (`ca`), Farsi (`fa`), English (`en`), Chinese (`zh`), Dutch (`nl`), Esperanto (`eo`), Finnish (`fi`), French (`fr`), Spanish (`es`), Swedish (`sv`), German (`de`), Russian (`ru`), Italian (`it`). - [Contributing instructions](https://join-lemmy.org/docs/contributors/01-overview.html)
- [Docker Development](https://join-lemmy.org/docs/contributors/03-docker-development.html)
- [Local Development](https://join-lemmy.org/docs/contributors/02-local-development.html)
<!-- translations --> When working on an issue or pull request, you can comment with any questions you may have so that maintainers can answer them. You can also join the [Matrix Development Chat](https://matrix.to/#/#lemmydev:matrix.org) for general assistance.
lang | done | missing ### Translations
---- | ---- | -------
ca | 99% | old,time,action
de | 87% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,old,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
fa | 72% | cross_post,subscribed_to_communities,trending_communities,create_private_message,send_secure_message,send_message,message,mod,mods,moderates,remove_as_mod,appoint_as_mod,modlog,stickied,ban,ban_from_site,unban,unban_from_site,banned,number_of_subscribers,subscribers,both,saved,unsubscribe,subscribe,subscribed,old,api,docs,inbox,inbox_for,message_sent,notifications_error,messages,no_email_setup,matrix_user_id,private_message_disclaimer,url,body,copy_suggested_title,community,expand_here,subscribe_to_communities,theme,sponsor_message,general_sponsors,joined,by,to,from,landing_0,logged_in,community_moderator_already_exists,community_follower_already_exists,community_user_already_banned,no_slurs,admin_already_created,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
eo | 75% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
es | 100% |
fi | 99% | old,time,action
fr | 82% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
it | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
nl | 99% | time,action
ru | 71% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
sv | 82% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
zh | 69% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
<!-- translationsstop -->
If you'd like to update this report, run: - If you want to help with translating, take a look at [Weblate](https://weblate.join-lemmy.org/projects/lemmy/). You can also help by [translating the documentation](https://github.com/LemmyNet/lemmy-docs#adding-a-new-language).
```bash ## Community
cd ui
ts-node translation_report.ts - [Matrix Space](https://matrix.to/#/#lemmy-space:matrix.org)
``` - [Lemmy Forum](https://lemmy.ml/c/lemmy)
- [Lemmy Support Forum](https://lemmy.ml/c/lemmy_support)
## Code Mirrors
- [GitHub](https://github.com/LemmyNet/lemmy)
- [Gitea](https://git.join-lemmy.org/LemmyNet/lemmy)
- [Codeberg](https://codeberg.org/LemmyNet/lemmy)
## Credits ## Credits

View File

@ -1,22 +1,3 @@
# Lemmy v0.6.0 Release (2020-01-16) [Lemmy Releases / news](https://join-lemmy.org/news)
`v0.6.0` is here, and we've closed [41 issues!](https://github.com/dessalines/lemmy/milestone/15?closed=1) [Github link](https://github.com/LemmyNet/joinlemmy-site/tree/main/src/assets/news)
This is the biggest release by far:
- Avatars!
- Optional Email notifications for username mentions, post and comment replies.
- Ability to change your password and email address.
- Can set a custom language.
- Lemmy-wide settings to disable downvotes, and close registration.
- A better documentation system, hosted in lemmy itself.
- [Huge DB performance gains](https://github.com/dessalines/lemmy/issues/411) (everthing down to < `30ms`) by using materialized views.
- Fixed major issue with similar post URL and title searching.
- Upgraded to Actix `2.0`
- Faster comment / post voting.
- Better small screen support.
- Lots of bug fixes, refactoring of back end code.
Another major announcement is that Lemmy now has another lead developer besides me, [@felix@radical.town](https://radical.town/@felix). Theyve created a better documentation system, implemented RSS feeds, simplified docker and project configs, upgraded actix, working on federation, a whole lot else.
https://dev.lemmy.ml

5
SECURITY.md Normal file
View File

@ -0,0 +1,5 @@
# Security Policy
## Reporting a Vulnerability
Use [Github's security advisory issue system](https://github.com/LemmyNet/lemmy/security/advisories/new).

View File

@ -1 +0,0 @@
v0.6.10

View File

@ -1,5 +0,0 @@
[defaults]
inventory=inventory
[ssh_connection]
pipelining = True

View File

@ -1,6 +0,0 @@
[lemmy]
# define the username and hostname that you use for ssh connection, and specify the domain
myuser@example.com domain=example.com letsencrypt_contact_email=your@email.com
[all:vars]
ansible_connection=ssh

View File

@ -1,66 +0,0 @@
---
- hosts: all
# Install python if required
# https://www.josharcher.uk/code/ansible-python-connection-failure-ubuntu-server-1604/
gather_facts: False
pre_tasks:
- name: install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal python-setuptools)
args:
executable: /bin/bash
register: output
changed_when: output.stdout != ""
- setup: # gather facts
tasks:
- name: install dependencies
apt:
pkg: ['nginx', 'docker-compose', 'docker.io', 'certbot', 'python-certbot-nginx']
- name: request initial letsencrypt certificate
command: certbot certonly --nginx --agree-tos -d '{{ domain }}' -m '{{ letsencrypt_contact_email }}'
args:
creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem'
- name: create lemmy folder
file: path={{item.path}} state=directory
with_items:
- { path: '/lemmy/' }
- { path: '/lemmy/volumes/' }
- block:
- name: add template files
template: src={{item.src}} dest={{item.dest}} mode={{item.mode}}
with_items:
- { src: 'templates/docker-compose.yml', dest: '/lemmy/docker-compose.yml', mode: '0600' }
- { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy.conf', mode: '0644' }
- name: add config file (only during initial setup)
template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000'
vars:
postgres_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/postgres chars=ascii_letters,digits') }}"
jwt_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/jwt chars=ascii_letters,digits') }}"
lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}"
- name: enable and start docker service
systemd:
name: docker
enabled: yes
state: started
- name: start docker-compose
docker_compose:
project_src: /lemmy/
state: present
pull: yes
- name: reload nginx with new config
shell: nginx -s reload
- name: certbot renewal cronjob
cron:
special_time=daily
name=certbot-renew-lemmy
user=root
job="certbot certonly --nginx -d '{{ domain }}' --deploy-hook 'docker-compose -f /peertube/docker-compose.yml exec nginx nginx -s reload'"

View File

@ -1,100 +0,0 @@
---
- hosts: all
vars:
lemmy_docker_image: "lemmy:dev"
# Install python if required
# https://www.josharcher.uk/code/ansible-python-connection-failure-ubuntu-server-1604/
gather_facts: False
pre_tasks:
- name: install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal python-setuptools)
args:
executable: /bin/bash
register: output
changed_when: output.stdout != ""
- setup: # gather facts
tasks:
- name: install dependencies
apt:
pkg: ['nginx', 'docker-compose', 'docker.io', 'certbot', 'python-certbot-nginx']
- name: request initial letsencrypt certificate
command: certbot certonly --nginx --agree-tos -d '{{ domain }}' -m '{{ letsencrypt_contact_email }}'
args:
creates: '/etc/letsencrypt/live/{{domain}}/privkey.pem'
- name: create lemmy folder
file: path={{item.path}} state=directory
with_items:
- { path: '/lemmy/' }
- { path: '/lemmy/volumes/' }
- block:
- name: add template files
template: src={{item.src}} dest={{item.dest}} mode={{item.mode}}
with_items:
- { src: 'templates/docker-compose.yml', dest: '/lemmy/docker-compose.yml', mode: '0600' }
- { src: 'templates/nginx.conf', dest: '/etc/nginx/sites-enabled/lemmy.conf', mode: '0644' }
- name: add config file (only during initial setup)
template: src='templates/config.hjson' dest='/lemmy/lemmy.hjson' mode='0600' force='no' owner='1000' group='1000'
vars:
postgres_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/postgres chars=ascii_letters,digits') }}"
jwt_password: "{{ lookup('password', 'passwords/{{ inventory_hostname }}/jwt chars=ascii_letters,digits') }}"
- name: build the dev docker image
local_action: shell cd .. && sudo docker build . -f docker/dev/Dockerfile -t lemmy:dev
register: image_build
- name: find hash of the new docker image
set_fact:
image_hash: "{{ image_build.stdout | regex_search('(?<=Successfully built )[0-9a-f]{12}') }}"
# this does not use become so that the output file is written as non-root user and is easy to delete later
- name: save dev docker image to file
local_action: shell sudo docker save lemmy:dev > lemmy-dev.tar
- name: copy dev docker image to server
copy: src=lemmy-dev.tar dest=/lemmy/lemmy-dev.tar
- name: import docker image
docker_image:
name: lemmy
tag: dev
load_path: /lemmy/lemmy-dev.tar
source: load
force_source: yes
register: image_import
- name: delete remote image file
file: path=/lemmy/lemmy-dev.tar state=absent
- name: delete local image file
local_action: file path=lemmy-dev.tar state=absent
- name: enable and start docker service
systemd:
name: docker
enabled: yes
state: started
# cant pull here because that fails due to lemmy:dev (without dessalines/) not being on docker hub, but that shouldnt
# be a problem for testing
- name: start docker-compose
docker_compose:
project_src: /lemmy/
state: present
recreate: always
ignore_errors: yes
- name: reload nginx with new config
shell: nginx -s reload
- name: certbot renewal cronjob
cron:
special_time=daily
name=certbot-renew-lemmy
user=root
job="certbot certonly --nginx -d '{{ domain }}' --deploy-hook 'docker-compose -f /peertube/docker-compose.yml exec nginx nginx -s reload'"

View File

@ -1,14 +0,0 @@
{
database: {
password: "{{ postgres_password }}"
host: "lemmy_db"
}
hostname: "{{ domain }}"
jwt_secret: "{{ jwt_password }}"
front_end_dir: "/app/dist"
email: {
smtp_server: "postfix:25"
smtp_from_address: "noreply@{{ domain }}"
use_tls: false
}
}

View File

@ -1,40 +0,0 @@
version: '3.3'
services:
lemmy:
image: {{ lemmy_docker_image }}
ports:
- "127.0.0.1:8536:8536"
restart: always
volumes:
- ./lemmy.hjson:/config/config.hjson:ro
depends_on:
- lemmy_db
- lemmy_pictshare
lemmy_db:
image: postgres:12-alpine
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD={{ postgres_password }}
- POSTGRES_DB=lemmy
volumes:
- lemmy_db:/var/lib/postgresql/data
restart: always
lemmy_pictshare:
image: shtripok/pictshare:latest
ports:
- "127.0.0.1:8537:80"
volumes:
- lemmy_pictshare:/usr/share/nginx/html/data
restart: always
postfix:
image: mwader/postfix-relay
environment:
- POSTFIX_myhostname={{ domain }}
restart: "always"
volumes:
lemmy_db:
lemmy_pictshare:

View File

@ -1,96 +0,0 @@
proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m use_temp_path=off;
server {
listen 80;
server_name {{ domain }};
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
server_name {{ domain }};
ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem;
# Various TLS hardening settings
# https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
# Hide nginx version
server_tokens off;
# Enable compression for JS/CSS/HTML bundle, for improved client load times.
# It might be nice to compress JSON, but leaving that out to protect against potential
# compression+encryption information leak attacks like BREACH.
gzip on;
gzip_types text/css application/javascript;
gzip_vary on;
# Only connect to this site via HTTPS for the two years
add_header Strict-Transport-Security "max-age=63072000";
# Various content security headers
add_header Referrer-Policy "same-origin";
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "DENY";
add_header X-XSS-Protection "1; mode=block";
# Upload limit for pictshare
client_max_body_size 50M;
location / {
proxy_pass http://0.0.0.0:8536;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Proxy Cache
proxy_cache lemmy_frontend_cache;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_cache_min_uses 5;
}
location /pictshare/ {
proxy_pass http://0.0.0.0:8537/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ($request_uri ~ \.(?:ico|gif|jpe?g|png|webp|bmp|mp4)$) {
add_header Cache-Control "public, max-age=31536000, immutable";
}
}
}
# Anonymize IP addresses
# https://www.supertechcrew.com/anonymizing-logs-nginx-apache/
map $remote_addr $remote_addr_anon {
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0;
~(?P<ip>[^:]+:[^:]+): $ip::;
127.0.0.1 $remote_addr;
::1 $remote_addr;
default 0.0.0.0;
}
log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log main;

View File

@ -1,48 +0,0 @@
---
- hosts: all
vars_prompt:
- name: confirm_uninstall
prompt: "Do you really want to uninstall Lemmy? This will delete all data and can not be reverted [yes/no]"
private: no
- name: delete_certs
prompt: "Delete certificates? Select 'no' if you want to reinstall Lemmy [yes/no]"
private: no
tasks:
- name: end play if no confirmation was given
debug:
msg: "Uninstall cancelled, doing nothing"
when: not confirm_uninstall|bool
- meta: end_play
when: not confirm_uninstall|bool
- name: stop docker-compose
docker_compose:
project_src: /lemmy/
state: absent
- name: delete data
file: path={{item.path}} state=absent
with_items:
- { path: '/lemmy/' }
- { path: '/etc/nginx/sites-enabled/lemmy.conf' }
- name: Remove a volume
docker_volume: name={{item.name}} state=absent
with_items:
- { name: 'lemmy_lemmy_db' }
- { name: 'lemmy_lemmy_pictshare' }
- name: delete entire ecloud folder
file: path='/mnt/repo-base/' state=absent
when: delete_certs|bool
- name: remove certbot cronjob
cron:
name=certbot-renew-lemmy
state=absent

View File

@ -3,41 +3,26 @@
"env": { "env": {
"browser": true "browser": true
}, },
"plugins": [ "plugins": ["@typescript-eslint"],
"jane", "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"inferno"
],
"extends": [
"plugin:jane/recommended",
"plugin:jane/typescript",
"plugin:inferno/recommended"
],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"project": "./tsconfig.json", "project": "./tsconfig.json",
"warnOnUnsupportedTypeScriptVersion": false "warnOnUnsupportedTypeScriptVersion": false
}, },
"rules": { "rules": {
"@typescript-eslint/camelcase": 0, "@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-this-alias": 0, "@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-unused-vars": 0, "@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-useless-constructor": 0,
"arrow-body-style": 0, "arrow-body-style": 0,
"curly": 0, "curly": 0,
"eol-last": 0, "eol-last": 0,
"eqeqeq": 0, "eqeqeq": 0,
"func-style": 0, "func-style": 0,
"import/no-duplicates": 0, "import/no-duplicates": 0,
"inferno/jsx-key": 0,
"inferno/jsx-no-target-blank": 0,
"inferno/jsx-props-class-name": 0,
"inferno/no-direct-mutation-state": 0,
"inferno/no-unknown-property": 0,
"max-statements": 0, "max-statements": 0,
"max-params": 0,
"new-cap": 0, "new-cap": 0,
"no-console": 0, "no-console": 0,
"no-duplicate-imports": 0, "no-duplicate-imports": 0,

1
api_tests/.npmrc Normal file
View File

@ -0,0 +1 @@
package-manager-strict=false

View File

@ -0,0 +1,4 @@
{
"arrowParens": "avoid",
"semi": true
}

4
api_tests/jest.config.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};

36
api_tests/package.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": "api_tests",
"version": "0.0.1",
"description": "API tests for lemmy backend",
"main": "index.js",
"repository": "https://github.com/LemmyNet/lemmy",
"author": "Dessalines",
"license": "AGPL-3.0",
"packageManager": "pnpm@9.1.1+sha256.9551e803dcb7a1839fdf5416153a844060c7bce013218ce823410532504ac10b",
"scripts": {
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check 'src/**/*.ts'",
"fix": "prettier --write src && eslint --fix src",
"api-test": "jest -i follow.spec.ts && jest -i image.spec.ts && jest -i user.spec.ts && jest -i private_message.spec.ts && jest -i community.spec.ts && jest -i post.spec.ts && jest -i comment.spec.ts ",
"api-test-follow": "jest -i follow.spec.ts",
"api-test-comment": "jest -i comment.spec.ts",
"api-test-post": "jest -i post.spec.ts",
"api-test-user": "jest -i user.spec.ts",
"api-test-community": "jest -i community.spec.ts",
"api-test-private-message": "jest -i private_message.spec.ts",
"api-test-image": "jest -i image.spec.ts"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.12.4",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"download-file-sync": "^1.0.4",
"eslint": "^8.57.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.5.0",
"lemmy-js-client": "0.19.4-alpha.18",
"prettier": "^3.2.5",
"ts-jest": "^29.1.0",
"typescript": "^5.4.4"
}
}

3449
api_tests/pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,94 @@
#!/usr/bin/env bash
# IMPORTANT NOTE: this script does not use the normal LEMMY_DATABASE_URL format
# it is expected that this script is called by run-federation-test.sh script.
set -e
if [ -z "$LEMMY_LOG_LEVEL" ];
then
LEMMY_LOG_LEVEL=info
fi
export RUST_BACKTRACE=1
export RUST_LOG="warn,lemmy_server=$LEMMY_LOG_LEVEL,lemmy_federate=$LEMMY_LOG_LEVEL,lemmy_api=$LEMMY_LOG_LEVEL,lemmy_api_common=$LEMMY_LOG_LEVEL,lemmy_api_crud=$LEMMY_LOG_LEVEL,lemmy_apub=$LEMMY_LOG_LEVEL,lemmy_db_schema=$LEMMY_LOG_LEVEL,lemmy_db_views=$LEMMY_LOG_LEVEL,lemmy_db_views_actor=$LEMMY_LOG_LEVEL,lemmy_db_views_moderator=$LEMMY_LOG_LEVEL,lemmy_routes=$LEMMY_LOG_LEVEL,lemmy_utils=$LEMMY_LOG_LEVEL,lemmy_websocket=$LEMMY_LOG_LEVEL"
export LEMMY_TEST_FAST_FEDERATION=1 # by default, the persistent federation queue has delays in the scale of 30s-5min
# pictrs setup
if [ ! -f "api_tests/pict-rs" ]; then
curl "https://git.asonix.dog/asonix/pict-rs/releases/download/v0.5.13/pict-rs-linux-amd64" -o api_tests/pict-rs
chmod +x api_tests/pict-rs
fi
./api_tests/pict-rs \
run -a 0.0.0.0:8080 \
--danger-dummy-mode \
--api-key "my-pictrs-key" \
filesystem -p /tmp/pictrs/files \
sled -p /tmp/pictrs/sled-repo 2>&1 &
for INSTANCE in lemmy_alpha lemmy_beta lemmy_gamma lemmy_delta lemmy_epsilon; do
echo "DB URL: ${LEMMY_DATABASE_URL} INSTANCE: $INSTANCE"
psql "${LEMMY_DATABASE_URL}/lemmy" -c "DROP DATABASE IF EXISTS $INSTANCE"
echo "create database"
psql "${LEMMY_DATABASE_URL}/lemmy" -c "CREATE DATABASE $INSTANCE"
done
if [ -z "$DO_WRITE_HOSTS_FILE" ]; then
if ! grep -q lemmy-alpha /etc/hosts; then
echo "Please add the following to your /etc/hosts file, then press enter:
127.0.0.1 lemmy-alpha
127.0.0.1 lemmy-beta
127.0.0.1 lemmy-gamma
127.0.0.1 lemmy-delta
127.0.0.1 lemmy-epsilon"
read -p ""
fi
else
for INSTANCE in lemmy-alpha lemmy-beta lemmy-gamma lemmy-delta lemmy-epsilon; do
echo "127.0.0.1 $INSTANCE" >>/etc/hosts
done
fi
echo "$PWD"
LOG_DIR=target/log
mkdir -p $LOG_DIR
echo "start alpha"
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_alpha.hjson \
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_alpha" \
target/lemmy_server >$LOG_DIR/lemmy_alpha.out 2>&1 &
echo "start beta"
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_beta.hjson \
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_beta" \
target/lemmy_server >$LOG_DIR/lemmy_beta.out 2>&1 &
echo "start gamma"
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_gamma.hjson \
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_gamma" \
target/lemmy_server >$LOG_DIR/lemmy_gamma.out 2>&1 &
echo "start delta"
# An instance with only an allowlist for beta
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_delta.hjson \
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_delta" \
target/lemmy_server >$LOG_DIR/lemmy_delta.out 2>&1 &
echo "start epsilon"
# An instance who has a blocklist, with lemmy-alpha blocked
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_epsilon.hjson \
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_epsilon" \
target/lemmy_server >$LOG_DIR/lemmy_epsilon.out 2>&1 &
echo "wait for all instances to start"
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'lemmy-alpha:8541/api/v3/site')" != "200" ]]; do sleep 1; done
echo "alpha started"
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'lemmy-beta:8551/api/v3/site')" != "200" ]]; do sleep 1; done
echo "beta started"
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'lemmy-gamma:8561/api/v3/site')" != "200" ]]; do sleep 1; done
echo "gamma started"
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'lemmy-delta:8571/api/v3/site')" != "200" ]]; do sleep 1; done
echo "delta started"
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'lemmy-epsilon:8581/api/v3/site')" != "200" ]]; do sleep 1; done
echo "epsilon started. All started"

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432
pushd ..
cargo build
rm target/lemmy_server || true
cp target/debug/lemmy_server target/lemmy_server
killall -s1 lemmy_server || true
./api_tests/prepare-drone-federation-test.sh
popd
pnpm i
pnpm api-test || true
killall -s1 lemmy_server || true
killall -s1 pict-rs || true
for INSTANCE in lemmy_alpha lemmy_beta lemmy_gamma lemmy_delta lemmy_epsilon; do
psql "$LEMMY_DATABASE_URL" -c "DROP DATABASE $INSTANCE"
done
rm -r /tmp/pictrs

View File

@ -0,0 +1,806 @@
jest.setTimeout(180000);
import { PostResponse } from "lemmy-js-client/dist/types/PostResponse";
import {
alpha,
beta,
gamma,
setupLogins,
createPost,
getPost,
resolveComment,
likeComment,
followBeta,
resolveBetaCommunity,
createComment,
editComment,
deleteComment,
removeComment,
getMentions,
resolvePost,
unfollowRemotes,
createCommunity,
registerUser,
reportComment,
listCommentReports,
randomString,
unfollows,
getComments,
getCommentParentId,
resolveCommunity,
getPersonDetails,
getReplies,
getUnreadCount,
waitUntil,
waitForPost,
alphaUrl,
followCommunity,
blockCommunity,
delay,
} from "./shared";
import { CommentView, CommunityView } from "lemmy-js-client";
let betaCommunity: CommunityView | undefined;
let postOnAlphaRes: PostResponse;
beforeAll(async () => {
await setupLogins();
await Promise.all([followBeta(alpha), followBeta(gamma)]);
betaCommunity = (await resolveBetaCommunity(alpha)).community;
if (betaCommunity) {
postOnAlphaRes = await createPost(alpha, betaCommunity.community.id);
}
});
afterAll(unfollows);
function assertCommentFederation(
commentOne?: CommentView,
commentTwo?: CommentView,
) {
expect(commentOne?.comment.ap_id).toBe(commentTwo?.comment.ap_id);
expect(commentOne?.comment.content).toBe(commentTwo?.comment.content);
expect(commentOne?.creator.name).toBe(commentTwo?.creator.name);
expect(commentOne?.community.actor_id).toBe(commentTwo?.community.actor_id);
expect(commentOne?.comment.published).toBe(commentTwo?.comment.published);
expect(commentOne?.comment.updated).toBe(commentOne?.comment.updated);
expect(commentOne?.comment.deleted).toBe(commentOne?.comment.deleted);
expect(commentOne?.comment.removed).toBe(commentOne?.comment.removed);
}
test("Create a comment", async () => {
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
expect(commentRes.comment_view.comment.content).toBeDefined();
expect(commentRes.comment_view.community.local).toBe(false);
expect(commentRes.comment_view.creator.local).toBe(true);
expect(commentRes.comment_view.counts.score).toBe(1);
// Make sure that comment is liked on beta
let betaComment = (
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment),
c => c.comment?.counts.score === 1,
)
).comment;
expect(betaComment).toBeDefined();
expect(betaComment?.community.local).toBe(true);
expect(betaComment?.creator.local).toBe(false);
expect(betaComment?.counts.score).toBe(1);
assertCommentFederation(betaComment, commentRes.comment_view);
});
test("Create a comment in a non-existent post", async () => {
await expect(createComment(alpha, -1)).rejects.toStrictEqual(
Error("couldnt_find_post"),
);
});
test("Update a comment", async () => {
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
// Federate the comment first
let betaComment = (
await resolveComment(beta, commentRes.comment_view.comment)
).comment;
assertCommentFederation(betaComment, commentRes.comment_view);
let updateCommentRes = await editComment(
alpha,
commentRes.comment_view.comment.id,
);
expect(updateCommentRes.comment_view.comment.content).toBe(
"A jest test federated comment update",
);
expect(updateCommentRes.comment_view.community.local).toBe(false);
expect(updateCommentRes.comment_view.creator.local).toBe(true);
// Make sure that post is updated on beta
let betaCommentUpdated = (
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment),
c =>
c.comment?.comment.content === "A jest test federated comment update",
)
).comment;
assertCommentFederation(betaCommentUpdated, updateCommentRes.comment_view);
});
test("Delete a comment", async () => {
let post = await createPost(alpha, betaCommunity!.community.id);
// creating a comment on alpha (remote from home of community)
let commentRes = await createComment(alpha, post.post_view.post.id);
// Find the comment on beta (home of community)
let betaComment = (
await resolveComment(beta, commentRes.comment_view.comment)
).comment;
if (!betaComment) {
throw "Missing beta comment before delete";
}
// Find the comment on remote instance gamma
let gammaComment = (
await waitUntil(
() =>
resolveComment(gamma, commentRes.comment_view.comment).catch(e => e),
r => r.message !== "couldnt_find_object",
)
).comment;
if (!gammaComment) {
throw "Missing gamma comment (remote-home-remote replication) before delete";
}
let deleteCommentRes = await deleteComment(
alpha,
true,
commentRes.comment_view.comment.id,
);
expect(deleteCommentRes.comment_view.comment.deleted).toBe(true);
expect(deleteCommentRes.comment_view.comment.content).toBe("");
// Make sure that comment is undefined on beta
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment).catch(e => e),
e => e.message == "couldnt_find_object",
);
// Make sure that comment is undefined on gamma after delete
await waitUntil(
() => resolveComment(gamma, commentRes.comment_view.comment).catch(e => e),
e => e.message === "couldnt_find_object",
);
// Test undeleting the comment
let undeleteCommentRes = await deleteComment(
alpha,
false,
commentRes.comment_view.comment.id,
);
expect(undeleteCommentRes.comment_view.comment.deleted).toBe(false);
// Make sure that comment is undeleted on beta
let betaComment2 = (
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment).catch(e => e),
e => e.message !== "couldnt_find_object",
)
).comment;
expect(betaComment2?.comment.deleted).toBe(false);
assertCommentFederation(betaComment2, undeleteCommentRes.comment_view);
});
test.skip("Remove a comment from admin and community on the same instance", async () => {
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
// Get the id for beta
let betaCommentId = (
await resolveComment(beta, commentRes.comment_view.comment)
).comment?.comment.id;
if (!betaCommentId) {
throw "beta comment id is missing";
}
// The beta admin removes it (the community lives on beta)
let removeCommentRes = await removeComment(beta, true, betaCommentId);
expect(removeCommentRes.comment_view.comment.removed).toBe(true);
// Make sure that comment is removed on alpha (it gets pushed since an admin from beta removed it)
let refetchedPostComments = await getPersonDetails(
alpha,
commentRes.comment_view.comment.creator_id,
);
expect(refetchedPostComments.comments[0].comment.removed).toBe(true);
// beta will unremove the comment
let unremoveCommentRes = await removeComment(beta, false, betaCommentId);
expect(unremoveCommentRes.comment_view.comment.removed).toBe(false);
// Make sure that comment is unremoved on alpha
let refetchedPostComments2 = await getComments(
alpha,
postOnAlphaRes.post_view.post.id,
);
expect(refetchedPostComments2.comments[0].comment.removed).toBe(false);
assertCommentFederation(
refetchedPostComments2.comments[0],
unremoveCommentRes.comment_view,
);
});
test("Remove a comment from admin and community on different instance", async () => {
let newAlphaApi = await registerUser(alpha, alphaUrl);
// New alpha user creates a community, post, and comment.
let newCommunity = await createCommunity(newAlphaApi);
let newPost = await createPost(
newAlphaApi,
newCommunity.community_view.community.id,
);
let commentRes = await createComment(newAlphaApi, newPost.post_view.post.id);
expect(commentRes.comment_view.comment.content).toBeDefined();
// Beta searches that to cache it, then removes it
let betaComment = (
await resolveComment(beta, commentRes.comment_view.comment)
).comment;
if (!betaComment) {
throw "beta comment missing";
}
let removeCommentRes = await removeComment(
beta,
true,
betaComment.comment.id,
);
expect(removeCommentRes.comment_view.comment.removed).toBe(true);
expect(removeCommentRes.comment_view.comment.content).toBe("");
// Comment text is also hidden from list
let listComments = await getComments(
beta,
removeCommentRes.comment_view.post.id,
);
expect(listComments.comments.length).toBe(1);
expect(listComments.comments[0].comment.removed).toBe(true);
expect(listComments.comments[0].comment.content).toBe("");
// Make sure its not removed on alpha
let refetchedPostComments = await getComments(
alpha,
newPost.post_view.post.id,
);
expect(refetchedPostComments.comments[0].comment.removed).toBe(false);
assertCommentFederation(
refetchedPostComments.comments[0],
commentRes.comment_view,
);
});
test("Unlike a comment", async () => {
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
// Lemmy automatically creates 1 like (vote) by author of comment.
// Make sure that comment is liked (voted up) on gamma, downstream peer
// This is testing replication from remote-home-remote (alpha-beta-gamma)
let gammaComment1 = (
await waitUntil(
() => resolveComment(gamma, commentRes.comment_view.comment),
c => c.comment?.counts.score === 1,
)
).comment;
expect(gammaComment1).toBeDefined();
expect(gammaComment1?.community.local).toBe(false);
expect(gammaComment1?.creator.local).toBe(false);
expect(gammaComment1?.counts.score).toBe(1);
let unlike = await likeComment(alpha, 0, commentRes.comment_view.comment);
expect(unlike.comment_view.counts.score).toBe(0);
// Make sure that comment is unliked on beta
let betaComment = (
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment),
c => c.comment?.counts.score === 0,
)
).comment;
expect(betaComment).toBeDefined();
expect(betaComment?.community.local).toBe(true);
expect(betaComment?.creator.local).toBe(false);
expect(betaComment?.counts.score).toBe(0);
// Make sure that comment is unliked on gamma, downstream peer
// This is testing replication from remote-home-remote (alpha-beta-gamma)
let gammaComment = (
await waitUntil(
() => resolveComment(gamma, commentRes.comment_view.comment),
c => c.comment?.counts.score === 0,
)
).comment;
expect(gammaComment).toBeDefined();
expect(gammaComment?.community.local).toBe(false);
expect(gammaComment?.creator.local).toBe(false);
expect(gammaComment?.counts.score).toBe(0);
});
test("Federated comment like", async () => {
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment),
c => c.comment?.counts.score === 1,
);
// Find the comment on beta
let betaComment = (
await resolveComment(beta, commentRes.comment_view.comment)
).comment;
if (!betaComment) {
throw "Missing beta comment";
}
let like = await likeComment(beta, 1, betaComment.comment);
expect(like.comment_view.counts.score).toBe(2);
// Get the post from alpha, check the likes
let postComments = await waitUntil(
() => getComments(alpha, postOnAlphaRes.post_view.post.id),
c => c.comments[0].counts.score === 2,
);
expect(postComments.comments[0].counts.score).toBe(2);
});
test("Reply to a comment from another instance, get notification", async () => {
await alpha.markAllAsRead();
let betaCommunity = (
await waitUntil(
() => resolveBetaCommunity(alpha),
c => !!c.community?.community.instance_id,
)
).community;
if (!betaCommunity) {
throw "Missing beta community";
}
const postOnAlphaRes = await createPost(alpha, betaCommunity.community.id);
// Create a root-level trunk-branch comment on alpha
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
// find that comment id on beta
let betaComment = (
await waitUntil(
() => resolveComment(beta, commentRes.comment_view.comment),
c => c.comment?.counts.score === 1,
)
).comment;
if (!betaComment) {
throw "Missing beta comment";
}
// Reply from beta, extending the branch
let replyRes = await createComment(
beta,
betaComment.post.id,
betaComment.comment.id,
);
expect(replyRes.comment_view.comment.content).toBeDefined();
expect(replyRes.comment_view.community.local).toBe(true);
expect(replyRes.comment_view.creator.local).toBe(true);
expect(getCommentParentId(replyRes.comment_view.comment)).toBe(
betaComment.comment.id,
);
expect(replyRes.comment_view.counts.score).toBe(1);
// Make sure that reply comment is seen on alpha
let commentSearch = await waitUntil(
() => resolveComment(alpha, replyRes.comment_view.comment),
c => c.comment?.counts.score === 1,
);
let alphaComment = commentSearch.comment!;
let postComments = await waitUntil(
() => getComments(alpha, postOnAlphaRes.post_view.post.id),
pc => pc.comments.length >= 2,
);
// Note: this test fails when run twice and this count will differ
expect(postComments.comments.length).toBeGreaterThanOrEqual(2);
expect(alphaComment.comment.content).toBeDefined();
expect(getCommentParentId(alphaComment.comment)).toBe(
postComments.comments[1].comment.id,
);
expect(alphaComment.community.local).toBe(false);
expect(alphaComment.creator.local).toBe(false);
expect(alphaComment.counts.score).toBe(1);
assertCommentFederation(alphaComment, replyRes.comment_view);
// Did alpha get notified of the reply from beta?
let alphaUnreadCountRes = await waitUntil(
() => getUnreadCount(alpha),
e => e.replies >= 1,
);
expect(alphaUnreadCountRes.replies).toBeGreaterThanOrEqual(1);
// check inbox of replies on alpha, fetching read/unread both
let alphaRepliesRes = await waitUntil(
() => getReplies(alpha),
r => r.replies.length > 0,
);
const alphaReply = alphaRepliesRes.replies.find(
r => r.comment.id === alphaComment.comment.id,
);
expect(alphaReply).toBeDefined();
if (!alphaReply) throw Error();
expect(alphaReply.comment.content).toBeDefined();
expect(alphaReply.community.local).toBe(false);
expect(alphaReply.creator.local).toBe(false);
expect(alphaReply.counts.score).toBe(1);
// ToDo: interesting alphaRepliesRes.replies[0].comment_reply.id is 1, meaning? how did that come about?
expect(alphaReply.comment.id).toBe(alphaComment.comment.id);
// this is a new notification, getReplies fetch was for read/unread both, confirm it is unread.
expect(alphaReply.comment_reply.read).toBe(false);
assertCommentFederation(alphaReply, replyRes.comment_view);
});
test("Mention beta from alpha", async () => {
if (!betaCommunity) throw Error("no community");
const postOnAlphaRes = await createPost(alpha, betaCommunity.community.id);
// Create a new branch, trunk-level comment branch, from alpha instance
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
// Create a reply comment to previous comment, this has a mention in body
let mentionContent = "A test mention of @lemmy_beta@lemmy-beta:8551";
let mentionRes = await createComment(
alpha,
postOnAlphaRes.post_view.post.id,
commentRes.comment_view.comment.id,
mentionContent,
);
expect(mentionRes.comment_view.comment.content).toBeDefined();
expect(mentionRes.comment_view.community.local).toBe(false);
expect(mentionRes.comment_view.creator.local).toBe(true);
expect(mentionRes.comment_view.counts.score).toBe(1);
// get beta's localized copy of the alpha post
let betaPost = await waitForPost(beta, postOnAlphaRes.post_view.post);
if (!betaPost) {
throw "unable to locate post on beta";
}
expect(betaPost.post.ap_id).toBe(postOnAlphaRes.post_view.post.ap_id);
expect(betaPost.post.name).toBe(postOnAlphaRes.post_view.post.name);
// Make sure that both new comments are seen on beta and have parent/child relationship
let betaPostComments = await waitUntil(
() => getComments(beta, betaPost!.post.id),
c => c.comments[1]?.counts.score === 1,
);
expect(betaPostComments.comments.length).toEqual(2);
// the trunk-branch root comment will be older than the mention reply comment, so index 1
let betaRootComment = betaPostComments.comments[1];
// the trunk-branch root comment should not have a parent
expect(getCommentParentId(betaRootComment.comment)).toBeUndefined();
expect(betaRootComment.comment.content).toBeDefined();
// the mention reply comment should have parent that points to the branch root level comment
expect(getCommentParentId(betaPostComments.comments[0].comment)).toBe(
betaPostComments.comments[1].comment.id,
);
expect(betaRootComment.community.local).toBe(true);
expect(betaRootComment.creator.local).toBe(false);
expect(betaRootComment.counts.score).toBe(1);
assertCommentFederation(betaRootComment, commentRes.comment_view);
let mentionsRes = await waitUntil(
() => getMentions(beta),
m => !!m.mentions[0],
);
expect(mentionsRes.mentions[0].comment.content).toBeDefined();
expect(mentionsRes.mentions[0].community.local).toBe(true);
expect(mentionsRes.mentions[0].creator.local).toBe(false);
expect(mentionsRes.mentions[0].counts.score).toBe(1);
// the reply comment with mention should be the most fresh, newest, index 0
expect(mentionsRes.mentions[0].person_mention.comment_id).toBe(
betaPostComments.comments[0].comment.id,
);
});
test("Comment Search", async () => {
let commentRes = await createComment(alpha, postOnAlphaRes.post_view.post.id);
let betaComment = (
await resolveComment(beta, commentRes.comment_view.comment)
).comment;
assertCommentFederation(betaComment, commentRes.comment_view);
});
test("A and G subscribe to B (center) A posts, G mentions B, it gets announced to A", async () => {
// Create a local post
let alphaCommunity = (await resolveCommunity(alpha, "!main@lemmy-alpha:8541"))
.community;
if (!alphaCommunity) {
throw "Missing alpha community";
}
// follow community from beta so that it accepts the mention
let betaCommunity = await resolveCommunity(
beta,
alphaCommunity.community.actor_id,
);
await followCommunity(beta, true, betaCommunity.community!.community.id);
let alphaPost = await createPost(alpha, alphaCommunity.community.id);
expect(alphaPost.post_view.community.local).toBe(true);
// Make sure gamma sees it
let gammaPost = (await resolvePost(gamma, alphaPost.post_view.post))!.post;
if (!gammaPost) {
throw "Missing gamma post";
}
let commentContent =
"A jest test federated comment announce, lets mention @lemmy_beta@lemmy-beta:8551";
let commentRes = await createComment(
gamma,
gammaPost.post.id,
undefined,
commentContent,
);
expect(commentRes.comment_view.comment.content).toBe(commentContent);
expect(commentRes.comment_view.community.local).toBe(false);
expect(commentRes.comment_view.creator.local).toBe(true);
expect(commentRes.comment_view.counts.score).toBe(1);
// Make sure alpha sees it
let alphaPostComments2 = await waitUntil(
() => getComments(alpha, alphaPost.post_view.post.id),
e => e.comments[0]?.counts.score === 1,
);
expect(alphaPostComments2.comments[0].comment.content).toBe(commentContent);
expect(alphaPostComments2.comments[0].community.local).toBe(true);
expect(alphaPostComments2.comments[0].creator.local).toBe(false);
expect(alphaPostComments2.comments[0].counts.score).toBe(1);
assertCommentFederation(
alphaPostComments2.comments[0],
commentRes.comment_view,
);
// Make sure beta has mentions
let relevantMention = await waitUntil(
() =>
getMentions(beta).then(m =>
m.mentions.find(
m => m.comment.ap_id === commentRes.comment_view.comment.ap_id,
),
),
e => !!e,
);
if (!relevantMention) throw Error("could not find mention");
expect(relevantMention.comment.content).toBe(commentContent);
expect(relevantMention.community.local).toBe(false);
expect(relevantMention.creator.local).toBe(false);
// TODO this is failing because fetchInReplyTos aren't getting score
// expect(mentionsRes.mentions[0].score).toBe(1);
});
test("Check that activity from another instance is sent to third instance", async () => {
// Alpha and gamma users follow beta community
let alphaFollow = await followBeta(alpha);
expect(alphaFollow.community_view.community.local).toBe(false);
expect(alphaFollow.community_view.community.name).toBe("main");
let gammaFollow = await followBeta(gamma);
expect(gammaFollow.community_view.community.local).toBe(false);
expect(gammaFollow.community_view.community.name).toBe("main");
await waitUntil(
() => resolveBetaCommunity(alpha),
c => c.community?.subscribed === "Subscribed",
);
await waitUntil(
() => resolveBetaCommunity(gamma),
c => c.community?.subscribed === "Subscribed",
);
// Create a post on beta
let betaPost = await createPost(beta, 2);
expect(betaPost.post_view.community.local).toBe(true);
// Make sure gamma and alpha see it
let gammaPost = await waitForPost(gamma, betaPost.post_view.post);
if (!gammaPost) {
throw "Missing gamma post";
}
expect(gammaPost.post).toBeDefined();
let alphaPost = await waitForPost(alpha, betaPost.post_view.post);
if (!alphaPost) {
throw "Missing alpha post";
}
expect(alphaPost.post).toBeDefined();
// The bug: gamma comments, and alpha should see it.
let commentContent = "Comment from gamma";
let commentRes = await createComment(
gamma,
gammaPost.post.id,
undefined,
commentContent,
);
expect(commentRes.comment_view.comment.content).toBe(commentContent);
expect(commentRes.comment_view.community.local).toBe(false);
expect(commentRes.comment_view.creator.local).toBe(true);
expect(commentRes.comment_view.counts.score).toBe(1);
// Make sure alpha sees it
let alphaPostComments2 = await waitUntil(
() => getComments(alpha, alphaPost!.post.id),
e => e.comments[0]?.counts.score === 1,
);
expect(alphaPostComments2.comments[0].comment.content).toBe(commentContent);
expect(alphaPostComments2.comments[0].community.local).toBe(false);
expect(alphaPostComments2.comments[0].creator.local).toBe(false);
expect(alphaPostComments2.comments[0].counts.score).toBe(1);
assertCommentFederation(
alphaPostComments2.comments[0],
commentRes.comment_view,
);
await Promise.all([unfollowRemotes(alpha), unfollowRemotes(gamma)]);
});
test("Fetch in_reply_tos: A is unsubbed from B, B makes a post, and some embedded comments, A subs to B, B updates the lowest level comment, A fetches both the post and all the inreplyto comments for that post.", async () => {
// Unfollow all remote communities
let site = await unfollowRemotes(alpha);
expect(
site.my_user?.follows.filter(c => c.community.local == false).length,
).toBe(0);
// B creates a post, and two comments, should be invisible to A
let postOnBetaRes = await createPost(beta, 2);
expect(postOnBetaRes.post_view.post.name).toBeDefined();
let parentCommentContent = "An invisible top level comment from beta";
let parentCommentRes = await createComment(
beta,
postOnBetaRes.post_view.post.id,
undefined,
parentCommentContent,
);
expect(parentCommentRes.comment_view.comment.content).toBe(
parentCommentContent,
);
// B creates a comment, then a child one of that.
let childCommentContent = "An invisible child comment from beta";
let childCommentRes = await createComment(
beta,
postOnBetaRes.post_view.post.id,
parentCommentRes.comment_view.comment.id,
childCommentContent,
);
expect(childCommentRes.comment_view.comment.content).toBe(
childCommentContent,
);
// Follow beta again
let follow = await followBeta(alpha);
expect(follow.community_view.community.local).toBe(false);
expect(follow.community_view.community.name).toBe("main");
// An update to the child comment on beta, should push the post, parent, and child to alpha now
let updatedCommentContent = "An update child comment from beta";
let updateRes = await editComment(
beta,
childCommentRes.comment_view.comment.id,
updatedCommentContent,
);
expect(updateRes.comment_view.comment.content).toBe(updatedCommentContent);
// Get the post from alpha
let alphaPostB = await waitForPost(alpha, postOnBetaRes.post_view.post);
if (!alphaPostB) {
throw "Missing alpha post B";
}
let alphaPost = await getPost(alpha, alphaPostB.post.id);
let alphaPostComments = await waitUntil(
() => getComments(alpha, alphaPostB!.post.id),
c =>
c.comments[1]?.comment.content ===
parentCommentRes.comment_view.comment.content &&
c.comments[0]?.comment.content === updateRes.comment_view.comment.content,
);
expect(alphaPost.post_view.post.name).toBeDefined();
assertCommentFederation(
alphaPostComments.comments[1],
parentCommentRes.comment_view,
);
assertCommentFederation(
alphaPostComments.comments[0],
updateRes.comment_view,
);
expect(alphaPost.post_view.community.local).toBe(false);
expect(alphaPost.post_view.creator.local).toBe(false);
await unfollowRemotes(alpha);
});
test("Report a comment", async () => {
let betaCommunity = (await resolveBetaCommunity(beta)).community;
if (!betaCommunity) {
throw "Missing beta community";
}
let postOnBetaRes = (await createPost(beta, betaCommunity.community.id))
.post_view.post;
expect(postOnBetaRes).toBeDefined();
let commentRes = (await createComment(beta, postOnBetaRes.id)).comment_view
.comment;
expect(commentRes).toBeDefined();
let alphaComment = (await resolveComment(alpha, commentRes)).comment?.comment;
if (!alphaComment) {
throw "Missing alpha comment";
}
const reason = randomString(10);
let alphaReport = (await reportComment(alpha, alphaComment.id, reason))
.comment_report_view.comment_report;
let betaReport = (await waitUntil(
() =>
listCommentReports(beta).then(r =>
r.comment_reports.find(rep => rep.comment_report.reason === reason),
),
e => !!e,
))!.comment_report;
expect(betaReport).toBeDefined();
expect(betaReport.resolved).toBe(false);
expect(betaReport.original_comment_text).toBe(
alphaReport.original_comment_text,
);
expect(betaReport.reason).toBe(alphaReport.reason);
});
test("Dont send a comment reply to a blocked community", async () => {
let newCommunity = await createCommunity(beta);
let newCommunityId = newCommunity.community_view.community.id;
// Create a post on beta
let betaPost = await createPost(beta, newCommunityId);
let alphaPost = (await resolvePost(alpha, betaPost.post_view.post))!.post;
if (!alphaPost) {
throw "unable to locate post on alpha";
}
// Check beta's inbox count
let unreadCount = await getUnreadCount(beta);
expect(unreadCount.replies).toBe(1);
// Beta blocks the new beta community
let blockRes = await blockCommunity(beta, newCommunityId, true);
expect(blockRes.blocked).toBe(true);
delay();
// Alpha creates a comment
let commentRes = await createComment(alpha, alphaPost.post.id);
expect(commentRes.comment_view.comment.content).toBeDefined();
let alphaComment = await resolveComment(
beta,
commentRes.comment_view.comment,
);
if (!alphaComment) {
throw "Missing alpha comment before block";
}
// Check beta's inbox count, make sure it stays the same
unreadCount = await getUnreadCount(beta);
expect(unreadCount.replies).toBe(1);
let replies = await getReplies(beta);
expect(replies.replies.length).toBe(1);
// Unblock the community
blockRes = await blockCommunity(beta, newCommunityId, false);
expect(blockRes.blocked).toBe(false);
});

View File

@ -0,0 +1,535 @@
jest.setTimeout(120000);
import { CommunityView } from "lemmy-js-client/dist/types/CommunityView";
import {
alpha,
beta,
gamma,
setupLogins,
resolveCommunity,
createCommunity,
deleteCommunity,
removeCommunity,
getCommunity,
followCommunity,
banPersonFromCommunity,
resolvePerson,
getSite,
createPost,
getPost,
resolvePost,
registerUser,
getPosts,
getComments,
createComment,
getCommunityByName,
blockInstance,
waitUntil,
alphaUrl,
delta,
betaAllowedInstances,
searchPostLocal,
longDelay,
editCommunity,
unfollows,
} from "./shared";
import { EditCommunity, EditSite } from "lemmy-js-client";
beforeAll(setupLogins);
afterAll(unfollows);
function assertCommunityFederation(
communityOne?: CommunityView,
communityTwo?: CommunityView,
) {
expect(communityOne?.community.actor_id).toBe(
communityTwo?.community.actor_id,
);
expect(communityOne?.community.name).toBe(communityTwo?.community.name);
expect(communityOne?.community.title).toBe(communityTwo?.community.title);
expect(communityOne?.community.description).toBe(
communityTwo?.community.description,
);
expect(communityOne?.community.icon).toBe(communityTwo?.community.icon);
expect(communityOne?.community.banner).toBe(communityTwo?.community.banner);
expect(communityOne?.community.published).toBe(
communityTwo?.community.published,
);
expect(communityOne?.community.nsfw).toBe(communityTwo?.community.nsfw);
expect(communityOne?.community.removed).toBe(communityTwo?.community.removed);
expect(communityOne?.community.deleted).toBe(communityTwo?.community.deleted);
}
test("Create community", async () => {
let communityRes = await createCommunity(alpha);
expect(communityRes.community_view.community.name).toBeDefined();
// A dupe check
let prevName = communityRes.community_view.community.name;
await expect(createCommunity(alpha, prevName)).rejects.toStrictEqual(
Error("community_already_exists"),
);
// Cache the community on beta, make sure it has the other fields
let searchShort = `!${prevName}@lemmy-alpha:8541`;
let betaCommunity = (await resolveCommunity(beta, searchShort)).community;
assertCommunityFederation(betaCommunity, communityRes.community_view);
});
test("Delete community", async () => {
let communityRes = await createCommunity(beta);
// Cache the community on Alpha
let searchShort = `!${communityRes.community_view.community.name}@lemmy-beta:8551`;
let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community;
if (!alphaCommunity) {
throw "Missing alpha community";
}
assertCommunityFederation(alphaCommunity, communityRes.community_view);
// Follow the community from alpha
let follow = await followCommunity(alpha, true, alphaCommunity.community.id);
// Make sure the follow response went through
expect(follow.community_view.community.local).toBe(false);
let deleteCommunityRes = await deleteCommunity(
beta,
true,
communityRes.community_view.community.id,
);
expect(deleteCommunityRes.community_view.community.deleted).toBe(true);
expect(deleteCommunityRes.community_view.community.title).toBe(
communityRes.community_view.community.title,
);
// Make sure it got deleted on A
let communityOnAlphaDeleted = await waitUntil(
() => getCommunity(alpha, alphaCommunity!.community.id),
g => g.community_view.community.deleted,
);
expect(communityOnAlphaDeleted.community_view.community.deleted).toBe(true);
// Undelete
let undeleteCommunityRes = await deleteCommunity(
beta,
false,
communityRes.community_view.community.id,
);
expect(undeleteCommunityRes.community_view.community.deleted).toBe(false);
// Make sure it got undeleted on A
let communityOnAlphaUnDeleted = await waitUntil(
() => getCommunity(alpha, alphaCommunity!.community.id),
g => !g.community_view.community.deleted,
);
expect(communityOnAlphaUnDeleted.community_view.community.deleted).toBe(
false,
);
});
test("Remove community", async () => {
let communityRes = await createCommunity(beta);
// Cache the community on Alpha
let searchShort = `!${communityRes.community_view.community.name}@lemmy-beta:8551`;
let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community;
if (!alphaCommunity) {
throw "Missing alpha community";
}
assertCommunityFederation(alphaCommunity, communityRes.community_view);
// Follow the community from alpha
let follow = await followCommunity(alpha, true, alphaCommunity.community.id);
// Make sure the follow response went through
expect(follow.community_view.community.local).toBe(false);
let removeCommunityRes = await removeCommunity(
beta,
true,
communityRes.community_view.community.id,
);
expect(removeCommunityRes.community_view.community.removed).toBe(true);
expect(removeCommunityRes.community_view.community.title).toBe(
communityRes.community_view.community.title,
);
// Make sure it got Removed on A
let communityOnAlphaRemoved = await waitUntil(
() => getCommunity(alpha, alphaCommunity!.community.id),
g => g.community_view.community.removed,
);
expect(communityOnAlphaRemoved.community_view.community.removed).toBe(true);
// unremove
let unremoveCommunityRes = await removeCommunity(
beta,
false,
communityRes.community_view.community.id,
);
expect(unremoveCommunityRes.community_view.community.removed).toBe(false);
// Make sure it got undeleted on A
let communityOnAlphaUnRemoved = await waitUntil(
() => getCommunity(alpha, alphaCommunity!.community.id),
g => !g.community_view.community.removed,
);
expect(communityOnAlphaUnRemoved.community_view.community.removed).toBe(
false,
);
});
test("Search for beta community", async () => {
let communityRes = await createCommunity(beta);
expect(communityRes.community_view.community.name).toBeDefined();
let searchShort = `!${communityRes.community_view.community.name}@lemmy-beta:8551`;
let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community;
assertCommunityFederation(alphaCommunity, communityRes.community_view);
});
test("Admin actions in remote community are not federated to origin", async () => {
// create a community on alpha
let communityRes = (await createCommunity(alpha)).community_view;
expect(communityRes.community.name).toBeDefined();
// gamma follows community and posts in it
let gammaCommunity = (
await resolveCommunity(gamma, communityRes.community.actor_id)
).community;
if (!gammaCommunity) {
throw "Missing gamma community";
}
await followCommunity(gamma, true, gammaCommunity.community.id);
gammaCommunity = (
await waitUntil(
() => resolveCommunity(gamma, communityRes.community.actor_id),
g => g.community?.subscribed === "Subscribed",
)
).community;
if (!gammaCommunity) {
throw "Missing gamma community";
}
expect(gammaCommunity.subscribed).toBe("Subscribed");
let gammaPost = (await createPost(gamma, gammaCommunity.community.id))
.post_view;
expect(gammaPost.post.id).toBeDefined();
expect(gammaPost.creator_banned_from_community).toBe(false);
// admin of beta decides to ban gamma from community
let betaCommunity = (
await resolveCommunity(beta, communityRes.community.actor_id)
).community;
if (!betaCommunity) {
throw "Missing beta community";
}
let bannedUserInfo1 = (await getSite(gamma)).my_user?.local_user_view.person;
if (!bannedUserInfo1) {
throw "Missing banned user 1";
}
let bannedUserInfo2 = (await resolvePerson(beta, bannedUserInfo1.actor_id))
.person;
if (!bannedUserInfo2) {
throw "Missing banned user 2";
}
let banRes = await banPersonFromCommunity(
beta,
bannedUserInfo2.person.id,
betaCommunity.community.id,
true,
true,
);
expect(banRes.banned).toBe(true);
// ban doesn't federate to community's origin instance alpha
let alphaPost = (await resolvePost(alpha, gammaPost.post)).post;
expect(alphaPost?.creator_banned_from_community).toBe(false);
// and neither to gamma
let gammaPost2 = await getPost(gamma, gammaPost.post.id);
expect(gammaPost2.post_view.creator_banned_from_community).toBe(false);
});
test("moderator view", async () => {
// register a new user with their own community on alpha and post to it
let otherUser = await registerUser(alpha, alphaUrl);
let otherCommunity = (await createCommunity(otherUser)).community_view;
expect(otherCommunity.community.name).toBeDefined();
let otherPost = (await createPost(otherUser, otherCommunity.community.id))
.post_view;
expect(otherPost.post.id).toBeDefined();
let otherComment = (await createComment(otherUser, otherPost.post.id))
.comment_view;
expect(otherComment.comment.id).toBeDefined();
// create a community and post on alpha
let alphaCommunity = (await createCommunity(alpha)).community_view;
expect(alphaCommunity.community.name).toBeDefined();
let alphaPost = (await createPost(alpha, alphaCommunity.community.id))
.post_view;
expect(alphaPost.post.id).toBeDefined();
let alphaComment = (await createComment(otherUser, alphaPost.post.id))
.comment_view;
expect(alphaComment.comment.id).toBeDefined();
// other user also posts on alpha's community
let otherAlphaPost = (
await createPost(otherUser, alphaCommunity.community.id)
).post_view;
expect(otherAlphaPost.post.id).toBeDefined();
let otherAlphaComment = (
await createComment(otherUser, otherAlphaPost.post.id)
).comment_view;
expect(otherAlphaComment.comment.id).toBeDefined();
// alpha lists posts and comments on home page, should contain all posts that were made
let posts = (await getPosts(alpha, "All")).posts;
expect(posts).toBeDefined();
let postIds = posts.map(post => post.post.id);
let comments = (await getComments(alpha, undefined, "All")).comments;
expect(comments).toBeDefined();
let commentIds = comments.map(comment => comment.comment.id);
expect(postIds).toContain(otherPost.post.id);
expect(commentIds).toContain(otherComment.comment.id);
expect(postIds).toContain(alphaPost.post.id);
expect(commentIds).toContain(alphaComment.comment.id);
expect(postIds).toContain(otherAlphaPost.post.id);
expect(commentIds).toContain(otherAlphaComment.comment.id);
// in moderator view, alpha should not see otherPost, wich was posted on a community alpha doesn't moderate
posts = (await getPosts(alpha, "ModeratorView")).posts;
expect(posts).toBeDefined();
postIds = posts.map(post => post.post.id);
comments = (await getComments(alpha, undefined, "ModeratorView")).comments;
expect(comments).toBeDefined();
commentIds = comments.map(comment => comment.comment.id);
expect(postIds).not.toContain(otherPost.post.id);
expect(commentIds).not.toContain(otherComment.comment.id);
expect(postIds).toContain(alphaPost.post.id);
expect(commentIds).toContain(alphaComment.comment.id);
expect(postIds).toContain(otherAlphaPost.post.id);
expect(commentIds).toContain(otherAlphaComment.comment.id);
});
test("Get community for different casing on domain", async () => {
let communityRes = await createCommunity(alpha);
expect(communityRes.community_view.community.name).toBeDefined();
// A dupe check
let prevName = communityRes.community_view.community.name;
await expect(createCommunity(alpha, prevName)).rejects.toStrictEqual(
Error("community_already_exists"),
);
// Cache the community on beta, make sure it has the other fields
let communityName = `${communityRes.community_view.community.name}@LEMMY-ALPHA:8541`;
let betaCommunity = (await getCommunityByName(beta, communityName))
.community_view;
assertCommunityFederation(betaCommunity, communityRes.community_view);
});
test("User blocks instance, communities are hidden", async () => {
// create community and post on beta
let communityRes = await createCommunity(beta);
expect(communityRes.community_view.community.name).toBeDefined();
let postRes = await createPost(
beta,
communityRes.community_view.community.id,
);
expect(postRes.post_view.post.id).toBeDefined();
// fetch post to alpha
let alphaPost = (await resolvePost(alpha, postRes.post_view.post)).post!;
expect(alphaPost.post).toBeDefined();
// post should be included in listing
let listing = await getPosts(alpha, "All");
let listing_ids = listing.posts.map(p => p.post.ap_id);
expect(listing_ids).toContain(postRes.post_view.post.ap_id);
// block the beta instance
await blockInstance(alpha, alphaPost.community.instance_id, true);
// after blocking, post should not be in listing
let listing2 = await getPosts(alpha, "All");
let listing_ids2 = listing2.posts.map(p => p.post.ap_id);
expect(listing_ids2.indexOf(postRes.post_view.post.ap_id)).toBe(-1);
// unblock instance again
await blockInstance(alpha, alphaPost.community.instance_id, false);
// post should be included in listing
let listing3 = await getPosts(alpha, "All");
let listing_ids3 = listing3.posts.map(p => p.post.ap_id);
expect(listing_ids3).toContain(postRes.post_view.post.ap_id);
});
test("Community follower count is federated", async () => {
// Follow the beta community from alpha
let community = await createCommunity(beta);
let communityActorId = community.community_view.community.actor_id;
let resolved = await resolveCommunity(alpha, communityActorId);
if (!resolved.community) {
throw "Missing beta community";
}
await followCommunity(alpha, true, resolved.community.community.id);
let followed = (
await waitUntil(
() => resolveCommunity(alpha, communityActorId),
c => c.community?.subscribed === "Subscribed",
)
).community;
// Make sure there is 1 subscriber
expect(followed?.counts.subscribers).toBe(1);
// Follow the community from gamma
resolved = await resolveCommunity(gamma, communityActorId);
if (!resolved.community) {
throw "Missing beta community";
}
await followCommunity(gamma, true, resolved.community.community.id);
followed = (
await waitUntil(
() => resolveCommunity(gamma, communityActorId),
c => c.community?.subscribed === "Subscribed",
)
).community;
// Make sure there are 2 subscribers
expect(followed?.counts?.subscribers).toBe(2);
// Follow the community from delta
resolved = await resolveCommunity(delta, communityActorId);
if (!resolved.community) {
throw "Missing beta community";
}
await followCommunity(delta, true, resolved.community.community.id);
followed = (
await waitUntil(
() => resolveCommunity(delta, communityActorId),
c => c.community?.subscribed === "Subscribed",
)
).community;
// Make sure there are 3 subscribers
expect(followed?.counts?.subscribers).toBe(3);
});
test("Dont receive community activities after unsubscribe", async () => {
let communityRes = await createCommunity(alpha);
expect(communityRes.community_view.community.name).toBeDefined();
expect(communityRes.community_view.counts.subscribers).toBe(1);
let betaCommunity = (
await resolveCommunity(beta, communityRes.community_view.community.actor_id)
).community;
assertCommunityFederation(betaCommunity, communityRes.community_view);
// follow alpha community from beta
await followCommunity(beta, true, betaCommunity!.community.id);
// ensure that follower count was updated
let communityRes1 = await getCommunity(
alpha,
communityRes.community_view.community.id,
);
expect(communityRes1.community_view.counts.subscribers).toBe(2);
// temporarily block alpha, so that it doesn't know about unfollow
let editSiteForm: EditSite = {};
editSiteForm.allowed_instances = ["lemmy-epsilon"];
await beta.editSite(editSiteForm);
await longDelay();
// unfollow
await followCommunity(beta, false, betaCommunity!.community.id);
// ensure that alpha still sees beta as follower
let communityRes2 = await getCommunity(
alpha,
communityRes.community_view.community.id,
);
expect(communityRes2.community_view.counts.subscribers).toBe(2);
// unblock alpha
editSiteForm.allowed_instances = betaAllowedInstances;
await beta.editSite(editSiteForm);
await longDelay();
// create a post, it shouldnt reach beta
let postRes = await createPost(
alpha,
communityRes.community_view.community.id,
);
expect(postRes.post_view.post.id).toBeDefined();
// await longDelay();
let postResBeta = searchPostLocal(beta, postRes.post_view.post);
expect((await postResBeta).posts.length).toBe(0);
});
test("Fetch community, includes posts", async () => {
let communityRes = await createCommunity(alpha);
expect(communityRes.community_view.community.name).toBeDefined();
expect(communityRes.community_view.counts.subscribers).toBe(1);
let postRes = await createPost(
alpha,
communityRes.community_view.community.id,
);
expect(postRes.post_view.post).toBeDefined();
let resolvedCommunity = await waitUntil(
() =>
resolveCommunity(beta, communityRes.community_view.community.actor_id),
c => c.community?.community.id != undefined,
);
let betaCommunity = resolvedCommunity.community;
expect(betaCommunity?.community.actor_id).toBe(
communityRes.community_view.community.actor_id,
);
await longDelay();
let post_listing = await getPosts(beta, "All", betaCommunity?.community.id);
expect(post_listing.posts.length).toBe(1);
expect(post_listing.posts[0].post.ap_id).toBe(postRes.post_view.post.ap_id);
});
test("Content in local-only community doesn't federate", async () => {
// create a community and set it local-only
let communityRes = (await createCommunity(alpha)).community_view.community;
let form: EditCommunity = {
community_id: communityRes.id,
visibility: "LocalOnly",
};
await editCommunity(alpha, form);
// cant resolve the community from another instance
await expect(
resolveCommunity(beta, communityRes.actor_id),
).rejects.toStrictEqual(Error("couldnt_find_object"));
// create a post, also cant resolve it
let postRes = await createPost(alpha, communityRes.id);
await expect(resolvePost(beta, postRes.post_view.post)).rejects.toStrictEqual(
Error("couldnt_find_object"),
);
});

View File

@ -0,0 +1,98 @@
jest.setTimeout(120000);
import {
alpha,
setupLogins,
resolveBetaCommunity,
followCommunity,
getSite,
waitUntil,
beta,
betaUrl,
registerUser,
unfollows,
} from "./shared";
beforeAll(setupLogins);
afterAll(unfollows);
test("Follow local community", async () => {
let user = await registerUser(beta, betaUrl);
let community = (await resolveBetaCommunity(user)).community!;
expect(community.counts.subscribers).toBe(1);
expect(community.counts.subscribers_local).toBe(1);
let follow = await followCommunity(user, true, community.community.id);
// Make sure the follow response went through
expect(follow.community_view.community.local).toBe(true);
expect(follow.community_view.subscribed).toBe("Subscribed");
expect(follow.community_view.counts.subscribers).toBe(2);
expect(follow.community_view.counts.subscribers_local).toBe(2);
// Test an unfollow
let unfollow = await followCommunity(user, false, community.community.id);
expect(unfollow.community_view.subscribed).toBe("NotSubscribed");
expect(unfollow.community_view.counts.subscribers).toBe(1);
expect(unfollow.community_view.counts.subscribers_local).toBe(1);
});
test("Follow federated community", async () => {
// It takes about 1 second for the community aggregates to federate
let betaCommunity = (
await waitUntil(
() => resolveBetaCommunity(alpha),
c =>
c.community?.counts.subscribers === 1 &&
c.community.counts.subscribers_local === 0,
)
).community;
if (!betaCommunity) {
throw "Missing beta community";
}
let follow = await followCommunity(alpha, true, betaCommunity.community.id);
expect(follow.community_view.subscribed).toBe("Pending");
betaCommunity = (
await waitUntil(
() => resolveBetaCommunity(alpha),
c => c.community?.subscribed === "Subscribed",
)
).community;
// Make sure the follow response went through
expect(betaCommunity?.community.local).toBe(false);
expect(betaCommunity?.community.name).toBe("main");
expect(betaCommunity?.subscribed).toBe("Subscribed");
expect(betaCommunity?.counts.subscribers_local).toBe(1);
// check that unfollow was federated
let communityOnBeta1 = await resolveBetaCommunity(beta);
expect(communityOnBeta1.community?.counts.subscribers).toBe(2);
expect(communityOnBeta1.community?.counts.subscribers_local).toBe(1);
// Check it from local
let site = await getSite(alpha);
let remoteCommunityId = site.my_user?.follows.find(
c => c.community.local == false,
)?.community.id;
expect(remoteCommunityId).toBeDefined();
expect(site.my_user?.follows.length).toBe(2);
if (!remoteCommunityId) {
throw "Missing remote community id";
}
// Test an unfollow
let unfollow = await followCommunity(alpha, false, remoteCommunityId);
expect(unfollow.community_view.subscribed).toBe("NotSubscribed");
// Make sure you are unsubbed locally
let siteUnfollowCheck = await getSite(alpha);
expect(siteUnfollowCheck.my_user?.follows.length).toBe(1);
// check that unfollow was federated
let communityOnBeta2 = await resolveBetaCommunity(beta);
expect(communityOnBeta2.community?.counts.subscribers).toBe(1);
expect(communityOnBeta2.community?.counts.subscribers_local).toBe(1);
});

363
api_tests/src/image.spec.ts Normal file
View File

@ -0,0 +1,363 @@
jest.setTimeout(120000);
import {
UploadImage,
DeleteImage,
PurgePerson,
PurgePost,
} from "lemmy-js-client";
import {
alpha,
alphaImage,
alphaUrl,
beta,
betaUrl,
createCommunity,
createPost,
deleteAllImages,
epsilon,
followCommunity,
gamma,
getSite,
imageFetchLimit,
registerUser,
resolveBetaCommunity,
resolveCommunity,
resolvePost,
setupLogins,
waitForPost,
unfollows,
getPost,
waitUntil,
createPostWithThumbnail,
sampleImage,
sampleSite,
} from "./shared";
const downloadFileSync = require("download-file-sync");
beforeAll(setupLogins);
afterAll(async () => {
await Promise.all([unfollows(), deleteAllImages(alpha)]);
});
test("Upload image and delete it", async () => {
// Before running this test, you need to delete all previous images in the DB
await deleteAllImages(alpha);
// Upload test image. We use a simple string buffer as pictrs doesn't require an actual image
// in testing mode.
const upload_form: UploadImage = {
image: Buffer.from("test"),
};
const upload = await alphaImage.uploadImage(upload_form);
expect(upload.files![0].file).toBeDefined();
expect(upload.files![0].delete_token).toBeDefined();
expect(upload.url).toBeDefined();
expect(upload.delete_url).toBeDefined();
// ensure that image download is working. theres probably a better way to do this
const content = downloadFileSync(upload.url);
expect(content.length).toBeGreaterThan(0);
// Ensure that it comes back with the list_media endpoint
const listMediaRes = await alphaImage.listMedia();
expect(listMediaRes.images.length).toBe(1);
// Ensure that it also comes back with the admin all images
const listAllMediaRes = await alphaImage.listAllMedia({
limit: imageFetchLimit,
});
// This number comes from all the previous thumbnails fetched in other tests.
const previousThumbnails = 1;
expect(listAllMediaRes.images.length).toBe(previousThumbnails);
// The deleteUrl is a combination of the endpoint, delete token, and alias
let firstImage = listMediaRes.images[0];
let deleteUrl = `${alphaUrl}/pictrs/image/delete/${firstImage.local_image.pictrs_delete_token}/${firstImage.local_image.pictrs_alias}`;
expect(deleteUrl).toBe(upload.delete_url);
// Make sure the uploader is correct
expect(firstImage.person.actor_id).toBe(
`http://lemmy-alpha:8541/u/lemmy_alpha`,
);
// delete image
const delete_form: DeleteImage = {
token: upload.files![0].delete_token,
filename: upload.files![0].file,
};
const delete_ = await alphaImage.deleteImage(delete_form);
expect(delete_).toBe(true);
// ensure that image is deleted
const content2 = downloadFileSync(upload.url);
expect(content2).toBe("");
// Ensure that it shows the image is deleted
const deletedListMediaRes = await alphaImage.listMedia();
expect(deletedListMediaRes.images.length).toBe(0);
// Ensure that the admin shows its deleted
const deletedListAllMediaRes = await alphaImage.listAllMedia({
limit: imageFetchLimit,
});
expect(deletedListAllMediaRes.images.length).toBe(previousThumbnails - 1);
});
test("Purge user, uploaded image removed", async () => {
let user = await registerUser(alphaImage, alphaUrl);
// upload test image
const upload_form: UploadImage = {
image: Buffer.from("test"),
};
const upload = await user.uploadImage(upload_form);
expect(upload.files![0].file).toBeDefined();
expect(upload.files![0].delete_token).toBeDefined();
expect(upload.url).toBeDefined();
expect(upload.delete_url).toBeDefined();
// ensure that image download is working. theres probably a better way to do this
const content = downloadFileSync(upload.url);
expect(content.length).toBeGreaterThan(0);
// purge user
let site = await getSite(user);
const purgeForm: PurgePerson = {
person_id: site.my_user!.local_user_view.person.id,
};
const delete_ = await alphaImage.purgePerson(purgeForm);
expect(delete_.success).toBe(true);
// ensure that image is deleted
const content2 = downloadFileSync(upload.url);
expect(content2).toBe("");
});
test("Purge post, linked image removed", async () => {
let user = await registerUser(beta, betaUrl);
// upload test image
const upload_form: UploadImage = {
image: Buffer.from("test"),
};
const upload = await user.uploadImage(upload_form);
expect(upload.files![0].file).toBeDefined();
expect(upload.files![0].delete_token).toBeDefined();
expect(upload.url).toBeDefined();
expect(upload.delete_url).toBeDefined();
// ensure that image download is working. theres probably a better way to do this
const content = downloadFileSync(upload.url);
expect(content.length).toBeGreaterThan(0);
let community = await resolveBetaCommunity(user);
let post = await createPost(
user,
community.community!.community.id,
upload.url,
);
expect(post.post_view.post.url).toBe(upload.url);
// purge post
const purgeForm: PurgePost = {
post_id: post.post_view.post.id,
};
const delete_ = await beta.purgePost(purgeForm);
expect(delete_.success).toBe(true);
// ensure that image is deleted
const content2 = downloadFileSync(upload.url);
expect(content2).toBe("");
});
test("Images in remote image post are proxied if setting enabled", async () => {
let community = await createCommunity(gamma);
let postRes = await createPost(
gamma,
community.community_view.community.id,
sampleImage,
`![](${sampleImage})`,
);
const post = postRes.post_view.post;
expect(post).toBeDefined();
// remote image gets proxied after upload
expect(
post.thumbnail_url?.startsWith(
"http://lemmy-gamma:8561/api/v3/image_proxy?url",
),
).toBeTruthy();
expect(
post.body?.startsWith("![](http://lemmy-gamma:8561/api/v3/image_proxy?url"),
).toBeTruthy();
// Make sure that it ends with jpg, to be sure its an image
expect(post.thumbnail_url?.endsWith(".jpg")).toBeTruthy();
let epsilonPostRes = await resolvePost(epsilon, postRes.post_view.post);
expect(epsilonPostRes.post).toBeDefined();
// Fetch the post again, the metadata should be backgrounded now
// Wait for the metadata to get fetched, since this is backgrounded now
let epsilonPostRes2 = await waitUntil(
() => getPost(epsilon, epsilonPostRes.post!.post.id),
p => p.post_view.post.thumbnail_url != undefined,
);
const epsilonPost = epsilonPostRes2.post_view.post;
expect(
epsilonPost.thumbnail_url?.startsWith(
"http://lemmy-epsilon:8581/api/v3/image_proxy?url",
),
).toBeTruthy();
expect(
epsilonPost.body?.startsWith(
"![](http://lemmy-epsilon:8581/api/v3/image_proxy?url",
),
).toBeTruthy();
// Make sure that it ends with jpg, to be sure its an image
expect(epsilonPost.thumbnail_url?.endsWith(".jpg")).toBeTruthy();
});
test("Thumbnail of remote image link is proxied if setting enabled", async () => {
let community = await createCommunity(gamma);
let postRes = await createPost(
gamma,
community.community_view.community.id,
// The sample site metadata thumbnail ends in png
sampleSite,
);
const post = postRes.post_view.post;
expect(post).toBeDefined();
// remote image gets proxied after upload
expect(
post.thumbnail_url?.startsWith(
"http://lemmy-gamma:8561/api/v3/image_proxy?url",
),
).toBeTruthy();
// Make sure that it ends with png, to be sure its an image
expect(post.thumbnail_url?.endsWith(".png")).toBeTruthy();
let epsilonPostRes = await resolvePost(epsilon, postRes.post_view.post);
expect(epsilonPostRes.post).toBeDefined();
let epsilonPostRes2 = await waitUntil(
() => getPost(epsilon, epsilonPostRes.post!.post.id),
p => p.post_view.post.thumbnail_url != undefined,
);
const epsilonPost = epsilonPostRes2.post_view.post;
expect(
epsilonPost.thumbnail_url?.startsWith(
"http://lemmy-epsilon:8581/api/v3/image_proxy?url",
),
).toBeTruthy();
// Make sure that it ends with png, to be sure its an image
expect(epsilonPost.thumbnail_url?.endsWith(".png")).toBeTruthy();
});
test("No image proxying if setting is disabled", async () => {
let user = await registerUser(beta, betaUrl);
let community = await createCommunity(alpha);
let betaCommunity = await resolveCommunity(
beta,
community.community_view.community.actor_id,
);
await followCommunity(beta, true, betaCommunity.community!.community.id);
const upload_form: UploadImage = {
image: Buffer.from("test"),
};
const upload = await user.uploadImage(upload_form);
let post = await createPost(
alpha,
community.community_view.community.id,
upload.url,
`![](${sampleImage})`,
);
expect(post.post_view.post).toBeDefined();
// remote image doesn't get proxied after upload
expect(
post.post_view.post.url?.startsWith("http://127.0.0.1:8551/pictrs/image/"),
).toBeTruthy();
expect(post.post_view.post.body).toBe(`![](${sampleImage})`);
let betaPost = await waitForPost(
beta,
post.post_view.post,
res => res?.post.alt_text != null,
);
expect(betaPost.post).toBeDefined();
// remote image doesn't get proxied after federation
expect(
betaPost.post.url?.startsWith("http://127.0.0.1:8551/pictrs/image/"),
).toBeTruthy();
expect(betaPost.post.body).toBe(`![](${sampleImage})`);
// Make sure the alt text got federated
expect(post.post_view.post.alt_text).toBe(betaPost.post.alt_text);
});
test("Make regular post, and give it a custom thumbnail", async () => {
const uploadForm1: UploadImage = {
image: Buffer.from("testRegular1"),
};
const upload1 = await alphaImage.uploadImage(uploadForm1);
const community = await createCommunity(alphaImage);
// Use wikipedia since it has an opengraph image
const wikipediaUrl = "https://wikipedia.org/";
let post = await createPostWithThumbnail(
alphaImage,
community.community_view.community.id,
wikipediaUrl,
upload1.url!,
);
// Wait for the metadata to get fetched, since this is backgrounded now
post = await waitUntil(
() => getPost(alphaImage, post.post_view.post.id),
p => p.post_view.post.thumbnail_url != undefined,
);
expect(post.post_view.post.url).toBe(wikipediaUrl);
// Make sure it uses custom thumbnail
expect(post.post_view.post.thumbnail_url).toBe(upload1.url);
});
test("Create an image post, and make sure a custom thumbnail doesn't overwrite it", async () => {
const uploadForm1: UploadImage = {
image: Buffer.from("test1"),
};
const upload1 = await alphaImage.uploadImage(uploadForm1);
const uploadForm2: UploadImage = {
image: Buffer.from("test2"),
};
const upload2 = await alphaImage.uploadImage(uploadForm2);
const community = await createCommunity(alphaImage);
let post = await createPostWithThumbnail(
alphaImage,
community.community_view.community.id,
upload1.url!,
upload2.url!,
);
post = await waitUntil(
() => getPost(alphaImage, post.post_view.post.id),
p => p.post_view.post.thumbnail_url != undefined,
);
expect(post.post_view.post.url).toBe(upload1.url);
// Make sure the custom thumbnail is ignored
expect(post.post_view.post.thumbnail_url == upload2.url).toBe(false);
});

781
api_tests/src/post.spec.ts Normal file
View File

@ -0,0 +1,781 @@
jest.setTimeout(120000);
import { CommunityView } from "lemmy-js-client/dist/types/CommunityView";
import {
alpha,
beta,
gamma,
delta,
epsilon,
setupLogins,
createPost,
editPost,
featurePost,
lockPost,
resolvePost,
likePost,
followBeta,
resolveBetaCommunity,
createComment,
deletePost,
delay,
removePost,
getPost,
unfollowRemotes,
resolvePerson,
banPersonFromSite,
followCommunity,
banPersonFromCommunity,
reportPost,
listPostReports,
randomString,
registerUser,
getSite,
unfollows,
resolveCommunity,
waitUntil,
waitForPost,
alphaUrl,
loginUser,
createCommunity,
} from "./shared";
import { PostView } from "lemmy-js-client/dist/types/PostView";
import { EditSite, ResolveObject } from "lemmy-js-client";
let betaCommunity: CommunityView | undefined;
beforeAll(async () => {
await setupLogins();
betaCommunity = (await resolveBetaCommunity(alpha)).community;
expect(betaCommunity).toBeDefined();
});
afterAll(unfollows);
async function assertPostFederation(postOne: PostView, postTwo: PostView) {
// Link metadata is generated in background task and may not be ready yet at this time,
// so wait for it explicitly. For removed posts we cant refetch anything.
postOne = await waitForPost(beta, postOne.post, res => {
return res === null || res?.post.embed_title !== null;
});
postTwo = await waitForPost(
beta,
postTwo.post,
res => res === null || res?.post.embed_title !== null,
);
expect(postOne?.post.ap_id).toBe(postTwo?.post.ap_id);
expect(postOne?.post.name).toBe(postTwo?.post.name);
expect(postOne?.post.body).toBe(postTwo?.post.body);
// TODO url clears arent working
// expect(postOne?.post.url).toBe(postTwo?.post.url);
expect(postOne?.post.nsfw).toBe(postTwo?.post.nsfw);
expect(postOne?.post.embed_title).toBe(postTwo?.post.embed_title);
expect(postOne?.post.embed_description).toBe(postTwo?.post.embed_description);
expect(postOne?.post.embed_video_url).toBe(postTwo?.post.embed_video_url);
expect(postOne?.post.published).toBe(postTwo?.post.published);
expect(postOne?.community.actor_id).toBe(postTwo?.community.actor_id);
expect(postOne?.post.locked).toBe(postTwo?.post.locked);
expect(postOne?.post.removed).toBe(postTwo?.post.removed);
expect(postOne?.post.deleted).toBe(postTwo?.post.deleted);
}
test("Create a post", async () => {
// Setup some allowlists and blocklists
const editSiteForm: EditSite = {};
editSiteForm.allowed_instances = [];
editSiteForm.blocked_instances = ["lemmy-alpha"];
await epsilon.editSite(editSiteForm);
if (!betaCommunity) {
throw "Missing beta community";
}
let postRes = await createPost(
alpha,
betaCommunity.community.id,
"https://example.com/",
"აშშ ითხოვს ირანს დაუყოვნებლივ გაანთავისუფლოს დაკავებული ნავთობის ტანკერი",
);
expect(postRes.post_view.post).toBeDefined();
expect(postRes.post_view.community.local).toBe(false);
expect(postRes.post_view.creator.local).toBe(true);
expect(postRes.post_view.counts.score).toBe(1);
// Make sure that post is liked on beta
const betaPost = await waitForPost(
beta,
postRes.post_view.post,
res => res?.counts.score === 1,
);
expect(betaPost).toBeDefined();
expect(betaPost?.community.local).toBe(true);
expect(betaPost?.creator.local).toBe(false);
expect(betaPost?.counts.score).toBe(1);
await assertPostFederation(betaPost, postRes.post_view);
// Delta only follows beta, so it should not see an alpha ap_id
await expect(
resolvePost(delta, postRes.post_view.post),
).rejects.toStrictEqual(Error("couldnt_find_object"));
// Epsilon has alpha blocked, it should not see the alpha post
await expect(
resolvePost(epsilon, postRes.post_view.post),
).rejects.toStrictEqual(Error("couldnt_find_object"));
// remove added allow/blocklists
editSiteForm.allowed_instances = [];
editSiteForm.blocked_instances = [];
await delta.editSite(editSiteForm);
await epsilon.editSite(editSiteForm);
});
test("Create a post in a non-existent community", async () => {
await expect(createPost(alpha, -2)).rejects.toStrictEqual(
Error("couldnt_find_community"),
);
});
test("Unlike a post", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
let postRes = await createPost(alpha, betaCommunity.community.id);
let unlike = await likePost(alpha, 0, postRes.post_view.post);
expect(unlike.post_view.counts.score).toBe(0);
// Try to unlike it again, make sure it stays at 0
let unlike2 = await likePost(alpha, 0, postRes.post_view.post);
expect(unlike2.post_view.counts.score).toBe(0);
// Make sure that post is unliked on beta
const betaPost = await waitForPost(
beta,
postRes.post_view.post,
post => post?.counts.score === 0,
);
expect(betaPost).toBeDefined();
expect(betaPost?.community.local).toBe(true);
expect(betaPost?.creator.local).toBe(false);
expect(betaPost?.counts.score).toBe(0);
await assertPostFederation(betaPost, postRes.post_view);
});
test("Update a post", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
let postRes = await createPost(alpha, betaCommunity.community.id);
await waitForPost(beta, postRes.post_view.post);
let updatedName = "A jest test federated post, updated";
let updatedPost = await editPost(alpha, postRes.post_view.post);
expect(updatedPost.post_view.post.name).toBe(updatedName);
expect(updatedPost.post_view.community.local).toBe(false);
expect(updatedPost.post_view.creator.local).toBe(true);
// Make sure that post is updated on beta
let betaPost = await waitForPost(beta, updatedPost.post_view.post);
expect(betaPost.community.local).toBe(true);
expect(betaPost.creator.local).toBe(false);
expect(betaPost.post.name).toBe(updatedName);
await assertPostFederation(betaPost, updatedPost.post_view);
// Make sure lemmy beta cannot update the post
await expect(editPost(beta, betaPost.post)).rejects.toStrictEqual(
Error("no_post_edit_allowed"),
);
});
test("Sticky a post", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
let postRes = await createPost(alpha, betaCommunity.community.id);
let betaPost1 = await waitForPost(beta, postRes.post_view.post);
if (!betaPost1) {
throw "Missing beta post1";
}
let stickiedPostRes = await featurePost(beta, true, betaPost1.post);
expect(stickiedPostRes.post_view.post.featured_community).toBe(true);
// Make sure that post is stickied on beta
let betaPost = (await resolvePost(beta, postRes.post_view.post)).post;
expect(betaPost?.community.local).toBe(true);
expect(betaPost?.creator.local).toBe(false);
expect(betaPost?.post.featured_community).toBe(true);
// Unsticky a post
let unstickiedPost = await featurePost(beta, false, betaPost1.post);
expect(unstickiedPost.post_view.post.featured_community).toBe(false);
// Make sure that post is unstickied on beta
let betaPost2 = (await resolvePost(beta, postRes.post_view.post)).post;
expect(betaPost2?.community.local).toBe(true);
expect(betaPost2?.creator.local).toBe(false);
expect(betaPost2?.post.featured_community).toBe(false);
// Make sure that gamma cannot sticky the post on beta
let gammaPost = (await resolvePost(gamma, postRes.post_view.post)).post;
if (!gammaPost) {
throw "Missing gamma post";
}
// This has been failing occasionally
await featurePost(gamma, true, gammaPost.post);
let betaPost3 = (await resolvePost(beta, postRes.post_view.post)).post;
// expect(gammaTrySticky.post_view.post.featured_community).toBe(true);
expect(betaPost3?.post.featured_community).toBe(false);
});
test("Collection of featured posts gets federated", async () => {
// create a new community and feature a post
let community = await createCommunity(alpha);
let post = await createPost(alpha, community.community_view.community.id);
let featuredPost = await featurePost(alpha, true, post.post_view.post);
expect(featuredPost.post_view.post.featured_community).toBe(true);
// fetch the community, ensure that post is also fetched and marked as featured
let betaCommunity = await resolveCommunity(
beta,
community.community_view.community.actor_id,
);
expect(betaCommunity).toBeDefined();
const betaPost = await waitForPost(
beta,
post.post_view.post,
post => post?.post.featured_community === true,
);
expect(betaPost).toBeDefined();
});
test("Lock a post", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
await followCommunity(alpha, true, betaCommunity.community.id);
await waitUntil(
() => resolveBetaCommunity(alpha),
c => c.community?.subscribed === "Subscribed",
);
let postRes = await createPost(alpha, betaCommunity.community.id);
let betaPost1 = await waitForPost(beta, postRes.post_view.post);
// Lock the post
let lockedPostRes = await lockPost(beta, true, betaPost1.post);
expect(lockedPostRes.post_view.post.locked).toBe(true);
// Make sure that post is locked on alpha
let alphaPost1 = await waitForPost(
alpha,
postRes.post_view.post,
post => !!post && post.post.locked,
);
// Try to make a new comment there, on alpha. For this we need to create a normal
// user account because admins/mods can comment in locked posts.
let user = await registerUser(alpha, alphaUrl);
await expect(createComment(user, alphaPost1.post.id)).rejects.toStrictEqual(
Error("locked"),
);
// Unlock a post
let unlockedPost = await lockPost(beta, false, betaPost1.post);
expect(unlockedPost.post_view.post.locked).toBe(false);
// Make sure that post is unlocked on alpha
let alphaPost2 = await waitForPost(
alpha,
postRes.post_view.post,
post => !!post && !post.post.locked,
);
expect(alphaPost2.community.local).toBe(false);
expect(alphaPost2.creator.local).toBe(true);
expect(alphaPost2.post.locked).toBe(false);
// Try to create a new comment, on alpha
let commentAlpha = await createComment(user, alphaPost1.post.id);
expect(commentAlpha).toBeDefined();
});
test("Delete a post", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
let postRes = await createPost(alpha, betaCommunity.community.id);
expect(postRes.post_view.post).toBeDefined();
await waitForPost(beta, postRes.post_view.post);
let deletedPost = await deletePost(alpha, true, postRes.post_view.post);
expect(deletedPost.post_view.post.deleted).toBe(true);
expect(deletedPost.post_view.post.name).toBe(postRes.post_view.post.name);
// Make sure lemmy beta sees post is deleted
// This will be undefined because of the tombstone
await waitForPost(beta, postRes.post_view.post, p => !p || p.post.deleted);
// Undelete
let undeletedPost = await deletePost(alpha, false, postRes.post_view.post);
// Make sure lemmy beta sees post is undeleted
let betaPost2 = await waitForPost(
beta,
postRes.post_view.post,
p => !!p && !p.post.deleted,
);
if (!betaPost2) {
throw "Missing beta post 2";
}
expect(betaPost2.post.deleted).toBe(false);
await assertPostFederation(betaPost2, undeletedPost.post_view);
// Make sure lemmy beta cannot delete the post
await expect(deletePost(beta, true, betaPost2.post)).rejects.toStrictEqual(
Error("no_post_edit_allowed"),
);
});
test("Remove a post from admin and community on different instance", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
let gammaCommunity = (
await resolveCommunity(gamma, betaCommunity.community.actor_id)
).community?.community;
if (!gammaCommunity) {
throw "Missing gamma community";
}
let postRes = await createPost(gamma, gammaCommunity.id);
let alphaPost = (await resolvePost(alpha, postRes.post_view.post)).post;
if (!alphaPost) {
throw "Missing alpha post";
}
let removedPost = await removePost(alpha, true, alphaPost.post);
expect(removedPost.post_view.post.removed).toBe(true);
expect(removedPost.post_view.post.name).toBe(postRes.post_view.post.name);
// Make sure lemmy beta sees post is NOT removed
let betaPost = (await resolvePost(beta, postRes.post_view.post)).post;
if (!betaPost) {
throw "Missing beta post";
}
expect(betaPost.post.removed).toBe(false);
// Undelete
let undeletedPost = await removePost(alpha, false, alphaPost.post);
expect(undeletedPost.post_view.post.removed).toBe(false);
// Make sure lemmy beta sees post is undeleted
let betaPost2 = (await resolvePost(beta, postRes.post_view.post)).post;
expect(betaPost2?.post.removed).toBe(false);
await assertPostFederation(betaPost2!, undeletedPost.post_view);
});
test("Remove a post from admin and community on same instance", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
await followBeta(alpha);
let gammaCommunity = await resolveCommunity(
gamma,
betaCommunity.community.actor_id,
);
let postRes = await createPost(gamma, gammaCommunity.community!.community.id);
expect(postRes.post_view.post).toBeDefined();
// Get the id for beta
let betaPost = await waitForPost(beta, postRes.post_view.post);
expect(betaPost).toBeDefined();
let alphaPost0 = await waitForPost(alpha, postRes.post_view.post);
expect(alphaPost0).toBeDefined();
// The beta admin removes it (the community lives on beta)
let removePostRes = await removePost(beta, true, betaPost.post);
expect(removePostRes.post_view.post.removed).toBe(true);
// Make sure lemmy alpha sees post is removed
let alphaPost = await waitUntil(
() => getPost(alpha, alphaPost0.post.id),
p => p?.post_view.post.removed ?? false,
);
expect(alphaPost?.post_view.post.removed).toBe(true);
await assertPostFederation(alphaPost.post_view, removePostRes.post_view);
// Undelete
let undeletedPost = await removePost(beta, false, betaPost.post);
expect(undeletedPost.post_view.post.removed).toBe(false);
// Make sure lemmy alpha sees post is undeleted
let alphaPost2 = await waitForPost(
alpha,
postRes.post_view.post,
p => !!p && !p.post.removed,
);
expect(alphaPost2.post.removed).toBe(false);
await assertPostFederation(alphaPost2, undeletedPost.post_view);
await unfollowRemotes(alpha);
});
test("Search for a post", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
await unfollowRemotes(alpha);
let postRes = await createPost(alpha, betaCommunity.community.id);
expect(postRes.post_view.post).toBeDefined();
let betaPost = await waitForPost(beta, postRes.post_view.post);
expect(betaPost?.post.name).toBeDefined();
});
test("Enforce site ban federation for local user", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
// create a test user
let alphaUserHttp = await registerUser(alpha, alphaUrl);
let alphaUserPerson = (await getSite(alphaUserHttp)).my_user?.local_user_view
.person;
let alphaUserActorId = alphaUserPerson?.actor_id;
if (!alphaUserActorId) {
throw "Missing alpha user actor id";
}
expect(alphaUserActorId).toBeDefined();
await followBeta(alphaUserHttp);
let alphaPerson = (await resolvePerson(alphaUserHttp, alphaUserActorId!))
.person;
if (!alphaPerson) {
throw "Missing alpha person";
}
expect(alphaPerson).toBeDefined();
// alpha makes post in beta community, it federates to beta instance
let postRes1 = await createPost(alphaUserHttp, betaCommunity.community.id);
let searchBeta1 = await waitForPost(beta, postRes1.post_view.post);
// ban alpha from its own instance
let banAlpha = await banPersonFromSite(
alpha,
alphaPerson.person.id,
true,
true,
);
expect(banAlpha.banned).toBe(true);
// alpha ban should be federated to beta
let alphaUserOnBeta1 = await waitUntil(
() => resolvePerson(beta, alphaUserActorId!),
res => res.person?.person.banned ?? false,
);
expect(alphaUserOnBeta1.person?.person.banned).toBe(true);
// existing alpha post should be removed on beta
let betaBanRes = await waitUntil(
() => getPost(beta, searchBeta1.post.id),
s => s.post_view.post.removed,
);
expect(betaBanRes.post_view.post.removed).toBe(true);
// Unban alpha
let unBanAlpha = await banPersonFromSite(
alpha,
alphaPerson.person.id,
false,
false,
);
expect(unBanAlpha.banned).toBe(false);
// Login gets invalidated by ban, need to login again
if (!alphaUserPerson) {
throw "Missing alpha person";
}
let newAlphaUserJwt = await loginUser(alpha, alphaUserPerson.name);
alphaUserHttp.setHeaders({
Authorization: "Bearer " + newAlphaUserJwt.jwt ?? "",
});
// alpha makes new post in beta community, it federates
let postRes2 = await createPost(alphaUserHttp, betaCommunity!.community.id);
await waitForPost(beta, postRes2.post_view.post);
await unfollowRemotes(alpha);
});
test("Enforce site ban federation for federated user", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
// create a test user
let alphaUserHttp = await registerUser(alpha, alphaUrl);
let alphaUserPerson = (await getSite(alphaUserHttp)).my_user?.local_user_view
.person;
let alphaUserActorId = alphaUserPerson?.actor_id;
if (!alphaUserActorId) {
throw "Missing alpha user actor id";
}
expect(alphaUserActorId).toBeDefined();
await followBeta(alphaUserHttp);
let alphaUserOnBeta2 = await resolvePerson(beta, alphaUserActorId!);
expect(alphaUserOnBeta2.person?.person.banned).toBe(false);
if (!alphaUserOnBeta2.person) {
throw "Missing alpha person";
}
// alpha makes post in beta community, it federates to beta instance
let postRes1 = await createPost(alphaUserHttp, betaCommunity.community.id);
let searchBeta1 = await waitForPost(beta, postRes1.post_view.post);
expect(searchBeta1.post).toBeDefined();
// Now ban and remove their data from beta
let banAlphaOnBeta = await banPersonFromSite(
beta,
alphaUserOnBeta2.person.person.id,
true,
true,
);
expect(banAlphaOnBeta.banned).toBe(true);
// The beta site ban should NOT be federated to alpha
let alphaPerson2 = (await getSite(alphaUserHttp)).my_user!.local_user_view
.person;
expect(alphaPerson2.banned).toBe(false);
// existing alpha post should be removed on beta
let betaBanRes = await waitUntil(
() => getPost(beta, searchBeta1.post.id),
s => s.post_view.post.removed,
);
expect(betaBanRes.post_view.post.removed).toBe(true);
// existing alpha's post to the beta community should be removed on alpha
let alphaPostAfterRemoveOnBeta = await waitUntil(
() => getPost(alpha, postRes1.post_view.post.id),
s => s.post_view.post.removed,
);
expect(betaBanRes.post_view.post.removed).toBe(true);
expect(alphaPostAfterRemoveOnBeta.post_view.post.removed).toBe(true);
expect(
alphaPostAfterRemoveOnBeta.post_view.creator_banned_from_community,
).toBe(true);
await unfollowRemotes(alpha);
});
test("Enforce community ban for federated user", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
await followBeta(alpha);
let alphaShortname = `@lemmy_alpha@lemmy-alpha:8541`;
let alphaPerson = (await resolvePerson(beta, alphaShortname)).person;
if (!alphaPerson) {
throw "Missing alpha person";
}
expect(alphaPerson).toBeDefined();
// make a post in beta, it goes through
let postRes1 = await createPost(alpha, betaCommunity.community.id);
let searchBeta1 = await waitForPost(beta, postRes1.post_view.post);
expect(searchBeta1.post).toBeDefined();
// ban alpha from beta community
let banAlpha = await banPersonFromCommunity(
beta,
alphaPerson.person.id,
searchBeta1.community.id,
true,
true,
);
expect(banAlpha.banned).toBe(true);
// ensure that the post by alpha got removed
let removePostRes = await waitUntil(
() => getPost(alpha, postRes1.post_view.post.id),
s => s.post_view.post.removed,
);
expect(removePostRes.post_view.post.removed).toBe(true);
expect(removePostRes.post_view.creator_banned_from_community).toBe(true);
expect(removePostRes.community_view.banned_from_community).toBe(true);
// Alpha tries to make post on beta, but it fails because of ban
await expect(
createPost(alpha, betaCommunity.community.id),
).rejects.toStrictEqual(Error("banned_from_community"));
// Unban alpha
let unBanAlpha = await banPersonFromCommunity(
beta,
alphaPerson.person.id,
searchBeta1.community.id,
false,
false,
);
expect(unBanAlpha.banned).toBe(false);
// Need to re-follow the community
await followBeta(alpha);
let postRes3 = await createPost(alpha, betaCommunity.community.id);
expect(postRes3.post_view.post).toBeDefined();
expect(postRes3.post_view.community.local).toBe(false);
expect(postRes3.post_view.creator.local).toBe(true);
expect(postRes3.post_view.counts.score).toBe(1);
// Make sure that post makes it to beta community
let postRes4 = await waitForPost(beta, postRes3.post_view.post);
expect(postRes4.post).toBeDefined();
expect(postRes4.creator_banned_from_community).toBe(false);
await unfollowRemotes(alpha);
});
test("A and G subscribe to B (center) A posts, it gets announced to G", async () => {
if (!betaCommunity) {
throw "Missing beta community";
}
await followBeta(alpha);
let postRes = await createPost(alpha, betaCommunity.community.id);
expect(postRes.post_view.post).toBeDefined();
let betaPost = (await resolvePost(gamma, postRes.post_view.post)).post;
expect(betaPost?.post.name).toBeDefined();
await unfollowRemotes(alpha);
});
test("Report a post", async () => {
// Create post from alpha
let alphaCommunity = (await resolveBetaCommunity(alpha)).community!;
await followBeta(alpha);
let postRes = await createPost(alpha, alphaCommunity.community.id);
expect(postRes.post_view.post).toBeDefined();
let alphaPost = (await resolvePost(alpha, postRes.post_view.post)).post;
if (!alphaPost) {
throw "Missing alpha post";
}
// Send report from gamma
let gammaPost = (await resolvePost(gamma, alphaPost.post)).post!;
let gammaReport = (
await reportPost(gamma, gammaPost.post.id, randomString(10))
).post_report_view.post_report;
expect(gammaReport).toBeDefined();
// Report was federated to community instance
let betaReport = (await waitUntil(
() =>
listPostReports(beta).then(p =>
p.post_reports.find(
r =>
r.post_report.original_post_name === gammaReport.original_post_name,
),
),
res => !!res,
))!.post_report;
expect(betaReport).toBeDefined();
expect(betaReport.resolved).toBe(false);
expect(betaReport.original_post_name).toBe(gammaReport.original_post_name);
//expect(betaReport.original_post_url).toBe(gammaReport.original_post_url);
expect(betaReport.original_post_body).toBe(gammaReport.original_post_body);
expect(betaReport.reason).toBe(gammaReport.reason);
await unfollowRemotes(alpha);
// Report was federated to poster's instance
let alphaReport = (await waitUntil(
() =>
listPostReports(alpha).then(p =>
p.post_reports.find(
r =>
r.post_report.original_post_name === gammaReport.original_post_name,
),
),
res => !!res,
))!.post_report;
expect(alphaReport).toBeDefined();
expect(alphaReport.resolved).toBe(false);
expect(alphaReport.original_post_name).toBe(gammaReport.original_post_name);
//expect(alphaReport.original_post_url).toBe(gammaReport.original_post_url);
expect(alphaReport.original_post_body).toBe(gammaReport.original_post_body);
expect(alphaReport.reason).toBe(gammaReport.reason);
});
test("Fetch post via redirect", async () => {
await followBeta(alpha);
let alphaPost = await createPost(alpha, betaCommunity!.community.id);
expect(alphaPost.post_view.post).toBeDefined();
// Make sure that post is liked on beta
const betaPost = await waitForPost(
beta,
alphaPost.post_view.post,
res => res?.counts.score === 1,
);
expect(betaPost).toBeDefined();
expect(betaPost.post?.ap_id).toBe(alphaPost.post_view.post.ap_id);
// Fetch post from url on beta instance instead of ap_id
let q = `http://lemmy-beta:8551/post/${betaPost.post.id}`;
let form: ResolveObject = {
q,
};
let gammaPost = await gamma.resolveObject(form);
expect(gammaPost).toBeDefined();
expect(gammaPost.post?.post.ap_id).toBe(alphaPost.post_view.post.ap_id);
await unfollowRemotes(alpha);
});
test("Block post that contains banned URL", async () => {
let editSiteForm: EditSite = {
blocked_urls: ["https://evil.com/"],
};
await epsilon.editSite(editSiteForm);
await delay();
if (!betaCommunity) {
throw "Missing beta community";
}
expect(
createPost(epsilon, betaCommunity.community.id, "https://evil.com"),
).rejects.toStrictEqual(Error("blocked_url"));
// Later tests need this to be empty
editSiteForm.blocked_urls = [];
await epsilon.editSite(editSiteForm);
});
test("Fetch post with redirect", async () => {
let alphaPost = await createPost(alpha, betaCommunity!.community.id);
expect(alphaPost.post_view.post).toBeDefined();
// beta fetches from alpha as usual
let betaPost = await resolvePost(beta, alphaPost.post_view.post);
expect(betaPost.post).toBeDefined();
// gamma fetches from beta, and gets redirected to alpha
let gammaPost = await resolvePost(gamma, betaPost.post!.post);
expect(gammaPost.post).toBeDefined();
// fetch remote object from local url, which redirects to the original url
let form: ResolveObject = {
q: `http://lemmy-gamma:8561/post/${gammaPost.post!.post.id}`,
};
let gammaPost2 = await gamma.resolveObject(form);
expect(gammaPost2.post).toBeDefined();
});

View File

@ -0,0 +1,149 @@
jest.setTimeout(120000);
import {
alpha,
beta,
setupLogins,
followBeta,
createPrivateMessage,
editPrivateMessage,
listPrivateMessages,
deletePrivateMessage,
waitUntil,
reportPrivateMessage,
unfollows,
} from "./shared";
let recipient_id: number;
beforeAll(async () => {
await setupLogins();
await followBeta(alpha);
recipient_id = 3;
});
afterAll(unfollows);
test("Create a private message", async () => {
let pmRes = await createPrivateMessage(alpha, recipient_id);
expect(pmRes.private_message_view.private_message.content).toBeDefined();
expect(pmRes.private_message_view.private_message.local).toBe(true);
expect(pmRes.private_message_view.creator.local).toBe(true);
expect(pmRes.private_message_view.recipient.local).toBe(false);
let betaPms = await waitUntil(
() => listPrivateMessages(beta),
e => !!e.private_messages[0],
);
expect(betaPms.private_messages[0].private_message.content).toBeDefined();
expect(betaPms.private_messages[0].private_message.local).toBe(false);
expect(betaPms.private_messages[0].creator.local).toBe(false);
expect(betaPms.private_messages[0].recipient.local).toBe(true);
});
test("Update a private message", async () => {
let updatedContent = "A jest test federated private message edited";
let pmRes = await createPrivateMessage(alpha, recipient_id);
let pmUpdated = await editPrivateMessage(
alpha,
pmRes.private_message_view.private_message.id,
);
expect(pmUpdated.private_message_view.private_message.content).toBe(
updatedContent,
);
let betaPms = await waitUntil(
() => listPrivateMessages(beta),
p => p.private_messages[0].private_message.content === updatedContent,
);
expect(betaPms.private_messages[0].private_message.content).toBe(
updatedContent,
);
});
test("Delete a private message", async () => {
let pmRes = await createPrivateMessage(alpha, recipient_id);
let betaPms1 = await waitUntil(
() => listPrivateMessages(beta),
m =>
!!m.private_messages.find(
e =>
e.private_message.ap_id ===
pmRes.private_message_view.private_message.ap_id,
),
);
let deletedPmRes = await deletePrivateMessage(
alpha,
true,
pmRes.private_message_view.private_message.id,
);
expect(deletedPmRes.private_message_view.private_message.deleted).toBe(true);
// The GetPrivateMessages filters out deleted,
// even though they are in the actual database.
// no reason to show them
let betaPms2 = await waitUntil(
() => listPrivateMessages(beta),
p => p.private_messages.length === betaPms1.private_messages.length - 1,
);
expect(betaPms2.private_messages.length).toBe(
betaPms1.private_messages.length - 1,
);
// Undelete
let undeletedPmRes = await deletePrivateMessage(
alpha,
false,
pmRes.private_message_view.private_message.id,
);
expect(undeletedPmRes.private_message_view.private_message.deleted).toBe(
false,
);
let betaPms3 = await waitUntil(
() => listPrivateMessages(beta),
p => p.private_messages.length === betaPms1.private_messages.length,
);
expect(betaPms3.private_messages.length).toBe(
betaPms1.private_messages.length,
);
});
test("Create a private message report", async () => {
let pmRes = await createPrivateMessage(alpha, recipient_id);
let betaPms1 = await waitUntil(
() => listPrivateMessages(beta),
m =>
!!m.private_messages.find(
e =>
e.private_message.ap_id ===
pmRes.private_message_view.private_message.ap_id,
),
);
let betaPm = betaPms1.private_messages[0];
expect(betaPm).toBeDefined();
// Make sure that only the recipient can report it, so this should fail
await expect(
reportPrivateMessage(
alpha,
pmRes.private_message_view.private_message.id,
"a reason",
),
).rejects.toStrictEqual(Error("couldnt_create_report"));
// This one should pass
let reason = "another reason";
let report = await reportPrivateMessage(
beta,
betaPm.private_message.id,
reason,
);
expect(report.private_message_report_view.private_message.id).toBe(
betaPm.private_message.id,
);
expect(report.private_message_report_view.private_message_report.reason).toBe(
reason,
);
});

973
api_tests/src/shared.ts Normal file
View File

@ -0,0 +1,973 @@
import {
BlockCommunity,
BlockCommunityResponse,
BlockInstance,
BlockInstanceResponse,
CommunityId,
CreatePrivateMessageReport,
DeleteImage,
EditCommunity,
GetReplies,
GetRepliesResponse,
GetUnreadCountResponse,
InstanceId,
LemmyHttp,
PostView,
PrivateMessageReportResponse,
SuccessResponse,
} from "lemmy-js-client";
import { CreatePost } from "lemmy-js-client/dist/types/CreatePost";
import { DeletePost } from "lemmy-js-client/dist/types/DeletePost";
import { EditPost } from "lemmy-js-client/dist/types/EditPost";
import { EditSite } from "lemmy-js-client/dist/types/EditSite";
import { FeaturePost } from "lemmy-js-client/dist/types/FeaturePost";
import { GetComments } from "lemmy-js-client/dist/types/GetComments";
import { GetCommentsResponse } from "lemmy-js-client/dist/types/GetCommentsResponse";
import { GetPost } from "lemmy-js-client/dist/types/GetPost";
import { GetPostResponse } from "lemmy-js-client/dist/types/GetPostResponse";
import { LockPost } from "lemmy-js-client/dist/types/LockPost";
import { Login } from "lemmy-js-client/dist/types/Login";
import { Post } from "lemmy-js-client/dist/types/Post";
import { PostResponse } from "lemmy-js-client/dist/types/PostResponse";
import { RemovePost } from "lemmy-js-client/dist/types/RemovePost";
import { ResolveObject } from "lemmy-js-client/dist/types/ResolveObject";
import { ResolveObjectResponse } from "lemmy-js-client/dist/types/ResolveObjectResponse";
import { Search } from "lemmy-js-client/dist/types/Search";
import { SearchResponse } from "lemmy-js-client/dist/types/SearchResponse";
import { Comment } from "lemmy-js-client/dist/types/Comment";
import { BanPersonResponse } from "lemmy-js-client/dist/types/BanPersonResponse";
import { BanPerson } from "lemmy-js-client/dist/types/BanPerson";
import { BanFromCommunityResponse } from "lemmy-js-client/dist/types/BanFromCommunityResponse";
import { BanFromCommunity } from "lemmy-js-client/dist/types/BanFromCommunity";
import { CommunityResponse } from "lemmy-js-client/dist/types/CommunityResponse";
import { FollowCommunity } from "lemmy-js-client/dist/types/FollowCommunity";
import { CreatePostLike } from "lemmy-js-client/dist/types/CreatePostLike";
import { CommentResponse } from "lemmy-js-client/dist/types/CommentResponse";
import { CreateComment } from "lemmy-js-client/dist/types/CreateComment";
import { EditComment } from "lemmy-js-client/dist/types/EditComment";
import { DeleteComment } from "lemmy-js-client/dist/types/DeleteComment";
import { RemoveComment } from "lemmy-js-client/dist/types/RemoveComment";
import { GetPersonMentionsResponse } from "lemmy-js-client/dist/types/GetPersonMentionsResponse";
import { GetPersonMentions } from "lemmy-js-client/dist/types/GetPersonMentions";
import { CreateCommentLike } from "lemmy-js-client/dist/types/CreateCommentLike";
import { CreateCommunity } from "lemmy-js-client/dist/types/CreateCommunity";
import { GetCommunity } from "lemmy-js-client/dist/types/GetCommunity";
import { DeleteCommunity } from "lemmy-js-client/dist/types/DeleteCommunity";
import { RemoveCommunity } from "lemmy-js-client/dist/types/RemoveCommunity";
import { PrivateMessageResponse } from "lemmy-js-client/dist/types/PrivateMessageResponse";
import { CreatePrivateMessage } from "lemmy-js-client/dist/types/CreatePrivateMessage";
import { EditPrivateMessage } from "lemmy-js-client/dist/types/EditPrivateMessage";
import { DeletePrivateMessage } from "lemmy-js-client/dist/types/DeletePrivateMessage";
import { LoginResponse } from "lemmy-js-client/dist/types/LoginResponse";
import { Register } from "lemmy-js-client/dist/types/Register";
import { SaveUserSettings } from "lemmy-js-client/dist/types/SaveUserSettings";
import { DeleteAccount } from "lemmy-js-client/dist/types/DeleteAccount";
import { GetSiteResponse } from "lemmy-js-client/dist/types/GetSiteResponse";
import { PrivateMessagesResponse } from "lemmy-js-client/dist/types/PrivateMessagesResponse";
import { GetPrivateMessages } from "lemmy-js-client/dist/types/GetPrivateMessages";
import { PostReportResponse } from "lemmy-js-client/dist/types/PostReportResponse";
import { CreatePostReport } from "lemmy-js-client/dist/types/CreatePostReport";
import { ListPostReportsResponse } from "lemmy-js-client/dist/types/ListPostReportsResponse";
import { ListPostReports } from "lemmy-js-client/dist/types/ListPostReports";
import { CommentReportResponse } from "lemmy-js-client/dist/types/CommentReportResponse";
import { CreateCommentReport } from "lemmy-js-client/dist/types/CreateCommentReport";
import { ListCommentReportsResponse } from "lemmy-js-client/dist/types/ListCommentReportsResponse";
import { ListCommentReports } from "lemmy-js-client/dist/types/ListCommentReports";
import { GetPostsResponse } from "lemmy-js-client/dist/types/GetPostsResponse";
import { GetPosts } from "lemmy-js-client/dist/types/GetPosts";
import { GetPersonDetailsResponse } from "lemmy-js-client/dist/types/GetPersonDetailsResponse";
import { GetPersonDetails } from "lemmy-js-client/dist/types/GetPersonDetails";
import { ListingType } from "lemmy-js-client/dist/types/ListingType";
export const fetchFunction = fetch;
export const imageFetchLimit = 50;
export const sampleImage =
"https://i.pinimg.com/originals/df/5f/5b/df5f5b1b174a2b4b6026cc6c8f9395c1.jpg";
export const sampleSite = "https://yahoo.com";
export const alphaUrl = "http://127.0.0.1:8541";
export const betaUrl = "http://127.0.0.1:8551";
export const gammaUrl = "http://127.0.0.1:8561";
export const deltaUrl = "http://127.0.0.1:8571";
export const epsilonUrl = "http://127.0.0.1:8581";
export const alpha = new LemmyHttp(alphaUrl, { fetchFunction });
export const alphaImage = new LemmyHttp(alphaUrl);
export const beta = new LemmyHttp(betaUrl, { fetchFunction });
export const gamma = new LemmyHttp(gammaUrl, { fetchFunction });
export const delta = new LemmyHttp(deltaUrl, { fetchFunction });
export const epsilon = new LemmyHttp(epsilonUrl, { fetchFunction });
export const betaAllowedInstances = [
"lemmy-alpha",
"lemmy-gamma",
"lemmy-delta",
"lemmy-epsilon",
];
const password = "lemmylemmy";
export async function setupLogins() {
let formAlpha: Login = {
username_or_email: "lemmy_alpha",
password,
};
let resAlpha = alpha.login(formAlpha);
let formBeta: Login = {
username_or_email: "lemmy_beta",
password,
};
let resBeta = beta.login(formBeta);
let formGamma: Login = {
username_or_email: "lemmy_gamma",
password,
};
let resGamma = gamma.login(formGamma);
let formDelta: Login = {
username_or_email: "lemmy_delta",
password,
};
let resDelta = delta.login(formDelta);
let formEpsilon: Login = {
username_or_email: "lemmy_epsilon",
password,
};
let resEpsilon = epsilon.login(formEpsilon);
let res = await Promise.all([
resAlpha,
resBeta,
resGamma,
resDelta,
resEpsilon,
]);
alpha.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` });
alphaImage.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` });
beta.setHeaders({ Authorization: `Bearer ${res[1].jwt ?? ""}` });
gamma.setHeaders({ Authorization: `Bearer ${res[2].jwt ?? ""}` });
delta.setHeaders({ Authorization: `Bearer ${res[3].jwt ?? ""}` });
epsilon.setHeaders({ Authorization: `Bearer ${res[4].jwt ?? ""}` });
// Registration applications are now enabled by default, need to disable them
let editSiteForm: EditSite = {
registration_mode: "Open",
rate_limit_message: 999,
rate_limit_post: 999,
rate_limit_register: 999,
rate_limit_image: 999,
rate_limit_comment: 999,
rate_limit_search: 999,
};
// Set the blocks and auths for each
editSiteForm.allowed_instances = [
"lemmy-beta",
"lemmy-gamma",
"lemmy-delta",
"lemmy-epsilon",
];
await alpha.editSite(editSiteForm);
editSiteForm.allowed_instances = betaAllowedInstances;
await beta.editSite(editSiteForm);
editSiteForm.allowed_instances = [
"lemmy-alpha",
"lemmy-beta",
"lemmy-delta",
"lemmy-epsilon",
];
await gamma.editSite(editSiteForm);
// Setup delta allowed instance
editSiteForm.allowed_instances = ["lemmy-beta"];
await delta.editSite(editSiteForm);
// Create the main alpha/beta communities
// Ignore thrown errors of duplicates
try {
await createCommunity(alpha, "main");
await createCommunity(beta, "main");
// wait for > INSTANCES_RECHECK_DELAY to ensure federation is initialized
// otherwise the first few federated events may be missed
// (because last_successful_id is set to current id when federation to an instance is first started)
// only needed the first time so do in this try
await delay(10_000);
} catch (_) {
console.log("Communities already exist");
}
}
export async function createPost(
api: LemmyHttp,
community_id: number,
url: string = "https://example.com/",
body = randomString(10),
// use example.com for consistent title and embed description
name: string = randomString(5),
alt_text = randomString(10),
custom_thumbnail: string | undefined = undefined,
): Promise<PostResponse> {
let form: CreatePost = {
name,
url,
body,
alt_text,
community_id,
custom_thumbnail,
};
return api.createPost(form);
}
export async function editPost(
api: LemmyHttp,
post: Post,
): Promise<PostResponse> {
let name = "A jest test federated post, updated";
let form: EditPost = {
name,
post_id: post.id,
};
return api.editPost(form);
}
export async function createPostWithThumbnail(
api: LemmyHttp,
community_id: number,
url: string,
custom_thumbnail: string,
): Promise<PostResponse> {
let form: CreatePost = {
name: randomString(10),
url,
community_id,
custom_thumbnail,
};
return api.createPost(form);
}
export async function deletePost(
api: LemmyHttp,
deleted: boolean,
post: Post,
): Promise<PostResponse> {
let form: DeletePost = {
post_id: post.id,
deleted: deleted,
};
return api.deletePost(form);
}
export async function removePost(
api: LemmyHttp,
removed: boolean,
post: Post,
): Promise<PostResponse> {
let form: RemovePost = {
post_id: post.id,
removed,
};
return api.removePost(form);
}
export async function featurePost(
api: LemmyHttp,
featured: boolean,
post: Post,
): Promise<PostResponse> {
let form: FeaturePost = {
post_id: post.id,
featured,
feature_type: "Community",
};
return api.featurePost(form);
}
export async function lockPost(
api: LemmyHttp,
locked: boolean,
post: Post,
): Promise<PostResponse> {
let form: LockPost = {
post_id: post.id,
locked,
};
return api.lockPost(form);
}
export async function resolvePost(
api: LemmyHttp,
post: Post,
): Promise<ResolveObjectResponse> {
let form: ResolveObject = {
q: post.ap_id,
};
return api.resolveObject(form);
}
export async function searchPostLocal(
api: LemmyHttp,
post: Post,
): Promise<SearchResponse> {
let form: Search = {
q: post.name,
type_: "Posts",
sort: "TopAll",
listing_type: "All",
};
return api.search(form);
}
/// wait for a post to appear locally without pulling it
export async function waitForPost(
api: LemmyHttp,
post: Post,
checker: (t: PostView | undefined) => boolean = p => !!p,
) {
return waitUntil<PostView>(
() => searchPostLocal(api, post).then(p => p.posts[0]),
checker,
);
}
export async function getPost(
api: LemmyHttp,
post_id: number,
): Promise<GetPostResponse> {
let form: GetPost = {
id: post_id,
};
return api.getPost(form);
}
export async function getComments(
api: LemmyHttp,
post_id?: number,
listingType: ListingType = "All",
): Promise<GetCommentsResponse> {
let form: GetComments = {
post_id: post_id,
type_: listingType,
sort: "New",
limit: 50,
};
return api.getComments(form);
}
export async function getUnreadCount(
api: LemmyHttp,
): Promise<GetUnreadCountResponse> {
return api.getUnreadCount();
}
export async function getReplies(api: LemmyHttp): Promise<GetRepliesResponse> {
let form: GetReplies = {
sort: "New",
unread_only: false,
};
return api.getReplies(form);
}
export async function resolveComment(
api: LemmyHttp,
comment: Comment,
): Promise<ResolveObjectResponse> {
let form: ResolveObject = {
q: comment.ap_id,
};
return api.resolveObject(form);
}
export async function resolveBetaCommunity(
api: LemmyHttp,
): Promise<ResolveObjectResponse> {
// Use short-hand search url
let form: ResolveObject = {
q: "!main@lemmy-beta:8551",
};
return api.resolveObject(form);
}
export async function resolveCommunity(
api: LemmyHttp,
q: string,
): Promise<ResolveObjectResponse> {
let form: ResolveObject = {
q,
};
return api.resolveObject(form);
}
export async function resolvePerson(
api: LemmyHttp,
apShortname: string,
): Promise<ResolveObjectResponse> {
let form: ResolveObject = {
q: apShortname,
};
return api.resolveObject(form);
}
export async function banPersonFromSite(
api: LemmyHttp,
person_id: number,
ban: boolean,
remove_data: boolean,
): Promise<BanPersonResponse> {
// Make sure lemmy-beta/c/main is cached on lemmy_alpha
let form: BanPerson = {
person_id,
ban,
remove_data,
};
return api.banPerson(form);
}
export async function banPersonFromCommunity(
api: LemmyHttp,
person_id: number,
community_id: number,
remove_data: boolean,
ban: boolean,
): Promise<BanFromCommunityResponse> {
let form: BanFromCommunity = {
person_id,
community_id,
remove_data: remove_data,
ban,
};
return api.banFromCommunity(form);
}
export async function followCommunity(
api: LemmyHttp,
follow: boolean,
community_id: number,
): Promise<CommunityResponse> {
let form: FollowCommunity = {
community_id,
follow,
};
const res = await api.followCommunity(form);
await waitUntil(
() => getCommunity(api, res.community_view.community.id),
g =>
g.community_view.subscribed === (follow ? "Subscribed" : "NotSubscribed"),
);
// wait FOLLOW_ADDITIONS_RECHECK_DELAY (there's no API to wait for this currently)
await delay(2000);
return res;
}
export async function likePost(
api: LemmyHttp,
score: number,
post: Post,
): Promise<PostResponse> {
let form: CreatePostLike = {
post_id: post.id,
score: score,
};
return api.likePost(form);
}
export async function createComment(
api: LemmyHttp,
post_id: number,
parent_id?: number,
content = "a jest test comment",
): Promise<CommentResponse> {
let form: CreateComment = {
content,
post_id,
parent_id,
};
return api.createComment(form);
}
export async function editComment(
api: LemmyHttp,
comment_id: number,
content = "A jest test federated comment update",
): Promise<CommentResponse> {
let form: EditComment = {
content,
comment_id,
};
return api.editComment(form);
}
export async function deleteComment(
api: LemmyHttp,
deleted: boolean,
comment_id: number,
): Promise<CommentResponse> {
let form: DeleteComment = {
comment_id,
deleted,
};
return api.deleteComment(form);
}
export async function removeComment(
api: LemmyHttp,
removed: boolean,
comment_id: number,
): Promise<CommentResponse> {
let form: RemoveComment = {
comment_id,
removed,
};
return api.removeComment(form);
}
export async function getMentions(
api: LemmyHttp,
): Promise<GetPersonMentionsResponse> {
let form: GetPersonMentions = {
sort: "New",
unread_only: false,
};
return api.getPersonMentions(form);
}
export async function likeComment(
api: LemmyHttp,
score: number,
comment: Comment,
): Promise<CommentResponse> {
let form: CreateCommentLike = {
comment_id: comment.id,
score,
};
return api.likeComment(form);
}
export async function createCommunity(
api: LemmyHttp,
name_: string = randomString(10),
): Promise<CommunityResponse> {
let description = "a sample description";
let form: CreateCommunity = {
name: name_,
title: name_,
description,
};
return api.createCommunity(form);
}
export async function editCommunity(
api: LemmyHttp,
form: EditCommunity,
): Promise<CommunityResponse> {
return api.editCommunity(form);
}
export async function getCommunity(
api: LemmyHttp,
id: number,
): Promise<CommunityResponse> {
let form: GetCommunity = {
id,
};
return api.getCommunity(form);
}
export async function getCommunityByName(
api: LemmyHttp,
name: string,
): Promise<CommunityResponse> {
let form: GetCommunity = {
name,
};
return api.getCommunity(form);
}
export async function deleteCommunity(
api: LemmyHttp,
deleted: boolean,
community_id: number,
): Promise<CommunityResponse> {
let form: DeleteCommunity = {
community_id,
deleted,
};
return api.deleteCommunity(form);
}
export async function removeCommunity(
api: LemmyHttp,
removed: boolean,
community_id: number,
): Promise<CommunityResponse> {
let form: RemoveCommunity = {
community_id,
removed,
};
return api.removeCommunity(form);
}
export async function createPrivateMessage(
api: LemmyHttp,
recipient_id: number,
): Promise<PrivateMessageResponse> {
let content = "A jest test federated private message";
let form: CreatePrivateMessage = {
content,
recipient_id,
};
return api.createPrivateMessage(form);
}
export async function editPrivateMessage(
api: LemmyHttp,
private_message_id: number,
): Promise<PrivateMessageResponse> {
let updatedContent = "A jest test federated private message edited";
let form: EditPrivateMessage = {
content: updatedContent,
private_message_id,
};
return api.editPrivateMessage(form);
}
export async function deletePrivateMessage(
api: LemmyHttp,
deleted: boolean,
private_message_id: number,
): Promise<PrivateMessageResponse> {
let form: DeletePrivateMessage = {
deleted,
private_message_id,
};
return api.deletePrivateMessage(form);
}
export async function registerUser(
api: LemmyHttp,
url: string,
username: string = randomString(5),
): Promise<LemmyHttp> {
let form: Register = {
username,
password,
password_verify: password,
show_nsfw: true,
};
let login_response = await api.register(form);
expect(login_response.jwt).toBeDefined();
let lemmy_http = new LemmyHttp(url, {
headers: { Authorization: `Bearer ${login_response.jwt ?? ""}` },
});
return lemmy_http;
}
export async function loginUser(
api: LemmyHttp,
username: string,
): Promise<LoginResponse> {
let form: Login = {
username_or_email: username,
password: password,
};
return api.login(form);
}
export async function saveUserSettingsBio(
api: LemmyHttp,
): Promise<SuccessResponse> {
let form: SaveUserSettings = {
show_nsfw: true,
blur_nsfw: false,
auto_expand: true,
theme: "darkly",
default_sort_type: "Active",
default_listing_type: "All",
interface_language: "en",
show_avatars: true,
send_notifications_to_email: false,
bio: "a changed bio",
};
return saveUserSettings(api, form);
}
export async function saveUserSettingsFederated(
api: LemmyHttp,
): Promise<SuccessResponse> {
let avatar = sampleImage;
let banner = sampleImage;
let bio = "a changed bio";
let form: SaveUserSettings = {
show_nsfw: false,
blur_nsfw: true,
auto_expand: false,
default_sort_type: "Hot",
default_listing_type: "All",
interface_language: "",
avatar,
banner,
display_name: "user321",
show_avatars: false,
send_notifications_to_email: false,
bio,
};
return await saveUserSettings(api, form);
}
export async function saveUserSettings(
api: LemmyHttp,
form: SaveUserSettings,
): Promise<SuccessResponse> {
return api.saveUserSettings(form);
}
export async function getPersonDetails(
api: LemmyHttp,
person_id: number,
): Promise<GetPersonDetailsResponse> {
let form: GetPersonDetails = {
person_id: person_id,
};
return api.getPersonDetails(form);
}
export async function deleteUser(api: LemmyHttp): Promise<SuccessResponse> {
let form: DeleteAccount = {
delete_content: true,
password,
};
return api.deleteAccount(form);
}
export async function getSite(api: LemmyHttp): Promise<GetSiteResponse> {
return api.getSite();
}
export async function listPrivateMessages(
api: LemmyHttp,
): Promise<PrivateMessagesResponse> {
let form: GetPrivateMessages = {
unread_only: false,
};
return api.getPrivateMessages(form);
}
export async function unfollowRemotes(
api: LemmyHttp,
): Promise<GetSiteResponse> {
// Unfollow all remote communities
let site = await getSite(api);
let remoteFollowed =
site.my_user?.follows.filter(c => c.community.local == false) ?? [];
await Promise.all(
remoteFollowed.map(cu => followCommunity(api, false, cu.community.id)),
);
let siteRes = await getSite(api);
return siteRes;
}
export async function followBeta(api: LemmyHttp): Promise<CommunityResponse> {
let betaCommunity = (await resolveBetaCommunity(api)).community;
if (betaCommunity) {
let follow = await followCommunity(api, true, betaCommunity.community.id);
return follow;
} else {
return Promise.reject("no community worked");
}
}
export async function reportPost(
api: LemmyHttp,
post_id: number,
reason: string,
): Promise<PostReportResponse> {
let form: CreatePostReport = {
post_id,
reason,
};
return api.createPostReport(form);
}
export async function listPostReports(
api: LemmyHttp,
): Promise<ListPostReportsResponse> {
let form: ListPostReports = {};
return api.listPostReports(form);
}
export async function reportComment(
api: LemmyHttp,
comment_id: number,
reason: string,
): Promise<CommentReportResponse> {
let form: CreateCommentReport = {
comment_id,
reason,
};
return api.createCommentReport(form);
}
export async function reportPrivateMessage(
api: LemmyHttp,
private_message_id: number,
reason: string,
): Promise<PrivateMessageReportResponse> {
let form: CreatePrivateMessageReport = {
private_message_id,
reason,
};
return api.createPrivateMessageReport(form);
}
export async function listCommentReports(
api: LemmyHttp,
): Promise<ListCommentReportsResponse> {
let form: ListCommentReports = {};
return api.listCommentReports(form);
}
export function getPosts(
api: LemmyHttp,
listingType?: ListingType,
community_id?: number,
): Promise<GetPostsResponse> {
let form: GetPosts = {
type_: listingType,
limit: 50,
community_id,
};
return api.getPosts(form);
}
export function blockInstance(
api: LemmyHttp,
instance_id: InstanceId,
block: boolean,
): Promise<BlockInstanceResponse> {
let form: BlockInstance = {
instance_id,
block,
};
return api.blockInstance(form);
}
export function blockCommunity(
api: LemmyHttp,
community_id: CommunityId,
block: boolean,
): Promise<BlockCommunityResponse> {
let form: BlockCommunity = {
community_id,
block,
};
return api.blockCommunity(form);
}
export function delay(millis = 500) {
return new Promise(resolve => setTimeout(resolve, millis));
}
export function longDelay() {
return delay(10000);
}
export function wrapper(form: any): string {
return JSON.stringify(form);
}
export function randomString(length: number): string {
var result = "";
var characters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
export async function deleteAllImages(api: LemmyHttp) {
const imagesRes = await api.listAllMedia({
limit: imageFetchLimit,
});
imagesRes.images;
Promise.all(
imagesRes.images
.map(image => {
const form: DeleteImage = {
token: image.local_image.pictrs_delete_token,
filename: image.local_image.pictrs_alias,
};
return form;
})
.map(form => api.deleteImage(form)),
);
}
export async function unfollows() {
await Promise.all([
unfollowRemotes(alpha),
unfollowRemotes(beta),
unfollowRemotes(gamma),
unfollowRemotes(delta),
unfollowRemotes(epsilon),
]);
await Promise.all([
purgeAllPosts(alpha),
purgeAllPosts(beta),
purgeAllPosts(gamma),
purgeAllPosts(delta),
purgeAllPosts(epsilon),
]);
}
export async function purgeAllPosts(api: LemmyHttp) {
// The best way to get all federated items, is to find the posts
let res = await api.getPosts({ type_: "All", limit: 50 });
await Promise.all(
Array.from(new Set(res.posts.map(p => p.post.id)))
.map(post_id => api.purgePost({ post_id }))
// Ignore errors
.map(p => p.catch(e => e)),
);
}
export function getCommentParentId(comment: Comment): number | undefined {
let split = comment.path.split(".");
// remove the 0
split.shift();
if (split.length > 1) {
return Number(split[split.length - 2]);
} else {
console.log(`Failed to extract comment parent id from ${comment.path}`);
return undefined;
}
}
export async function waitUntil<T>(
fetcher: () => Promise<T>,
checker: (t: T) => boolean,
retries = 10,
delaySeconds = [0.2, 0.5, 1, 2, 3],
) {
let retry = 0;
let result;
while (retry++ < retries) {
result = await fetcher();
if (checker(result)) return result;
await delay(
delaySeconds[Math.min(retry - 1, delaySeconds.length - 1)] * 1000,
);
}
console.error("result", result);
throw Error(
`Failed "${fetcher}": "${checker}" did not return true after ${retries} retries (delayed ${delaySeconds}s each)`,
);
}

195
api_tests/src/user.spec.ts Normal file
View File

@ -0,0 +1,195 @@
jest.setTimeout(120000);
import { PersonView } from "lemmy-js-client/dist/types/PersonView";
import {
alpha,
beta,
registerUser,
resolvePerson,
getSite,
createPost,
resolveCommunity,
createComment,
resolveBetaCommunity,
deleteUser,
saveUserSettingsFederated,
setupLogins,
alphaUrl,
saveUserSettings,
getPost,
getComments,
fetchFunction,
alphaImage,
unfollows,
} from "./shared";
import { LemmyHttp, SaveUserSettings, UploadImage } from "lemmy-js-client";
import { GetPosts } from "lemmy-js-client/dist/types/GetPosts";
beforeAll(setupLogins);
afterAll(unfollows);
let apShortname: string;
function assertUserFederation(userOne?: PersonView, userTwo?: PersonView) {
expect(userOne?.person.name).toBe(userTwo?.person.name);
expect(userOne?.person.display_name).toBe(userTwo?.person.display_name);
expect(userOne?.person.bio).toBe(userTwo?.person.bio);
expect(userOne?.person.actor_id).toBe(userTwo?.person.actor_id);
expect(userOne?.person.avatar).toBe(userTwo?.person.avatar);
expect(userOne?.person.banner).toBe(userTwo?.person.banner);
expect(userOne?.person.published).toBe(userTwo?.person.published);
}
test("Create user", async () => {
let user = await registerUser(alpha, alphaUrl);
let site = await getSite(user);
expect(site.my_user).toBeDefined();
if (!site.my_user) {
throw "Missing site user";
}
apShortname = `${site.my_user.local_user_view.person.name}@lemmy-alpha:8541`;
});
test("Set some user settings, check that they are federated", async () => {
await saveUserSettingsFederated(alpha);
let alphaPerson = (await resolvePerson(alpha, apShortname)).person;
let betaPerson = (await resolvePerson(beta, apShortname)).person;
assertUserFederation(alphaPerson, betaPerson);
// Catches a bug where when only the person or local_user changed
let form: SaveUserSettings = {
theme: "test",
};
await saveUserSettings(beta, form);
let site = await getSite(beta);
expect(site.my_user?.local_user_view.local_user.theme).toBe("test");
});
test("Delete user", async () => {
let user = await registerUser(alpha, alphaUrl);
// make a local post and comment
let alphaCommunity = (await resolveCommunity(user, "main@lemmy-alpha:8541"))
.community;
if (!alphaCommunity) {
throw "Missing alpha community";
}
let localPost = (await createPost(user, alphaCommunity.community.id))
.post_view.post;
expect(localPost).toBeDefined();
let localComment = (await createComment(user, localPost.id)).comment_view
.comment;
expect(localComment).toBeDefined();
// make a remote post and comment
let betaCommunity = (await resolveBetaCommunity(user)).community;
if (!betaCommunity) {
throw "Missing beta community";
}
let remotePost = (await createPost(user, betaCommunity.community.id))
.post_view.post;
expect(remotePost).toBeDefined();
let remoteComment = (await createComment(user, remotePost.id)).comment_view
.comment;
expect(remoteComment).toBeDefined();
await deleteUser(user);
// check that posts and comments are marked as deleted on other instances.
// use get methods to avoid refetching from origin instance
expect((await getPost(alpha, localPost.id)).post_view.post.deleted).toBe(
true,
);
expect((await getPost(alpha, remotePost.id)).post_view.post.deleted).toBe(
true,
);
expect(
(await getComments(alpha, localComment.post_id)).comments[0].comment
.deleted,
).toBe(true);
expect(
(await getComments(alpha, remoteComment.post_id)).comments[0].comment
.deleted,
).toBe(true);
});
test("Requests with invalid auth should be treated as unauthenticated", async () => {
let invalid_auth = new LemmyHttp(alphaUrl, {
headers: { Authorization: "Bearer foobar" },
fetchFunction,
});
let site = await getSite(invalid_auth);
expect(site.my_user).toBeUndefined();
expect(site.site_view).toBeDefined();
let form: GetPosts = {};
let posts = invalid_auth.getPosts(form);
expect((await posts).posts).toBeDefined();
});
test("Create user with Arabic name", async () => {
let user = await registerUser(alpha, alphaUrl, "تجريب");
let site = await getSite(user);
expect(site.my_user).toBeDefined();
if (!site.my_user) {
throw "Missing site user";
}
apShortname = `${site.my_user.local_user_view.person.name}@lemmy-alpha:8541`;
let alphaPerson = (await resolvePerson(alpha, apShortname)).person;
expect(alphaPerson).toBeDefined();
});
test("Create user with accept-language", async () => {
let lemmy_http = new LemmyHttp(alphaUrl, {
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language#syntax
headers: { "Accept-Language": "fr-CH, en;q=0.8, de;q=0.7, *;q=0.5" },
});
let user = await registerUser(lemmy_http, alphaUrl);
let site = await getSite(user);
expect(site.my_user).toBeDefined();
expect(site.my_user?.local_user_view.local_user.interface_language).toBe(
"fr",
);
let langs = site.all_languages
.filter(a => site.my_user?.discussion_languages.includes(a.id))
.map(l => l.code);
// should have languages from accept header, as well as "undetermined"
// which is automatically enabled by backend
expect(langs).toStrictEqual(["und", "de", "en", "fr"]);
});
test("Set a new avatar, old avatar is deleted", async () => {
const listMediaRes = await alphaImage.listMedia();
expect(listMediaRes.images.length).toBe(0);
const upload_form1: UploadImage = {
image: Buffer.from("test1"),
};
const upload1 = await alphaImage.uploadImage(upload_form1);
expect(upload1.url).toBeDefined();
let form1 = {
avatar: upload1.url,
};
await saveUserSettings(alpha, form1);
const listMediaRes1 = await alphaImage.listMedia();
expect(listMediaRes1.images.length).toBe(1);
const upload_form2: UploadImage = {
image: Buffer.from("test2"),
};
const upload2 = await alphaImage.uploadImage(upload_form2);
expect(upload2.url).toBeDefined();
let form2 = {
avatar: upload1.url,
};
await saveUserSettings(alpha, form2);
// make sure only the new avatar is kept
const listMediaRes2 = await alphaImage.listMedia();
expect(listMediaRes2.images.length).toBe(1);
});

15
api_tests/tsconfig.json Normal file
View File

@ -0,0 +1,15 @@
{
"compilerOptions": {
"declaration": true,
"declarationDir": "./dist",
"module": "CommonJS",
"noImplicitAny": true,
"lib": ["es2017", "es7", "es6", "dom"],
"outDir": "./dist",
"target": "ES2020",
"strictNullChecks": true,
"moduleResolution": "Node"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}

86
cliff.toml Normal file
View File

@ -0,0 +1,86 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
[remote.github]
owner = "LemmyNet"
repo = "lemmy"
# token = ""
[changelog]
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
{% if commit.github.pr_title -%}
{%- set commit_message = commit.github.pr_title -%}
{%- else -%}
{%- set commit_message = commit.message -%}
{%- endif -%}
* {{ commit_message | split(pat="\n") | first | trim }}\
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%}
{% if commit.github.pr_number %} in \
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# postprocessors
postprocessors = []
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# regex for matching git tags
tag_pattern = "[0-9].*"
# regex for skipping tags
skip_tags = "beta|alpha"
# regex for ignoring tags
ignore_tags = "rc"
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"

5
config/config.hjson Normal file
View File

@ -0,0 +1,5 @@
# See the documentation for available config fields and descriptions:
# https://join-lemmy.org/docs/en/administration/configuration.html
{
hostname: lemmy-alpha
}

122
config/defaults.hjson Normal file
View File

@ -0,0 +1,122 @@
{
# settings related to the postgresql database
database: {
# Configure the database by specifying a URI
#
# This is the preferred method to specify database connection details since
# it is the most flexible.
# Connection URI pointing to a postgres instance
#
# This example uses peer authentication to obviate the need for creating,
# configuring, and managing passwords.
#
# For an explanation of how to use connection URIs, see [here][0] in
# PostgreSQL's documentation.
#
# [0]: https://www.postgresql.org/docs/current/libpq-connect.html#id-1.7.3.8.3.6
uri: "postgresql:///lemmy?user=lemmy&host=/var/run/postgresql"
# or
# Configure the database by specifying parts of a URI
#
# Note that specifying the `uri` field should be preferred since it provides
# greater control over how the connection is made. This merely exists for
# backwards-compatibility.
# Username to connect to postgres
user: "string"
# Password to connect to postgres
password: "string"
# Host where postgres is running
host: "string"
# Port where postgres can be accessed
port: 123
# Name of the postgres database for lemmy
database: "string"
# Maximum number of active sql connections
pool_size: 30
}
# Pictrs image server configuration.
pictrs: {
# Address where pictrs is available (for image hosting)
url: "http://localhost:8080/"
# Set a custom pictrs API key. ( Required for deleting images )
api_key: "string"
# Backwards compatibility with 0.18.1. False is equivalent to `image_mode: None`, true is
# equivalent to `image_mode: StoreLinkPreviews`.
#
# To be removed in 0.20
cache_external_link_previews: true
# Specifies how to handle remote images, so that users don't have to connect directly to remote
# servers.
image_mode:
# Leave images unchanged, don't generate any local thumbnails for post urls. Instead the
# Opengraph image is directly returned as thumbnail
"None"
# or
# Generate thumbnails for external post urls and store them persistently in pict-rs. This
# ensures that they can be reliably retrieved and can be resized using pict-rs APIs. However
# it also increases storage usage.
#
# This is the default behaviour, and also matches Lemmy 0.18.
"StoreLinkPreviews"
# or
# If enabled, all images from remote domains are rewritten to pass through
# `/api/v3/image_proxy`, including embedded images in markdown. Images are stored temporarily
# in pict-rs for caching. This improves privacy as users don't expose their IP to untrusted
# servers, and decreases load on other servers. However it increases bandwidth use for the
# local server.
#
# Requires pict-rs 0.5
"ProxyAllImages"
# Timeout for uploading images to pictrs (in seconds)
upload_timeout: 30
}
# Email sending configuration. All options except login/password are mandatory
email: {
# Hostname and port of the smtp server
smtp_server: "localhost:25"
# Login name for smtp server
smtp_login: "string"
# Password to login to the smtp server
smtp_password: "string"
# Address to send emails from, eg "noreply@your-instance.com"
smtp_from_address: "noreply@example.com"
# Whether or not smtp connections should use tls. Can be none, tls, or starttls
tls_type: "none"
}
# Parameters for automatic configuration of new instance (only used at first start)
setup: {
# Username for the admin user
admin_username: "admin"
# Password for the admin user. It must be between 10 and 60 characters.
admin_password: "tf6HHDS4RolWfFhk4Rq9"
# Name of the site, can be changed later. Maximum 20 characters.
site_name: "My Lemmy Instance"
# Email for the admin user (optional, can be omitted and set later through the website)
admin_email: "user@example.com"
}
# the domain name of your instance (mandatory)
hostname: "unset"
# Address where lemmy should listen for incoming requests
bind: "0.0.0.0"
# Port where lemmy should listen for incoming requests
port: 8536
# Whether the site is available over TLS. Needs to be true for federation to work.
tls_enabled: true
# The number of activitypub federation workers that can be in-flight concurrently
worker_count: 0
# The number of activitypub federation retry workers that can be in-flight concurrently
retry_count: 0
prometheus: {
bind: "127.0.0.1"
port: 10002
}
# Sets a response Access-Control-Allow-Origin CORS header
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
cors_origin: "*"
}

45
crates/api/Cargo.toml Normal file
View File

@ -0,0 +1,45 @@
[package]
name = "lemmy_api"
publish = false
version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
homepage.workspace = true
documentation.workspace = true
repository.workspace = true
[lib]
name = "lemmy_api"
path = "src/lib.rs"
doctest = false
[lints]
workspace = true
[dependencies]
lemmy_utils = { workspace = true }
lemmy_db_schema = { workspace = true, features = ["full"] }
lemmy_db_views = { workspace = true, features = ["full"] }
lemmy_db_views_moderator = { workspace = true, features = ["full"] }
lemmy_db_views_actor = { workspace = true, features = ["full"] }
lemmy_api_common = { workspace = true, features = ["full"] }
activitypub_federation = { workspace = true }
bcrypt = { workspace = true }
actix-web = { workspace = true }
base64 = { workspace = true }
captcha = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
chrono = { workspace = true }
url = { workspace = true }
wav = "1.0.1"
sitemap-rs = "0.2.1"
totp-rs = { version = "5.5.1", features = ["gen_secret", "otpauth"] }
actix-web-httpauth = "0.8.1"
[dev-dependencies]
serial_test = { workspace = true }
tokio = { workspace = true }
elementtree = "1.2.3"
pretty_assertions = { workspace = true }

View File

@ -0,0 +1,66 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
comment::{CommentResponse, DistinguishComment},
context::LemmyContext,
utils::{check_community_mod_action, check_community_user_action},
};
use lemmy_db_schema::{
source::comment::{Comment, CommentUpdateForm},
traits::Crud,
};
use lemmy_db_views::structs::{CommentView, LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn distinguish_comment(
data: Json<DistinguishComment>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommentResponse>> {
let orig_comment = CommentView::read(&mut context.pool(), data.comment_id, None)
.await?
.ok_or(LemmyErrorType::CouldntFindComment)?;
check_community_user_action(
&local_user_view.person,
orig_comment.community.id,
&mut context.pool(),
)
.await?;
// Verify that only the creator can distinguish
if local_user_view.person.id != orig_comment.creator.id {
Err(LemmyErrorType::NoCommentEditAllowed)?
}
// Verify that only a mod or admin can distinguish a comment
check_community_mod_action(
&local_user_view.person,
orig_comment.community.id,
false,
&mut context.pool(),
)
.await?;
// Update the Comment
let form = CommentUpdateForm {
distinguished: Some(data.distinguished),
..Default::default()
};
Comment::update(&mut context.pool(), data.comment_id, &form)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
let comment_view = CommentView::read(
&mut context.pool(),
data.comment_id,
Some(local_user_view.person.id),
)
.await?
.ok_or(LemmyErrorType::CouldntFindComment)?;
Ok(Json(CommentResponse {
comment_view,
recipient_ids: Vec::new(),
}))
}

View File

@ -0,0 +1,100 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
build_response::build_comment_response,
comment::{CommentResponse, CreateCommentLike},
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::{check_bot_account, check_community_user_action, check_downvotes_enabled},
};
use lemmy_db_schema::{
newtypes::LocalUserId,
source::{
comment::{CommentLike, CommentLikeForm},
comment_reply::CommentReply,
local_site::LocalSite,
},
traits::Likeable,
};
use lemmy_db_views::structs::{CommentView, LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use std::ops::Deref;
#[tracing::instrument(skip(context))]
pub async fn like_comment(
data: Json<CreateCommentLike>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommentResponse>> {
let local_site = LocalSite::read(&mut context.pool()).await?;
let mut recipient_ids = Vec::<LocalUserId>::new();
// Don't do a downvote if site has downvotes disabled
check_downvotes_enabled(data.score, &local_site)?;
check_bot_account(&local_user_view.person)?;
let comment_id = data.comment_id;
let orig_comment = CommentView::read(&mut context.pool(), comment_id, None)
.await?
.ok_or(LemmyErrorType::CouldntFindComment)?;
check_community_user_action(
&local_user_view.person,
orig_comment.community.id,
&mut context.pool(),
)
.await?;
// Add parent poster or commenter to recipients
let comment_reply = CommentReply::read_by_comment(&mut context.pool(), comment_id).await;
if let Ok(Some(reply)) = comment_reply {
let recipient_id = reply.recipient_id;
if let Ok(Some(local_recipient)) =
LocalUserView::read_person(&mut context.pool(), recipient_id).await
{
recipient_ids.push(local_recipient.local_user.id);
}
}
let like_form = CommentLikeForm {
comment_id: data.comment_id,
post_id: orig_comment.post.id,
person_id: local_user_view.person.id,
score: data.score,
};
// Remove any likes first
let person_id = local_user_view.person.id;
CommentLike::remove(&mut context.pool(), person_id, comment_id).await?;
// Only add the like if the score isnt 0
let do_add = like_form.score != 0 && (like_form.score == 1 || like_form.score == -1);
if do_add {
CommentLike::like(&mut context.pool(), &like_form)
.await
.with_lemmy_type(LemmyErrorType::CouldntLikeComment)?;
}
ActivityChannel::submit_activity(
SendActivityData::LikePostOrComment {
object_id: orig_comment.comment.ap_id,
actor: local_user_view.person.clone(),
community: orig_comment.community,
score: data.score,
},
&context,
)
.await?;
Ok(Json(
build_comment_response(
context.deref(),
comment_id,
Some(local_user_view),
recipient_ids,
)
.await?,
))
}

View File

@ -0,0 +1,36 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
comment::{ListCommentLikes, ListCommentLikesResponse},
context::LemmyContext,
utils::is_mod_or_admin,
};
use lemmy_db_views::structs::{CommentView, LocalUserView, VoteView};
use lemmy_utils::{error::LemmyResult, LemmyErrorType};
/// Lists likes for a comment
#[tracing::instrument(skip(context))]
pub async fn list_comment_likes(
data: Query<ListCommentLikes>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<ListCommentLikesResponse>> {
let comment_view = CommentView::read(
&mut context.pool(),
data.comment_id,
Some(local_user_view.person.id),
)
.await?
.ok_or(LemmyErrorType::CouldntFindComment)?;
is_mod_or_admin(
&mut context.pool(),
&local_user_view.person,
comment_view.community.id,
)
.await?;
let comment_likes =
VoteView::list_for_comment(&mut context.pool(), data.comment_id, data.page, data.limit).await?;
Ok(Json(ListCommentLikesResponse { comment_likes }))
}

View File

@ -0,0 +1,4 @@
pub mod distinguish;
pub mod like;
pub mod list_comment_likes;
pub mod save;

View File

@ -0,0 +1,44 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
comment::{CommentResponse, SaveComment},
context::LemmyContext,
};
use lemmy_db_schema::{
source::comment::{CommentSaved, CommentSavedForm},
traits::Saveable,
};
use lemmy_db_views::structs::{CommentView, LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn save_comment(
data: Json<SaveComment>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommentResponse>> {
let comment_saved_form = CommentSavedForm {
comment_id: data.comment_id,
person_id: local_user_view.person.id,
};
if data.save {
CommentSaved::save(&mut context.pool(), &comment_saved_form)
.await
.with_lemmy_type(LemmyErrorType::CouldntSaveComment)?;
} else {
CommentSaved::unsave(&mut context.pool(), &comment_saved_form)
.await
.with_lemmy_type(LemmyErrorType::CouldntSaveComment)?;
}
let comment_id = data.comment_id;
let person_id = local_user_view.person.id;
let comment_view = CommentView::read(&mut context.pool(), comment_id, Some(person_id))
.await?
.ok_or(LemmyErrorType::CouldntFindComment)?;
Ok(Json(CommentResponse {
comment_view,
recipient_ids: Vec::new(),
}))
}

View File

@ -0,0 +1,92 @@
use crate::check_report_reason;
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
comment::{CommentReportResponse, CreateCommentReport},
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::{
check_comment_deleted_or_removed,
check_community_user_action,
send_new_report_email_to_admins,
},
};
use lemmy_db_schema::{
source::{
comment_report::{CommentReport, CommentReportForm},
local_site::LocalSite,
},
traits::Reportable,
};
use lemmy_db_views::structs::{CommentReportView, CommentView, LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
/// Creates a comment report and notifies the moderators of the community
#[tracing::instrument(skip(context))]
pub async fn create_comment_report(
data: Json<CreateCommentReport>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommentReportResponse>> {
let local_site = LocalSite::read(&mut context.pool()).await?;
let reason = data.reason.trim().to_string();
check_report_reason(&reason, &local_site)?;
let person_id = local_user_view.person.id;
let comment_id = data.comment_id;
let comment_view = CommentView::read(&mut context.pool(), comment_id, None)
.await?
.ok_or(LemmyErrorType::CouldntFindComment)?;
check_community_user_action(
&local_user_view.person,
comment_view.community.id,
&mut context.pool(),
)
.await?;
// Don't allow creating reports for removed / deleted comments
check_comment_deleted_or_removed(&comment_view.comment)?;
let report_form = CommentReportForm {
creator_id: person_id,
comment_id,
original_comment_text: comment_view.comment.content,
reason,
};
let report = CommentReport::report(&mut context.pool(), &report_form)
.await
.with_lemmy_type(LemmyErrorType::CouldntCreateReport)?;
let comment_report_view = CommentReportView::read(&mut context.pool(), report.id, person_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommentReport)?;
// Email the admins
if local_site.reports_email_admins {
send_new_report_email_to_admins(
&comment_report_view.creator.name,
&comment_report_view.comment_creator.name,
&mut context.pool(),
context.settings(),
)
.await?;
}
ActivityChannel::submit_activity(
SendActivityData::CreateReport {
object_id: comment_view.comment.ap_id.inner().clone(),
actor: local_user_view.person,
community: comment_view.community,
reason: data.reason.clone(),
},
&context,
)
.await?;
Ok(Json(CommentReportResponse {
comment_report_view,
}))
}

View File

@ -0,0 +1,37 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
comment::{ListCommentReports, ListCommentReportsResponse},
context::LemmyContext,
utils::check_community_mod_of_any_or_admin_action,
};
use lemmy_db_views::{comment_report_view::CommentReportQuery, structs::LocalUserView};
use lemmy_utils::error::LemmyResult;
/// Lists comment reports for a community if an id is supplied
/// or returns all comment reports for communities a user moderates
#[tracing::instrument(skip(context))]
pub async fn list_comment_reports(
data: Query<ListCommentReports>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<ListCommentReportsResponse>> {
let community_id = data.community_id;
let comment_id = data.comment_id;
let unresolved_only = data.unresolved_only.unwrap_or_default();
check_community_mod_of_any_or_admin_action(&local_user_view, &mut context.pool()).await?;
let page = data.page;
let limit = data.limit;
let comment_reports = CommentReportQuery {
community_id,
comment_id,
unresolved_only,
page,
limit,
}
.list(&mut context.pool(), &local_user_view)
.await?;
Ok(Json(ListCommentReportsResponse { comment_reports }))
}

View File

@ -0,0 +1,3 @@
pub mod create;
pub mod list;
pub mod resolve;

View File

@ -0,0 +1,51 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
comment::{CommentReportResponse, ResolveCommentReport},
context::LemmyContext,
utils::check_community_mod_action,
};
use lemmy_db_schema::{source::comment_report::CommentReport, traits::Reportable};
use lemmy_db_views::structs::{CommentReportView, LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
/// Resolves or unresolves a comment report and notifies the moderators of the community
#[tracing::instrument(skip(context))]
pub async fn resolve_comment_report(
data: Json<ResolveCommentReport>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommentReportResponse>> {
let report_id = data.report_id;
let person_id = local_user_view.person.id;
let report = CommentReportView::read(&mut context.pool(), report_id, person_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommentReport)?;
let person_id = local_user_view.person.id;
check_community_mod_action(
&local_user_view.person,
report.community.id,
true,
&mut context.pool(),
)
.await?;
if data.resolved {
CommentReport::resolve(&mut context.pool(), report_id, person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntResolveReport)?;
} else {
CommentReport::unresolve(&mut context.pool(), report_id, person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntResolveReport)?;
}
let report_id = data.report_id;
let comment_report_view = CommentReportView::read(&mut context.pool(), report_id, person_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommentReport)?;
Ok(Json(CommentReportResponse {
comment_report_view,
}))
}

View File

@ -0,0 +1,97 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
community::{AddModToCommunity, AddModToCommunityResponse},
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::check_community_mod_action,
};
use lemmy_db_schema::{
source::{
community::{Community, CommunityModerator, CommunityModeratorForm},
moderator::{ModAddCommunity, ModAddCommunityForm},
},
traits::{Crud, Joinable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::CommunityModeratorView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn add_mod_to_community(
data: Json<AddModToCommunity>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<AddModToCommunityResponse>> {
let community_id = data.community_id;
// Verify that only mods or admins can add mod
check_community_mod_action(
&local_user_view.person,
community_id,
false,
&mut context.pool(),
)
.await?;
let community = Community::read(&mut context.pool(), community_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommunity)?;
// If user is admin and community is remote, explicitly check that he is a
// moderator. This is necessary because otherwise the action would be rejected
// by the community's home instance.
if local_user_view.local_user.admin && !community.local {
let is_mod = CommunityModeratorView::is_community_moderator(
&mut context.pool(),
community.id,
local_user_view.person.id,
)
.await?;
if !is_mod {
Err(LemmyErrorType::NotAModerator)?
}
}
// Update in local database
let community_moderator_form = CommunityModeratorForm {
community_id: data.community_id,
person_id: data.person_id,
};
if data.added {
CommunityModerator::join(&mut context.pool(), &community_moderator_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityModeratorAlreadyExists)?;
} else {
CommunityModerator::leave(&mut context.pool(), &community_moderator_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityModeratorAlreadyExists)?;
}
// Mod tables
let form = ModAddCommunityForm {
mod_person_id: local_user_view.person.id,
other_person_id: data.person_id,
community_id: data.community_id,
removed: Some(!data.added),
};
ModAddCommunity::create(&mut context.pool(), &form).await?;
// Note: in case a remote mod is added, this returns the old moderators list, it will only get
// updated once we receive an activity from the community (like `Announce/Add/Moderator`)
let community_id = data.community_id;
let moderators = CommunityModeratorView::for_community(&mut context.pool(), community_id).await?;
ActivityChannel::submit_activity(
SendActivityData::AddModToCommunity {
moderator: local_user_view.person,
community_id: data.community_id,
target: data.person_id,
added: data.added,
},
&context,
)
.await?;
Ok(Json(AddModToCommunityResponse { moderators }))
}

View File

@ -0,0 +1,111 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
community::{BanFromCommunity, BanFromCommunityResponse},
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::{check_community_mod_action, check_expire_time, remove_user_data_in_community},
};
use lemmy_db_schema::{
source::{
community::{
CommunityFollower,
CommunityFollowerForm,
CommunityPersonBan,
CommunityPersonBanForm,
},
moderator::{ModBanFromCommunity, ModBanFromCommunityForm},
},
traits::{Bannable, Crud, Followable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::PersonView;
use lemmy_utils::{
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
utils::validation::is_valid_body_field,
};
#[tracing::instrument(skip(context))]
pub async fn ban_from_community(
data: Json<BanFromCommunity>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<BanFromCommunityResponse>> {
let banned_person_id = data.person_id;
let remove_data = data.remove_data.unwrap_or(false);
let expires = check_expire_time(data.expires)?;
// Verify that only mods or admins can ban
check_community_mod_action(
&local_user_view.person,
data.community_id,
false,
&mut context.pool(),
)
.await?;
is_valid_body_field(&data.reason, false)?;
let community_user_ban_form = CommunityPersonBanForm {
community_id: data.community_id,
person_id: data.person_id,
expires: Some(expires),
};
if data.ban {
CommunityPersonBan::ban(&mut context.pool(), &community_user_ban_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityUserAlreadyBanned)?;
// Also unsubscribe them from the community, if they are subscribed
let community_follower_form = CommunityFollowerForm {
community_id: data.community_id,
person_id: banned_person_id,
pending: false,
};
CommunityFollower::unfollow(&mut context.pool(), &community_follower_form)
.await
.ok();
} else {
CommunityPersonBan::unban(&mut context.pool(), &community_user_ban_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityUserAlreadyBanned)?;
}
// Remove/Restore their data if that's desired
if remove_data {
remove_user_data_in_community(data.community_id, banned_person_id, &mut context.pool()).await?;
}
// Mod tables
let form = ModBanFromCommunityForm {
mod_person_id: local_user_view.person.id,
other_person_id: data.person_id,
community_id: data.community_id,
reason: data.reason.clone(),
banned: Some(data.ban),
expires,
};
ModBanFromCommunity::create(&mut context.pool(), &form).await?;
let person_view = PersonView::read(&mut context.pool(), data.person_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPerson)?;
ActivityChannel::submit_activity(
SendActivityData::BanFromCommunity {
moderator: local_user_view.person,
community_id: data.community_id,
target: person_view.person.clone(),
data: data.0.clone(),
},
&context,
)
.await?;
Ok(Json(BanFromCommunityResponse {
person_view,
banned: data.ban,
}))
}

View File

@ -0,0 +1,72 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
community::{BlockCommunity, BlockCommunityResponse},
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
};
use lemmy_db_schema::{
source::{
community::{CommunityFollower, CommunityFollowerForm},
community_block::{CommunityBlock, CommunityBlockForm},
},
traits::{Blockable, Followable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::CommunityView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn block_community(
data: Json<BlockCommunity>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<BlockCommunityResponse>> {
let community_id = data.community_id;
let person_id = local_user_view.person.id;
let community_block_form = CommunityBlockForm {
person_id,
community_id,
};
if data.block {
CommunityBlock::block(&mut context.pool(), &community_block_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityBlockAlreadyExists)?;
// Also, unfollow the community, and send a federated unfollow
let community_follower_form = CommunityFollowerForm {
community_id: data.community_id,
person_id,
pending: false,
};
CommunityFollower::unfollow(&mut context.pool(), &community_follower_form)
.await
.ok();
} else {
CommunityBlock::unblock(&mut context.pool(), &community_block_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityBlockAlreadyExists)?;
}
let community_view =
CommunityView::read(&mut context.pool(), community_id, Some(person_id), false)
.await?
.ok_or(LemmyErrorType::CouldntFindCommunity)?;
ActivityChannel::submit_activity(
SendActivityData::FollowCommunity(
community_view.community.clone(),
local_user_view.person.clone(),
false,
),
&context,
)
.await?;
Ok(Json(BlockCommunityResponse {
blocked: data.block,
community_view,
}))
}

View File

@ -0,0 +1,77 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
community::{CommunityResponse, FollowCommunity},
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::check_community_user_action,
};
use lemmy_db_schema::{
source::{
actor_language::CommunityLanguage,
community::{Community, CommunityFollower, CommunityFollowerForm},
},
traits::{Crud, Followable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::CommunityView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn follow_community(
data: Json<FollowCommunity>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommunityResponse>> {
let community = Community::read(&mut context.pool(), data.community_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommunity)?;
let mut community_follower_form = CommunityFollowerForm {
community_id: community.id,
person_id: local_user_view.person.id,
pending: false,
};
if data.follow {
if community.local {
check_community_user_action(&local_user_view.person, community.id, &mut context.pool())
.await?;
CommunityFollower::follow(&mut context.pool(), &community_follower_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityFollowerAlreadyExists)?;
} else {
// Mark as pending, the actual federation activity is sent via `SendActivity` handler
community_follower_form.pending = true;
CommunityFollower::follow(&mut context.pool(), &community_follower_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityFollowerAlreadyExists)?;
}
} else {
CommunityFollower::unfollow(&mut context.pool(), &community_follower_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityFollowerAlreadyExists)?;
}
if !community.local {
ActivityChannel::submit_activity(
SendActivityData::FollowCommunity(community, local_user_view.person.clone(), data.follow),
&context,
)
.await?;
}
let community_id = data.community_id;
let person_id = local_user_view.person.id;
let community_view =
CommunityView::read(&mut context.pool(), community_id, Some(person_id), false)
.await?
.ok_or(LemmyErrorType::CouldntFindCommunity)?;
let discussion_languages = CommunityLanguage::read(&mut context.pool(), community_id).await?;
Ok(Json(CommunityResponse {
community_view,
discussion_languages,
}))
}

View File

@ -0,0 +1,55 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
community::HideCommunity,
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::is_admin,
SuccessResponse,
};
use lemmy_db_schema::{
source::{
community::{Community, CommunityUpdateForm},
moderator::{ModHideCommunity, ModHideCommunityForm},
},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn hide_community(
data: Json<HideCommunity>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<SuccessResponse>> {
// Verify its a admin (only admin can hide or unhide it)
is_admin(&local_user_view)?;
let community_form = CommunityUpdateForm {
hidden: Some(data.hidden),
..Default::default()
};
let mod_hide_community_form = ModHideCommunityForm {
community_id: data.community_id,
mod_person_id: local_user_view.person.id,
reason: data.reason.clone(),
hidden: Some(data.hidden),
};
let community_id = data.community_id;
let community = Community::update(&mut context.pool(), community_id, &community_form)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateCommunityHiddenStatus)?;
ModHideCommunity::create(&mut context.pool(), &mod_hide_community_form).await?;
ActivityChannel::submit_activity(
SendActivityData::UpdateCommunity(local_user_view.person.clone(), community),
&context,
)
.await?;
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,6 @@
pub mod add_mod;
pub mod ban;
pub mod block;
pub mod follow;
pub mod hide;
pub mod transfer;

View File

@ -0,0 +1,97 @@
use actix_web::web::{Data, Json};
use anyhow::Context;
use lemmy_api_common::{
community::{GetCommunityResponse, TransferCommunity},
context::LemmyContext,
utils::{check_community_user_action, is_admin, is_top_mod},
};
use lemmy_db_schema::{
source::{
community::{CommunityModerator, CommunityModeratorForm},
moderator::{ModTransferCommunity, ModTransferCommunityForm},
},
traits::{Crud, Joinable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
use lemmy_utils::{
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
location_info,
};
// TODO: we dont do anything for federation here, it should be updated the next time the community
// gets fetched. i hope we can get rid of the community creator role soon.
#[tracing::instrument(skip(context))]
pub async fn transfer_community(
data: Json<TransferCommunity>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<GetCommunityResponse>> {
let community_id = data.community_id;
let mut community_mods =
CommunityModeratorView::for_community(&mut context.pool(), community_id).await?;
check_community_user_action(&local_user_view.person, community_id, &mut context.pool()).await?;
// Make sure transferrer is either the top community mod, or an admin
if !(is_top_mod(&local_user_view, &community_mods).is_ok() || is_admin(&local_user_view).is_ok())
{
Err(LemmyErrorType::NotAnAdmin)?
}
// You have to re-do the community_moderator table, reordering it.
// Add the transferee to the top
let creator_index = community_mods
.iter()
.position(|r| r.moderator.id == data.person_id)
.context(location_info!())?;
let creator_person = community_mods.remove(creator_index);
community_mods.insert(0, creator_person);
// Delete all the mods
let community_id = data.community_id;
CommunityModerator::delete_for_community(&mut context.pool(), community_id).await?;
// TODO: this should probably be a bulk operation
// Re-add the mods, in the new order
for cmod in &community_mods {
let community_moderator_form = CommunityModeratorForm {
community_id: cmod.community.id,
person_id: cmod.moderator.id,
};
CommunityModerator::join(&mut context.pool(), &community_moderator_form)
.await
.with_lemmy_type(LemmyErrorType::CommunityModeratorAlreadyExists)?;
}
// Mod tables
let form = ModTransferCommunityForm {
mod_person_id: local_user_view.person.id,
other_person_id: data.person_id,
community_id: data.community_id,
};
ModTransferCommunity::create(&mut context.pool(), &form).await?;
let community_id = data.community_id;
let person_id = local_user_view.person.id;
let community_view =
CommunityView::read(&mut context.pool(), community_id, Some(person_id), false)
.await?
.ok_or(LemmyErrorType::CouldntFindCommunity)?;
let community_id = data.community_id;
let moderators = CommunityModeratorView::for_community(&mut context.pool(), community_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntFindCommunity)?;
// Return the jwt
Ok(Json(GetCommunityResponse {
community_view,
site: None,
moderators,
discussion_languages: vec![],
}))
}

277
crates/api/src/lib.rs Normal file
View File

@ -0,0 +1,277 @@
use activitypub_federation::config::Data;
use actix_web::{http::header::Header, HttpRequest};
use actix_web_httpauth::headers::authorization::{Authorization, Bearer};
use base64::{engine::general_purpose::STANDARD_NO_PAD as base64, Engine};
use captcha::Captcha;
use lemmy_api_common::{
claims::Claims,
community::BanFromCommunity,
context::LemmyContext,
send_activity::{ActivityChannel, SendActivityData},
utils::{check_expire_time, check_user_valid, local_site_to_slur_regex, AUTH_COOKIE_NAME},
};
use lemmy_db_schema::{
source::{
community::{
CommunityFollower,
CommunityFollowerForm,
CommunityPersonBan,
CommunityPersonBanForm,
},
local_site::LocalSite,
moderator::{ModBanFromCommunity, ModBanFromCommunityForm},
person::Person,
},
traits::{Bannable, Crud, Followable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::{
error::{LemmyErrorExt, LemmyErrorExt2, LemmyErrorType, LemmyResult},
utils::slurs::check_slurs,
};
use std::io::Cursor;
use totp_rs::{Secret, TOTP};
pub mod comment;
pub mod comment_report;
pub mod community;
pub mod local_user;
pub mod post;
pub mod post_report;
pub mod private_message;
pub mod private_message_report;
pub mod site;
pub mod sitemap;
/// Converts the captcha to a base64 encoded wav audio file
#[allow(deprecated)]
pub(crate) fn captcha_as_wav_base64(captcha: &Captcha) -> LemmyResult<String> {
let letters = captcha.as_wav();
// Decode each wav file, concatenate the samples
let mut concat_samples: Vec<i16> = Vec::new();
let mut any_header: Option<wav::Header> = None;
for letter in letters {
let mut cursor = Cursor::new(letter.unwrap_or_default());
let (header, samples) = wav::read(&mut cursor)?;
any_header = Some(header);
if let Some(samples16) = samples.as_sixteen() {
concat_samples.extend(samples16);
} else {
Err(LemmyErrorType::CouldntCreateAudioCaptcha)?
}
}
// Encode the concatenated result as a wav file
let mut output_buffer = Cursor::new(vec![]);
if let Some(header) = any_header {
wav::write(
header,
&wav::BitDepth::Sixteen(concat_samples),
&mut output_buffer,
)
.with_lemmy_type(LemmyErrorType::CouldntCreateAudioCaptcha)?;
Ok(base64.encode(output_buffer.into_inner()))
} else {
Err(LemmyErrorType::CouldntCreateAudioCaptcha)?
}
}
/// Check size of report
pub(crate) fn check_report_reason(reason: &str, local_site: &LocalSite) -> LemmyResult<()> {
let slur_regex = &local_site_to_slur_regex(local_site);
check_slurs(reason, slur_regex)?;
if reason.is_empty() {
Err(LemmyErrorType::ReportReasonRequired)?
} else if reason.chars().count() > 1000 {
Err(LemmyErrorType::ReportTooLong)?
} else {
Ok(())
}
}
pub fn read_auth_token(req: &HttpRequest) -> LemmyResult<Option<String>> {
// Try reading jwt from auth header
if let Ok(header) = Authorization::<Bearer>::parse(req) {
Ok(Some(header.as_ref().token().to_string()))
}
// If that fails, try to read from cookie
else if let Some(cookie) = &req.cookie(AUTH_COOKIE_NAME) {
Ok(Some(cookie.value().to_string()))
}
// Otherwise, there's no auth
else {
Ok(None)
}
}
pub(crate) fn check_totp_2fa_valid(
local_user_view: &LocalUserView,
totp_token: &Option<String>,
site_name: &str,
) -> LemmyResult<()> {
// Throw an error if their token is missing
let token = totp_token
.as_deref()
.ok_or(LemmyErrorType::MissingTotpToken)?;
let secret = local_user_view
.local_user
.totp_2fa_secret
.as_deref()
.ok_or(LemmyErrorType::MissingTotpSecret)?;
let totp = build_totp_2fa(site_name, &local_user_view.person.name, secret)?;
let check_passed = totp.check_current(token)?;
if !check_passed {
return Err(LemmyErrorType::IncorrectTotpToken.into());
}
Ok(())
}
pub(crate) fn generate_totp_2fa_secret() -> String {
Secret::generate_secret().to_string()
}
fn build_totp_2fa(hostname: &str, username: &str, secret: &str) -> LemmyResult<TOTP> {
let sec = Secret::Raw(secret.as_bytes().to_vec());
let sec_bytes = sec
.to_bytes()
.map_err(|_| LemmyErrorType::CouldntParseTotpSecret)?;
TOTP::new(
totp_rs::Algorithm::SHA1,
6,
1,
30,
sec_bytes,
Some(hostname.to_string()),
username.to_string(),
)
.with_lemmy_type(LemmyErrorType::CouldntGenerateTotp)
}
/// Site bans are only federated for local users.
/// This is a problem, because site-banning non-local users will still leave content
/// they've posted to our local communities, on other servers.
///
/// So when doing a site ban for a non-local user, you need to federate/send a
/// community ban for every local community they've participated in.
/// See https://github.com/LemmyNet/lemmy/issues/4118
#[tracing::instrument(skip_all)]
pub(crate) async fn ban_nonlocal_user_from_local_communities(
local_user_view: &LocalUserView,
target: &Person,
ban: bool,
reason: &Option<String>,
remove_data: &Option<bool>,
expires: &Option<i64>,
context: &Data<LemmyContext>,
) -> LemmyResult<()> {
// Only run this code for federated users
if !target.local {
let ids = Person::list_local_community_ids(&mut context.pool(), target.id).await?;
for community_id in ids {
let expires_dt = check_expire_time(*expires)?;
// Ban / unban them from our local communities
let community_user_ban_form = CommunityPersonBanForm {
community_id,
person_id: target.id,
expires: Some(expires_dt),
};
if ban {
// Ignore all errors for these
CommunityPersonBan::ban(&mut context.pool(), &community_user_ban_form)
.await
.ok();
// Also unsubscribe them from the community, if they are subscribed
let community_follower_form = CommunityFollowerForm {
community_id,
person_id: target.id,
pending: false,
};
CommunityFollower::unfollow(&mut context.pool(), &community_follower_form)
.await
.ok();
} else {
CommunityPersonBan::unban(&mut context.pool(), &community_user_ban_form)
.await
.ok();
}
// Mod tables
let form = ModBanFromCommunityForm {
mod_person_id: local_user_view.person.id,
other_person_id: target.id,
community_id,
reason: reason.clone(),
banned: Some(ban),
expires: expires_dt,
};
ModBanFromCommunity::create(&mut context.pool(), &form).await?;
// Federate the ban from community
let ban_from_community = BanFromCommunity {
community_id,
person_id: target.id,
ban,
reason: reason.clone(),
remove_data: *remove_data,
expires: *expires,
};
ActivityChannel::submit_activity(
SendActivityData::BanFromCommunity {
moderator: local_user_view.person.clone(),
community_id,
target: target.clone(),
data: ban_from_community,
},
context,
)
.await?;
}
}
Ok(())
}
#[tracing::instrument(skip_all)]
pub async fn local_user_view_from_jwt(
jwt: &str,
context: &LemmyContext,
) -> LemmyResult<LocalUserView> {
let local_user_id = Claims::validate(jwt, context)
.await
.with_lemmy_type(LemmyErrorType::NotLoggedIn)?;
let local_user_view = LocalUserView::read(&mut context.pool(), local_user_id)
.await?
.ok_or(LemmyErrorType::CouldntFindLocalUser)?;
check_user_valid(&local_user_view.person)?;
Ok(local_user_view)
}
#[cfg(test)]
#[allow(clippy::unwrap_used)]
#[allow(clippy::indexing_slicing)]
mod tests {
use super::*;
#[test]
fn test_build_totp() {
let generated_secret = generate_totp_2fa_secret();
let totp = build_totp_2fa("lemmy.ml", "my_name", &generated_secret);
assert!(totp.is_ok());
}
}

View File

@ -0,0 +1,55 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::{AddAdmin, AddAdminResponse},
utils::is_admin,
};
use lemmy_db_schema::{
source::{
local_user::{LocalUser, LocalUserUpdateForm},
moderator::{ModAdd, ModAddForm},
},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::PersonView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn add_admin(
data: Json<AddAdmin>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<AddAdminResponse>> {
// Make sure user is an admin
is_admin(&local_user_view)?;
// Make sure that the person_id added is local
let added_local_user = LocalUserView::read_person(&mut context.pool(), data.person_id)
.await?
.ok_or(LemmyErrorType::ObjectNotLocal)?;
LocalUser::update(
&mut context.pool(),
added_local_user.local_user.id,
&LocalUserUpdateForm {
admin: Some(data.added),
..Default::default()
},
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
// Mod tables
let form = ModAddForm {
mod_person_id: local_user_view.person.id,
other_person_id: added_local_user.person.id,
removed: Some(!data.added),
};
ModAdd::create(&mut context.pool(), &form).await?;
let admins = PersonView::admins(&mut context.pool()).await?;
Ok(Json(AddAdminResponse { admins }))
}

View File

@ -0,0 +1,105 @@
use crate::ban_nonlocal_user_from_local_communities;
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
context::LemmyContext,
person::{BanPerson, BanPersonResponse},
send_activity::{ActivityChannel, SendActivityData},
utils::{check_expire_time, is_admin, remove_user_data},
};
use lemmy_db_schema::{
source::{
login_token::LoginToken,
moderator::{ModBan, ModBanForm},
person::{Person, PersonUpdateForm},
},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::PersonView;
use lemmy_utils::{
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
utils::validation::is_valid_body_field,
};
#[tracing::instrument(skip(context))]
pub async fn ban_from_site(
data: Json<BanPerson>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<BanPersonResponse>> {
// Make sure user is an admin
is_admin(&local_user_view)?;
is_valid_body_field(&data.reason, false)?;
let expires = check_expire_time(data.expires)?;
let person = Person::update(
&mut context.pool(),
data.person_id,
&PersonUpdateForm {
banned: Some(data.ban),
ban_expires: Some(expires),
..Default::default()
},
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
// if its a local user, invalidate logins
let local_user = LocalUserView::read_person(&mut context.pool(), person.id).await;
if let Ok(Some(local_user)) = local_user {
LoginToken::invalidate_all(&mut context.pool(), local_user.local_user.id).await?;
}
// Remove their data if that's desired
let remove_data = data.remove_data.unwrap_or(false);
if remove_data {
remove_user_data(person.id, &context).await?;
}
// Mod tables
let form = ModBanForm {
mod_person_id: local_user_view.person.id,
other_person_id: person.id,
reason: data.reason.clone(),
banned: Some(data.ban),
expires,
};
ModBan::create(&mut context.pool(), &form).await?;
let person_view = PersonView::read(&mut context.pool(), person.id)
.await?
.ok_or(LemmyErrorType::CouldntFindPerson)?;
ban_nonlocal_user_from_local_communities(
&local_user_view,
&person,
data.ban,
&data.reason,
&data.remove_data,
&data.expires,
&context,
)
.await?;
ActivityChannel::submit_activity(
SendActivityData::BanFromSite {
moderator: local_user_view.person,
banned_user: person_view.person.clone(),
reason: data.reason.clone(),
remove_data: data.remove_data,
ban: data.ban,
expires: data.expires,
},
&context,
)
.await?;
Ok(Json(BanPersonResponse {
person_view,
banned: data.ban,
}))
}

View File

@ -0,0 +1,59 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::{BlockPerson, BlockPersonResponse},
};
use lemmy_db_schema::{
source::person_block::{PersonBlock, PersonBlockForm},
traits::Blockable,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::PersonView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn block_person(
data: Json<BlockPerson>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<BlockPersonResponse>> {
let target_id = data.person_id;
let person_id = local_user_view.person.id;
// Don't let a person block themselves
if target_id == person_id {
Err(LemmyErrorType::CantBlockYourself)?
}
let person_block_form = PersonBlockForm {
person_id,
target_id,
};
let target_user = LocalUserView::read_person(&mut context.pool(), target_id)
.await
.ok()
.flatten();
if target_user.is_some_and(|t| t.local_user.admin) {
Err(LemmyErrorType::CantBlockAdmin)?
}
if data.block {
PersonBlock::block(&mut context.pool(), &person_block_form)
.await
.with_lemmy_type(LemmyErrorType::PersonBlockAlreadyExists)?;
} else {
PersonBlock::unblock(&mut context.pool(), &person_block_form)
.await
.with_lemmy_type(LemmyErrorType::PersonBlockAlreadyExists)?;
}
let person_view = PersonView::read(&mut context.pool(), target_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPerson)?;
Ok(Json(BlockPersonResponse {
person_view,
blocked: data.block,
}))
}

View File

@ -0,0 +1,53 @@
use actix_web::{
web::{Data, Json},
HttpRequest,
};
use bcrypt::verify;
use lemmy_api_common::{
claims::Claims,
context::LemmyContext,
person::{ChangePassword, LoginResponse},
utils::password_length_check,
};
use lemmy_db_schema::source::{local_user::LocalUser, login_token::LoginToken};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn change_password(
data: Json<ChangePassword>,
req: HttpRequest,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<LoginResponse>> {
password_length_check(&data.new_password)?;
// Make sure passwords match
if data.new_password != data.new_password_verify {
Err(LemmyErrorType::PasswordsDoNotMatch)?
}
// Check the old password
let valid: bool = verify(
&data.old_password,
&local_user_view.local_user.password_encrypted,
)
.unwrap_or(false);
if !valid {
Err(LemmyErrorType::IncorrectLogin)?
}
let local_user_id = local_user_view.local_user.id;
let new_password = data.new_password.clone();
let updated_local_user =
LocalUser::update_password(&mut context.pool(), local_user_id, &new_password).await?;
LoginToken::invalidate_all(&mut context.pool(), local_user_view.local_user.id).await?;
// Return the jwt
Ok(Json(LoginResponse {
jwt: Some(Claims::generate(updated_local_user.id, req, &context).await?),
verify_email_sent: false,
registration_created: false,
}))
}

View File

@ -0,0 +1,43 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::PasswordChangeAfterReset,
utils::password_length_check,
SuccessResponse,
};
use lemmy_db_schema::source::{
local_user::LocalUser,
login_token::LoginToken,
password_reset_request::PasswordResetRequest,
};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn change_password_after_reset(
data: Json<PasswordChangeAfterReset>,
context: Data<LemmyContext>,
) -> LemmyResult<Json<SuccessResponse>> {
// Fetch the user_id from the token
let token = data.token.clone();
let local_user_id = PasswordResetRequest::read_and_delete(&mut context.pool(), &token)
.await?
.ok_or(LemmyErrorType::TokenNotFound)?
.local_user_id;
password_length_check(&data.password)?;
// Make sure passwords match
if data.password != data.password_verify {
Err(LemmyErrorType::PasswordsDoNotMatch)?
}
// Update the user with the new password
let password = data.password.clone();
LocalUser::update_password(&mut context.pool(), local_user_id, &password)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
LoginToken::invalidate_all(&mut context.pool(), local_user_id).await?;
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,42 @@
use crate::{build_totp_2fa, generate_totp_2fa_secret};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{context::LemmyContext, person::GenerateTotpSecretResponse};
use lemmy_db_schema::source::local_user::{LocalUser, LocalUserUpdateForm};
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
/// Generate a new secret for two-factor-authentication. Afterwards you need to call [toggle_totp]
/// to enable it. This can only be called if 2FA is currently disabled.
#[tracing::instrument(skip(context))]
pub async fn generate_totp_secret(
local_user_view: LocalUserView,
context: Data<LemmyContext>,
) -> LemmyResult<Json<GenerateTotpSecretResponse>> {
let site_view = SiteView::read_local(&mut context.pool())
.await?
.ok_or(LemmyErrorType::LocalSiteNotSetup)?;
if local_user_view.local_user.totp_2fa_enabled {
return Err(LemmyErrorType::TotpAlreadyEnabled)?;
}
let secret = generate_totp_2fa_secret();
let secret_url =
build_totp_2fa(&site_view.site.name, &local_user_view.person.name, &secret)?.get_url();
let local_user_form = LocalUserUpdateForm {
totp_2fa_secret: Some(Some(secret)),
..Default::default()
};
LocalUser::update(
&mut context.pool(),
local_user_view.local_user.id,
&local_user_form,
)
.await?;
Ok(Json(GenerateTotpSecretResponse {
totp_secret_url: secret_url.into(),
}))
}

View File

@ -0,0 +1,56 @@
use crate::captcha_as_wav_base64;
use actix_web::{
http::{
header::{CacheControl, CacheDirective},
StatusCode,
},
web::{Data, Json},
HttpResponse,
HttpResponseBuilder,
};
use captcha::{gen, Difficulty};
use lemmy_api_common::{
context::LemmyContext,
person::{CaptchaResponse, GetCaptchaResponse},
};
use lemmy_db_schema::source::{
captcha_answer::{CaptchaAnswer, CaptchaAnswerForm},
local_site::LocalSite,
};
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn get_captcha(context: Data<LemmyContext>) -> LemmyResult<HttpResponse> {
let local_site = LocalSite::read(&mut context.pool()).await?;
let mut res = HttpResponseBuilder::new(StatusCode::OK);
res.insert_header(CacheControl(vec![CacheDirective::NoStore]));
if !local_site.captcha_enabled {
return Ok(res.json(Json(GetCaptchaResponse { ok: None })));
}
let captcha = gen(match local_site.captcha_difficulty.as_str() {
"easy" => Difficulty::Easy,
"hard" => Difficulty::Hard,
_ => Difficulty::Medium,
});
let answer = captcha.chars_as_string();
let png = captcha.as_base64().expect("failed to generate captcha");
let wav = captcha_as_wav_base64(&captcha)?;
let captcha_form: CaptchaAnswerForm = CaptchaAnswerForm { answer };
// Stores the captcha item in the db
let captcha = CaptchaAnswer::insert(&mut context.pool(), &captcha_form).await?;
let json = Json(GetCaptchaResponse {
ok: Some(CaptchaResponse {
png,
wav,
uuid: captcha.uuid.to_string(),
}),
});
Ok(res.json(json))
}

View File

@ -0,0 +1,17 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{context::LemmyContext, person::BannedPersonsResponse, utils::is_admin};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::PersonView;
use lemmy_utils::error::LemmyResult;
pub async fn list_banned_users(
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<BannedPersonsResponse>> {
// Make sure user is an admin
is_admin(&local_user_view)?;
let banned = PersonView::banned(&mut context.pool()).await?;
Ok(Json(BannedPersonsResponse { banned }))
}

View File

@ -0,0 +1,14 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::context::LemmyContext;
use lemmy_db_schema::source::login_token::LoginToken;
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::LemmyResult;
pub async fn list_logins(
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<Vec<LoginToken>>> {
let logins = LoginToken::list(&mut context.pool(), local_user_view.local_user.id).await?;
Ok(Json(logins))
}

View File

@ -0,0 +1,25 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
context::LemmyContext,
person::{ListMedia, ListMediaResponse},
};
use lemmy_db_views::structs::{LocalImageView, LocalUserView};
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn list_media(
data: Query<ListMedia>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<ListMediaResponse>> {
let page = data.page;
let limit = data.limit;
let images = LocalImageView::get_all_paged_by_local_user_id(
&mut context.pool(),
local_user_view.local_user.id,
page,
limit,
)
.await?;
Ok(Json(ListMediaResponse { images }))
}

View File

@ -0,0 +1,94 @@
use crate::{check_totp_2fa_valid, local_user::check_email_verified};
use actix_web::{
web::{Data, Json},
HttpRequest,
};
use bcrypt::verify;
use lemmy_api_common::{
claims::Claims,
context::LemmyContext,
person::{Login, LoginResponse},
utils::check_user_valid,
};
use lemmy_db_schema::{
source::{local_site::LocalSite, registration_application::RegistrationApplication},
utils::DbPool,
RegistrationMode,
};
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn login(
data: Json<Login>,
req: HttpRequest,
context: Data<LemmyContext>,
) -> LemmyResult<Json<LoginResponse>> {
let site_view = SiteView::read_local(&mut context.pool())
.await?
.ok_or(LemmyErrorType::LocalSiteNotSetup)?;
// Fetch that username / email
let username_or_email = data.username_or_email.clone();
let local_user_view =
LocalUserView::find_by_email_or_name(&mut context.pool(), &username_or_email)
.await?
.ok_or(LemmyErrorType::IncorrectLogin)?;
// Verify the password
let valid: bool = verify(
&data.password,
&local_user_view.local_user.password_encrypted,
)
.unwrap_or(false);
if !valid {
Err(LemmyErrorType::IncorrectLogin)?
}
check_user_valid(&local_user_view.person)?;
check_email_verified(&local_user_view, &site_view)?;
check_registration_application(&local_user_view, &site_view.local_site, &mut context.pool())
.await?;
// Check the totp if enabled
if local_user_view.local_user.totp_2fa_enabled {
check_totp_2fa_valid(
&local_user_view,
&data.totp_2fa_token,
&context.settings().hostname,
)?;
}
let jwt = Claims::generate(local_user_view.local_user.id, req, &context).await?;
Ok(Json(LoginResponse {
jwt: Some(jwt.clone()),
verify_email_sent: false,
registration_created: false,
}))
}
async fn check_registration_application(
local_user_view: &LocalUserView,
local_site: &LocalSite,
pool: &mut DbPool<'_>,
) -> LemmyResult<()> {
if (local_site.registration_mode == RegistrationMode::RequireApplication
|| local_site.registration_mode == RegistrationMode::Closed)
&& !local_user_view.local_user.accepted_application
&& !local_user_view.local_user.admin
{
// Fetch the registration application. If no admin id is present its still pending. Otherwise it
// was processed (either accepted or denied).
let local_user_id = local_user_view.local_user.id;
let registration = RegistrationApplication::find_by_local_user_id(pool, local_user_id)
.await?
.ok_or(LemmyErrorType::CouldntFindRegistrationApplication)?;
if registration.admin_id.is_some() {
Err(LemmyErrorType::RegistrationDenied(registration.deny_reason))?
} else {
Err(LemmyErrorType::RegistrationApplicationIsPending)?
}
}
Ok(())
}

View File

@ -0,0 +1,23 @@
use crate::read_auth_token;
use activitypub_federation::config::Data;
use actix_web::{cookie::Cookie, HttpRequest, HttpResponse};
use lemmy_api_common::{context::LemmyContext, utils::AUTH_COOKIE_NAME, SuccessResponse};
use lemmy_db_schema::source::login_token::LoginToken;
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn logout(
req: HttpRequest,
// require login
_local_user_view: LocalUserView,
context: Data<LemmyContext>,
) -> LemmyResult<HttpResponse> {
let jwt = read_auth_token(&req)?.ok_or(LemmyErrorType::NotLoggedIn)?;
LoginToken::invalidate(&mut context.pool(), &jwt).await?;
let mut res = HttpResponse::Ok().json(SuccessResponse::default());
let cookie = Cookie::new(AUTH_COOKIE_NAME, "");
res.add_removal_cookie(&cookie)?;
Ok(res)
}

View File

@ -0,0 +1,34 @@
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::{error::LemmyResult, LemmyErrorType};
pub mod add_admin;
pub mod ban_person;
pub mod block;
pub mod change_password;
pub mod change_password_after_reset;
pub mod generate_totp_secret;
pub mod get_captcha;
pub mod list_banned;
pub mod list_logins;
pub mod list_media;
pub mod login;
pub mod logout;
pub mod notifications;
pub mod report_count;
pub mod reset_password;
pub mod save_settings;
pub mod update_totp;
pub mod validate_auth;
pub mod verify_email;
/// Check if the user's email is verified if email verification is turned on
/// However, skip checking verification if the user is an admin
fn check_email_verified(local_user_view: &LocalUserView, site_view: &SiteView) -> LemmyResult<()> {
if !local_user_view.local_user.admin
&& site_view.local_site.require_email_verification
&& !local_user_view.local_user.email_verified
{
Err(LemmyErrorType::EmailNotVerified)?
}
Ok(())
}

View File

@ -0,0 +1,36 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
context::LemmyContext,
person::{GetPersonMentions, GetPersonMentionsResponse},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::person_mention_view::PersonMentionQuery;
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn list_mentions(
data: Query<GetPersonMentions>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<GetPersonMentionsResponse>> {
let sort = data.sort;
let page = data.page;
let limit = data.limit;
let unread_only = data.unread_only.unwrap_or_default();
let person_id = Some(local_user_view.person.id);
let show_bot_accounts = local_user_view.local_user.show_bot_accounts;
let mentions = PersonMentionQuery {
recipient_id: person_id,
my_person_id: person_id,
sort,
unread_only,
show_bot_accounts,
page,
limit,
}
.list(&mut context.pool())
.await?;
Ok(Json(GetPersonMentionsResponse { mentions }))
}

View File

@ -0,0 +1,36 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
context::LemmyContext,
person::{GetReplies, GetRepliesResponse},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::comment_reply_view::CommentReplyQuery;
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn list_replies(
data: Query<GetReplies>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<GetRepliesResponse>> {
let sort = data.sort;
let page = data.page;
let limit = data.limit;
let unread_only = data.unread_only.unwrap_or_default();
let person_id = Some(local_user_view.person.id);
let show_bot_accounts = local_user_view.local_user.show_bot_accounts;
let replies = CommentReplyQuery {
recipient_id: person_id,
my_person_id: person_id,
sort,
unread_only,
show_bot_accounts,
page,
limit,
}
.list(&mut context.pool())
.await?;
Ok(Json(GetRepliesResponse { replies }))
}

View File

@ -0,0 +1,34 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{context::LemmyContext, person::GetRepliesResponse};
use lemmy_db_schema::source::{
comment_reply::CommentReply,
person_mention::PersonMention,
private_message::PrivateMessage,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn mark_all_notifications_read(
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<GetRepliesResponse>> {
let person_id = local_user_view.person.id;
// Mark all comment_replies as read
CommentReply::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
// Mark all user mentions as read
PersonMention::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
// Mark all private_messages as read
PrivateMessage::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdatePrivateMessage)?;
Ok(Json(GetRepliesResponse { replies: vec![] }))
}

View File

@ -0,0 +1,49 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::{MarkPersonMentionAsRead, PersonMentionResponse},
};
use lemmy_db_schema::{
source::person_mention::{PersonMention, PersonMentionUpdateForm},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::PersonMentionView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn mark_person_mention_as_read(
data: Json<MarkPersonMentionAsRead>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<PersonMentionResponse>> {
let person_mention_id = data.person_mention_id;
let read_person_mention = PersonMention::read(&mut context.pool(), person_mention_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPersonMention)?;
if local_user_view.person.id != read_person_mention.recipient_id {
Err(LemmyErrorType::CouldntUpdateComment)?
}
let person_mention_id = read_person_mention.id;
let read = Some(data.read);
PersonMention::update(
&mut context.pool(),
person_mention_id,
&PersonMentionUpdateForm { read },
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
let person_mention_id = read_person_mention.id;
let person_id = local_user_view.person.id;
let person_mention_view =
PersonMentionView::read(&mut context.pool(), person_mention_id, Some(person_id))
.await?
.ok_or(LemmyErrorType::CouldntFindPersonMention)?;
Ok(Json(PersonMentionResponse {
person_mention_view,
}))
}

View File

@ -0,0 +1,48 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::{CommentReplyResponse, MarkCommentReplyAsRead},
};
use lemmy_db_schema::{
source::comment_reply::{CommentReply, CommentReplyUpdateForm},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_db_views_actor::structs::CommentReplyView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn mark_reply_as_read(
data: Json<MarkCommentReplyAsRead>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<CommentReplyResponse>> {
let comment_reply_id = data.comment_reply_id;
let read_comment_reply = CommentReply::read(&mut context.pool(), comment_reply_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommentReply)?;
if local_user_view.person.id != read_comment_reply.recipient_id {
Err(LemmyErrorType::CouldntUpdateComment)?
}
let comment_reply_id = read_comment_reply.id;
let read = Some(data.read);
CommentReply::update(
&mut context.pool(),
comment_reply_id,
&CommentReplyUpdateForm { read },
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
let comment_reply_id = read_comment_reply.id;
let person_id = local_user_view.person.id;
let comment_reply_view =
CommentReplyView::read(&mut context.pool(), comment_reply_id, Some(person_id))
.await?
.ok_or(LemmyErrorType::CouldntFindCommentReply)?;
Ok(Json(CommentReplyResponse { comment_reply_view }))
}

View File

@ -0,0 +1,6 @@
pub mod list_mentions;
pub mod list_replies;
pub mod mark_all_read;
pub mod mark_mention_read;
pub mod mark_reply_read;
pub mod unread_count;

View File

@ -0,0 +1,26 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{context::LemmyContext, person::GetUnreadCountResponse};
use lemmy_db_views::structs::{LocalUserView, PrivateMessageView};
use lemmy_db_views_actor::structs::{CommentReplyView, PersonMentionView};
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn unread_count(
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<GetUnreadCountResponse>> {
let person_id = local_user_view.person.id;
let replies = CommentReplyView::get_unread_replies(&mut context.pool(), person_id).await?;
let mentions = PersonMentionView::get_unread_mentions(&mut context.pool(), person_id).await?;
let private_messages =
PrivateMessageView::get_unread_messages(&mut context.pool(), person_id).await?;
Ok(Json(GetUnreadCountResponse {
replies,
mentions,
private_messages,
}))
}

View File

@ -0,0 +1,46 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
context::LemmyContext,
person::{GetReportCount, GetReportCountResponse},
utils::check_community_mod_of_any_or_admin_action,
};
use lemmy_db_views::structs::{
CommentReportView,
LocalUserView,
PostReportView,
PrivateMessageReportView,
};
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn report_count(
data: Query<GetReportCount>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<GetReportCountResponse>> {
let person_id = local_user_view.person.id;
let admin = local_user_view.local_user.admin;
let community_id = data.community_id;
check_community_mod_of_any_or_admin_action(&local_user_view, &mut context.pool()).await?;
let comment_reports =
CommentReportView::get_report_count(&mut context.pool(), person_id, admin, community_id)
.await?;
let post_reports =
PostReportView::get_report_count(&mut context.pool(), person_id, admin, community_id).await?;
let private_message_reports = if admin && community_id.is_none() {
Some(PrivateMessageReportView::get_report_count(&mut context.pool()).await?)
} else {
None
};
Ok(Json(GetReportCountResponse {
community_id,
comment_reports,
post_reports,
private_message_reports,
}))
}

View File

@ -0,0 +1,31 @@
use crate::local_user::check_email_verified;
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::PasswordReset,
utils::send_password_reset_email,
SuccessResponse,
};
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
#[tracing::instrument(skip(context))]
pub async fn reset_password(
data: Json<PasswordReset>,
context: Data<LemmyContext>,
) -> LemmyResult<Json<SuccessResponse>> {
// Fetch that email
let email = data.email.to_lowercase();
let local_user_view = LocalUserView::find_by_email(&mut context.pool(), &email)
.await?
.ok_or(LemmyErrorType::IncorrectLogin)?;
let site_view = SiteView::read_local(&mut context.pool())
.await?
.ok_or(LemmyErrorType::LocalSiteNotSetup)?;
check_email_verified(&local_user_view, &site_view)?;
// Email the pure token to the user.
send_password_reset_email(&local_user_view, &mut context.pool(), context.settings()).await?;
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,159 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
context::LemmyContext,
person::SaveUserSettings,
request::replace_image,
utils::{
get_url_blocklist,
local_site_to_slur_regex,
process_markdown_opt,
proxy_image_link_opt_api,
send_verification_email,
},
SuccessResponse,
};
use lemmy_db_schema::{
source::{
actor_language::LocalUserLanguage,
local_user::{LocalUser, LocalUserUpdateForm},
local_user_vote_display_mode::{LocalUserVoteDisplayMode, LocalUserVoteDisplayModeUpdateForm},
person::{Person, PersonUpdateForm},
},
traits::Crud,
utils::diesel_option_overwrite,
};
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::{
error::{LemmyErrorType, LemmyResult},
utils::validation::{is_valid_bio_field, is_valid_display_name, is_valid_matrix_id},
};
use std::ops::Deref;
#[tracing::instrument(skip(context))]
pub async fn save_user_settings(
data: Json<SaveUserSettings>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<SuccessResponse>> {
let site_view = SiteView::read_local(&mut context.pool())
.await?
.ok_or(LemmyErrorType::LocalSiteNotSetup)?;
let slur_regex = local_site_to_slur_regex(&site_view.local_site);
let url_blocklist = get_url_blocklist(&context).await?;
let bio = diesel_option_overwrite(
process_markdown_opt(&data.bio, &slur_regex, &url_blocklist, &context).await?,
);
replace_image(&data.avatar, &local_user_view.person.avatar, &context).await?;
replace_image(&data.banner, &local_user_view.person.banner, &context).await?;
let avatar = proxy_image_link_opt_api(&data.avatar, &context).await?;
let banner = proxy_image_link_opt_api(&data.banner, &context).await?;
let display_name = diesel_option_overwrite(data.display_name.clone());
let matrix_user_id = diesel_option_overwrite(data.matrix_user_id.clone());
let email_deref = data.email.as_deref().map(str::to_lowercase);
let email = diesel_option_overwrite(email_deref.clone());
if let Some(Some(email)) = &email {
let previous_email = local_user_view.local_user.email.clone().unwrap_or_default();
// if email was changed, check that it is not taken and send verification mail
if previous_email.deref() != email {
if LocalUser::is_email_taken(&mut context.pool(), email).await? {
return Err(LemmyErrorType::EmailAlreadyExists)?;
}
send_verification_email(
&local_user_view,
email,
&mut context.pool(),
context.settings(),
)
.await?;
}
}
// When the site requires email, make sure email is not Some(None). IE, an overwrite to a None
// value
if let Some(email) = &email {
if email.is_none() && site_view.local_site.require_email_verification {
Err(LemmyErrorType::EmailRequired)?
}
}
if let Some(Some(bio)) = &bio {
is_valid_bio_field(bio)?;
}
if let Some(Some(display_name)) = &display_name {
is_valid_display_name(
display_name.trim(),
site_view.local_site.actor_name_max_length as usize,
)?;
}
if let Some(Some(matrix_user_id)) = &matrix_user_id {
is_valid_matrix_id(matrix_user_id)?;
}
let local_user_id = local_user_view.local_user.id;
let person_id = local_user_view.person.id;
let default_listing_type = data.default_listing_type;
let default_sort_type = data.default_sort_type;
let person_form = PersonUpdateForm {
display_name,
bio,
matrix_user_id,
bot_account: data.bot_account,
avatar,
banner,
..Default::default()
};
// Ignore errors, because 'no fields updated' will return an error.
// https://github.com/LemmyNet/lemmy/issues/4076
Person::update(&mut context.pool(), person_id, &person_form)
.await
.ok();
if let Some(discussion_languages) = data.discussion_languages.clone() {
LocalUserLanguage::update(&mut context.pool(), discussion_languages, local_user_id).await?;
}
let local_user_form = LocalUserUpdateForm {
email,
show_avatars: data.show_avatars,
show_read_posts: data.show_read_posts,
send_notifications_to_email: data.send_notifications_to_email,
show_nsfw: data.show_nsfw,
blur_nsfw: data.blur_nsfw,
auto_expand: data.auto_expand,
show_bot_accounts: data.show_bot_accounts,
show_scores: data.show_scores,
default_sort_type,
default_listing_type,
theme: data.theme.clone(),
interface_language: data.interface_language.clone(),
open_links_in_new_tab: data.open_links_in_new_tab,
infinite_scroll_enabled: data.infinite_scroll_enabled,
post_listing_mode: data.post_listing_mode,
enable_keyboard_navigation: data.enable_keyboard_navigation,
enable_animated_images: data.enable_animated_images,
collapse_bot_comments: data.collapse_bot_comments,
..Default::default()
};
LocalUser::update(&mut context.pool(), local_user_id, &local_user_form).await?;
// Update the vote display modes
let vote_display_modes_form = LocalUserVoteDisplayModeUpdateForm {
score: data.show_scores,
upvotes: data.show_upvotes,
downvotes: data.show_downvotes,
upvote_percentage: data.show_upvote_percentage,
};
LocalUserVoteDisplayMode::update(&mut context.pool(), local_user_id, &vote_display_modes_form)
.await?;
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,49 @@
use crate::check_totp_2fa_valid;
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::{UpdateTotp, UpdateTotpResponse},
};
use lemmy_db_schema::source::local_user::{LocalUser, LocalUserUpdateForm};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::LemmyResult;
/// Enable or disable two-factor-authentication. The current setting is determined from
/// [LocalUser.totp_2fa_enabled].
///
/// To enable, you need to first call [generate_totp_secret] and then pass a valid token to this
/// function.
///
/// Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid
/// token.
#[tracing::instrument(skip(context))]
pub async fn update_totp(
data: Json<UpdateTotp>,
local_user_view: LocalUserView,
context: Data<LemmyContext>,
) -> LemmyResult<Json<UpdateTotpResponse>> {
check_totp_2fa_valid(
&local_user_view,
&Some(data.totp_token.clone()),
&context.settings().hostname,
)?;
// toggle the 2fa setting
let local_user_form = LocalUserUpdateForm {
totp_2fa_enabled: Some(data.enabled),
// if totp is enabled, leave unchanged. otherwise clear secret
totp_2fa_secret: if data.enabled { None } else { Some(None) },
..Default::default()
};
LocalUser::update(
&mut context.pool(),
local_user_view.local_user.id,
&local_user_form,
)
.await?;
Ok(Json(UpdateTotpResponse {
enabled: data.enabled,
}))
}

View File

@ -0,0 +1,23 @@
use crate::{local_user_view_from_jwt, read_auth_token};
use actix_web::{
web::{Data, Json},
HttpRequest,
};
use lemmy_api_common::{context::LemmyContext, SuccessResponse};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
/// Returns an error message if the auth token is invalid for any reason. Necessary because other
/// endpoints silently treat any call with invalid auth as unauthenticated.
#[tracing::instrument(skip(context))]
pub async fn validate_auth(
req: HttpRequest,
context: Data<LemmyContext>,
) -> LemmyResult<Json<SuccessResponse>> {
let jwt = read_auth_token(&req)?;
if let Some(jwt) = jwt {
local_user_view_from_jwt(&jwt, &context).await?;
} else {
Err(LemmyErrorType::NotLoggedIn)?;
}
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,60 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{
context::LemmyContext,
person::VerifyEmail,
utils::send_new_applicant_email_to_admins,
SuccessResponse,
};
use lemmy_db_schema::{
source::{
email_verification::EmailVerification,
local_user::{LocalUser, LocalUserUpdateForm},
},
RegistrationMode,
};
use lemmy_db_views::structs::{LocalUserView, SiteView};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
pub async fn verify_email(
data: Json<VerifyEmail>,
context: Data<LemmyContext>,
) -> LemmyResult<Json<SuccessResponse>> {
let site_view = SiteView::read_local(&mut context.pool())
.await?
.ok_or(LemmyErrorType::LocalSiteNotSetup)?;
let token = data.token.clone();
let verification = EmailVerification::read_for_token(&mut context.pool(), &token)
.await?
.ok_or(LemmyErrorType::TokenNotFound)?;
let form = LocalUserUpdateForm {
// necessary in case this is a new signup
email_verified: Some(true),
// necessary in case email of an existing user was changed
email: Some(Some(verification.email)),
..Default::default()
};
let local_user_id = verification.local_user_id;
LocalUser::update(&mut context.pool(), local_user_id, &form).await?;
EmailVerification::delete_old_tokens_for_local_user(&mut context.pool(), local_user_id).await?;
// send out notification about registration application to admins if enabled
if site_view.local_site.registration_mode == RegistrationMode::RequireApplication
&& site_view.local_site.application_email_admins
{
let local_user = LocalUserView::read(&mut context.pool(), local_user_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPerson)?;
send_new_applicant_email_to_admins(
&local_user.person.name,
&mut context.pool(),
context.settings(),
)
.await?;
}
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,82 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
build_response::build_post_response,
context::LemmyContext,
post::{FeaturePost, PostResponse},
send_activity::{ActivityChannel, SendActivityData},
utils::{check_community_mod_action, is_admin},
};
use lemmy_db_schema::{
source::{
moderator::{ModFeaturePost, ModFeaturePostForm},
post::{Post, PostUpdateForm},
},
traits::Crud,
PostFeatureType,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::{error::LemmyResult, LemmyErrorType};
#[tracing::instrument(skip(context))]
pub async fn feature_post(
data: Json<FeaturePost>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<PostResponse>> {
let post_id = data.post_id;
let orig_post = Post::read(&mut context.pool(), post_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPost)?;
check_community_mod_action(
&local_user_view.person,
orig_post.community_id,
false,
&mut context.pool(),
)
.await?;
if data.feature_type == PostFeatureType::Local {
is_admin(&local_user_view)?;
}
// Update the post
let post_id = data.post_id;
let new_post: PostUpdateForm = if data.feature_type == PostFeatureType::Community {
PostUpdateForm {
featured_community: Some(data.featured),
..Default::default()
}
} else {
PostUpdateForm {
featured_local: Some(data.featured),
..Default::default()
}
};
let post = Post::update(&mut context.pool(), post_id, &new_post).await?;
// Mod tables
let form = ModFeaturePostForm {
mod_person_id: local_user_view.person.id,
post_id: data.post_id,
featured: data.featured,
is_featured_community: data.feature_type == PostFeatureType::Community,
};
ModFeaturePost::create(&mut context.pool(), &form).await?;
ActivityChannel::submit_activity(
SendActivityData::FeaturePost(post, local_user_view.person.clone(), data.featured),
&context,
)
.await?;
build_post_response(
&context,
orig_post.community_id,
&local_user_view.person,
post_id,
)
.await
}

View File

@ -0,0 +1,17 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
context::LemmyContext,
post::{GetSiteMetadata, GetSiteMetadataResponse},
request::fetch_link_metadata,
};
use lemmy_utils::error::LemmyResult;
#[tracing::instrument(skip(context))]
pub async fn get_link_metadata(
data: Query<GetSiteMetadata>,
context: Data<LemmyContext>,
) -> LemmyResult<Json<GetSiteMetadataResponse>> {
let metadata = fetch_link_metadata(&data.url, &context).await?;
Ok(Json(GetSiteMetadataResponse { metadata }))
}

View File

@ -0,0 +1,34 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{context::LemmyContext, post::HidePost, SuccessResponse};
use lemmy_db_schema::source::post::PostHide;
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult, MAX_API_PARAM_ELEMENTS};
use std::collections::HashSet;
#[tracing::instrument(skip(context))]
pub async fn hide_post(
data: Json<HidePost>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<SuccessResponse>> {
let post_ids = HashSet::from_iter(data.post_ids.clone());
if post_ids.len() > MAX_API_PARAM_ELEMENTS {
Err(LemmyErrorType::TooManyItems)?;
}
let person_id = local_user_view.person.id;
// Mark the post as hidden / unhidden
if data.hide {
PostHide::hide(&mut context.pool(), post_ids, person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntHidePost)?;
} else {
PostHide::unhide(&mut context.pool(), post_ids, person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntHidePost)?;
}
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,96 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
build_response::build_post_response,
context::LemmyContext,
post::{CreatePostLike, PostResponse},
send_activity::{ActivityChannel, SendActivityData},
utils::{
check_bot_account,
check_community_user_action,
check_downvotes_enabled,
mark_post_as_read,
},
};
use lemmy_db_schema::{
source::{
community::Community,
local_site::LocalSite,
post::{Post, PostLike, PostLikeForm},
},
traits::{Crud, Likeable},
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use std::ops::Deref;
#[tracing::instrument(skip(context))]
pub async fn like_post(
data: Json<CreatePostLike>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<PostResponse>> {
let local_site = LocalSite::read(&mut context.pool()).await?;
// Don't do a downvote if site has downvotes disabled
check_downvotes_enabled(data.score, &local_site)?;
check_bot_account(&local_user_view.person)?;
// Check for a community ban
let post_id = data.post_id;
let post = Post::read(&mut context.pool(), post_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPost)?;
check_community_user_action(
&local_user_view.person,
post.community_id,
&mut context.pool(),
)
.await?;
let like_form = PostLikeForm {
post_id: data.post_id,
person_id: local_user_view.person.id,
score: data.score,
};
// Remove any likes first
let person_id = local_user_view.person.id;
PostLike::remove(&mut context.pool(), person_id, post_id).await?;
// Only add the like if the score isnt 0
let do_add = like_form.score != 0 && (like_form.score == 1 || like_form.score == -1);
if do_add {
PostLike::like(&mut context.pool(), &like_form)
.await
.with_lemmy_type(LemmyErrorType::CouldntLikePost)?;
}
// Mark the post as read
mark_post_as_read(person_id, post_id, &mut context.pool()).await?;
let community = Community::read(&mut context.pool(), post.community_id)
.await?
.ok_or(LemmyErrorType::CouldntFindCommunity)?;
ActivityChannel::submit_activity(
SendActivityData::LikePostOrComment {
object_id: post.ap_id,
actor: local_user_view.person.clone(),
community,
score: data.score,
},
&context,
)
.await?;
build_post_response(
context.deref(),
post.community_id,
&local_user_view.person,
post_id,
)
.await
}

View File

@ -0,0 +1,32 @@
use actix_web::web::{Data, Json, Query};
use lemmy_api_common::{
context::LemmyContext,
post::{ListPostLikes, ListPostLikesResponse},
utils::is_mod_or_admin,
};
use lemmy_db_schema::{source::post::Post, traits::Crud};
use lemmy_db_views::structs::{LocalUserView, VoteView};
use lemmy_utils::{error::LemmyResult, LemmyErrorType};
/// Lists likes for a post
#[tracing::instrument(skip(context))]
pub async fn list_post_likes(
data: Query<ListPostLikes>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<ListPostLikesResponse>> {
let post = Post::read(&mut context.pool(), data.post_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPost)?;
is_mod_or_admin(
&mut context.pool(),
&local_user_view.person,
post.community_id,
)
.await?;
let post_likes =
VoteView::list_for_post(&mut context.pool(), data.post_id, data.page, data.limit).await?;
Ok(Json(ListPostLikesResponse { post_likes }))
}

View File

@ -0,0 +1,73 @@
use activitypub_federation::config::Data;
use actix_web::web::Json;
use lemmy_api_common::{
build_response::build_post_response,
context::LemmyContext,
post::{LockPost, PostResponse},
send_activity::{ActivityChannel, SendActivityData},
utils::check_community_mod_action,
};
use lemmy_db_schema::{
source::{
moderator::{ModLockPost, ModLockPostForm},
post::{Post, PostUpdateForm},
},
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::{error::LemmyResult, LemmyErrorType};
#[tracing::instrument(skip(context))]
pub async fn lock_post(
data: Json<LockPost>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<PostResponse>> {
let post_id = data.post_id;
let orig_post = Post::read(&mut context.pool(), post_id)
.await?
.ok_or(LemmyErrorType::CouldntFindPost)?;
check_community_mod_action(
&local_user_view.person,
orig_post.community_id,
false,
&mut context.pool(),
)
.await?;
// Update the post
let post_id = data.post_id;
let locked = data.locked;
let post = Post::update(
&mut context.pool(),
post_id,
&PostUpdateForm {
locked: Some(locked),
..Default::default()
},
)
.await?;
// Mod tables
let form = ModLockPostForm {
mod_person_id: local_user_view.person.id,
post_id: data.post_id,
locked: Some(locked),
};
ModLockPost::create(&mut context.pool(), &form).await?;
ActivityChannel::submit_activity(
SendActivityData::LockPost(post, local_user_view.person.clone(), data.locked),
&context,
)
.await?;
build_post_response(
&context,
orig_post.community_id,
&local_user_view.person,
post_id,
)
.await
}

View File

@ -0,0 +1,34 @@
use actix_web::web::{Data, Json};
use lemmy_api_common::{context::LemmyContext, post::MarkPostAsRead, SuccessResponse};
use lemmy_db_schema::source::post::PostRead;
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult, MAX_API_PARAM_ELEMENTS};
use std::collections::HashSet;
#[tracing::instrument(skip(context))]
pub async fn mark_post_as_read(
data: Json<MarkPostAsRead>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<SuccessResponse>> {
let post_ids = HashSet::from_iter(data.post_ids.clone());
if post_ids.len() > MAX_API_PARAM_ELEMENTS {
Err(LemmyErrorType::TooManyItems)?;
}
let person_id = local_user_view.person.id;
// Mark the post as read / unread
if data.read {
PostRead::mark_as_read(&mut context.pool(), post_ids, person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntMarkPostAsRead)?;
} else {
PostRead::mark_as_unread(&mut context.pool(), post_ids, person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntMarkPostAsRead)?;
}
Ok(Json(SuccessResponse::default()))
}

View File

@ -0,0 +1,8 @@
pub mod feature;
pub mod get_link_metadata;
pub mod hide;
pub mod like;
pub mod list_post_likes;
pub mod lock;
pub mod mark_read;
pub mod save;

Some files were not shown because too many files have changed in this diff Show More