readme updates also 401 status_code becomes skippable
This commit is contained in:
parent
bda8bf5ebb
commit
d1fe11abf5
|
@ -386,6 +386,14 @@ Skip the fetching of blocklists from any URLs that are configured.
|
|||
|
||||
Skip the fetching of blocklists from any remote instances that are configured.
|
||||
|
||||
### override_private_comment
|
||||
|
||||
Defaults to None.
|
||||
|
||||
Stamp all *new* blocks pushed to a remote server with this comment or code.
|
||||
Helps to identify blocks you've created on a server via this process versus ones that
|
||||
already existed.
|
||||
|
||||
### mergeplan
|
||||
|
||||
If two (or more) blocklists define blocks for the same domain, but they're
|
||||
|
|
|
@ -77,8 +77,9 @@ blocklist_instance_destinations = [
|
|||
# merge_threshold_type = 'count'
|
||||
# merge_threshold = 0
|
||||
|
||||
## set an override private comment
|
||||
# override_private_comment = 'Updated by Fediblockhole'
|
||||
## set an override private comment to be added when pushing a NEW block to an instance
|
||||
# this does not require importing private comments
|
||||
# override_private_comment = 'Added by Fediblock Sync'
|
||||
|
||||
## Set which fields we import
|
||||
## 'domain' and 'severity' are always imported, these are additional
|
||||
|
|
|
@ -402,6 +402,9 @@ def fetch_instance_blocklist(host: str, token: str=None, admin: bool=False,
|
|||
link = True
|
||||
while link:
|
||||
response = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT)
|
||||
if response.status_code == 401:
|
||||
log.error(f"Cannot fetch remote blocklist. Access token has been revoked for {host}, skipping....")
|
||||
break
|
||||
if response.status_code != 200:
|
||||
log.error(f"Cannot fetch remote blocklist: {response.content}")
|
||||
raise ValueError("Unable to fetch domain block list: %s", response)
|
||||
|
|
Loading…
Reference in New Issue