Commit Graph

24 Commits

Author SHA1 Message Date
Justin Warren 9fe934240a
Added Mastodon public API parser type because #33
Added ability to set scheme when talking to instances.
2023-01-22 07:54:46 +11:00
Shawn Grigson 8d3b9da144 Blockdata var already converted to _asdict() 2023-01-17 17:17:59 -06:00
Justin Warren a25773f838
Allowlists just remove blocks from merged list before push. 2023-01-15 13:33:32 +11:00
Justin Warren 3aa2e378e3
Remove implied setting of reject_media/reports
if severity is set to 'suspend'.
Complicates understanding of what the code actually does.
2023-01-15 10:02:12 +11:00
Justin Warren 04c19c62df
Merge branch 'main' into allowlists 2023-01-15 09:56:13 +11:00
Justin Warren 11accf33d3
Restructured argparsing for easier testing.
Fixed bug: mergeplan in config file was ignored. Reported in #22
Added test cases for cmdline parsing.
Added test cases for configfile parsing.
2023-01-15 09:46:37 +11:00
Justin Warren 17e0bdab0b
Force allowlist entries to always be severity 'noop'. 2023-01-14 11:00:21 +11:00
Justin Warren 6d4e18bbf6
Fixed bug in how DomainBlock defaults
handle reject_media, reject_reports.
2023-01-14 10:59:19 +11:00
Justin Warren 7a31c3380e
Added support for allowlists.
Updated docstring for merge_blocklists()
2023-01-14 10:44:08 +11:00
Justin Warren 894b133fbb
str2bool() now converts '' to False.
Added some extra debug logging of blocklist parsing.
2023-01-14 10:43:17 +11:00
Justin Warren 9817c99e40
Fixed bug in _asdict() of severity level. 2023-01-14 10:41:54 +11:00
Justin Warren 69c28f1a3f
add DomainBlock type hint to update_known_block().
Use ._asdict() to get info to pass to add block API call.
2023-01-13 17:31:50 +11:00
Justin Warren a718af5a0b
Fix DomainBlock.id usage during __iter__() 2023-01-13 17:30:41 +11:00
Justin Warren 55dad3fa32
Aligned API call rate limit with server default. 2023-01-13 17:12:23 +11:00
Justin Warren e0d40b5861
Fixed bug in severity change detection. 2023-01-12 09:31:16 +11:00
Justin Warren 327a44d907
Removed redundant global vars.
Refactored fetch from URLs and instances.
Change API delay to be in calls per hour.
Improved check_followed_severity() behaviour.
Updated sample config to include new format.
Added support for per-instance-source import_fields.
BlockSeverity of 'suspend' implies reject_media and reject_reports.
2023-01-12 09:09:06 +11:00
Justin Warren 66f0373cbe
Added boolean fields like 'reject_reports' to mergeplan handling.
Clarified logic in apply_mergeplan() for boolean fields.
Added tests for boolean merge situations.
2023-01-12 08:08:09 +11:00
Justin Warren 0a6eec4bf2
Improved comment merging. 2023-01-12 07:39:17 +11:00
Justin Warren 10011a5ffb
Refactored to add a DomainBlock object.
Refactored to use a BlockParser structure.
Added ability to limit max severity per-URL source.
Improved method for checking if changes are needed.
2023-01-12 07:02:48 +11:00
Justin Warren edbc418e5e
Merge pull request #13 from eigenmagic/timeouts
Added timeout to requests calls
2023-01-10 18:50:33 +11:00
Justin Warren 1d0649ace5
Add args to show version information. 2023-01-10 13:16:23 +11:00
Justin Warren 23b8833a67
Added timeout to requests calls 2023-01-10 13:06:53 +11:00
Justin Warren 04d9eea827
Set User-Agent to FediBlockHole 2023-01-10 09:13:50 +11:00
Justin Warren 4ab369f95b
Package tool for PyPI/pip distribution. 2023-01-10 08:53:54 +11:00