Commit graph

66 commits

Author SHA1 Message Date
Rob Ede
986dc3f52c
update actix-web to v3 stable (#1125) 2020-09-11 21:37:25 -04: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
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
2d5a50e80f
Fixing broken websocket sends. Removing WebSocketInfo (#1098) 2020-08-24 11:58:24 +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
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
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
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
0f1a8ec928 Merge branch 'master' into federation 2020-06-09 14:01:26 +02:00
9a9a0b9735 Changing cache to 1 hour until we can figure out caching issue. 2020-06-03 12:11:40 -04:00
21e913192a Add cache-control header to HTTP responses based on mime 2020-06-02 19:22:00 +02:00
9e61c3be94 Rework imports 2020-05-16 20:04:17 +02:00
f0026065f5 Merge branch 'master' into federation_merge_from_master_1 2020-04-21 10:25:29 -04:00
4df2031ae0 Give ratelimit fields explicit names 2020-04-20 12:51:42 -05:00
db4454b52b Add websockets into the api scope 2020-04-20 10:25:47 -05: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
9c974fbe50 Remove instance follows 2020-04-17 16:39:03 +02:00
7ba6ee8714 Redundant to_owned 2020-04-14 19:25:58 -04:00
1336b4ed60 Merge branch 'dev' into federation 2020-04-14 16:07:20 -04:00
19c8461397 Implemented follow/accept 2020-04-14 17:37:23 +02:00
c92201a674 Removing redundant to_owned 2020-04-11 14:10:33 -04:00
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
509005fa0c Rename federation-test to federation, puller.rs to fetcher.rs 2020-04-10 13:37:35 +02:00
b7103a7e14 Store remote communities/posts in db, federate posts! 2020-04-07 18:47:19 +02:00
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
1e60e1e351 Implement HTTP API using generics (fixes #380) 2020-01-18 14:23:43 +01:00
81c6d276d5 Fix issue with adding multiple instances of chatserver. 2020-01-15 22:01:14 -05:00
3f868f99e6 removing some comments. 2020-01-12 16:47:02 -05:00
dff8b947bb Trying to add r2d2 connection pooling to websockets. 2020-01-12 10:31:51 -05:00
4361f48b98 Make various functions async 2020-01-11 13:50:07 +01:00
d8c84e2541 Upgrade actix to 2.0 (fixes #392) 2020-01-10 23:41:08 +01:00
d08e09fbdc Apply changes suggested by cargo clippy (fixes #395) 2020-01-02 12:30:00 +01:00
0f8965fac9 Adding some fixes to new docs system. 2020-01-01 17:47:00 -05:00
cd9df4455e Adding open_registration to nodeinfo. 2019-12-31 10:44:30 -05:00
80f76f2efd Use actix config to handle routes in seperate folders (#378) 2019-12-31 14:17:24 +01:00
786be3fa66 Config fixes.
- Adding front_end_dir to settings.
- Adding unit test for PasswordResetRequest encryption.
- Readme points to lemmy.hjson
- Fixing docker prod, dev, and ansible builds.
- Removing redundant env files, as all config is now in a single file.
- Some formatting fixes.
2019-12-28 16:11:03 -05:00
cdbf260803 Added option to enable/disable federation 2019-12-27 17:30:45 +01:00
3d9f7d28d6 Implement webfinger (fixes #149) 2019-12-27 17:29:50 +01:00
cf3ae15ee9 Implement config (fixes #351) 2019-12-27 17:28:44 +01:00
Lyra
34def84d43 Add correct ActivityPub types conversion for Community and Post. 2019-12-27 17:25:20 +01:00
665dca80d0 Moving front end routes from nginx to actix
- Fixes #363
2019-12-11 21:28:33 -08:00
Lyra
0ceed8fd9b Import the Settings struct instead of prefixing the namespace 2019-12-06 23:47:30 +01:00
Lyra
279a901e4a Add configuration variables in order to allow binding lemmy to a different adress/port 2019-12-06 20:36:56 +01:00
52ea7a32db Some RSS work.
- Display rss buttons on front end for user, /c/all, and community
pages. Fixes #348.
- Some clean up and additions to RSS feeds.
2019-12-01 17:23:52 -08:00
8e5c02f967 Add feed for all 2019-12-01 20:01:38 +01:00
cfbe8ac926 fix sort parameter handling, handle errors 2019-12-01 19:09:10 +01:00