Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon
52
daemon.py
|
|
@ -5084,8 +5084,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
|
|
||||||
# grayscale theme
|
# grayscale theme
|
||||||
if path.startswith('/users/' +
|
if path.startswith('/users/' + adminNickname + '/') or \
|
||||||
adminNickname + '/') or \
|
|
||||||
isArtist(baseDir, nickname):
|
isArtist(baseDir, nickname):
|
||||||
grayscale = False
|
grayscale = False
|
||||||
if fields.get('grayscale'):
|
if fields.get('grayscale'):
|
||||||
|
|
@ -5181,15 +5180,34 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if os.path.isfile(allowedInstancesFilename):
|
if os.path.isfile(allowedInstancesFilename):
|
||||||
os.remove(allowedInstancesFilename)
|
os.remove(allowedInstancesFilename)
|
||||||
|
|
||||||
# save peertube instances list
|
# save blocked user agents
|
||||||
peertubeInstancesFile = \
|
# This is admin lebel and global to the instance
|
||||||
baseDir + '/accounts/peertube.txt'
|
if path.startswith('/users/' + adminNickname + '/'):
|
||||||
if fields.get('ptInstances'):
|
userAgentsBlocked = []
|
||||||
adminNickname = \
|
if fields.get('userAgentsBlockedStr'):
|
||||||
getConfigParam(baseDir, 'admin')
|
userAgentsBlockedStr = \
|
||||||
if adminNickname and \
|
fields['userAgentsBlockedStr']
|
||||||
path.startswith('/users/' +
|
userAgentsBlockedList = \
|
||||||
adminNickname + '/'):
|
userAgentsBlockedStr.split('\n')
|
||||||
|
for ua in userAgentsBlockedList:
|
||||||
|
if ua in userAgentsBlocked:
|
||||||
|
continue
|
||||||
|
userAgentsBlocked.append(ua.strip())
|
||||||
|
if str(self.server.userAgentsBlocked) != \
|
||||||
|
str(userAgentsBlocked):
|
||||||
|
self.server.userAgentsBlocked = userAgentsBlocked
|
||||||
|
userAgentsBlockedStr = ''
|
||||||
|
for ua in userAgentsBlocked:
|
||||||
|
if userAgentsBlockedStr:
|
||||||
|
userAgentsBlockedStr += ','
|
||||||
|
userAgentsBlockedStr += ua
|
||||||
|
setConfigParam(baseDir, 'userAgentsBlocked',
|
||||||
|
userAgentsBlockedStr)
|
||||||
|
|
||||||
|
# save peertube instances list
|
||||||
|
peertubeInstancesFile = \
|
||||||
|
baseDir + '/accounts/peertube.txt'
|
||||||
|
if fields.get('ptInstances'):
|
||||||
self.server.peertubeInstances.clear()
|
self.server.peertubeInstances.clear()
|
||||||
with open(peertubeInstancesFile, 'w+') as aFile:
|
with open(peertubeInstancesFile, 'w+') as aFile:
|
||||||
aFile.write(fields['ptInstances'])
|
aFile.write(fields['ptInstances'])
|
||||||
|
|
@ -5203,10 +5221,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if url in self.server.peertubeInstances:
|
if url in self.server.peertubeInstances:
|
||||||
continue
|
continue
|
||||||
self.server.peertubeInstances.append(url)
|
self.server.peertubeInstances.append(url)
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(peertubeInstancesFile):
|
if os.path.isfile(peertubeInstancesFile):
|
||||||
os.remove(peertubeInstancesFile)
|
os.remove(peertubeInstancesFile)
|
||||||
self.server.peertubeInstances.clear()
|
self.server.peertubeInstances.clear()
|
||||||
|
|
||||||
# save git project names list
|
# save git project names list
|
||||||
gitProjectsFilename = \
|
gitProjectsFilename = \
|
||||||
|
|
@ -10328,7 +10346,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
city, accessKeys).encode('utf-8')
|
city,
|
||||||
|
self.server.userAgentsBlocked,
|
||||||
|
accessKeys).encode('utf-8')
|
||||||
if msg:
|
if msg:
|
||||||
msglen = len(msg)
|
msglen = len(msg)
|
||||||
self._set_headers('text/html', msglen,
|
self._set_headers('text/html', msglen,
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.2 KiB |
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "التصميم الجرافيكي",
|
"Graphic Design": "التصميم الجرافيكي",
|
||||||
"Import Theme": "استيراد الموضوع",
|
"Import Theme": "استيراد الموضوع",
|
||||||
"Export Theme": "موضوع التصدير",
|
"Export Theme": "موضوع التصدير",
|
||||||
"Custom post submit button text": "عرف نشر إرسال نص زر"
|
"Custom post submit button text": "عرف نشر إرسال نص زر",
|
||||||
|
"Blocked User Agents": "عوامل المستخدم المحظورة"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Disseny gràfic",
|
"Graphic Design": "Disseny gràfic",
|
||||||
"Import Theme": "Importació temàtica",
|
"Import Theme": "Importació temàtica",
|
||||||
"Export Theme": "Tema d'exportació",
|
"Export Theme": "Tema d'exportació",
|
||||||
"Custom post submit button text": "Text de botó d'enviament de publicacions personalitzades"
|
"Custom post submit button text": "Text de botó d'enviament de publicacions personalitzades",
|
||||||
|
"Blocked User Agents": "Agents d'usuari bloquejats"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Dylunio Graffig",
|
"Graphic Design": "Dylunio Graffig",
|
||||||
"Import Theme": "Thema Mewnforio",
|
"Import Theme": "Thema Mewnforio",
|
||||||
"Export Theme": "Thema Allforio",
|
"Export Theme": "Thema Allforio",
|
||||||
"Custom post submit button text": "Testun Post Post Post"
|
"Custom post submit button text": "Testun Post Post Post",
|
||||||
|
"Blocked User Agents": "Asiantau defnyddwyr wedi'u blocio"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Grafikdesign",
|
"Graphic Design": "Grafikdesign",
|
||||||
"Import Theme": "Theme importieren",
|
"Import Theme": "Theme importieren",
|
||||||
"Export Theme": "Theme exportieren",
|
"Export Theme": "Theme exportieren",
|
||||||
"Custom post submit button text": "Benutzerdefinierte Post-Senden Schaltfläche Text"
|
"Custom post submit button text": "Benutzerdefinierte Post-Senden Schaltfläche Text",
|
||||||
|
"Blocked User Agents": "Blockierte Benutzeragenten"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Graphic Design",
|
"Graphic Design": "Graphic Design",
|
||||||
"Import Theme": "Import Theme",
|
"Import Theme": "Import Theme",
|
||||||
"Export Theme": "Export Theme",
|
"Export Theme": "Export Theme",
|
||||||
"Custom post submit button text": "Custom post submit button text"
|
"Custom post submit button text": "Custom post submit button text",
|
||||||
|
"Blocked User Agents": "Blocked User Agents"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Diseño gráfico",
|
"Graphic Design": "Diseño gráfico",
|
||||||
"Import Theme": "Tema de importación",
|
"Import Theme": "Tema de importación",
|
||||||
"Export Theme": "Tema de exportación",
|
"Export Theme": "Tema de exportación",
|
||||||
"Custom post submit button text": "POST POST PERSONALIZADO Botón Texto"
|
"Custom post submit button text": "POST POST PERSONALIZADO Botón Texto",
|
||||||
|
"Blocked User Agents": "Agentes de usuario bloqueados"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Conception graphique",
|
"Graphic Design": "Conception graphique",
|
||||||
"Import Theme": "Import thème",
|
"Import Theme": "Import thème",
|
||||||
"Export Theme": "Thème d'exportation",
|
"Export Theme": "Thème d'exportation",
|
||||||
"Custom post submit button text": "Texte de bouton d'envoi postal personnalisé"
|
"Custom post submit button text": "Texte de bouton d'envoi postal personnalisé",
|
||||||
|
"Blocked User Agents": "Agents d'utilisateur bloqués"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Dearadh grafach",
|
"Graphic Design": "Dearadh grafach",
|
||||||
"Import Theme": "Téama Iompórtáil",
|
"Import Theme": "Téama Iompórtáil",
|
||||||
"Export Theme": "Téama Easpórtála",
|
"Export Theme": "Téama Easpórtála",
|
||||||
"Custom post submit button text": "Post saincheaptha Cuir isteach an cnaipe Téacs"
|
"Custom post submit button text": "Post saincheaptha Cuir isteach an cnaipe Téacs",
|
||||||
|
"Blocked User Agents": "Gníomhairí úsáideora blocáilte"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "ग्राफ़िक डिज़ाइन",
|
"Graphic Design": "ग्राफ़िक डिज़ाइन",
|
||||||
"Import Theme": "आयात विषय",
|
"Import Theme": "आयात विषय",
|
||||||
"Export Theme": "निर्यात विषय",
|
"Export Theme": "निर्यात विषय",
|
||||||
"Custom post submit button text": "कस्टम पोस्ट सबमिट बटन टेक्स्ट"
|
"Custom post submit button text": "कस्टम पोस्ट सबमिट बटन टेक्स्ट",
|
||||||
|
"Blocked User Agents": "अवरुद्ध उपयोगकर्ता एजेंट"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Graphic design",
|
"Graphic Design": "Graphic design",
|
||||||
"Import Theme": "Tema dell'importazione",
|
"Import Theme": "Tema dell'importazione",
|
||||||
"Export Theme": "Esportare tema",
|
"Export Theme": "Esportare tema",
|
||||||
"Custom post submit button text": "Pulsante di invio del post personalizzato"
|
"Custom post submit button text": "Pulsante di invio del post personalizzato",
|
||||||
|
"Blocked User Agents": "Agenti utente bloccati"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "グラフィックデザイン",
|
"Graphic Design": "グラフィックデザイン",
|
||||||
"Import Theme": "輸入テーマ",
|
"Import Theme": "輸入テーマ",
|
||||||
"Export Theme": "テーマをエクスポートします",
|
"Export Theme": "テーマをエクスポートします",
|
||||||
"Custom post submit button text": "カスタムポスト送信ボタンテキスト"
|
"Custom post submit button text": "カスタムポスト送信ボタンテキスト",
|
||||||
|
"Blocked User Agents": "ブロックされたユーザーエージェント"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Sêwirana grafîkî",
|
"Graphic Design": "Sêwirana grafîkî",
|
||||||
"Import Theme": "Mijara Import",
|
"Import Theme": "Mijara Import",
|
||||||
"Export Theme": "Mijara Export",
|
"Export Theme": "Mijara Export",
|
||||||
"Custom post submit button text": "Nivîsa bişkojka paşîn a paşîn"
|
"Custom post submit button text": "Nivîsa bişkojka paşîn a paşîn",
|
||||||
|
"Blocked User Agents": "Karmendên bikarhêner asteng kirin"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -444,5 +444,6 @@
|
||||||
"Graphic Design": "Graphic Design",
|
"Graphic Design": "Graphic Design",
|
||||||
"Import Theme": "Import Theme",
|
"Import Theme": "Import Theme",
|
||||||
"Export Theme": "Export Theme",
|
"Export Theme": "Export Theme",
|
||||||
"Custom post submit button text": "Custom post submit button text"
|
"Custom post submit button text": "Custom post submit button text",
|
||||||
|
"Blocked User Agents": "Blocked User Agents"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Design gráfico",
|
"Graphic Design": "Design gráfico",
|
||||||
"Import Theme": "Importar tema",
|
"Import Theme": "Importar tema",
|
||||||
"Export Theme": "Exportar tema",
|
"Export Theme": "Exportar tema",
|
||||||
"Custom post submit button text": "Texto de botão de envio de post personalizado"
|
"Custom post submit button text": "Texto de botão de envio de post personalizado",
|
||||||
|
"Blocked User Agents": "Agentes de usuário bloqueados"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Графический дизайн",
|
"Graphic Design": "Графический дизайн",
|
||||||
"Import Theme": "Импортировать тему",
|
"Import Theme": "Импортировать тему",
|
||||||
"Export Theme": "Экспортная тема",
|
"Export Theme": "Экспортная тема",
|
||||||
"Custom post submit button text": "Пользовательский пост Отправить кнопку текста"
|
"Custom post submit button text": "Пользовательский пост Отправить кнопку текста",
|
||||||
|
"Blocked User Agents": "Заблокированные пользовательские агенты"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "Graphic design",
|
"Graphic Design": "Graphic design",
|
||||||
"Import Theme": "Ingiza mandhari",
|
"Import Theme": "Ingiza mandhari",
|
||||||
"Export Theme": "Tuma mandhari",
|
"Export Theme": "Tuma mandhari",
|
||||||
"Custom post submit button text": "Ujumbe wa Desturi Wasilisha Nakala ya kifungo"
|
"Custom post submit button text": "Ujumbe wa Desturi Wasilisha Nakala ya kifungo",
|
||||||
|
"Blocked User Agents": "Wakala wa watumiaji waliozuiwa"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -448,5 +448,6 @@
|
||||||
"Graphic Design": "平面设计",
|
"Graphic Design": "平面设计",
|
||||||
"Import Theme": "进口主题",
|
"Import Theme": "进口主题",
|
||||||
"Export Theme": "出口主题",
|
"Export Theme": "出口主题",
|
||||||
"Custom post submit button text": "自定义发布提交按钮文本"
|
"Custom post submit button text": "自定义发布提交按钮文本",
|
||||||
|
"Blocked User Agents": "阻止用户代理商"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1414,7 +1414,7 @@ def _htmlEditProfileGitProjects(baseDir: str, nickname: str, domain: str,
|
||||||
|
|
||||||
|
|
||||||
def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
translate: {}) -> str:
|
userAgentsBlocked: str, translate: {}) -> str:
|
||||||
"""Filtering and blocking section of edit profile screen
|
"""Filtering and blocking section of edit profile screen
|
||||||
"""
|
"""
|
||||||
filterStr = ''
|
filterStr = ''
|
||||||
|
|
@ -1581,6 +1581,19 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
'style="height:200px" spellcheck="false">' + \
|
'style="height:200px" spellcheck="false">' + \
|
||||||
allowedInstancesStr + '</textarea>\n'
|
allowedInstancesStr + '</textarea>\n'
|
||||||
|
|
||||||
|
userAgentsBlockedStr = ''
|
||||||
|
for ua in userAgentsBlocked:
|
||||||
|
if userAgentsBlockedStr:
|
||||||
|
userAgentsBlockedStr += '\n'
|
||||||
|
userAgentsBlockedStr += ua
|
||||||
|
editProfileForm += \
|
||||||
|
' <br><b><label class="labels">' + \
|
||||||
|
translate['Blocked User Agents'] + '</label></b>\n'
|
||||||
|
editProfileForm += \
|
||||||
|
' <textarea id="message" name="userAgentsBlockedStr" ' + \
|
||||||
|
'style="height:200px" spellcheck="false">' + \
|
||||||
|
userAgentsBlockedStr + '</textarea>\n'
|
||||||
|
|
||||||
editProfileForm += ' </div></details>\n'
|
editProfileForm += ' </div></details>\n'
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
||||||
|
|
@ -1880,6 +1893,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
defaultTimeline: str, theme: str,
|
defaultTimeline: str, theme: str,
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
textModeBanner: str, city: str,
|
textModeBanner: str, city: str,
|
||||||
|
userAgentsBlocked: str,
|
||||||
accessKeys: {}) -> str:
|
accessKeys: {}) -> str:
|
||||||
"""Shows the edit profile screen
|
"""Shows the edit profile screen
|
||||||
"""
|
"""
|
||||||
|
|
@ -2056,7 +2070,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
|
|
||||||
# Filtering and blocking section
|
# Filtering and blocking section
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
_htmlEditProfileFiltering(baseDir, nickname, domain, translate)
|
_htmlEditProfileFiltering(baseDir, nickname, domain,
|
||||||
|
userAgentsBlocked, translate)
|
||||||
|
|
||||||
# git projects section
|
# git projects section
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
|
||||||