From 2ba69f2517a2e6349030f9d31f8e70d84a340871 Mon Sep 17 00:00:00 2001 From: rra Date: Thu, 7 Mar 2024 12:42:28 +0100 Subject: [PATCH] inform that blocklists and interests are beign configured in init-db #80 --- app/cli.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/cli.py b/app/cli.py index d37646cc..685e6887 100644 --- a/app/cli.py +++ b/app/cli.py @@ -86,16 +86,13 @@ def register(app): db.session.add(Settings(name='registration_open', value=json.dumps(True))) db.session.add(Settings(name='approve_registrations', value=json.dumps(False))) db.session.add(Settings(name='federation', value=json.dumps(True))) - db.session.add(BannedInstances(domain='lemmygrad.ml')) - db.session.add(BannedInstances(domain='gab.com')) - db.session.add(BannedInstances(domain='rqd2.net')) - db.session.add(BannedInstances(domain='exploding-heads.com')) - db.session.add(BannedInstances(domain='hexbear.net')) - db.session.add(BannedInstances(domain='threads.net')) - db.session.add(BannedInstances(domain='pieville.net')) - db.session.add(BannedInstances(domain='noauthority.social')) - db.session.add(BannedInstances(domain='pieville.net')) - db.session.add(BannedInstances(domain='links.hackliberty.org')) + banned_instances = ['lemmygrad.ml', 'gab.com', 'rqd2.net', 'exploding-heads.com', 'hexbear.net', 'threads.net', 'pieville.net', 'noauthority.social', 'pieville.net', 'links.hackliberty.org'] + for bi in banned_instances: + db.session.add(BannedInstances(domain=bi)) + print("Added banned instance", bi) + + print("Populating DB with instances and interests") + print("See interests.txt") interests = file_get_contents('interests.txt') db.session.add(Interest(name='🕊 Chilling', communities=parse_communities(interests, 'chilling'))) db.session.add(Interest(name='💭 Interesting stuff', communities=parse_communities(interests, 'interesting stuff'))) @@ -114,12 +111,14 @@ def register(app): if block_list: for domain in block_list.split('\n'): db.session.add(Domain(name=domain.strip(), banned=True)) + print("Added 'No-QAnon' blocklist, see https://github.com/rimu/no-qanon") # Load peertube domain block list block_list = retrieve_peertube_block_list() if block_list: for domain in block_list.split('\n'): db.session.add(Domain(name=domain.strip(), banned=True)) + print("Added 'Peertube Isolation' blocklist, see https://peertube_isolation.frama.io/") # Initial roles anon_role = Role(name='Anonymous user', weight=0)