diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac7b51..16984f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,21 @@ This project uses [Semantic Versioning] and generally follows the conventions of ## [Unreleased] -- Planning to add allowlist thresholds as noted in #28 +## [v0.4.3] - 2023-02-13 + +### Added + +- Added Mastodon public API parser type because #33 (9fe9342) +- Added ability to set scheme when talking to instances (9fe9342) +- Added tests of comment merging. (fb3a7ec) +- Added blocklist thresholds. (bb1d89e) +- Added logging to help debug threshold-based merging. (b67ff0c) + +### Changed + +- Dropped minimum Python version to 3.6 (df3c16f) +- Don't merge comments if new comment is empty. (b8aa11e) +- Tweaked comment merging to pass tests. (fb3a7ec) ## [v0.4.2] - 2023-01-19 diff --git a/README.md b/README.md index 882fca8..5db678f 100644 --- a/README.md +++ b/README.md @@ -81,17 +81,16 @@ admin to add a new Application at `https:///settings/applications/` and then tell you the access token. -The application needs the `admin:read:domain_blocks` OAuth scope, but -unfortunately this scope isn't available in the current application screen -(v4.0.2 of Mastodon at time of writing, but this has been fixed in the main -branch). +The application needs the `admin:read:domain_blocks` OAuth scope. You can allow +full `admin:read` access, but be aware that this authorizes someone to read all +the data in the instance. That's asking a lot of a remote instance admin who +just wants to share domain_blocks with you. -You can allow full `admin:read` access, but be aware that this authorizes -someone to read all the data in the instance. That's asking a lot of a remote -instance admin who just wants to share domain_blocks with you. +The `admin:read:domain_blocks` scope is available as of Mastodon v4.1.0, but for +earlier versions admins will need to use the manual method described below. -For now, you can ask the instance admin to update the scope in the database -directly like this: +You can update the scope for your application in the database directly like +this: ``` UPDATE oauth_applications as app @@ -136,8 +135,12 @@ chmod o-r ``` You can also grant full `admin:write` scope to the application, but if you'd -prefer to keep things more tightly secured you'll need to use SQL to set the -scopes in the database and then regenerate the token: +prefer to keep things more tightly secured, limit the scope to +`admin:read:domain_blocks`. + +Again, this scope is only available in the application config screen as of +Mastodon v4.1.0. If your instance is on an earlier version, you'll need to use +SQL to set the scopes in the database and then regenerate the token: ``` UPDATE oauth_applications as app diff --git a/etc/sample.fediblockhole.conf.toml b/etc/sample.fediblockhole.conf.toml index e377e97..bd93663 100644 --- a/etc/sample.fediblockhole.conf.toml +++ b/etc/sample.fediblockhole.conf.toml @@ -56,6 +56,24 @@ blocklist_instance_destinations = [ # The 'min' mergeplan will use the lightest severity block found for a domain. # mergeplan = 'max' +## Optional threshold-based merging. +# Only merge in domain blocks if the domain is mentioned in +# at least `threshold` blocklists. +# `merge_thresold` is an integer, with a default value of 0. +# The `merge_threshold_type` can be `count` or `pct`. +# If `count` type is selected, the threshold is reached when the domain +# is mentioned in at least `merge_threshold` blocklists. The default value +# of 0 means that every block in every list will be merged in. +# If `pct` type is selected, `merge_threshold` is interpreted as a percentage, +# i.e. if `merge_threshold` = 20, blocks will only be merged in if the domain +# is present in at least 20% of blocklists. +# Percentage calculated as number_of_mentions / total_number_of_blocklists. +# The percentage method is more flexibile, but also more complicated, so take care +# when using it. +# +# merge_threshold_type = 'count' +# merge_threshold = 0 + ## Set which fields we import ## 'domain' and 'severity' are always imported, these are additional ## diff --git a/pyproject.toml b/pyproject.toml index 4fddc2b..2736623 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "fediblockhole" -version = "0.4.2" +version = "0.4.3" description = "Federated blocklist management for Mastodon" readme = "README.md" license = {file = "LICENSE"} -requires-python = ">=3.10" +requires-python = ">=3.6" keywords = ["mastodon", "fediblock"] authors = [ {name = "Justin Warren"}, {email = "justin@eigenmagic.com"} @@ -17,6 +17,10 @@ classifiers = [ "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.6", ] dependencies = [ "requests",