Commit Graph

51 Commits (b7d1d91309cbf815f73a576bf236e5994057f1a4)

Author SHA1 Message Date
Felix Ableitner 722cdb78ba Split lemmy_apub crate into two parts apub and apub_receive 3 years ago
Felix Ableitner 249fcc5066 Split api crate into api_structs and api 3 years ago
Felix Ableitner 4f54108a9c Merge branch 'main' into federated-moderation 3 years ago
Dessalines c3efb9f7cf Strictly typing DB id fields. Fixes #1498 3 years ago
Felix Ableitner dcf40db225 Update activitystreams to 0.7.0-alpha.11 3 years ago
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
3 years ago
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.
3 years ago
Felix Ableitner 3bdd78f341 Rename `lemmy_structs` to `lemmy_api_structs` 3 years ago
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.
3 years ago
Felix Ableitner 999d9f4d6c Move routes into separate crate to speed up compilation 3 years ago
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>
3 years ago
Dessalines 1857f02af8 Moving back tokio and reqwest. 3 years ago
Dessalines 10f0b3b877 Trying to upgrade lemmys deps. 3 years ago
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.
3 years ago
Felix Ableitner c09c462a6e Serve activities in community outbox (fixes #1216) 3 years ago
Felix Ableitner c51f750831 Use Url type for ap_id fields in database (fixes #1364) 3 years ago
Dessalines ee03cf8ae9
Explicit error http status codes (#1362)
* Trying to type specific errors.

* Using @asonix 's downcast method.
3 years ago
Dessalines 1c113f915e Logging post query. 3 years ago
Felix Ableitner 95e30f0e08 Split up lemmy_db_views, put lemmy_rate_limit into lemmy_utils 3 years ago
Felix Ableitner d5efebbf47 Split lemmy_db into lemmy_db_queries, lemmy_db_aggregates and lemmy_db_views 3 years ago
Dessalines e5a65d5807 Upgrading deps. 3 years ago
Dessalines 1a0d1f64f0 Merge remote-tracking branch 'origin/split-db-workspace' into move_views_to_diesel_split 3 years ago
Dessalines d767dd998e Merge branch 'drone-io-dess' into move_views_to_diesel_drone 3 years ago
Felix Ableitner 114f3cbfb5 Move comment, post definitions into lemmy_db_schema 3 years ago
Felix Ableitner 089d812dc8 Split lemmy_db into separate workspaces 3 years ago
Dessalines 4c79e26078 Updating deps. 3 years ago
Felix Ableitner cbe5cf8ca0 try to run migrations on db connection in tests 3 years ago
Felix Ableitner 08748bbede try to init db from lemmy in tests 3 years ago
Felix Ableitner 08ab85a9d5 Remove logging to find bug (yerbamate.ml/LemmyNet/lemmy/pulls/146) 3 years ago
Dessalines b92e7eb781 Updating cargo deps, fixing image if_some deprecation. 4 years ago
Felix Ableitner 8fc4e1ecfe Add logging to find bug (ref #1283)
Also simplify check_object_domain()
4 years ago
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
4 years ago
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
4 years ago
Felix Ableitner a7b72ed5c4 Set valid context for our extra fields (ref #1220) 4 years ago
Felix Ableitner cd3f20e49b Populate `content` with HTML, and `source` with markdown (ref #1220) 4 years ago
Felix Ableitner aaeb852f23 Remove clap dependency 4 years ago
Felix Ableitner 964d95de5c Fix unit tests 4 years ago
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.
4 years ago
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.
4 years ago
Dessalines 907f8fff4c Updating deps. 4 years ago
asonix 1fc21aed1c Use http-signature-normalization-reqwest 4 years ago
Felix Ableitner 0aa0ea19fb Use reqwest to send activities 4 years ago
Felix Ableitner 927ab1f040 Remove hardcoded usage of https (fixes #1126) 4 years ago
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
4 years ago
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
4 years ago
Dessalines 8a7eb57c24
Add openssl (#1143)
* Adding openssl.

* Openssl didnt work, switching to rustls.
4 years ago
Dessalines 9f4493a0b2 Updating cargo.lock. 4 years ago
Dessalines 397fc74a56 Merge branch 'update-deps' into main 4 years ago
Felix Ableitner cf4cda2434 Update deps, remove rustls, dont specify patch version 4 years ago
Felix Ableitner 98c086abb9 Move websocket structs into lemmy_structs (ref #1115) 4 years ago