Commit graph

47 commits

Author SHA1 Message Date
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
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
353e2e027a Move api structs and rate limit into separate workspaces 2020-09-02 13:27:31 +02:00
5d64dfd4dc Remove wildcard imports (in particular super::*) 2020-09-01 15:20:22 +02:00
Dessalines
2d5a50e80f
Fixing broken websocket sends. Removing WebSocketInfo (#1098) 2020-08-24 11:58:24 +00: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
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
8daeba450c
Removing unnecessary oper struct. Fixes #660 (#1077) 2020-08-12 11:31:45 +00:00
313f315896 Various adjustments after review 2020-08-06 21:44:47 +02:00
cc2c7db9fe Add security checks and slur checks for activitypub inbox 2020-08-06 15:01:42 +02: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
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
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
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
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
dc94e58cbf Merge branch 'master' into federation_merge_from_master_2 2020-06-23 21:11:38 -04:00
2fbd44c59d Adding pictrs thumbnail caching for urls and embeds. 2020-06-10 18:22:57 -04:00
9e61c3be94 Rework imports 2020-05-16 20:04:17 +02:00
dfd6629a6f Federate community category and nsfw 2020-05-05 16:30:13 +02:00
9721b77317 1/3rd done with post likes 2020-04-27 22:47:26 -04:00
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
3ce0618362 Making a trait function for follow and accept. 2020-04-26 13:20:42 -04:00
66a2c4a2c3 Some fed fixes. 2020-04-24 10:04:36 -04:00
18e570b021 Merge branch 'master' into merge_master_2 2020-04-21 20:29:52 -04:00
d98c936295 Adding web::blocks to routes. 2020-04-21 16:40:03 -04:00
f0026065f5 Merge branch 'master' into federation_merge_from_master_1 2020-04-21 10:25:29 -04:00
ac43b86b60 Change RateLimit to act as a middleware 2020-04-19 22:59:07 -05:00
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
ac280782b2 Iframely and pictshare backend mostly done. 2020-03-07 18:31:13 -05:00
ee2038a75a Returning specific slurs from slur filter on failure. Fixes #463 2020-02-02 22:51:54 -05:00
ac1d5f2b86 Done merging http-api and private_message 2020-01-23 19:17:42 -05:00
253bc3e0af Adding private messaging, and matrix user ids.
- Fixes #244
2020-01-22 16:38:16 -05:00
f1035dacc2 working! 2020-01-18 14:26:04 +01:00
dff8b947bb Trying to add r2d2 connection pooling to websockets. 2020-01-12 10:31:51 -05:00
cf3ae15ee9 Implement config (fixes #351) 2019-12-27 17:28:44 +01:00
fca8e6a0a9 Adding some site oriented settings.
- Adding option to close registration. Fixes #350
- Adding option to disable showing NSFW buttons. Fixes #364
- Adding option to disable downvotes. Fixes #239
2019-12-11 12:21:47 -08:00
faef62e073 Switching to shorthands for rust params. 2019-12-09 11:08:19 -08:00
3350599901 Running cargo fmt. 2019-11-01 23:43:21 -07:00
9f35b33dc7 Halfway done with email, not fully working yet. 2019-10-29 20:35:39 -07:00
02dd9ac32a Adding username mentions / tagging from comments.
- Fixes #293
2019-10-19 17:46:29 -07:00
903d73d665 Adding permanently delete account comments and posts.
- Fixes #285
- Fixes #58
2019-10-15 15:09:01 -07:00
44442565aa Running cargo fmt on server code.
- Adding a .rustfmt.toml for the 2 space indent.
2019-09-07 08:35:05 -07:00
3561ef93a0 Adding Community and Site transfer
- Fixes #139
2019-08-23 19:40:41 -07:00
d7ab85ab70 Squashed commit of the following:
commit ecd6c5a2f4
Author: Dessalines <happydooby@gmail.com>
Date:   Tue Aug 13 19:49:38 2019 -0700

    Adding some docs

commit 3babd09aff
Author: Dessalines <happydooby@gmail.com>
Date:   Tue Aug 13 19:28:46 2019 -0700

    Adding save user settings

commit 6e8da9cc9e
Merge: 3246d5d c148eef
Author: Dessalines <happydooby@gmail.com>
Date:   Tue Aug 13 17:26:25 2019 -0700

    Merge branch 'dev' into nsfw

commit b3d4a5c4ce
Author: Dessalines <happydooby@gmail.com>
Date:   Sun Aug 11 20:55:09 2019 -0700

    nsfw mostly done, except for settings page.
2019-08-13 19:52:43 -07:00
8348399f60 Using Rust 2018 now.
- Fixes #170
2019-06-03 10:47:12 -07:00
f8615b6178 Done with reorg 2019-05-05 09:20:30 -07:00
7fb6a0b138 Mostly done with reorg. 2019-05-04 22:20:38 -07:00