Commit Graph

280 Commits (totp-hostname)

Author SHA1 Message Date
Dessalines 3ad172e8ed Adding a ban expires update job. Fixes #2177 2 years ago
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
2 years ago
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.
2 years ago
Dessalines 1e9f609cdb
Consolidate and lower reqwest timeouts. Fixes #2150 (#2151) 2 years ago
Nutomic ef1e164cc5
Make activity queue worker count configurable, log stats (#2113) 2 years ago
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>
2 years ago
Dessalines 81aa39ba68
Adding a reqwest timeout. Fixes #2089 (#2097) 2 years ago
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
2 years ago
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
2 years ago
Dessalines 2ac6e1a463
Adding a test comment. (#2081) 2 years ago
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
2 years ago
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
2 years ago
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>
2 years ago
Dessalines bd31475dba Adding a banned endpoint for admins. Removing it from GetSite. Fixes #1806 2 years ago
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>
3 years ago
Riley 0ed3856ef1
Remove awc (#1979)
* Remove unused awc dep

* Replace awc pict-rs client with reqwest

* Reinstate 30 second pict-rs timeout
3 years ago
Aode (lion) 97ebf2f6f3 Consolidate reqwest clients, use reqwest-middleware for tracing 3 years ago
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
3 years ago
Dessalines e765b42d46
Adding a captcha rate limit. Fixes #1755 (#1941)
* Adding a captcha rate limit. Fixes #1755

* Changing to post rate limit.
3 years ago
Dessalines d2e28e5f38
Adding a GetComment endpoint. Fixes #1919 (#1944) 3 years ago
Dessalines 86b2901e8c
Adding MarkPostAsRead to API. Fixes #1784 (#1946)
* Adding MarkPostAsRead to API. Fixes #1784

* Adding error
3 years ago
Riley 1579ee566f
background-jobs 0.11 (#1943) 3 years ago
Riley 3fea5645f8
Add tracing (#1942) 3 years ago
Dessalines 05d43150bc Making public key required. Fixes #1934 3 years ago
layla 7fe7062c47 Implement rate limits on comments 3 years ago
Dessalines f035af3738 Fixing clippy 3 years ago
Felix Ableitner 614490d29b Fix problem that prevented viewing of pleroma user profiles 3 years ago
Felix Ableitner f24999027e Merge crates db_schema and db_queries 3 years ago
Dessalines 97aa7268ae
Adding GetUnreadCount to the API. Fixes #1794 (#1842)
* Adding GetUnreadCount to the API. Fixes #1794

* Reordering filters to fix unread replies.
3 years ago
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
3 years ago
Dessalines 53a2b6d013
Trying a background_jobs fix. #1820 (#1822) 3 years ago
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
3 years ago
Dessalines 9c50cbf431
Adding a user agent. Fixes #1769 (#1800)
* Adding a user agent. Fixes #1769

* Fix client duplicate creation.
3 years ago
Dessalines 8708ad1b44 Moving settings and secrets to context. 3 years ago
Dessalines 0a91a28b27
Reindex tables non-concurrently on startup. Fixes #1726 . #1723 (#1736) 3 years ago
Felix Ableitner 251e0d3b82 Move resolving of activitypub objects to separate api endpoint (fixes #1584) 3 years ago
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.
3 years ago
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
3 years ago
Dessalines 7b8cbbba85
Simplify config using macros (#1686)
Co-authored-by: Felix Ableitner <me@nutomic.com>
3 years ago
Felix Ableitner c1db86925f Merge apub, apub_receive crates (fixes #1621) 3 years ago
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
3 years ago
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
3 years ago
Dessalines f54209c451
Running clippy --fix (#1647) 3 years ago
Dessalines c3d64f996e
Removing community.creator column. Fixes #1504 (#1541)
* Removing community.creator column. Fixes #1504

* Fixing unit tests.

* Fixing federation tests.
3 years ago
Dessalines 1a70477fc7
Better DB default fields. (#1560)
* Better DB default fields.

* Fixing clippy
3 years ago
Dessalines 727fa610d4
Merge pull request #1552 from LemmyNet/feature/1550-optional-config-values
Make some of the database config values optional (fixes #1550)
3 years ago
Felix Ableitner ccdf117c8f Make some of the database config values optional (fixes #1550) 3 years ago
Dessalines f33f763278 Moving ChangePassword to its own API action. Fixes #1471 3 years ago
Felix Ableitner 722cdb78ba Split lemmy_apub crate into two parts apub and apub_receive 3 years ago
Dessalines 4da6e42fc1 Fix websocket location to /api/vX 3 years ago
Dessalines 4c8f2e976e Merge remote-tracking branch 'yerba/split-api-crate' into test_merge_api_crates_reorg 3 years ago
Felix Ableitner 01fc1228d5 Fix API and clippy warnings 3 years ago
Felix Ableitner 249fcc5066 Split api crate into api_structs and api 3 years ago
Dessalines c884510173 Creating default DB forms. Fixes #1511 3 years ago
Dessalines 1745b64ceb Moving matrix_user_id to person table. #1438 3 years ago
Dessalines 9cb4dad4b4 A first pass. 3 years ago
Dessalines ddf4a667b1 ~80% done 3 years ago
Felix Ableitner 7f56281c26 Forbid usage of unwrap 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
Felix Ableitner 3141ad31de Remove categories (fixes #1429) 3 years ago
Felix Ableitner 999d9f4d6c Move routes into separate crate to speed up compilation 3 years ago
Dessalines 14465b91b1 Fixing inbox url code migration. Fixes #1414 3 years ago
Dessalines d5d99fa3b9
Moving docs to join.lemmy.ml . Fixes #1396 (#1410)
* Moving docs to join.lemmy.ml . Fixes #1396

* Removing submodule fetch from drone.
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 51465bc0d7 Nodeinfo devs think halfyear is one word. 3 years ago
Dessalines 3f23e0e6b9 Adding camelCase to node-info users. 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
Nutomic 3d578f9df2
Use Url type for ap_id fields in database (fixes #1364) (#1371) 3 years ago
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`.
3 years ago
Dessalines 4fdcb57753 Report only local counts in site_view.
- Move open_registrations under top level.
- Fixes #1340
3 years ago
Dessalines 1e0c32f7a3 Merge branch 'main' into move_views_to_diesel 3 years ago
Felix Ableitner 95e30f0e08 Split up lemmy_db_views, put lemmy_rate_limit into lemmy_utils 4 years ago
Felix Ableitner d5efebbf47 Split lemmy_db into lemmy_db_queries, lemmy_db_aggregates and lemmy_db_views 4 years ago
Dessalines 1a0d1f64f0 Merge remote-tracking branch 'origin/split-db-workspace' into move_views_to_diesel_split 4 years ago
Felix Ableitner 5231666465 Move remaining structs from lemmy_db::source to lemmy_db_schema 4 years ago
Felix Ableitner a7e231b35b Move community to lemmy_db_schema 4 years ago
Dessalines 929f1d02b5 Fixing integration tests. 4 years ago
Dessalines 5af8257e19 Changing unit tests to api v2. 4 years ago
Felix Ableitner f842bbff8d Move user to lemmy_db_schema, create traits for impls 4 years ago
Felix Ableitner 114f3cbfb5 Move comment, post definitions into lemmy_db_schema 4 years ago
Felix Ableitner 089d812dc8 Split lemmy_db into separate workspaces 4 years ago
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
4 years ago
Felix Ableitner 4bf0ec94c8 Create empty inbox collections for actors (ref #1322) 4 years ago
Dessalines 57c2f2ef1c Getting rid of terrible boxedjoin types. 4 years ago
Dessalines 711db4c790 Removing old user_mention_view. 4 years ago
Felix Ableitner cbd02f2a87 Use correct content-type headers for apub inbox (ref #1220) 4 years ago
Dessalines 471abf7f29 Removing old comment_view. 4 years ago
Dessalines f456f5da46 Re-organizing source tables into a different folder. 4 years ago
Dessalines 35bf50ab15 Removing old postview. 4 years ago
Dessalines 2400a078d7 Merge branch 'main' into move_views_to_diesel 4 years ago
Dessalines b92e7eb781 Updating cargo deps, fixing image if_some deprecation. 4 years ago
Dessalines ca7224c086 Starting on siteview. 4 years ago
Dessalines 45efa94ba4
Making sure image uploads have jwt cookie. Fixes #1291 (#1299) 4 years ago
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>
4 years ago
Felix Ableitner a2d80d8f2e Generate valid RSS feed (fixes #1274) 4 years ago
Felix Ableitner 7fe4558bee Create empty outbox for user (ref #1220) 4 years ago
Felix Ableitner d6493f31d9 Reduce visibility of some structs and methods (replaces #1266) 4 years ago
eiknat 9e604b4038 update/fix migration, add some doc
also run cargo fmt/clippy
4 years ago
eiknat 30d784c27c add mod room websocket impl 4 years ago
eiknat 2cd2a4df45 reports: split post/comment out again, add some other fixes 4 years ago
eiknat d6b1c8df2f reports: update db tables, combine api impl 4 years ago
eiknat 6d43202efb reports: initial reports api commit 4 years ago
Felix Ableitner 8803e7834f Enforce site and community bans for federated users 4 years ago
Kenneth Koski b3035e21ef
Parameterize docs directory (#1245)
Adds `docs_dir` setting for configurable documentation location
4 years ago
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
4 years ago
Felix Ableitner 99abc49040 Add /activities endpoint (ref #1220) 4 years ago
Dessalines e7d3905093 Remove cache headers. Fixes #1222 4 years ago
Felix Ableitner e8379cb3f7 Also return json for long accept header with profile link (ref #1216) 4 years ago
Dessalines 815cf60f45 Fixing clippy. 4 years ago
Dessalines c87a009b37 Altering lemmy pict-rs-v2 forwarding. 4 years ago
Dessalines 9bbacd38f4 Merge branch 'asonix/pict-rs-v2' of https://github.com/asonix/lemmy into asonix-asonix/pict-rs-v2 4 years ago
Felix Ableitner 0dda2577e1 Refactor apub code, split up large files 4 years ago
asonix 08588c873a pict-rs v2 4 years ago
Dessalines 2ad137c280 Merge branch 'remove-hardcoded-https-dess' into main 4 years ago
Felix Ableitner 927ab1f040 Remove hardcoded usage of https (fixes #1126) 4 years ago
Dessalines 8bea13d651
More overwriteable fields (#1155)
* Adding more overwriteable fields for user. Fixes #1154

* Adding a note for bio.
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 b99b62a211 Version v0.7.59 4 years ago
Dessalines 2189d15e5b Merge branch 'main' of https://github.com/lemmynet/lemmy into main 4 years ago
Dessalines 66cf9ff70a Merge remote-tracking branch 'yerba/main' into main 4 years ago
Dessalines 9395312079 Fixing remote subscribe result. Fixes #1144 4 years ago
Felix Ableitner 9d4973829b Add integration test to ensure that signatures are verified 4 years ago
Dessalines 7bdb1abbe6
Published user time (#1141)
* Adding published time to UserForm.

- Federates user creation time. Fixes #1140

* Check the user published time.
4 years ago
Dessalines 96535366c3 Running cargo fmt. 4 years ago
Dessalines 3fbc8b130d Adding site checking. 4 years ago
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 4 years ago
Felix Ableitner 98c086abb9 Move websocket structs into lemmy_structs (ref #1115) 4 years ago
eiknat d0fefca6f9 api.site: check for existing site before creating 4 years ago
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>
4 years ago