# this is used for generating activitypub messages, as well as instructions for
# linking AP identities. it should be an SSL-enabled domain reachable by https.
host: 'relay.example.com'
+ blocked_instances:
+ - 'bad-instance.example.com'
+ - 'another-bad-instance.example.com'
+
from .remote_actor import fetch_actor
-AP_CONFIG = CONFIG.get('ap', {'host': 'localhost'})
+AP_CONFIG = CONFIG.get('ap', {'host': 'localhost','blocked_instances':[]})
async def actor(request):
following = DATABASE.get('relay-list', [])
inbox = get_actor_inbox(actor)
+ if re.search('https://(.*)/inbox',inbox).group(1) in AP_CONFIG['blocked_instances']:
+ return
+
if inbox not in following:
following += [inbox]
DATABASE['relay-list'] = following
logging.info('No database was found, making a new one.')
DATABASE = {}
+following = DATABASE.get('relay-list', [])
+for inbox in following:
+ if re.search('https://(.*)/inbox',inbox).group(1) in CONFIG['ap']['blocked_instances']:
+ following.remove(inbox)
+ DATABASE['relay-list'] = following
async def database_save():
while True: