Commit graph

59 commits

Author SHA1 Message Date
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
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 0f1a8ec928 Merge branch 'master' into federation 2020-06-09 14:01:26 +02:00
Dessalines 9a9a0b9735 Changing cache to 1 hour until we can figure out caching issue. 2020-06-03 12:11:40 -04:00
Felix Ableitner 21e913192a Add cache-control header to HTTP responses based on mime 2020-06-02 19:22:00 +02:00
Felix 9e61c3be94 Rework imports 2020-05-16 20:04:17 +02:00
Dessalines f0026065f5 Merge branch 'master' into federation_merge_from_master_1 2020-04-21 10:25:29 -04:00
asonix 4df2031ae0 Give ratelimit fields explicit names 2020-04-20 12:51:42 -05:00
asonix db4454b52b Add websockets into the api scope 2020-04-20 10:25:47 -05:00
asonix ac43b86b60 Change RateLimit to act as a middleware 2020-04-19 22:59:07 -05: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 9c974fbe50 Remove instance follows 2020-04-17 16:39:03 +02:00
Dessalines 7ba6ee8714 Redundant to_owned 2020-04-14 19:25:58 -04:00
Dessalines 1336b4ed60 Merge branch 'dev' into federation 2020-04-14 16:07:20 -04:00
Felix 19c8461397 Implemented follow/accept 2020-04-14 17:37:23 +02: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
Felix 509005fa0c Rename federation-test to federation, puller.rs to fetcher.rs 2020-04-10 13:37:35 +02:00
Felix Ableitner b7103a7e14 Store remote communities/posts in db, federate posts! 2020-04-07 18:47:19 +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
Felix 1e60e1e351 Implement HTTP API using generics (fixes #380) 2020-01-18 14:23:43 +01:00
Dessalines 81c6d276d5 Fix issue with adding multiple instances of chatserver. 2020-01-15 22:01:14 -05:00
Dessalines 3f868f99e6 removing some comments. 2020-01-12 16:47:02 -05:00
Dessalines dff8b947bb Trying to add r2d2 connection pooling to websockets. 2020-01-12 10:31:51 -05:00
Felix 4361f48b98 Make various functions async 2020-01-11 13:50:07 +01:00
Felix d8c84e2541 Upgrade actix to 2.0 (fixes #392) 2020-01-10 23:41:08 +01:00
Felix Ableitner d08e09fbdc Apply changes suggested by cargo clippy (fixes #395) 2020-01-02 12:30:00 +01:00
Dessalines 0f8965fac9 Adding some fixes to new docs system. 2020-01-01 17:47:00 -05:00
Dessalines cd9df4455e Adding open_registration to nodeinfo. 2019-12-31 10:44:30 -05:00
Felix Ableitner 80f76f2efd Use actix config to handle routes in seperate folders (#378) 2019-12-31 14:17:24 +01:00
Dessalines 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
Felix Ableitner cdbf260803 Added option to enable/disable federation 2019-12-27 17:30:45 +01:00
Felix Ableitner 3d9f7d28d6 Implement webfinger (fixes #149) 2019-12-27 17:29:50 +01:00
Felix Ableitner 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
Dessalines 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
Dessalines 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
Felix Ableitner 8e5c02f967 Add feed for all 2019-12-01 20:01:38 +01:00
Felix Ableitner cfbe8ac926 fix sort parameter handling, handle errors 2019-12-01 19:09:10 +01:00
Felix Ableitner f47bdbc37a wip 2019-11-23 23:25:59 +01:00
Felix Ableitner 942f6a05af basic, working rss feeds 2019-11-23 23:24:50 +01:00
Felix Ableitner de313fc977 Implement RSS feeds (fixes #118) 2019-11-23 23:24:10 +01:00
Dessalines dcad96170e Running cargo fmt 2019-11-21 11:27:52 -08:00
Felix Ableitner 20966e085a preserve json order 2019-11-16 01:31:41 +01:00
Felix Ableitner 2666ba6adf rewrite 2019-11-16 01:31:41 +01:00
Felix Ableitner 4f116dc758 got it working 2019-11-16 01:31:41 +01:00