Extract instance metadata rules from tos

merge-requests/26/head
Bob Mottram 2021-10-12 12:09:04 +01:00
parent e8b589db14
commit bc5e6008ae
2 changed files with 20 additions and 3 deletions

View File

@ -24,7 +24,7 @@ Moderators rely upon your reports. Don't assume that something of concern has al
Content found to be non-compliant with this policy will be removed and any accounts on this instance producing, repeating or linking to such content will be deleted typically without prior notification.
### Federation Policy
In a proactive effort to avoid the classic fate of *"embrace, extend, extinguish"* this system will block any instance launched, acquired or funded by Alphabet, Facebook, Twitter, Microsoft, Apple, Amazon, Elsevier or other monopolistic Silicon Valley companies.
In a proactive effort to avoid the classic fate of *"embrace, extend, extinguish"* this system will block any instance launched, acquired or funded by Alphabet/Google, Facebook, Twitter, Microsoft, Apple, Amazon, Elsevier or other monopolistic Silicon Valley companies.
This system will not federate with instances whose moderation policy is incompatible with the content policy described above. If an instance lacks a moderation policy, or refuses to enforce one, it will be assumed to be incompatible.

View File

@ -101,6 +101,25 @@ def metaDataInstance(showAccounts: bool,
print('WARN: json load exception metaDataInstance')
return {}
rulesList = []
rulesFilename = \
baseDir + '/accounts/tos.md'
if os.path.isfile(rulesFilename):
with open(rulesFilename, 'r') as fp:
rulesLines = fp.readlines()
ruleCtr = 1
for line in rulesLines:
line = line.strip()
if not line:
continue
if line.startswith('#'):
continue
rulesList.append({
'id': str(ruleCtr),
'text': line
})
ruleCtr += 1
isBot = False
isGroup = False
if adminActor['type'] == 'Group':
@ -123,8 +142,6 @@ def metaDataInstance(showAccounts: bool,
if adminActor.get('published'):
createdAt = adminActor['published']
rulesList = []
instance = {
'approval_required': False,
'invites_enabled': False,