* Rework the way 2FA is enabled/disabled (fixes#3309)
* postgres format
* change algo to sha1 for better compat
* review comments
* review
* clippy
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* User can block instances (fixes#2397)
* update comments
* review comments
* use route
* update
* add api test
* update tests
* fix
* fix test
* ci
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* persistent activity queue
* fixes
* fixes
* make federation workers function callable from outside
* log federation instances
* dead instance detection not needed here
* taplo fmt
* split federate bin/lib
* minor fix
* better logging
* log
* create struct to hold cancellable task for readability
* use boxfuture for readability
* reset submodule
* fix
* fix lint
* swap
* remove json column, use separate array columns instead
* some review comments
* make worker a struct for readability
* minor readability
* add local filter to community follower view
* remove separate lemmy_federate entry point
* fix remaining duration
* address review comments mostly
* fix lint
* upgrade actitypub-fed to simpler interface
* fix sql format
* increase delays a bit
* fixes after merge
* remove selectable
* fix instance selectable
* add comment
* start federation based on latest id at the time
* rename federate process args
* dead instances in one query
* filter follow+report activities by local
* remove synchronous federation
remove activity sender queue
* lint
* fix federation tests by waiting for results to change
* fix fed test
* fix comment report
* wait some more
* Apply suggestions from code review
Co-authored-by: SorteKanin <sortekanin@gmail.com>
* fix most remaining tests
* wait until private messages
* fix community tests
* fix community tests
* move arg parse
* use instance_id instead of domain in federation_queue_state table
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: SorteKanin <sortekanin@gmail.com>
* add logic to prevent downloading remote pictrs images
* apply formatting
* Do not attempt a pictrs fetch if the remote image is also on a pictrs instance
* Do not attempt a pictrs fetch if the remote image is also on a pictrs instance and cache_federated_images is false
* Generalising the no caching option to handle all remote images
* rustfmt
* Return None if the URL is not an image
* Updating defaults.hjson
* fixing typo
* Fixing typo
* Skip cloning the Url unless we need to
* using a HEAD request for checking the content type, saving bandwidth/improving perf
* Removing early returns
* Switching back to GET requests for Content-Type because pictrs does not handle HEAD requests
* Simplifying logic and using metadata_image instead of url if we do not get a pictrs thumbnail
* Removing unused import
* Return None as a thumbnail if caching is disabled
* formatting
---------
Co-authored-by: Djones4822 <david.jones4822@gmail.com>
* Add person name to PersonIsBannedFromSite error (#3786)
* Log PersonId instead of Person name (#3850)
* Log actor_id for PersonIsBannedFromSite (#3850)
---------
Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
* Allow filtering posts and comments by whether they were liked/disliked
* Switch to 2 args - liked_only, disliked_only - taking bools
* Make liked_only and disliked_only Option<bool>
* Fix unrelated is_profile_view compilation error
* detailed error message for blocked domains (#3698)
* Pass the domain as an error param
Not formatting the error message to support i18n
---------
Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
* Try using drone cache plugin
* Try another path
* Include volume
* Fix formatting
* Include fmt
* Exclude cargo dir from prettier
* Don't override cargo
* Just do check
* Add cache key
* Use different cache plugin
* Add clippy
* Try minio
* Add quotes
* Try adding secrets
* Try again
* Again
* Use correct secret formation
* Add back clippy
* Use secret for the root bucket name
* Try drone cache instead
* Add region
* Add path-style option
* Include cargo clippy
* Include everything again
* Fix formatting
* Don't run clippy twice
* Add `allow` statements for tests to pass
* Adjust endpoint to be a secret
* Fix prettier
* Merge & fix tests
* Try to restart the woodpecker test
* Change the ENV var name
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* Fix#3366: API does return plain HTML errors
* Fix Clippy errors
* Improve api response times by doing send_activity asynchronously (#3493)
* do send_activity after http response
* move to util function
* format
* fix prometheus
* make synchronous federation configurable
* cargo fmt
* empty
* empty
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* Updating `login.rs` with generic `incorrect_login` response. (#3549)
* Adding v0.18.1 and v0.18.0 release notes. (#3530)
* Update RELEASES.md (#3556)
added instruction to find the location of your docker directory (especially useful for those who used ansible since they never had to setup docker manually)
* Use async email sender (#3554)
* Upgrade all dependencies (#3526)
* Upgrade all dependencies
* as base64
* Adding phiresky to codeowners. (#3576)
* Error enum fixed (#3487)
* Create error type enum
* Replace magic string slices with LemmyErrorTypes
* Remove unused enum
* Add rename snake case to error enum
* Rename functions
* clippy
* Fix merge errors
* Serialize in PascalCase instead of snake_case
* Revert src/lib
* Add serialization tests
* Update translations
* Fix compilation error in test
* Fix another compilation error
* Add code for generating typescript types
* Various fixes to avoid breaking api
* impl From<LemmyErrorType> for LemmyError
* with_lemmy_type
* trigger ci
---------
Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
* Only update site_aggregates for local site (#3516)
* Fix#3501 - Fix aggregation counts for elements removed and deleted (#3543)
Two bugs were found and fixed:
- previously elements removal and deletion were counted as two separate disappearances
- removing comments did not affect post aggregations
* Use LemmyErrorType also make error_type compulsory
* Add missing import for jsonify_plain_text_errors
* Fix formatting
* Trying to make woodpecker run again
---------
Co-authored-by: phiresky <phireskyde+git@gmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: rosenjcb <rosenjcb@gmail.com>
Co-authored-by: nixoye <12674582+nixoye@users.noreply.github.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
Co-authored-by: Sander Saarend <sander@saarend.com>
Co-authored-by: Piotr Juszczyk <74842304+pijuszczyk@users.noreply.github.com>
With this change only http(s) schemes are allowed for post.url
field. This is checked for incoming api and federation requests.
Existing posts in database which are sent to clients are not
checked. Neither does it check urls in markdown.
Add a server for serving Prometheus metrics. Include a configuration
block in the config file. Provide HTTP metrics on the API, along with
process-level metrics and DB pool metrics.
* Fixed validation of display names
Fixed validation of display names: reject names beginning with invisible unicode characters.
* Formatting
Formatting fix.
* Expanded list of forbidden Unicode characters. Validation now checks for disallowed characters anywhere in the name.
* Formatting
* Added a comment detailing source of the list of invisible chars.
* Fixes#2900 - Checks slur regex to see if it is too permissive along with small validation organization
* Clean up variable names, add handler for valid empty string usecase
* Update tests
* Create validation function and add tests
* Test clean up
* Use payload value vs local site value to prevent stunlocking
* Remove println added while testing
* Fall back to local site regex if not provided from request
* Attempt clean up of flaky comment_view tests
* Pull in latest submodule
* Move application, post check into functions, add more tests and improve test readability
---------
Co-authored-by: Nutomic <me@nutomic.com>
* Add separate Post check for is_valid_body_field
* Modify is_valid_body_check for posts only
* Fix check var reinit in validation.rs
* Extra empty line to rerun woodpecker with changes
* Change Option to bool, add false to non-post calls
* Woodpecker trick.. again
* Probable rust_fmt fail fixed
* cargo_clippy changes
* Missing space between = and if
* Remove ; after body length checks
* Remove `actix_rt` & use standard tokio spawn
* Adjust rust log back down
* Format correctly
* Update cargo lock
* Add DB settings
* Change name and update to latest rev
* Clean up formatting changes
* Move `worker_count` and `worker_retry_count` to settings
* Update defaults
* Use `0.4.4` instead of git branch