mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
af628d051c
commit
6604143504
10
blog.py
10
blog.py
|
@ -23,7 +23,7 @@ from utils import get_base_content_from_post
|
||||||
from utils import get_content_from_post
|
from utils import get_content_from_post
|
||||||
from utils import isAccountDir
|
from utils import isAccountDir
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import getMediaFormats
|
from utils import getMediaFormats
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
|
@ -457,7 +457,7 @@ def htmlBlogPost(session, authorized: bool,
|
||||||
if os.path.isfile(base_dir + '/blog.css'):
|
if os.path.isfile(base_dir + '/blog.css'):
|
||||||
cssFilename = base_dir + '/blog.css'
|
cssFilename = base_dir + '/blog.css'
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
published = post_json_object['object']['published']
|
published = post_json_object['object']['published']
|
||||||
modified = published
|
modified = published
|
||||||
if post_json_object['object'].get('updated'):
|
if post_json_object['object'].get('updated'):
|
||||||
|
@ -521,7 +521,7 @@ def htmlBlogPage(authorized: bool, session,
|
||||||
if os.path.isfile(base_dir + '/epicyon.css'):
|
if os.path.isfile(base_dir + '/epicyon.css'):
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
_htmlBlogRemoveCwButton(blogStr, translate)
|
_htmlBlogRemoveCwButton(blogStr, translate)
|
||||||
|
|
||||||
|
@ -741,7 +741,7 @@ def htmlBlogView(authorized: bool,
|
||||||
if os.path.isfile(base_dir + '/epicyon.css'):
|
if os.path.isfile(base_dir + '/epicyon.css'):
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
if _noOfBlogAccounts(base_dir) <= 1:
|
if _noOfBlogAccounts(base_dir) <= 1:
|
||||||
|
@ -847,7 +847,7 @@ def htmlEditBlog(media_instance: bool, translate: {},
|
||||||
dateAndLocation += '</div>'
|
dateAndLocation += '</div>'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
editBlogForm = \
|
editBlogForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
|
|
105
daemon.py
105
daemon.py
|
@ -284,7 +284,7 @@ from utils import clearFromPostCaches
|
||||||
from utils import containsInvalidChars
|
from utils import containsInvalidChars
|
||||||
from utils import isSystemAccount
|
from utils import isSystemAccount
|
||||||
from utils import setConfigParam
|
from utils import setConfigParam
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import removeIdEnding
|
from utils import removeIdEnding
|
||||||
from utils import undoLikesCollectionEntry
|
from utils import undoLikesCollectionEntry
|
||||||
from utils import deletePost
|
from utils import deletePost
|
||||||
|
@ -2484,7 +2484,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# person options screen, permission to post to newswire
|
# person options screen, permission to post to newswire
|
||||||
# See htmlPersonOptions
|
# See htmlPersonOptions
|
||||||
if '&submitPostToNews=' in optionsConfirmParams:
|
if '&submitPostToNews=' in optionsConfirmParams:
|
||||||
adminNickname = getConfigParam(self.server.base_dir, 'admin')
|
adminNickname = get_config_param(self.server.base_dir, 'admin')
|
||||||
if (chooserNickname != optionsNickname and
|
if (chooserNickname != optionsNickname and
|
||||||
(chooserNickname == adminNickname or
|
(chooserNickname == adminNickname or
|
||||||
(isModerator(self.server.base_dir, chooserNickname) and
|
(isModerator(self.server.base_dir, chooserNickname) and
|
||||||
|
@ -2529,7 +2529,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# person options screen, permission to post to featured articles
|
# person options screen, permission to post to featured articles
|
||||||
# See htmlPersonOptions
|
# See htmlPersonOptions
|
||||||
if '&submitPostToFeatures=' in optionsConfirmParams:
|
if '&submitPostToFeatures=' in optionsConfirmParams:
|
||||||
adminNickname = getConfigParam(self.server.base_dir, 'admin')
|
adminNickname = get_config_param(self.server.base_dir, 'admin')
|
||||||
if (chooserNickname != optionsNickname and
|
if (chooserNickname != optionsNickname and
|
||||||
(chooserNickname == adminNickname or
|
(chooserNickname == adminNickname or
|
||||||
(isModerator(self.server.base_dir, chooserNickname) and
|
(isModerator(self.server.base_dir, chooserNickname) and
|
||||||
|
@ -2575,7 +2575,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# person options screen, permission to post to newswire
|
# person options screen, permission to post to newswire
|
||||||
# See htmlPersonOptions
|
# See htmlPersonOptions
|
||||||
if '&submitModNewsPosts=' in optionsConfirmParams:
|
if '&submitModNewsPosts=' in optionsConfirmParams:
|
||||||
adminNickname = getConfigParam(self.server.base_dir, 'admin')
|
adminNickname = get_config_param(self.server.base_dir, 'admin')
|
||||||
if (chooserNickname != optionsNickname and
|
if (chooserNickname != optionsNickname and
|
||||||
(chooserNickname == adminNickname or
|
(chooserNickname == adminNickname or
|
||||||
(isModerator(self.server.base_dir, chooserNickname) and
|
(isModerator(self.server.base_dir, chooserNickname) and
|
||||||
|
@ -2698,7 +2698,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.server.keyShortcuts.get(nickname):
|
if self.server.keyShortcuts.get(nickname):
|
||||||
accessKeys = self.server.keyShortcuts[nickname]
|
accessKeys = self.server.keyShortcuts[nickname]
|
||||||
|
|
||||||
customSubmitText = getConfigParam(base_dir, 'customSubmitText')
|
customSubmitText = get_config_param(base_dir, 'customSubmitText')
|
||||||
conversationId = None
|
conversationId = None
|
||||||
msg = htmlNewPost(self.server.cssCache,
|
msg = htmlNewPost(self.server.cssCache,
|
||||||
False, self.server.translate,
|
False, self.server.translate,
|
||||||
|
@ -2833,7 +2833,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.server.keyShortcuts.get(nickname):
|
if self.server.keyShortcuts.get(nickname):
|
||||||
accessKeys = self.server.keyShortcuts[nickname]
|
accessKeys = self.server.keyShortcuts[nickname]
|
||||||
|
|
||||||
customSubmitText = getConfigParam(base_dir, 'customSubmitText')
|
customSubmitText = get_config_param(base_dir, 'customSubmitText')
|
||||||
conversationId = None
|
conversationId = None
|
||||||
msg = htmlNewPost(self.server.cssCache,
|
msg = htmlNewPost(self.server.cssCache,
|
||||||
False, self.server.translate,
|
False, self.server.translate,
|
||||||
|
@ -3862,7 +3862,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
shareActor = removeShareConfirmParams.split('actor=')[1]
|
shareActor = removeShareConfirmParams.split('actor=')[1]
|
||||||
if '&' in shareActor:
|
if '&' in shareActor:
|
||||||
shareActor = shareActor.split('&')[0]
|
shareActor = shareActor.split('&')[0]
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
adminActor = \
|
adminActor = \
|
||||||
local_actor_url(http_prefix, adminNickname, domain_full)
|
local_actor_url(http_prefix, adminNickname, domain_full)
|
||||||
actor = originPathStr
|
actor = originPathStr
|
||||||
|
@ -3929,7 +3929,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
shareActor = removeShareConfirmParams.split('actor=')[1]
|
shareActor = removeShareConfirmParams.split('actor=')[1]
|
||||||
if '&' in shareActor:
|
if '&' in shareActor:
|
||||||
shareActor = shareActor.split('&')[0]
|
shareActor = shareActor.split('&')[0]
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
adminActor = \
|
adminActor = \
|
||||||
local_actor_url(http_prefix, adminNickname, domain_full)
|
local_actor_url(http_prefix, adminNickname, domain_full)
|
||||||
actor = originPathStr
|
actor = originPathStr
|
||||||
|
@ -4154,7 +4154,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
linksFilename)
|
linksFilename)
|
||||||
|
|
||||||
adminNickname = \
|
adminNickname = \
|
||||||
getConfigParam(base_dir, 'admin')
|
get_config_param(base_dir, 'admin')
|
||||||
if nickname == adminNickname:
|
if nickname == adminNickname:
|
||||||
if fields.get('editedAbout'):
|
if fields.get('editedAbout'):
|
||||||
aboutStr = fields['editedAbout']
|
aboutStr = fields['editedAbout']
|
||||||
|
@ -4733,7 +4733,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.POSTbusy = False
|
self.server.POSTbusy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
adminNickname = getConfigParam(self.server.base_dir, 'admin')
|
adminNickname = get_config_param(self.server.base_dir, 'admin')
|
||||||
|
|
||||||
# get the various avatar, banner and background images
|
# get the various avatar, banner and background images
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
|
@ -5024,20 +5024,20 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.iconsCache = {}
|
self.server.iconsCache = {}
|
||||||
self.server.fontsCache = {}
|
self.server.fontsCache = {}
|
||||||
self.server.show_publish_as_icon = \
|
self.server.show_publish_as_icon = \
|
||||||
getConfigParam(self.server.base_dir,
|
get_config_param(self.server.base_dir,
|
||||||
'show_publish_as_icon')
|
'show_publish_as_icon')
|
||||||
self.server.full_width_tl_button_header = \
|
self.server.full_width_tl_button_header = \
|
||||||
getConfigParam(self.server.base_dir,
|
get_config_param(self.server.base_dir,
|
||||||
'full_width_tl_button_header')
|
'full_width_tl_button_header')
|
||||||
self.server.icons_as_buttons = \
|
self.server.icons_as_buttons = \
|
||||||
getConfigParam(self.server.base_dir,
|
get_config_param(self.server.base_dir,
|
||||||
'icons_as_buttons')
|
'icons_as_buttons')
|
||||||
self.server.rss_icon_at_top = \
|
self.server.rss_icon_at_top = \
|
||||||
getConfigParam(self.server.base_dir,
|
get_config_param(self.server.base_dir,
|
||||||
'rss_icon_at_top')
|
'rss_icon_at_top')
|
||||||
self.server.publish_button_at_top = \
|
self.server.publish_button_at_top = \
|
||||||
getConfigParam(self.server.base_dir,
|
get_config_param(self.server.base_dir,
|
||||||
'publish_button_at_top')
|
'publish_button_at_top')
|
||||||
setNewsAvatar(base_dir,
|
setNewsAvatar(base_dir,
|
||||||
fields['themeDropdown'],
|
fields['themeDropdown'],
|
||||||
http_prefix,
|
http_prefix,
|
||||||
|
@ -5131,7 +5131,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# change instance title
|
# change instance title
|
||||||
if fields.get('instanceTitle'):
|
if fields.get('instanceTitle'):
|
||||||
currInstanceTitle = \
|
currInstanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
if fields['instanceTitle'] != currInstanceTitle:
|
if fields['instanceTitle'] != currInstanceTitle:
|
||||||
setConfigParam(base_dir, 'instanceTitle',
|
setConfigParam(base_dir, 'instanceTitle',
|
||||||
fields['instanceTitle'])
|
fields['instanceTitle'])
|
||||||
|
@ -5181,7 +5181,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# change custom post submit button text
|
# change custom post submit button text
|
||||||
currCustomSubmitText = \
|
currCustomSubmitText = \
|
||||||
getConfigParam(base_dir, 'customSubmitText')
|
get_config_param(base_dir, 'customSubmitText')
|
||||||
if fields.get('customSubmitText'):
|
if fields.get('customSubmitText'):
|
||||||
if fields['customSubmitText'] != \
|
if fields['customSubmitText'] != \
|
||||||
currCustomSubmitText:
|
currCustomSubmitText:
|
||||||
|
@ -5196,8 +5196,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# libretranslate URL
|
# libretranslate URL
|
||||||
currLibretranslateUrl = \
|
currLibretranslateUrl = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'libretranslateUrl')
|
'libretranslateUrl')
|
||||||
if fields.get('libretranslateUrl'):
|
if fields.get('libretranslateUrl'):
|
||||||
if fields['libretranslateUrl'] != \
|
if fields['libretranslateUrl'] != \
|
||||||
currLibretranslateUrl:
|
currLibretranslateUrl:
|
||||||
|
@ -5214,8 +5214,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# libretranslate API Key
|
# libretranslate API Key
|
||||||
currLibretranslateApiKey = \
|
currLibretranslateApiKey = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'libretranslateApiKey')
|
'libretranslateApiKey')
|
||||||
if fields.get('libretranslateApiKey'):
|
if fields.get('libretranslateApiKey'):
|
||||||
if fields['libretranslateApiKey'] != \
|
if fields['libretranslateApiKey'] != \
|
||||||
currLibretranslateApiKey:
|
currLibretranslateApiKey:
|
||||||
|
@ -5248,8 +5248,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# change instance short description
|
# change instance short description
|
||||||
currInstanceDescriptionShort = \
|
currInstanceDescriptionShort = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'instanceDescriptionShort')
|
'instanceDescriptionShort')
|
||||||
if fields.get('instanceDescriptionShort'):
|
if fields.get('instanceDescriptionShort'):
|
||||||
if fields['instanceDescriptionShort'] != \
|
if fields['instanceDescriptionShort'] != \
|
||||||
currInstanceDescriptionShort:
|
currInstanceDescriptionShort:
|
||||||
|
@ -5264,7 +5264,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# change instance description
|
# change instance description
|
||||||
currInstanceDescription = \
|
currInstanceDescription = \
|
||||||
getConfigParam(base_dir, 'instanceDescription')
|
get_config_param(base_dir, 'instanceDescription')
|
||||||
if fields.get('instanceDescription'):
|
if fields.get('instanceDescription'):
|
||||||
if fields['instanceDescription'] != \
|
if fields['instanceDescription'] != \
|
||||||
currInstanceDescription:
|
currInstanceDescription:
|
||||||
|
@ -5546,7 +5546,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
redirectPath = 'previewAvatar'
|
redirectPath = 'previewAvatar'
|
||||||
|
|
||||||
adminNickname = \
|
adminNickname = \
|
||||||
getConfigParam(base_dir, 'admin')
|
get_config_param(base_dir, 'admin')
|
||||||
|
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
# whether to require jsonld signatures
|
# whether to require jsonld signatures
|
||||||
|
@ -5585,7 +5585,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if fields['broch_mode'] == 'on':
|
if fields['broch_mode'] == 'on':
|
||||||
broch_mode = True
|
broch_mode = True
|
||||||
currBrochMode = \
|
currBrochMode = \
|
||||||
getConfigParam(base_dir, "broch_mode")
|
get_config_param(base_dir, "broch_mode")
|
||||||
if broch_mode != currBrochMode:
|
if broch_mode != currBrochMode:
|
||||||
setBrochMode(self.server.base_dir,
|
setBrochMode(self.server.base_dir,
|
||||||
self.server.domain_full,
|
self.server.domain_full,
|
||||||
|
@ -5598,8 +5598,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
fed_domains_variable = \
|
fed_domains_variable = \
|
||||||
"shared_items_federated_domains"
|
"shared_items_federated_domains"
|
||||||
fed_domains_str = \
|
fed_domains_str = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
fed_domains_variable)
|
fed_domains_variable)
|
||||||
if not fed_domains_str:
|
if not fed_domains_str:
|
||||||
fed_domains_str = ''
|
fed_domains_str = ''
|
||||||
sharedItemsFormStr = ''
|
sharedItemsFormStr = ''
|
||||||
|
@ -5964,21 +5964,21 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.iconsCache = {}
|
self.server.iconsCache = {}
|
||||||
self.server.fontsCache = {}
|
self.server.fontsCache = {}
|
||||||
self.server.show_publish_as_icon = \
|
self.server.show_publish_as_icon = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'show_publish_as_icon')
|
'show_publish_as_icon')
|
||||||
self.server.full_width_tl_button_header = \
|
self.server.full_width_tl_button_header = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'fullWidthTimeline' +
|
'fullWidthTimeline' +
|
||||||
'ButtonHeader')
|
'ButtonHeader')
|
||||||
self.server.icons_as_buttons = \
|
self.server.icons_as_buttons = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'icons_as_buttons')
|
'icons_as_buttons')
|
||||||
self.server.rss_icon_at_top = \
|
self.server.rss_icon_at_top = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'rss_icon_at_top')
|
'rss_icon_at_top')
|
||||||
self.server.publish_button_at_top = \
|
self.server.publish_button_at_top = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir,
|
||||||
'publish_button_at_top')
|
'publish_button_at_top')
|
||||||
|
|
||||||
# only receive DMs from accounts you follow
|
# only receive DMs from accounts you follow
|
||||||
followDMsFilename = \
|
followDMsFilename = \
|
||||||
|
@ -6212,7 +6212,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if path.startswith('/users/' + adminNickname + '/') or \
|
if path.startswith('/users/' + adminNickname + '/') or \
|
||||||
isArtist(base_dir, nickname):
|
isArtist(base_dir, nickname):
|
||||||
currLowBandwidth = \
|
currLowBandwidth = \
|
||||||
getConfigParam(base_dir, 'low_bandwidth')
|
get_config_param(base_dir, 'low_bandwidth')
|
||||||
low_bandwidth = False
|
low_bandwidth = False
|
||||||
if fields.get('low_bandwidth'):
|
if fields.get('low_bandwidth'):
|
||||||
if fields['low_bandwidth'] == 'on':
|
if fields['low_bandwidth'] == 'on':
|
||||||
|
@ -6682,7 +6682,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
favType = 'image/avif'
|
favType = 'image/avif'
|
||||||
favFilename = favFilename.split('.')[0] + '.avif'
|
favFilename = favFilename.split('.')[0] + '.avif'
|
||||||
if not self.server.theme_name:
|
if not self.server.theme_name:
|
||||||
self.theme_name = getConfigParam(base_dir, 'theme')
|
self.theme_name = get_config_param(base_dir, 'theme')
|
||||||
if not self.server.theme_name:
|
if not self.server.theme_name:
|
||||||
self.server.theme_name = 'default'
|
self.server.theme_name = 'default'
|
||||||
# custom favicon
|
# custom favicon
|
||||||
|
@ -12964,7 +12964,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.server.keyShortcuts.get(nickname):
|
if self.server.keyShortcuts.get(nickname):
|
||||||
accessKeys = self.server.keyShortcuts[nickname]
|
accessKeys = self.server.keyShortcuts[nickname]
|
||||||
|
|
||||||
customSubmitText = getConfigParam(base_dir, 'customSubmitText')
|
customSubmitText = get_config_param(base_dir, 'customSubmitText')
|
||||||
|
|
||||||
post_json_object = None
|
post_json_object = None
|
||||||
if inReplyToUrl:
|
if inReplyToUrl:
|
||||||
|
@ -16552,7 +16552,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return -1
|
return -1
|
||||||
submitText = self.server.translate['Submit']
|
submitText = self.server.translate['Submit']
|
||||||
customSubmitText = \
|
customSubmitText = \
|
||||||
getConfigParam(self.server.base_dir, 'customSubmitText')
|
get_config_param(self.server.base_dir, 'customSubmitText')
|
||||||
if customSubmitText:
|
if customSubmitText:
|
||||||
submitText = customSubmitText
|
submitText = customSubmitText
|
||||||
if fields.get('submitPost'):
|
if fields.get('submitPost'):
|
||||||
|
@ -17965,8 +17965,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('SharesCatalog header: ' + self.headers['SharesCatalog'])
|
print('SharesCatalog header: ' + self.headers['SharesCatalog'])
|
||||||
if not self.server.shared_items_federated_domains:
|
if not self.server.shared_items_federated_domains:
|
||||||
siDomainsStr = getConfigParam(self.server.base_dir,
|
siDomainsStr = \
|
||||||
'shared_items_federated_domains')
|
get_config_param(self.server.base_dir,
|
||||||
|
'shared_items_federated_domains')
|
||||||
if siDomainsStr:
|
if siDomainsStr:
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('Loading shared items federated domains list')
|
print('Loading shared items federated domains list')
|
||||||
|
@ -18818,11 +18819,11 @@ def runDaemon(content_license_url: str,
|
||||||
if lists_enabled:
|
if lists_enabled:
|
||||||
httpd.lists_enabled = lists_enabled
|
httpd.lists_enabled = lists_enabled
|
||||||
else:
|
else:
|
||||||
httpd.lists_enabled = getConfigParam(base_dir, "lists_enabled")
|
httpd.lists_enabled = get_config_param(base_dir, "lists_enabled")
|
||||||
httpd.cw_lists = loadCWLists(base_dir, True)
|
httpd.cw_lists = loadCWLists(base_dir, True)
|
||||||
|
|
||||||
# set the avatar for the news account
|
# set the avatar for the news account
|
||||||
httpd.theme_name = getConfigParam(base_dir, 'theme')
|
httpd.theme_name = get_config_param(base_dir, 'theme')
|
||||||
if not httpd.theme_name:
|
if not httpd.theme_name:
|
||||||
httpd.theme_name = 'default'
|
httpd.theme_name = 'default'
|
||||||
if isNewsThemeName(base_dir, httpd.theme_name):
|
if isNewsThemeName(base_dir, httpd.theme_name):
|
||||||
|
|
192
epicyon.py
192
epicyon.py
|
@ -70,7 +70,7 @@ from utils import getPortFromDomain
|
||||||
from utils import has_users_path
|
from utils import has_users_path
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import setConfigParam
|
from utils import setConfigParam
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import followPerson
|
from utils import followPerson
|
||||||
|
@ -694,7 +694,7 @@ if args.libretranslateApiKey:
|
||||||
|
|
||||||
if args.posts:
|
if args.posts:
|
||||||
if not args.domain:
|
if not args.domain:
|
||||||
originDomain = getConfigParam(base_dir, 'domain')
|
originDomain = get_config_param(base_dir, 'domain')
|
||||||
else:
|
else:
|
||||||
originDomain = args.domain
|
originDomain = args.domain
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -763,7 +763,7 @@ if args.postDomains:
|
||||||
args.language = 'en'
|
args.language = 'en'
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if not args.domain:
|
if not args.domain:
|
||||||
originDomain = getConfigParam(base_dir, 'domain')
|
originDomain = get_config_param(base_dir, 'domain')
|
||||||
else:
|
else:
|
||||||
originDomain = args.domain
|
originDomain = args.domain
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
|
@ -882,7 +882,7 @@ if args.socnet:
|
||||||
if not args.language:
|
if not args.language:
|
||||||
args.language = 'en'
|
args.language = 'en'
|
||||||
if not args.domain:
|
if not args.domain:
|
||||||
args.domain = getConfigParam(base_dir, 'domain')
|
args.domain = get_config_param(base_dir, 'domain')
|
||||||
domain = ''
|
domain = ''
|
||||||
if args.domain:
|
if args.domain:
|
||||||
domain = args.domain
|
domain = args.domain
|
||||||
|
@ -904,7 +904,7 @@ if args.socnet:
|
||||||
|
|
||||||
if args.postsraw:
|
if args.postsraw:
|
||||||
if not args.domain:
|
if not args.domain:
|
||||||
originDomain = getConfigParam(base_dir, 'domain')
|
originDomain = get_config_param(base_dir, 'domain')
|
||||||
else:
|
else:
|
||||||
originDomain = args.domain
|
originDomain = args.domain
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -939,7 +939,7 @@ if args.json:
|
||||||
'Accept': 'application/ld+json; profile="' + profileStr + '"'
|
'Accept': 'application/ld+json; profile="' + profileStr + '"'
|
||||||
}
|
}
|
||||||
if not args.domain:
|
if not args.domain:
|
||||||
args.domain = getConfigParam(base_dir, 'domain')
|
args.domain = get_config_param(base_dir, 'domain')
|
||||||
domain = ''
|
domain = ''
|
||||||
if args.domain:
|
if args.domain:
|
||||||
domain = args.domain
|
domain = args.domain
|
||||||
|
@ -963,7 +963,7 @@ if args.htmlpost:
|
||||||
'Accept': 'text/html; profile="' + profileStr + '"'
|
'Accept': 'text/html; profile="' + profileStr + '"'
|
||||||
}
|
}
|
||||||
if not args.domain:
|
if not args.domain:
|
||||||
args.domain = getConfigParam(base_dir, 'domain')
|
args.domain = get_config_param(base_dir, 'domain')
|
||||||
domain = ''
|
domain = ''
|
||||||
if args.domain:
|
if args.domain:
|
||||||
domain = args.domain
|
domain = args.domain
|
||||||
|
@ -992,13 +992,13 @@ if not os.path.isdir(base_dir + '/cache/announce'):
|
||||||
os.mkdir(base_dir + '/cache/announce')
|
os.mkdir(base_dir + '/cache/announce')
|
||||||
|
|
||||||
# set the theme in config.json
|
# set the theme in config.json
|
||||||
theme_name = getConfigParam(base_dir, 'theme')
|
theme_name = get_config_param(base_dir, 'theme')
|
||||||
if not theme_name:
|
if not theme_name:
|
||||||
setConfigParam(base_dir, 'theme', 'default')
|
setConfigParam(base_dir, 'theme', 'default')
|
||||||
theme_name = 'default'
|
theme_name = 'default'
|
||||||
|
|
||||||
if not args.mediainstance:
|
if not args.mediainstance:
|
||||||
media_instance = getConfigParam(base_dir, 'media_instance')
|
media_instance = get_config_param(base_dir, 'media_instance')
|
||||||
if media_instance is not None:
|
if media_instance is not None:
|
||||||
args.mediainstance = media_instance
|
args.mediainstance = media_instance
|
||||||
if args.mediainstance:
|
if args.mediainstance:
|
||||||
|
@ -1006,7 +1006,7 @@ if not args.mediainstance:
|
||||||
args.newsinstance = False
|
args.newsinstance = False
|
||||||
|
|
||||||
if not args.newsinstance:
|
if not args.newsinstance:
|
||||||
news_instance = getConfigParam(base_dir, 'news_instance')
|
news_instance = get_config_param(base_dir, 'news_instance')
|
||||||
if news_instance is not None:
|
if news_instance is not None:
|
||||||
args.newsinstance = news_instance
|
args.newsinstance = news_instance
|
||||||
if args.newsinstance:
|
if args.newsinstance:
|
||||||
|
@ -1014,7 +1014,7 @@ if not args.newsinstance:
|
||||||
args.mediainstance = False
|
args.mediainstance = False
|
||||||
|
|
||||||
if not args.blogsinstance:
|
if not args.blogsinstance:
|
||||||
blogs_instance = getConfigParam(base_dir, 'blogs_instance')
|
blogs_instance = get_config_param(base_dir, 'blogs_instance')
|
||||||
if blogs_instance is not None:
|
if blogs_instance is not None:
|
||||||
args.blogsinstance = blogs_instance
|
args.blogsinstance = blogs_instance
|
||||||
if args.blogsinstance:
|
if args.blogsinstance:
|
||||||
|
@ -1022,18 +1022,18 @@ if not args.blogsinstance:
|
||||||
args.newsinstance = False
|
args.newsinstance = False
|
||||||
|
|
||||||
# set the instance title in config.json
|
# set the instance title in config.json
|
||||||
title = getConfigParam(base_dir, 'instanceTitle')
|
title = get_config_param(base_dir, 'instanceTitle')
|
||||||
if not title:
|
if not title:
|
||||||
setConfigParam(base_dir, 'instanceTitle', 'Epicyon')
|
setConfigParam(base_dir, 'instanceTitle', 'Epicyon')
|
||||||
|
|
||||||
# set the instance description in config.json
|
# set the instance description in config.json
|
||||||
descFull = getConfigParam(base_dir, 'instanceDescription')
|
descFull = get_config_param(base_dir, 'instanceDescription')
|
||||||
if not descFull:
|
if not descFull:
|
||||||
setConfigParam(base_dir, 'instanceDescription',
|
setConfigParam(base_dir, 'instanceDescription',
|
||||||
'Just another ActivityPub server')
|
'Just another ActivityPub server')
|
||||||
|
|
||||||
# set the short instance description in config.json
|
# set the short instance description in config.json
|
||||||
descShort = getConfigParam(base_dir, 'instanceDescriptionShort')
|
descShort = get_config_param(base_dir, 'instanceDescriptionShort')
|
||||||
if not descShort:
|
if not descShort:
|
||||||
setConfigParam(base_dir, 'instanceDescriptionShort',
|
setConfigParam(base_dir, 'instanceDescriptionShort',
|
||||||
'Just another ActivityPub server')
|
'Just another ActivityPub server')
|
||||||
|
@ -1069,7 +1069,7 @@ if args.i2p_domain:
|
||||||
setConfigParam(base_dir, 'i2p_domain', i2p_domain)
|
setConfigParam(base_dir, 'i2p_domain', i2p_domain)
|
||||||
|
|
||||||
if not args.language:
|
if not args.language:
|
||||||
languageCode = getConfigParam(base_dir, 'language')
|
languageCode = get_config_param(base_dir, 'language')
|
||||||
if languageCode:
|
if languageCode:
|
||||||
args.language = languageCode
|
args.language = languageCode
|
||||||
else:
|
else:
|
||||||
|
@ -1077,7 +1077,7 @@ if not args.language:
|
||||||
|
|
||||||
# maximum number of new registrations
|
# maximum number of new registrations
|
||||||
if not args.maxRegistrations:
|
if not args.maxRegistrations:
|
||||||
maxRegistrations = getConfigParam(base_dir, 'maxRegistrations')
|
maxRegistrations = get_config_param(base_dir, 'maxRegistrations')
|
||||||
if not maxRegistrations:
|
if not maxRegistrations:
|
||||||
maxRegistrations = 10
|
maxRegistrations = 10
|
||||||
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
|
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
|
||||||
|
@ -1088,7 +1088,7 @@ else:
|
||||||
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
|
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
|
||||||
|
|
||||||
# if this is the initial run then allow new registrations
|
# if this is the initial run then allow new registrations
|
||||||
if not getConfigParam(base_dir, 'registration'):
|
if not get_config_param(base_dir, 'registration'):
|
||||||
if args.registration.lower() == 'open':
|
if args.registration.lower() == 'open':
|
||||||
setConfigParam(base_dir, 'registration', 'open')
|
setConfigParam(base_dir, 'registration', 'open')
|
||||||
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
|
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
|
||||||
|
@ -1100,35 +1100,35 @@ if args.resetregistrations:
|
||||||
print('Number of new registrations reset to ' + str(maxRegistrations))
|
print('Number of new registrations reset to ' + str(maxRegistrations))
|
||||||
|
|
||||||
# unique ID for the instance
|
# unique ID for the instance
|
||||||
instance_id = getConfigParam(base_dir, 'instance_id')
|
instance_id = get_config_param(base_dir, 'instance_id')
|
||||||
if not instance_id:
|
if not instance_id:
|
||||||
instance_id = createPassword(32)
|
instance_id = createPassword(32)
|
||||||
setConfigParam(base_dir, 'instance_id', instance_id)
|
setConfigParam(base_dir, 'instance_id', instance_id)
|
||||||
print('Instance ID: ' + instance_id)
|
print('Instance ID: ' + instance_id)
|
||||||
|
|
||||||
# get domain name from configuration
|
# get domain name from configuration
|
||||||
configDomain = getConfigParam(base_dir, 'domain')
|
configDomain = get_config_param(base_dir, 'domain')
|
||||||
if configDomain:
|
if configDomain:
|
||||||
domain = configDomain
|
domain = configDomain
|
||||||
else:
|
else:
|
||||||
domain = 'localhost'
|
domain = 'localhost'
|
||||||
|
|
||||||
# get onion domain name from configuration
|
# get onion domain name from configuration
|
||||||
configOnionDomain = getConfigParam(base_dir, 'onion')
|
configOnionDomain = get_config_param(base_dir, 'onion')
|
||||||
if configOnionDomain:
|
if configOnionDomain:
|
||||||
onion_domain = configOnionDomain
|
onion_domain = configOnionDomain
|
||||||
else:
|
else:
|
||||||
onion_domain = None
|
onion_domain = None
|
||||||
|
|
||||||
# get i2p domain name from configuration
|
# get i2p domain name from configuration
|
||||||
configi2p_domain = getConfigParam(base_dir, 'i2p_domain')
|
configi2p_domain = get_config_param(base_dir, 'i2p_domain')
|
||||||
if configi2p_domain:
|
if configi2p_domain:
|
||||||
i2p_domain = configi2p_domain
|
i2p_domain = configi2p_domain
|
||||||
else:
|
else:
|
||||||
i2p_domain = None
|
i2p_domain = None
|
||||||
|
|
||||||
# get port number from configuration
|
# get port number from configuration
|
||||||
configPort = getConfigParam(base_dir, 'port')
|
configPort = get_config_param(base_dir, 'port')
|
||||||
if configPort:
|
if configPort:
|
||||||
port = configPort
|
port = configPort
|
||||||
else:
|
else:
|
||||||
|
@ -1138,7 +1138,7 @@ else:
|
||||||
else:
|
else:
|
||||||
port = 443
|
port = 443
|
||||||
|
|
||||||
configProxyPort = getConfigParam(base_dir, 'proxy_port')
|
configProxyPort = get_config_param(base_dir, 'proxy_port')
|
||||||
if configProxyPort:
|
if configProxyPort:
|
||||||
proxy_port = configProxyPort
|
proxy_port = configProxyPort
|
||||||
else:
|
else:
|
||||||
|
@ -1162,7 +1162,7 @@ if args.federation_list:
|
||||||
federation_list = args.federation_list.copy()
|
federation_list = args.federation_list.copy()
|
||||||
setConfigParam(base_dir, 'federation_list', federation_list)
|
setConfigParam(base_dir, 'federation_list', federation_list)
|
||||||
else:
|
else:
|
||||||
configFederationList = getConfigParam(base_dir, 'federation_list')
|
configFederationList = get_config_param(base_dir, 'federation_list')
|
||||||
if configFederationList:
|
if configFederationList:
|
||||||
federation_list = configFederationList
|
federation_list = configFederationList
|
||||||
|
|
||||||
|
@ -1187,7 +1187,7 @@ if args.approve:
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1215,7 +1215,7 @@ if args.deny:
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1308,7 +1308,7 @@ if args.message:
|
||||||
followersOnly = False
|
followersOnly = False
|
||||||
isArticle = False
|
isArticle = False
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1346,7 +1346,7 @@ if args.announce:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1390,7 +1390,7 @@ if args.box:
|
||||||
elif args.gnunet:
|
elif args.gnunet:
|
||||||
proxy_type = 'gnunet'
|
proxy_type = 'gnunet'
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1451,7 +1451,7 @@ if args.itemName:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1494,7 +1494,7 @@ if args.undoItemName:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1556,7 +1556,7 @@ if args.wantedItemName:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1599,7 +1599,7 @@ if args.undoWantedItemName:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1633,7 +1633,7 @@ if args.like:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1672,7 +1672,7 @@ if args.react:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1705,7 +1705,7 @@ if args.undolike:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1745,7 +1745,7 @@ if args.undoreact:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1779,7 +1779,7 @@ if args.bookmark:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1813,7 +1813,7 @@ if args.unbookmark:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1846,7 +1846,7 @@ if args.delete:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1891,7 +1891,7 @@ if args.follow:
|
||||||
if args.follow.startswith('https'):
|
if args.follow.startswith('https'):
|
||||||
followHttpPrefix = 'https'
|
followHttpPrefix = 'https'
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1937,7 +1937,7 @@ if args.unfollow:
|
||||||
if args.follow.startswith('https'):
|
if args.follow.startswith('https'):
|
||||||
followHttpPrefix = 'https'
|
followHttpPrefix = 'https'
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -1972,7 +1972,7 @@ if args.followingList:
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
followHttpPrefix = http_prefix
|
followHttpPrefix = http_prefix
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2005,7 +2005,7 @@ if args.followersList:
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
followHttpPrefix = http_prefix
|
followHttpPrefix = http_prefix
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2039,7 +2039,7 @@ if args.followRequestsList:
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
followHttpPrefix = http_prefix
|
followHttpPrefix = http_prefix
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2091,7 +2091,7 @@ if args.migrations:
|
||||||
port = 443
|
port = 443
|
||||||
session = createSession(proxy_type)
|
session = createSession(proxy_type)
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2106,7 +2106,7 @@ if args.migrations:
|
||||||
|
|
||||||
if args.actor:
|
if args.actor:
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
if debug:
|
if debug:
|
||||||
print('base_dir: ' + str(base_dir))
|
print('base_dir: ' + str(base_dir))
|
||||||
|
@ -2260,11 +2260,11 @@ if args.addaccount:
|
||||||
domain = args.addaccount.split('@')[1]
|
domain = args.addaccount.split('@')[1]
|
||||||
else:
|
else:
|
||||||
nickname = args.addaccount
|
nickname = args.addaccount
|
||||||
if not args.domain or not getConfigParam(base_dir, 'domain'):
|
if not args.domain or not get_config_param(base_dir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
configuredDomain = getConfigParam(base_dir, 'domain')
|
configuredDomain = get_config_param(base_dir, 'domain')
|
||||||
if configuredDomain:
|
if configuredDomain:
|
||||||
if domain != configuredDomain:
|
if domain != configuredDomain:
|
||||||
print('The account domain is expected to be ' + configuredDomain)
|
print('The account domain is expected to be ' + configuredDomain)
|
||||||
|
@ -2308,7 +2308,7 @@ if args.addgroup:
|
||||||
domain = args.addgroup.split('@')[1]
|
domain = args.addgroup.split('@')[1]
|
||||||
else:
|
else:
|
||||||
nickname = args.addgroup
|
nickname = args.addgroup
|
||||||
if not args.domain or not getConfigParam(base_dir, 'domain'):
|
if not args.domain or not get_config_param(base_dir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
if nickname.startswith('!'):
|
if nickname.startswith('!'):
|
||||||
|
@ -2350,15 +2350,15 @@ if args.rmaccount:
|
||||||
domain = args.rmaccount.split('@')[1]
|
domain = args.rmaccount.split('@')[1]
|
||||||
else:
|
else:
|
||||||
nickname = args.rmaccount
|
nickname = args.rmaccount
|
||||||
if not args.domain or not getConfigParam(base_dir, 'domain'):
|
if not args.domain or not get_config_param(base_dir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
if args.domain:
|
if args.domain:
|
||||||
domain = args.domain
|
domain = args.domain
|
||||||
else:
|
else:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
|
|
||||||
configuredDomain = getConfigParam(base_dir, 'domain')
|
configuredDomain = get_config_param(base_dir, 'domain')
|
||||||
if configuredDomain:
|
if configuredDomain:
|
||||||
if domain != configuredDomain:
|
if domain != configuredDomain:
|
||||||
print('The account domain is expected to be ' + configuredDomain)
|
print('The account domain is expected to be ' + configuredDomain)
|
||||||
|
@ -2384,7 +2384,7 @@ if args.activate:
|
||||||
domain = args.activate.split('@')[1]
|
domain = args.activate.split('@')[1]
|
||||||
else:
|
else:
|
||||||
nickname = args.activate
|
nickname = args.activate
|
||||||
if not args.domain or not getConfigParam(base_dir, 'domain'):
|
if not args.domain or not get_config_param(base_dir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
if activateAccount(base_dir, nickname, domain):
|
if activateAccount(base_dir, nickname, domain):
|
||||||
|
@ -2403,7 +2403,7 @@ if args.changepassword:
|
||||||
domain = args.changepassword[0].split('@')[1]
|
domain = args.changepassword[0].split('@')[1]
|
||||||
else:
|
else:
|
||||||
nickname = args.changepassword[0]
|
nickname = args.changepassword[0]
|
||||||
if not args.domain or not getConfigParam(base_dir, 'domain'):
|
if not args.domain or not get_config_param(base_dir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
newPassword = args.changepassword[1]
|
newPassword = args.changepassword[1]
|
||||||
|
@ -2499,7 +2499,7 @@ if args.skill:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2534,7 +2534,7 @@ if args.availability:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2614,7 +2614,7 @@ if args.shared_items_federated_domains:
|
||||||
fed_domains_str)
|
fed_domains_str)
|
||||||
else:
|
else:
|
||||||
fed_domains_str = \
|
fed_domains_str = \
|
||||||
getConfigParam(base_dir, 'shared_items_federated_domains')
|
get_config_param(base_dir, 'shared_items_federated_domains')
|
||||||
if fed_domains_str:
|
if fed_domains_str:
|
||||||
fed_domains_list = fed_domains_str.split(',')
|
fed_domains_list = fed_domains_str.split(',')
|
||||||
for sharedFederatedDomain in fed_domains_list:
|
for sharedFederatedDomain in fed_domains_list:
|
||||||
|
@ -2648,7 +2648,7 @@ if args.block:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2680,7 +2680,7 @@ if args.mute:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2712,7 +2712,7 @@ if args.unmute:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -2756,7 +2756,7 @@ if args.unblock:
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
domain = getConfigParam(base_dir, 'domain')
|
domain = get_config_param(base_dir, 'domain')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
if args.secure_mode:
|
if args.secure_mode:
|
||||||
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
|
||||||
|
@ -3001,11 +3001,11 @@ if args.testdata:
|
||||||
if args.max_mentions < 4:
|
if args.max_mentions < 4:
|
||||||
args.max_mentions = 4
|
args.max_mentions = 4
|
||||||
|
|
||||||
registration = getConfigParam(base_dir, 'registration')
|
registration = get_config_param(base_dir, 'registration')
|
||||||
if not registration:
|
if not registration:
|
||||||
registration = False
|
registration = False
|
||||||
|
|
||||||
minimumvotes = getConfigParam(base_dir, 'minvotes')
|
minimumvotes = get_config_param(base_dir, 'minvotes')
|
||||||
if minimumvotes:
|
if minimumvotes:
|
||||||
args.minimumvotes = int(minimumvotes)
|
args.minimumvotes = int(minimumvotes)
|
||||||
|
|
||||||
|
@ -3014,127 +3014,127 @@ if args.content_license_url:
|
||||||
content_license_url = args.content_license_url
|
content_license_url = args.content_license_url
|
||||||
setConfigParam(base_dir, 'content_license_url', content_license_url)
|
setConfigParam(base_dir, 'content_license_url', content_license_url)
|
||||||
else:
|
else:
|
||||||
content_license_url = getConfigParam(base_dir, 'content_license_url')
|
content_license_url = get_config_param(base_dir, 'content_license_url')
|
||||||
|
|
||||||
votingtime = getConfigParam(base_dir, 'votingtime')
|
votingtime = get_config_param(base_dir, 'votingtime')
|
||||||
if votingtime:
|
if votingtime:
|
||||||
args.votingtime = votingtime
|
args.votingtime = votingtime
|
||||||
|
|
||||||
# only show the date at the bottom of posts
|
# only show the date at the bottom of posts
|
||||||
dateonly = getConfigParam(base_dir, 'dateonly')
|
dateonly = get_config_param(base_dir, 'dateonly')
|
||||||
if dateonly:
|
if dateonly:
|
||||||
args.dateonly = dateonly
|
args.dateonly = dateonly
|
||||||
|
|
||||||
# set the maximum number of newswire posts per account or rss feed
|
# set the maximum number of newswire posts per account or rss feed
|
||||||
max_newswire_postsPerSource = \
|
max_newswire_postsPerSource = \
|
||||||
getConfigParam(base_dir, 'max_newswire_postsPerSource')
|
get_config_param(base_dir, 'max_newswire_postsPerSource')
|
||||||
if max_newswire_postsPerSource:
|
if max_newswire_postsPerSource:
|
||||||
args.max_newswire_postsPerSource = int(max_newswire_postsPerSource)
|
args.max_newswire_postsPerSource = int(max_newswire_postsPerSource)
|
||||||
|
|
||||||
# set the maximum number of newswire posts appearing in the right column
|
# set the maximum number of newswire posts appearing in the right column
|
||||||
max_newswire_posts = \
|
max_newswire_posts = \
|
||||||
getConfigParam(base_dir, 'max_newswire_posts')
|
get_config_param(base_dir, 'max_newswire_posts')
|
||||||
if max_newswire_posts:
|
if max_newswire_posts:
|
||||||
args.max_newswire_posts = int(max_newswire_posts)
|
args.max_newswire_posts = int(max_newswire_posts)
|
||||||
|
|
||||||
# set the maximum size of a newswire rss/atom feed in Kilobytes
|
# set the maximum size of a newswire rss/atom feed in Kilobytes
|
||||||
max_newswire_feed_size_kb = \
|
max_newswire_feed_size_kb = \
|
||||||
getConfigParam(base_dir, 'max_newswire_feed_size_kb')
|
get_config_param(base_dir, 'max_newswire_feed_size_kb')
|
||||||
if max_newswire_feed_size_kb:
|
if max_newswire_feed_size_kb:
|
||||||
args.max_newswire_feed_size_kb = int(max_newswire_feed_size_kb)
|
args.max_newswire_feed_size_kb = int(max_newswire_feed_size_kb)
|
||||||
|
|
||||||
max_mirrored_articles = \
|
max_mirrored_articles = \
|
||||||
getConfigParam(base_dir, 'max_mirrored_articles')
|
get_config_param(base_dir, 'max_mirrored_articles')
|
||||||
if max_mirrored_articles is not None:
|
if max_mirrored_articles is not None:
|
||||||
args.max_mirrored_articles = int(max_mirrored_articles)
|
args.max_mirrored_articles = int(max_mirrored_articles)
|
||||||
|
|
||||||
max_news_posts = \
|
max_news_posts = \
|
||||||
getConfigParam(base_dir, 'max_news_posts')
|
get_config_param(base_dir, 'max_news_posts')
|
||||||
if max_news_posts is not None:
|
if max_news_posts is not None:
|
||||||
args.max_news_posts = int(max_news_posts)
|
args.max_news_posts = int(max_news_posts)
|
||||||
|
|
||||||
max_followers = \
|
max_followers = \
|
||||||
getConfigParam(base_dir, 'max_followers')
|
get_config_param(base_dir, 'max_followers')
|
||||||
if max_followers is not None:
|
if max_followers is not None:
|
||||||
args.max_followers = int(max_followers)
|
args.max_followers = int(max_followers)
|
||||||
|
|
||||||
max_feed_item_size_kb = \
|
max_feed_item_size_kb = \
|
||||||
getConfigParam(base_dir, 'max_feed_item_size_kb')
|
get_config_param(base_dir, 'max_feed_item_size_kb')
|
||||||
if max_feed_item_size_kb is not None:
|
if max_feed_item_size_kb is not None:
|
||||||
args.max_feed_item_size_kb = int(max_feed_item_size_kb)
|
args.max_feed_item_size_kb = int(max_feed_item_size_kb)
|
||||||
|
|
||||||
dormant_months = \
|
dormant_months = \
|
||||||
getConfigParam(base_dir, 'dormant_months')
|
get_config_param(base_dir, 'dormant_months')
|
||||||
if dormant_months is not None:
|
if dormant_months is not None:
|
||||||
args.dormant_months = int(dormant_months)
|
args.dormant_months = int(dormant_months)
|
||||||
|
|
||||||
send_threads_timeout_mins = \
|
send_threads_timeout_mins = \
|
||||||
getConfigParam(base_dir, 'send_threads_timeout_mins')
|
get_config_param(base_dir, 'send_threads_timeout_mins')
|
||||||
if send_threads_timeout_mins is not None:
|
if send_threads_timeout_mins is not None:
|
||||||
args.send_threads_timeout_mins = int(send_threads_timeout_mins)
|
args.send_threads_timeout_mins = int(send_threads_timeout_mins)
|
||||||
|
|
||||||
max_like_count = \
|
max_like_count = \
|
||||||
getConfigParam(base_dir, 'max_like_count')
|
get_config_param(base_dir, 'max_like_count')
|
||||||
if max_like_count is not None:
|
if max_like_count is not None:
|
||||||
args.max_like_count = int(max_like_count)
|
args.max_like_count = int(max_like_count)
|
||||||
|
|
||||||
show_publish_as_icon = \
|
show_publish_as_icon = \
|
||||||
getConfigParam(base_dir, 'show_publish_as_icon')
|
get_config_param(base_dir, 'show_publish_as_icon')
|
||||||
if show_publish_as_icon is not None:
|
if show_publish_as_icon is not None:
|
||||||
args.show_publish_as_icon = bool(show_publish_as_icon)
|
args.show_publish_as_icon = bool(show_publish_as_icon)
|
||||||
|
|
||||||
icons_as_buttons = \
|
icons_as_buttons = \
|
||||||
getConfigParam(base_dir, 'icons_as_buttons')
|
get_config_param(base_dir, 'icons_as_buttons')
|
||||||
if icons_as_buttons is not None:
|
if icons_as_buttons is not None:
|
||||||
args.icons_as_buttons = bool(icons_as_buttons)
|
args.icons_as_buttons = bool(icons_as_buttons)
|
||||||
|
|
||||||
rss_icon_at_top = \
|
rss_icon_at_top = \
|
||||||
getConfigParam(base_dir, 'rss_icon_at_top')
|
get_config_param(base_dir, 'rss_icon_at_top')
|
||||||
if rss_icon_at_top is not None:
|
if rss_icon_at_top is not None:
|
||||||
args.rss_icon_at_top = bool(rss_icon_at_top)
|
args.rss_icon_at_top = bool(rss_icon_at_top)
|
||||||
|
|
||||||
publish_button_at_top = \
|
publish_button_at_top = \
|
||||||
getConfigParam(base_dir, 'publish_button_at_top')
|
get_config_param(base_dir, 'publish_button_at_top')
|
||||||
if publish_button_at_top is not None:
|
if publish_button_at_top is not None:
|
||||||
args.publish_button_at_top = bool(publish_button_at_top)
|
args.publish_button_at_top = bool(publish_button_at_top)
|
||||||
|
|
||||||
full_width_tl_button_header = \
|
full_width_tl_button_header = \
|
||||||
getConfigParam(base_dir, 'full_width_tl_button_header')
|
get_config_param(base_dir, 'full_width_tl_button_header')
|
||||||
if full_width_tl_button_header is not None:
|
if full_width_tl_button_header is not None:
|
||||||
args.full_width_tl_button_header = bool(full_width_tl_button_header)
|
args.full_width_tl_button_header = bool(full_width_tl_button_header)
|
||||||
|
|
||||||
allow_local_network_access = \
|
allow_local_network_access = \
|
||||||
getConfigParam(base_dir, 'allow_local_network_access')
|
get_config_param(base_dir, 'allow_local_network_access')
|
||||||
if allow_local_network_access is not None:
|
if allow_local_network_access is not None:
|
||||||
args.allow_local_network_access = bool(allow_local_network_access)
|
args.allow_local_network_access = bool(allow_local_network_access)
|
||||||
|
|
||||||
verify_all_signatures = \
|
verify_all_signatures = \
|
||||||
getConfigParam(base_dir, 'verify_all_signatures')
|
get_config_param(base_dir, 'verify_all_signatures')
|
||||||
if verify_all_signatures is not None:
|
if verify_all_signatures is not None:
|
||||||
args.verify_all_signatures = bool(verify_all_signatures)
|
args.verify_all_signatures = bool(verify_all_signatures)
|
||||||
|
|
||||||
broch_mode = \
|
broch_mode = \
|
||||||
getConfigParam(base_dir, 'broch_mode')
|
get_config_param(base_dir, 'broch_mode')
|
||||||
if broch_mode is not None:
|
if broch_mode is not None:
|
||||||
args.broch_mode = bool(broch_mode)
|
args.broch_mode = bool(broch_mode)
|
||||||
|
|
||||||
log_login_failures = \
|
log_login_failures = \
|
||||||
getConfigParam(base_dir, 'log_login_failures')
|
get_config_param(base_dir, 'log_login_failures')
|
||||||
if log_login_failures is not None:
|
if log_login_failures is not None:
|
||||||
args.log_login_failures = bool(log_login_failures)
|
args.log_login_failures = bool(log_login_failures)
|
||||||
|
|
||||||
show_node_info_accounts = \
|
show_node_info_accounts = \
|
||||||
getConfigParam(base_dir, 'show_node_info_accounts')
|
get_config_param(base_dir, 'show_node_info_accounts')
|
||||||
if show_node_info_accounts is not None:
|
if show_node_info_accounts is not None:
|
||||||
args.show_node_info_accounts = bool(show_node_info_accounts)
|
args.show_node_info_accounts = bool(show_node_info_accounts)
|
||||||
|
|
||||||
show_node_info_version = \
|
show_node_info_version = \
|
||||||
getConfigParam(base_dir, 'show_node_info_version')
|
get_config_param(base_dir, 'show_node_info_version')
|
||||||
if show_node_info_version is not None:
|
if show_node_info_version is not None:
|
||||||
args.show_node_info_version = bool(show_node_info_version)
|
args.show_node_info_version = bool(show_node_info_version)
|
||||||
|
|
||||||
low_bandwidth = \
|
low_bandwidth = \
|
||||||
getConfigParam(base_dir, 'low_bandwidth')
|
get_config_param(base_dir, 'low_bandwidth')
|
||||||
if low_bandwidth is not None:
|
if low_bandwidth is not None:
|
||||||
args.low_bandwidth = bool(low_bandwidth)
|
args.low_bandwidth = bool(low_bandwidth)
|
||||||
|
|
||||||
|
@ -3144,7 +3144,7 @@ if args.userAgentBlocks:
|
||||||
setConfigParam(base_dir, 'user_agents_blocked', user_agents_blockedStr)
|
setConfigParam(base_dir, 'user_agents_blocked', user_agents_blockedStr)
|
||||||
else:
|
else:
|
||||||
user_agents_blockedStr = \
|
user_agents_blockedStr = \
|
||||||
getConfigParam(base_dir, 'user_agents_blocked')
|
get_config_param(base_dir, 'user_agents_blocked')
|
||||||
if user_agents_blockedStr:
|
if user_agents_blockedStr:
|
||||||
agentBlocksList = user_agents_blockedStr.split(',')
|
agentBlocksList = user_agents_blockedStr.split(',')
|
||||||
for agentBlockStr in agentBlocksList:
|
for agentBlockStr in agentBlocksList:
|
||||||
|
@ -3155,14 +3155,14 @@ if args.lists_enabled:
|
||||||
lists_enabled = args.lists_enabled
|
lists_enabled = args.lists_enabled
|
||||||
setConfigParam(base_dir, 'lists_enabled', lists_enabled)
|
setConfigParam(base_dir, 'lists_enabled', lists_enabled)
|
||||||
else:
|
else:
|
||||||
lists_enabled = getConfigParam(base_dir, 'lists_enabled')
|
lists_enabled = get_config_param(base_dir, 'lists_enabled')
|
||||||
|
|
||||||
city = \
|
city = \
|
||||||
getConfigParam(base_dir, 'city')
|
get_config_param(base_dir, 'city')
|
||||||
if city is not None:
|
if city is not None:
|
||||||
args.city = city
|
args.city = city
|
||||||
|
|
||||||
YTDomain = getConfigParam(base_dir, 'youtubedomain')
|
YTDomain = get_config_param(base_dir, 'youtubedomain')
|
||||||
if YTDomain:
|
if YTDomain:
|
||||||
if '://' in YTDomain:
|
if '://' in YTDomain:
|
||||||
YTDomain = YTDomain.split('://')[1]
|
YTDomain = YTDomain.split('://')[1]
|
||||||
|
@ -3171,7 +3171,7 @@ if YTDomain:
|
||||||
if '.' in YTDomain:
|
if '.' in YTDomain:
|
||||||
args.yt_replace_domain = YTDomain
|
args.yt_replace_domain = YTDomain
|
||||||
|
|
||||||
twitterDomain = getConfigParam(base_dir, 'twitterdomain')
|
twitterDomain = get_config_param(base_dir, 'twitterdomain')
|
||||||
if twitterDomain:
|
if twitterDomain:
|
||||||
if '://' in twitterDomain:
|
if '://' in twitterDomain:
|
||||||
twitterDomain = twitterDomain.split('://')[1]
|
twitterDomain = twitterDomain.split('://')[1]
|
||||||
|
@ -3187,7 +3187,7 @@ if setTheme(base_dir, theme_name, domain,
|
||||||
# whether new registrations are open or closed
|
# whether new registrations are open or closed
|
||||||
if args.registration:
|
if args.registration:
|
||||||
if args.registration.lower() == 'open':
|
if args.registration.lower() == 'open':
|
||||||
registration = getConfigParam(base_dir, 'registration')
|
registration = get_config_param(base_dir, 'registration')
|
||||||
if not registration:
|
if not registration:
|
||||||
setConfigParam(base_dir, 'registrationsRemaining',
|
setConfigParam(base_dir, 'registrationsRemaining',
|
||||||
str(maxRegistrations))
|
str(maxRegistrations))
|
||||||
|
@ -3201,7 +3201,7 @@ if args.registration:
|
||||||
setConfigParam(base_dir, 'registration', 'closed')
|
setConfigParam(base_dir, 'registration', 'closed')
|
||||||
print('New registrations closed')
|
print('New registrations closed')
|
||||||
|
|
||||||
defaultCurrency = getConfigParam(base_dir, 'defaultCurrency')
|
defaultCurrency = get_config_param(base_dir, 'defaultCurrency')
|
||||||
if not defaultCurrency:
|
if not defaultCurrency:
|
||||||
setConfigParam(base_dir, 'defaultCurrency', 'EUR')
|
setConfigParam(base_dir, 'defaultCurrency', 'EUR')
|
||||||
if args.defaultCurrency:
|
if args.defaultCurrency:
|
||||||
|
|
|
@ -11,7 +11,7 @@ import os
|
||||||
import time
|
import time
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import saveJson
|
from utils import saveJson
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ def htmlWatchPointsGraph(base_dir: str, fitness: {}, fitnessId: str,
|
||||||
cssFilename = base_dir + '/graph.css'
|
cssFilename = base_dir + '/graph.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
htmlStr += \
|
htmlStr += \
|
||||||
'<table class="graph">\n' + \
|
'<table class="graph">\n' + \
|
||||||
|
|
14
inbox.py
14
inbox.py
|
@ -35,7 +35,7 @@ from utils import getPortFromDomain
|
||||||
from utils import has_object_dict
|
from utils import has_object_dict
|
||||||
from utils import dmAllowedFromDomain
|
from utils import dmAllowedFromDomain
|
||||||
from utils import isRecentPost
|
from utils import isRecentPost
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import has_users_path
|
from utils import has_users_path
|
||||||
from utils import valid_post_date
|
from utils import valid_post_date
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
|
@ -303,8 +303,8 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, max_recent_posts: int,
|
||||||
boxname = 'inbox'
|
boxname = 'inbox'
|
||||||
|
|
||||||
notDM = not isDM(post_json_object)
|
notDM = not isDM(post_json_object)
|
||||||
yt_replace_domain = getConfigParam(base_dir, 'youtubedomain')
|
yt_replace_domain = get_config_param(base_dir, 'youtubedomain')
|
||||||
twitter_replacement_domain = getConfigParam(base_dir, 'twitterdomain')
|
twitter_replacement_domain = get_config_param(base_dir, 'twitterdomain')
|
||||||
individualPostAsHtml(signing_priv_key_pem,
|
individualPostAsHtml(signing_priv_key_pem,
|
||||||
True, recentPostsCache, max_recent_posts,
|
True, recentPostsCache, max_recent_posts,
|
||||||
translate, pageNumber,
|
translate, pageNumber,
|
||||||
|
@ -2631,7 +2631,7 @@ def _sendToGroupMembers(session, base_dir: str, handle: str, port: int,
|
||||||
sharedItemFederationTokens = {}
|
sharedItemFederationTokens = {}
|
||||||
shared_items_federated_domains = []
|
shared_items_federated_domains = []
|
||||||
shared_items_federated_domainsStr = \
|
shared_items_federated_domainsStr = \
|
||||||
getConfigParam(base_dir, 'shared_items_federated_domains')
|
get_config_param(base_dir, 'shared_items_federated_domains')
|
||||||
if shared_items_federated_domainsStr:
|
if shared_items_federated_domainsStr:
|
||||||
siFederatedDomainsList = \
|
siFederatedDomainsList = \
|
||||||
shared_items_federated_domainsStr.split(',')
|
shared_items_federated_domainsStr.split(',')
|
||||||
|
@ -4207,7 +4207,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
|
||||||
'accounts': {}
|
'accounts': {}
|
||||||
}
|
}
|
||||||
# also check if the json signature enforcement has changed
|
# also check if the json signature enforcement has changed
|
||||||
verifyAllSigs = getConfigParam(base_dir, "verify_all_signatures")
|
verifyAllSigs = get_config_param(base_dir, "verify_all_signatures")
|
||||||
if verifyAllSigs is not None:
|
if verifyAllSigs is not None:
|
||||||
verify_all_signatures = verifyAllSigs
|
verify_all_signatures = verifyAllSigs
|
||||||
# change the last time that this was done
|
# change the last time that this was done
|
||||||
|
@ -4489,8 +4489,8 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
|
||||||
if not os.path.isfile(sharedInboxPostFilename):
|
if not os.path.isfile(sharedInboxPostFilename):
|
||||||
saveJson(queueJson['post'], sharedInboxPostFilename)
|
saveJson(queueJson['post'], sharedInboxPostFilename)
|
||||||
|
|
||||||
lists_enabled = getConfigParam(base_dir, "lists_enabled")
|
lists_enabled = get_config_param(base_dir, "lists_enabled")
|
||||||
content_license_url = getConfigParam(base_dir, "content_license_url")
|
content_license_url = get_config_param(base_dir, "content_license_url")
|
||||||
|
|
||||||
# for posts addressed to specific accounts
|
# for posts addressed to specific accounts
|
||||||
for handle, capsId in recipientsDict.items():
|
for handle, capsId in recipientsDict.items():
|
||||||
|
|
11
languages.py
11
languages.py
|
@ -13,7 +13,7 @@ from urllib import request, parse
|
||||||
from utils import get_actor_languages_list
|
from utils import get_actor_languages_list
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import has_object_dict
|
from utils import has_object_dict
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import local_actor_url
|
from utils import local_actor_url
|
||||||
from cache import getPersonFromCache
|
from cache import getPersonFromCache
|
||||||
|
|
||||||
|
@ -118,9 +118,10 @@ def understoodPostLanguage(base_dir: str, nickname: str, domain: str,
|
||||||
if msgObject['contentMap'].get(lang):
|
if msgObject['contentMap'].get(lang):
|
||||||
return True
|
return True
|
||||||
# is the language for this post supported by libretranslate?
|
# is the language for this post supported by libretranslate?
|
||||||
libretranslateUrl = getConfigParam(base_dir, "libretranslateUrl")
|
libretranslateUrl = get_config_param(base_dir, "libretranslateUrl")
|
||||||
if libretranslateUrl:
|
if libretranslateUrl:
|
||||||
libretranslateApiKey = getConfigParam(base_dir, "libretranslateApiKey")
|
libretranslateApiKey = \
|
||||||
|
get_config_param(base_dir, "libretranslateApiKey")
|
||||||
lang_list = \
|
lang_list = \
|
||||||
libretranslateLanguages(libretranslateUrl, libretranslateApiKey)
|
libretranslateLanguages(libretranslateUrl, libretranslateApiKey)
|
||||||
for lang in lang_list:
|
for lang in lang_list:
|
||||||
|
@ -287,10 +288,10 @@ def autoTranslatePost(base_dir: str, post_json_object: {},
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
# is the language for this post supported by libretranslate?
|
# is the language for this post supported by libretranslate?
|
||||||
libretranslateUrl = getConfigParam(base_dir, "libretranslateUrl")
|
libretranslateUrl = get_config_param(base_dir, "libretranslateUrl")
|
||||||
if not libretranslateUrl:
|
if not libretranslateUrl:
|
||||||
return ''
|
return ''
|
||||||
libretranslateApiKey = getConfigParam(base_dir, "libretranslateApiKey")
|
libretranslateApiKey = get_config_param(base_dir, "libretranslateApiKey")
|
||||||
lang_list = \
|
lang_list = \
|
||||||
libretranslateLanguages(libretranslateUrl, libretranslateApiKey)
|
libretranslateLanguages(libretranslateUrl, libretranslateApiKey)
|
||||||
for lang in lang_list:
|
for lang in lang_list:
|
||||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "API"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from metadata import metaDataInstance
|
from metadata import metaDataInstance
|
||||||
|
|
||||||
|
@ -196,17 +196,16 @@ def mastoApiV1Response(path: str, callingDomain: str,
|
||||||
sendJsonStr = \
|
sendJsonStr = \
|
||||||
'masto API custom emojis sent ' + path + callingInfo
|
'masto API custom emojis sent ' + path + callingInfo
|
||||||
|
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if adminNickname and path == '/api/v1/instance':
|
if adminNickname and path == '/api/v1/instance':
|
||||||
instanceDescriptionShort = \
|
instanceDescriptionShort = \
|
||||||
getConfigParam(base_dir,
|
get_config_param(base_dir, 'instanceDescriptionShort')
|
||||||
'instanceDescriptionShort')
|
|
||||||
if not instanceDescriptionShort:
|
if not instanceDescriptionShort:
|
||||||
instanceDescriptionShort = \
|
instanceDescriptionShort = \
|
||||||
translate['Yet another Epicyon Instance']
|
translate['Yet another Epicyon Instance']
|
||||||
instanceDescription = getConfigParam(base_dir,
|
instanceDescription = \
|
||||||
'instanceDescription')
|
get_config_param(base_dir, 'instanceDescription')
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
|
|
||||||
if callingDomain.endswith('.onion') and onion_domain:
|
if callingDomain.endswith('.onion') and onion_domain:
|
||||||
domain_full = onion_domain
|
domain_full = onion_domain
|
||||||
|
|
16
person.py
16
person.py
|
@ -49,7 +49,7 @@ from utils import validNickname
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import saveJson
|
from utils import saveJson
|
||||||
from utils import setConfigParam
|
from utils import setConfigParam
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import refresh_newswire
|
from utils import refresh_newswire
|
||||||
from utils import getProtocolPrefixes
|
from utils import getProtocolPrefixes
|
||||||
from utils import has_users_path
|
from utils import has_users_path
|
||||||
|
@ -605,7 +605,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
# remaining registrations counter
|
# remaining registrations counter
|
||||||
if nickname != 'news':
|
if nickname != 'news':
|
||||||
remainingConfigExists = \
|
remainingConfigExists = \
|
||||||
getConfigParam(base_dir, 'registrationsRemaining')
|
get_config_param(base_dir, 'registrationsRemaining')
|
||||||
if remainingConfigExists:
|
if remainingConfigExists:
|
||||||
registrationsRemaining = int(remainingConfigExists)
|
registrationsRemaining = int(remainingConfigExists)
|
||||||
if registrationsRemaining <= 0:
|
if registrationsRemaining <= 0:
|
||||||
|
@ -625,7 +625,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
manual_follower,
|
manual_follower,
|
||||||
group_account,
|
group_account,
|
||||||
password)
|
password)
|
||||||
if not getConfigParam(base_dir, 'admin'):
|
if not get_config_param(base_dir, 'admin'):
|
||||||
if nickname != 'news':
|
if nickname != 'news':
|
||||||
# print(nickname+' becomes the instance admin and a moderator')
|
# print(nickname+' becomes the instance admin and a moderator')
|
||||||
setConfigParam(base_dir, 'admin', nickname)
|
setConfigParam(base_dir, 'admin', nickname)
|
||||||
|
@ -668,7 +668,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: unable to write ' + notifyReactionsFilename)
|
print('EX: unable to write ' + notifyReactionsFilename)
|
||||||
|
|
||||||
theme = getConfigParam(base_dir, 'theme')
|
theme = get_config_param(base_dir, 'theme')
|
||||||
if not theme:
|
if not theme:
|
||||||
theme = 'default'
|
theme = 'default'
|
||||||
|
|
||||||
|
@ -822,7 +822,7 @@ def personUpgradeActor(base_dir: str, personJson: {},
|
||||||
# roles are configured
|
# roles are configured
|
||||||
rolesList = getActorRolesList(personJson)
|
rolesList = getActorRolesList(personJson)
|
||||||
if not rolesList:
|
if not rolesList:
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if personJson['id'].endswith('/users/' + adminName):
|
if personJson['id'].endswith('/users/' + adminName):
|
||||||
rolesList = ["admin", "moderator", "editor"]
|
rolesList = ["admin", "moderator", "editor"]
|
||||||
setRolesFromList(personJson, rolesList)
|
setRolesFromList(personJson, rolesList)
|
||||||
|
@ -1060,7 +1060,7 @@ def suspendAccount(base_dir: str, nickname: str, domain: str) -> None:
|
||||||
"""Suspends the given account
|
"""Suspends the given account
|
||||||
"""
|
"""
|
||||||
# Don't suspend the admin
|
# Don't suspend the admin
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if not adminNickname:
|
if not adminNickname:
|
||||||
return
|
return
|
||||||
if nickname == adminNickname:
|
if nickname == adminNickname:
|
||||||
|
@ -1118,7 +1118,7 @@ def canRemovePost(base_dir: str, nickname: str,
|
||||||
domain_full = get_full_domain(domain, port)
|
domain_full = get_full_domain(domain, port)
|
||||||
|
|
||||||
# is the post by the admin?
|
# is the post by the admin?
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if not adminNickname:
|
if not adminNickname:
|
||||||
return False
|
return False
|
||||||
if domain_full + '/users/' + adminNickname + '/' in postId:
|
if domain_full + '/users/' + adminNickname + '/' in postId:
|
||||||
|
@ -1176,7 +1176,7 @@ def removeAccount(base_dir: str, nickname: str,
|
||||||
"""Removes an account
|
"""Removes an account
|
||||||
"""
|
"""
|
||||||
# Don't remove the admin
|
# Don't remove the admin
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if not adminNickname:
|
if not adminNickname:
|
||||||
return False
|
return False
|
||||||
if nickname == adminNickname:
|
if nickname == adminNickname:
|
||||||
|
|
8
posts.py
8
posts.py
|
@ -61,7 +61,7 @@ from utils import validNickname
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import saveJson
|
from utils import saveJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import locateNewsVotes
|
from utils import locateNewsVotes
|
||||||
from utils import locateNewsArrival
|
from utils import locateNewsArrival
|
||||||
from utils import votesOnNewswireItem
|
from utils import votesOnNewswireItem
|
||||||
|
@ -96,7 +96,7 @@ def isModerator(base_dir: str, nickname: str) -> bool:
|
||||||
moderatorsFile = base_dir + '/accounts/moderators.txt'
|
moderatorsFile = base_dir + '/accounts/moderators.txt'
|
||||||
|
|
||||||
if not os.path.isfile(moderatorsFile):
|
if not os.path.isfile(moderatorsFile):
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if not adminName:
|
if not adminName:
|
||||||
return False
|
return False
|
||||||
if adminName == nickname:
|
if adminName == nickname:
|
||||||
|
@ -106,7 +106,7 @@ def isModerator(base_dir: str, nickname: str) -> bool:
|
||||||
with open(moderatorsFile, 'r') as f:
|
with open(moderatorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if not adminName:
|
if not adminName:
|
||||||
return False
|
return False
|
||||||
if adminName == nickname:
|
if adminName == nickname:
|
||||||
|
@ -2153,7 +2153,7 @@ def createReportPost(base_dir: str,
|
||||||
moderatorsList.append(moderatorActor)
|
moderatorsList.append(moderatorActor)
|
||||||
if len(moderatorsList) == 0:
|
if len(moderatorsList) == 0:
|
||||||
# if there are no moderators then the admin becomes the moderator
|
# if there are no moderators then the admin becomes the moderator
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
localActor = \
|
localActor = \
|
||||||
local_actor_url(http_prefix, adminNickname, domain_full)
|
local_actor_url(http_prefix, adminNickname, domain_full)
|
||||||
|
|
|
@ -25,7 +25,7 @@ from session import createSession
|
||||||
from utils import hasObjectStringType
|
from utils import hasObjectStringType
|
||||||
from utils import dateStringToSeconds
|
from utils import dateStringToSeconds
|
||||||
from utils import dateSecondsToString
|
from utils import dateSecondsToString
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import validNickname
|
from utils import validNickname
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
|
@ -1711,7 +1711,7 @@ def runFederatedSharesDaemon(base_dir: str, httpd, http_prefix: str,
|
||||||
_generateNextSharesTokenUpdate(base_dir, minDays, maxDays)
|
_generateNextSharesTokenUpdate(base_dir, minDays, maxDays)
|
||||||
while True:
|
while True:
|
||||||
shared_items_federated_domainsStr = \
|
shared_items_federated_domainsStr = \
|
||||||
getConfigParam(base_dir, 'shared_items_federated_domains')
|
get_config_param(base_dir, 'shared_items_federated_domains')
|
||||||
if not shared_items_federated_domainsStr:
|
if not shared_items_federated_domainsStr:
|
||||||
time.sleep(fileCheckIntervalSec)
|
time.sleep(fileCheckIntervalSec)
|
||||||
continue
|
continue
|
||||||
|
|
12
utils.py
12
utils.py
|
@ -292,7 +292,7 @@ def is_editor(base_dir: str, nickname: str) -> bool:
|
||||||
editorsFile = base_dir + '/accounts/editors.txt'
|
editorsFile = base_dir + '/accounts/editors.txt'
|
||||||
|
|
||||||
if not os.path.isfile(editorsFile):
|
if not os.path.isfile(editorsFile):
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if not adminName:
|
if not adminName:
|
||||||
return False
|
return False
|
||||||
if adminName == nickname:
|
if adminName == nickname:
|
||||||
|
@ -302,7 +302,7 @@ def is_editor(base_dir: str, nickname: str) -> bool:
|
||||||
with open(editorsFile, 'r') as f:
|
with open(editorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if not adminName:
|
if not adminName:
|
||||||
return False
|
return False
|
||||||
if adminName == nickname:
|
if adminName == nickname:
|
||||||
|
@ -320,7 +320,7 @@ def isArtist(base_dir: str, nickname: str) -> bool:
|
||||||
artistsFile = base_dir + '/accounts/artists.txt'
|
artistsFile = base_dir + '/accounts/artists.txt'
|
||||||
|
|
||||||
if not os.path.isfile(artistsFile):
|
if not os.path.isfile(artistsFile):
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if not adminName:
|
if not adminName:
|
||||||
return False
|
return False
|
||||||
if adminName == nickname:
|
if adminName == nickname:
|
||||||
|
@ -330,7 +330,7 @@ def isArtist(base_dir: str, nickname: str) -> bool:
|
||||||
with open(artistsFile, 'r') as f:
|
with open(artistsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
adminName = getConfigParam(base_dir, 'admin')
|
adminName = get_config_param(base_dir, 'admin')
|
||||||
if not adminName:
|
if not adminName:
|
||||||
return False
|
return False
|
||||||
if adminName == nickname:
|
if adminName == nickname:
|
||||||
|
@ -516,7 +516,7 @@ def setConfigParam(base_dir: str, variableName: str, variableValue) -> None:
|
||||||
saveJson(configJson, configFilename)
|
saveJson(configJson, configFilename)
|
||||||
|
|
||||||
|
|
||||||
def getConfigParam(base_dir: str, variableName: str):
|
def get_config_param(base_dir: str, variableName: str):
|
||||||
"""Gets a configuration value
|
"""Gets a configuration value
|
||||||
"""
|
"""
|
||||||
_createConfig(base_dir)
|
_createConfig(base_dir)
|
||||||
|
@ -531,7 +531,7 @@ def getConfigParam(base_dir: str, variableName: str):
|
||||||
def isSuspended(base_dir: str, nickname: str) -> bool:
|
def isSuspended(base_dir: str, nickname: str) -> bool:
|
||||||
"""Returns true if the given nickname is suspended
|
"""Returns true if the given nickname is suspended
|
||||||
"""
|
"""
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if not adminNickname:
|
if not adminNickname:
|
||||||
return False
|
return False
|
||||||
if nickname == adminNickname:
|
if nickname == adminNickname:
|
||||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from webapp_utils import htmlHeaderWithWebsiteMarkup
|
from webapp_utils import htmlHeaderWithWebsiteMarkup
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from markdown import markdownToHtml
|
from markdown import markdownToHtml
|
||||||
|
@ -20,7 +20,7 @@ def htmlAbout(cssCache: {}, base_dir: str, http_prefix: str,
|
||||||
system_language: str) -> str:
|
system_language: str) -> str:
|
||||||
"""Show the about screen
|
"""Show the about screen
|
||||||
"""
|
"""
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if not os.path.isfile(base_dir + '/accounts/about.md'):
|
if not os.path.isfile(base_dir + '/accounts/about.md'):
|
||||||
copyfile(base_dir + '/default_about.md',
|
copyfile(base_dir + '/default_about.md',
|
||||||
base_dir + '/accounts/about.md')
|
base_dir + '/accounts/about.md')
|
||||||
|
@ -41,7 +41,7 @@ def htmlAbout(cssCache: {}, base_dir: str, http_prefix: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
aboutForm = \
|
aboutForm = \
|
||||||
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
|
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
|
||||||
http_prefix, domain_full,
|
http_prefix, domain_full,
|
||||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Accessibility"
|
||||||
import os
|
import os
|
||||||
from utils import isAccountDir
|
from utils import isAccountDir
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
@ -59,7 +59,7 @@ def htmlAccessKeys(cssCache: {}, base_dir: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
accessKeysForm = \
|
accessKeysForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
accessKeysForm += '<div class="container">\n'
|
accessKeysForm += '<div class="container">\n'
|
||||||
|
|
|
@ -11,7 +11,7 @@ import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from utils import getDisplayName
|
from utils import getDisplayName
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
|
@ -57,7 +57,7 @@ def htmlCalendarDeleteConfirm(cssCache: {}, translate: {}, base_dir: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
deletePostStr = \
|
deletePostStr = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
deletePostStr += \
|
deletePostStr += \
|
||||||
|
@ -119,7 +119,7 @@ def _htmlCalendarDay(person_cache: {}, cssCache: {}, translate: {},
|
||||||
if '/users/' in actor:
|
if '/users/' in actor:
|
||||||
calActor = '/users/' + actor.split('/users/')[1]
|
calActor = '/users/' + actor.split('/users/')[1]
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
calendarStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
calendarStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
calendarStr += '<main><table class="calendar">\n'
|
calendarStr += '<main><table class="calendar">\n'
|
||||||
calendarStr += '<caption class="calendar__banner--month">\n'
|
calendarStr += '<caption class="calendar__banner--month">\n'
|
||||||
|
@ -339,7 +339,7 @@ def htmlCalendar(person_cache: {}, cssCache: {}, translate: {},
|
||||||
calActor = '/users/' + actor.split('/users/')[1]
|
calActor = '/users/' + actor.split('/users/')[1]
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
headerStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
headerStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
# the main graphical calendar as a table
|
# the main graphical calendar as a table
|
||||||
|
|
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
||||||
__module_group__ = "Web Interface Columns"
|
__module_group__ = "Web Interface Columns"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import is_editor
|
from utils import is_editor
|
||||||
from utils import isArtist
|
from utils import isArtist
|
||||||
|
@ -377,7 +377,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str,
|
||||||
domain = removeDomainPort(domain_full)
|
domain = removeDomainPort(domain_full)
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
bannerFile, bannerFilename = \
|
bannerFile, bannerFilename = \
|
||||||
getBannerFile(base_dir, nickname, domain, theme)
|
getBannerFile(base_dir, nickname, domain, theme)
|
||||||
|
@ -441,7 +441,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
getBannerFile(base_dir, nickname, domain, theme)
|
getBannerFile(base_dir, nickname, domain, theme)
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
editLinksForm = \
|
editLinksForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
|
@ -495,7 +495,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
||||||
# the admin can edit terms of service and about text
|
# the admin can edit terms of service and about text
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
if nickname == adminNickname:
|
if nickname == adminNickname:
|
||||||
aboutFilename = base_dir + '/accounts/about.md'
|
aboutFilename = base_dir + '/accounts/about.md'
|
||||||
|
|
|
@ -19,7 +19,7 @@ from utils import loadJson
|
||||||
from utils import votesOnNewswireItem
|
from utils import votesOnNewswireItem
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import is_editor
|
from utils import is_editor
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import removeDomainPort
|
from utils import removeDomainPort
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from posts import isModerator
|
from posts import isModerator
|
||||||
|
@ -364,7 +364,7 @@ def htmlCitations(base_dir: str, nickname: str, domain: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
# top banner
|
# top banner
|
||||||
|
@ -479,7 +479,7 @@ def htmlNewswireMobile(cssCache: {}, base_dir: str, nickname: str,
|
||||||
showPublishButton = editor
|
showPublishButton = editor
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
bannerFile, bannerFilename = \
|
bannerFile, bannerFilename = \
|
||||||
|
@ -546,7 +546,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
getBannerFile(base_dir, nickname, domain, theme)
|
getBannerFile(base_dir, nickname, domain, theme)
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
editNewswireForm = \
|
editNewswireForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
|
@ -671,7 +671,7 @@ def htmlEditNewsPost(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
cssFilename = base_dir + '/links.css'
|
cssFilename = base_dir + '/links.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
editNewsPostForm = \
|
editNewsPostForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
editNewsPostForm += \
|
editNewsPostForm += \
|
||||||
|
|
|
@ -14,7 +14,7 @@ from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import getAltPath
|
from utils import getAltPath
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from webapp_utils import setCustomBackground
|
from webapp_utils import setCustomBackground
|
||||||
|
@ -61,7 +61,7 @@ def htmlConfirmDelete(cssCache: {},
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
deletePostStr = \
|
deletePostStr = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
deletePostStr += \
|
deletePostStr += \
|
||||||
|
@ -138,7 +138,7 @@ def htmlConfirmRemoveSharedItem(cssCache: {}, translate: {}, base_dir: str,
|
||||||
if os.path.isfile(base_dir + '/follow.css'):
|
if os.path.isfile(base_dir + '/follow.css'):
|
||||||
cssFilename = base_dir + '/follow.css'
|
cssFilename = base_dir + '/follow.css'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
sharesStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
sharesStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
sharesStr += '<div class="follow">\n'
|
sharesStr += '<div class="follow">\n'
|
||||||
sharesStr += ' <div class="followAvatar">\n'
|
sharesStr += ' <div class="followAvatar">\n'
|
||||||
|
@ -191,7 +191,7 @@ def htmlConfirmFollow(cssCache: {}, translate: {}, base_dir: str,
|
||||||
if os.path.isfile(base_dir + '/follow.css'):
|
if os.path.isfile(base_dir + '/follow.css'):
|
||||||
cssFilename = base_dir + '/follow.css'
|
cssFilename = base_dir + '/follow.css'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
followStr += '<div class="follow">\n'
|
followStr += '<div class="follow">\n'
|
||||||
followStr += ' <div class="followAvatar">\n'
|
followStr += ' <div class="followAvatar">\n'
|
||||||
|
@ -236,7 +236,7 @@ def htmlConfirmUnfollow(cssCache: {}, translate: {}, base_dir: str,
|
||||||
if os.path.isfile(base_dir + '/follow.css'):
|
if os.path.isfile(base_dir + '/follow.css'):
|
||||||
cssFilename = base_dir + '/follow.css'
|
cssFilename = base_dir + '/follow.css'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
followStr += '<div class="follow">\n'
|
followStr += '<div class="follow">\n'
|
||||||
followStr += ' <div class="followAvatar">\n'
|
followStr += ' <div class="followAvatar">\n'
|
||||||
|
@ -279,7 +279,7 @@ def htmlConfirmUnblock(cssCache: {}, translate: {}, base_dir: str,
|
||||||
if os.path.isfile(base_dir + '/follow.css'):
|
if os.path.isfile(base_dir + '/follow.css'):
|
||||||
cssFilename = base_dir + '/follow.css'
|
cssFilename = base_dir + '/follow.css'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
blockStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
blockStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
blockStr += '<div class="block">\n'
|
blockStr += '<div class="block">\n'
|
||||||
blockStr += ' <div class="blockAvatar">\n'
|
blockStr += ' <div class="blockAvatar">\n'
|
||||||
|
|
|
@ -13,7 +13,7 @@ from utils import isPublicPostFromUrl
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getMediaFormats
|
from utils import getMediaFormats
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from utils import getCurrencies
|
from utils import getCurrencies
|
||||||
from utils import getCategoryTypes
|
from utils import getCategoryTypes
|
||||||
|
@ -489,7 +489,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
|
||||||
for symbol, currName in currencies.items():
|
for symbol, currName in currencies.items():
|
||||||
currencyList.append(currName + ' ' + symbol)
|
currencyList.append(currName + ' ' + symbol)
|
||||||
currencyList.sort()
|
currencyList.sort()
|
||||||
defaultCurrency = getConfigParam(base_dir, 'defaultCurrency')
|
defaultCurrency = get_config_param(base_dir, 'defaultCurrency')
|
||||||
if not defaultCurrency:
|
if not defaultCurrency:
|
||||||
defaultCurrency = "EUR"
|
defaultCurrency = "EUR"
|
||||||
for currName in currencyList:
|
for currName in currencyList:
|
||||||
|
@ -554,7 +554,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
|
||||||
for symbol, currName in currencies.items():
|
for symbol, currName in currencies.items():
|
||||||
currencyList.append(currName + ' ' + symbol)
|
currencyList.append(currName + ' ' + symbol)
|
||||||
currencyList.sort()
|
currencyList.sort()
|
||||||
defaultCurrency = getConfigParam(base_dir, 'defaultCurrency')
|
defaultCurrency = get_config_param(base_dir, 'defaultCurrency')
|
||||||
if not defaultCurrency:
|
if not defaultCurrency:
|
||||||
defaultCurrency = "EUR"
|
defaultCurrency = "EUR"
|
||||||
for currName in currencyList:
|
for currName in currencyList:
|
||||||
|
@ -636,7 +636,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
|
||||||
editTextField(translate['Location'], 'location', '')
|
editTextField(translate['Location'], 'location', '')
|
||||||
dateAndLocation += '</div>\n'
|
dateAndLocation += '</div>\n'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
newPostForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
newPostForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
newPostForm += \
|
newPostForm += \
|
||||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Timeline"
|
||||||
import os
|
import os
|
||||||
from utils import isSystemAccount
|
from utils import isSystemAccount
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from person import personBoxJson
|
from person import personBoxJson
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
@ -206,7 +206,7 @@ def htmlFrontScreen(signing_priv_key_pem: str,
|
||||||
'</table>\n'
|
'</table>\n'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
profileStr = \
|
profileStr = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
|
||||||
profileStr + profileFooterStr + htmlFooter()
|
profileStr + profileFooterStr + htmlFooter()
|
||||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Web Interface"
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from categories import getHashtagCategories
|
from categories import getHashtagCategories
|
||||||
from categories import getHashtagCategory
|
from categories import getHashtagCategory
|
||||||
from webapp_utils import setCustomBackground
|
from webapp_utils import setCustomBackground
|
||||||
|
@ -208,7 +208,7 @@ def htmlSearchHashtagCategory(cssCache: {}, translate: {},
|
||||||
cssFilename = base_dir + '/search.css'
|
cssFilename = base_dir + '/search.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
# show a banner above the search box
|
# show a banner above the search box
|
||||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Web Interface"
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import noOfAccounts
|
from utils import noOfAccounts
|
||||||
from utils import getNicknameValidationPattern
|
from utils import getNicknameValidationPattern
|
||||||
from webapp_utils import setCustomBackground
|
from webapp_utils import setCustomBackground
|
||||||
|
@ -119,8 +119,8 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
|
|
||||||
# show the register button
|
# show the register button
|
||||||
registerButtonStr = ''
|
registerButtonStr = ''
|
||||||
if getConfigParam(base_dir, 'registration') == 'open':
|
if get_config_param(base_dir, 'registration') == 'open':
|
||||||
if int(getConfigParam(base_dir, 'registrationsRemaining')) > 0:
|
if int(get_config_param(base_dir, 'registrationsRemaining')) > 0:
|
||||||
if accounts > 0:
|
if accounts > 0:
|
||||||
idx = 'Welcome. Please login or register a new account.'
|
idx = 'Welcome. Please login or register a new account.'
|
||||||
loginText = \
|
loginText = \
|
||||||
|
@ -149,14 +149,14 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
autocompletePasswordStr = 'autocomplete="off" value=""'
|
autocompletePasswordStr = 'autocomplete="off" value=""'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
loginForm = \
|
loginForm = \
|
||||||
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
|
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
|
||||||
http_prefix, domain,
|
http_prefix, domain,
|
||||||
system_language)
|
system_language)
|
||||||
|
|
||||||
nicknamePattern = getNicknameValidationPattern()
|
nicknamePattern = getNicknameValidationPattern()
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
loginForm += \
|
loginForm += \
|
||||||
'<br>\n' + \
|
'<br>\n' + \
|
||||||
'<form method="POST" action="/login">\n' + \
|
'<form method="POST" action="/login">\n' + \
|
||||||
|
|
|
@ -15,7 +15,7 @@ from utils import is_editor
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import local_actor_url
|
from utils import local_actor_url
|
||||||
from posts import downloadFollowCollection
|
from posts import downloadFollowCollection
|
||||||
from posts import getPublicPostInfo
|
from posts import getPublicPostInfo
|
||||||
|
@ -100,7 +100,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
searchNickname = getNicknameFromActor(searchHandle)
|
searchNickname = getNicknameFromActor(searchHandle)
|
||||||
|
@ -287,7 +287,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
infoForm += \
|
infoForm += \
|
||||||
|
|
|
@ -13,7 +13,7 @@ from petnames import getPetName
|
||||||
from person import isPersonSnoozed
|
from person import isPersonSnoozed
|
||||||
from posts import isModerator
|
from posts import isModerator
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import is_dormant
|
from utils import is_dormant
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
|
@ -129,7 +129,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
translate['Donate'] + '</button></a>\n'
|
translate['Donate'] + '</button></a>\n'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
optionsStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
optionsStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
optionsStr += htmlKeyboardNavigation(text_mode_banner, {}, {})
|
optionsStr += htmlKeyboardNavigation(text_mode_banner, {}, {})
|
||||||
optionsStr += '<br><br>\n'
|
optionsStr += '<br><br>\n'
|
||||||
|
@ -289,7 +289,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
# checkbox for permission to post to newswire
|
# checkbox for permission to post to newswire
|
||||||
newswirePostsPermitted = False
|
newswirePostsPermitted = False
|
||||||
if optionsDomainFull == domain_full:
|
if optionsDomainFull == domain_full:
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if (nickname == adminNickname or
|
if (nickname == adminNickname or
|
||||||
(isModerator(base_dir, nickname) and
|
(isModerator(base_dir, nickname) and
|
||||||
not isModerator(base_dir, optionsNickname))):
|
not isModerator(base_dir, optionsNickname))):
|
||||||
|
@ -330,7 +330,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
|
|
||||||
# checkbox for permission to post to featured articles
|
# checkbox for permission to post to featured articles
|
||||||
if news_instance and optionsDomainFull == domain_full:
|
if news_instance and optionsDomainFull == domain_full:
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if (nickname == adminNickname or
|
if (nickname == adminNickname or
|
||||||
(isModerator(base_dir, nickname) and
|
(isModerator(base_dir, nickname) and
|
||||||
not isModerator(base_dir, optionsNickname))):
|
not isModerator(base_dir, optionsNickname))):
|
||||||
|
|
|
@ -34,7 +34,7 @@ from utils import isPGPEncrypted
|
||||||
from utils import isDM
|
from utils import isDM
|
||||||
from utils import rejectPostId
|
from utils import rejectPostId
|
||||||
from utils import isRecentPost
|
from utils import isRecentPost
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import is_editor
|
from utils import is_editor
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
|
@ -2146,7 +2146,7 @@ def htmlIndividualPost(cssCache: {},
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
metadataStr = _htmlPostMetadataOpenGraph(domain, originalPostJson)
|
metadataStr = _htmlPostMetadataOpenGraph(domain, originalPostJson)
|
||||||
headerStr = htmlHeaderWithExternalStyle(cssFilename,
|
headerStr = htmlHeaderWithExternalStyle(cssFilename,
|
||||||
instanceTitle, metadataStr)
|
instanceTitle, metadataStr)
|
||||||
|
@ -2197,7 +2197,7 @@ def htmlPostReplies(cssCache: {},
|
||||||
if os.path.isfile(base_dir + '/epicyon.css'):
|
if os.path.isfile(base_dir + '/epicyon.css'):
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
metadata = ''
|
metadata = ''
|
||||||
headerStr = \
|
headerStr = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, metadata)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, metadata)
|
||||||
|
@ -2275,7 +2275,7 @@ def htmlEmojiReactionPicker(cssCache: {},
|
||||||
bannerFile, _ = \
|
bannerFile, _ = \
|
||||||
getBannerFile(base_dir, nickname, domain, theme_name)
|
getBannerFile(base_dir, nickname, domain, theme_name)
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
metadata = ''
|
metadata = ''
|
||||||
headerStr = \
|
headerStr = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, metadata)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, metadata)
|
||||||
|
|
|
@ -23,7 +23,7 @@ from utils import getDomainFromActor
|
||||||
from utils import isSystemAccount
|
from utils import isSystemAccount
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import getImageFormats
|
from utils import getImageFormats
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from utils import getSupportedLanguages
|
from utils import getSupportedLanguages
|
||||||
|
@ -356,7 +356,7 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
break
|
break
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
return htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
|
return htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
|
||||||
profileStr + htmlFooter()
|
profileStr + htmlFooter()
|
||||||
|
|
||||||
|
@ -1016,7 +1016,7 @@ def htmlProfile(signing_priv_key_pem: str,
|
||||||
profileStr += '</div>'
|
profileStr += '</div>'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
profileStr = \
|
profileStr = \
|
||||||
htmlHeaderWithPersonMarkup(cssFilename, instanceTitle,
|
htmlHeaderWithPersonMarkup(cssFilename, instanceTitle,
|
||||||
profile_json, city,
|
profile_json, city,
|
||||||
|
@ -1242,7 +1242,7 @@ def _htmlThemesDropdown(base_dir: str, translate: {}) -> str:
|
||||||
themesDropdown += \
|
themesDropdown += \
|
||||||
editCheckBox(translate['Remove the custom font'],
|
editCheckBox(translate['Remove the custom font'],
|
||||||
'removeCustomFont', False)
|
'removeCustomFont', False)
|
||||||
theme_name = getConfigParam(base_dir, 'theme')
|
theme_name = get_config_param(base_dir, 'theme')
|
||||||
themesDropdown = \
|
themesDropdown = \
|
||||||
themesDropdown.replace('<option value="' + theme_name + '">',
|
themesDropdown.replace('<option value="' + theme_name + '">',
|
||||||
'<option value="' + theme_name +
|
'<option value="' + theme_name +
|
||||||
|
@ -1257,7 +1257,7 @@ def _htmlEditProfileGraphicDesign(base_dir: str, translate: {}) -> str:
|
||||||
|
|
||||||
graphicsStr = beginEditSection(translate['Graphic Design'])
|
graphicsStr = beginEditSection(translate['Graphic Design'])
|
||||||
|
|
||||||
low_bandwidth = getConfigParam(base_dir, 'low_bandwidth')
|
low_bandwidth = get_config_param(base_dir, 'low_bandwidth')
|
||||||
if not low_bandwidth:
|
if not low_bandwidth:
|
||||||
low_bandwidth = False
|
low_bandwidth = False
|
||||||
graphicsStr += _htmlThemesDropdown(base_dir, translate)
|
graphicsStr += _htmlThemesDropdown(base_dir, translate)
|
||||||
|
@ -1290,7 +1290,7 @@ def _htmlEditProfileTwitter(base_dir: str, translate: {},
|
||||||
twitterStr += \
|
twitterStr += \
|
||||||
editCheckBox(translate['Remove Twitter posts'],
|
editCheckBox(translate['Remove Twitter posts'],
|
||||||
'removeTwitter', removeTwitter)
|
'removeTwitter', removeTwitter)
|
||||||
twitter_replacement_domain = getConfigParam(base_dir, "twitterdomain")
|
twitter_replacement_domain = get_config_param(base_dir, "twitterdomain")
|
||||||
if not twitter_replacement_domain:
|
if not twitter_replacement_domain:
|
||||||
twitter_replacement_domain = ''
|
twitter_replacement_domain = ''
|
||||||
twitterStr += \
|
twitterStr += \
|
||||||
|
@ -1311,15 +1311,15 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
||||||
|
|
||||||
# Instance details section
|
# Instance details section
|
||||||
instanceDescription = \
|
instanceDescription = \
|
||||||
getConfigParam(base_dir, 'instanceDescription')
|
get_config_param(base_dir, 'instanceDescription')
|
||||||
customSubmitText = \
|
customSubmitText = \
|
||||||
getConfigParam(base_dir, 'customSubmitText')
|
get_config_param(base_dir, 'customSubmitText')
|
||||||
instanceDescriptionShort = \
|
instanceDescriptionShort = \
|
||||||
getConfigParam(base_dir, 'instanceDescriptionShort')
|
get_config_param(base_dir, 'instanceDescriptionShort')
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
content_license_url = \
|
content_license_url = \
|
||||||
getConfigParam(base_dir, 'content_license_url')
|
get_config_param(base_dir, 'content_license_url')
|
||||||
if not content_license_url:
|
if not content_license_url:
|
||||||
content_license_url = 'https://creativecommons.org/licenses/by/4.0'
|
content_license_url = 'https://creativecommons.org/licenses/by/4.0'
|
||||||
|
|
||||||
|
@ -1355,7 +1355,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
||||||
|
|
||||||
nodeInfoStr = \
|
nodeInfoStr = \
|
||||||
translate['Show numbers of accounts within instance metadata']
|
translate['Show numbers of accounts within instance metadata']
|
||||||
if getConfigParam(base_dir, "show_node_info_accounts"):
|
if get_config_param(base_dir, "show_node_info_accounts"):
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
editCheckBox(nodeInfoStr, 'show_node_info_accounts', True)
|
editCheckBox(nodeInfoStr, 'show_node_info_accounts', True)
|
||||||
else:
|
else:
|
||||||
|
@ -1364,14 +1364,14 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
||||||
|
|
||||||
nodeInfoStr = \
|
nodeInfoStr = \
|
||||||
translate['Show version number within instance metadata']
|
translate['Show version number within instance metadata']
|
||||||
if getConfigParam(base_dir, "show_node_info_version"):
|
if get_config_param(base_dir, "show_node_info_version"):
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
editCheckBox(nodeInfoStr, 'show_node_info_version', True)
|
editCheckBox(nodeInfoStr, 'show_node_info_version', True)
|
||||||
else:
|
else:
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
editCheckBox(nodeInfoStr, 'show_node_info_version', False)
|
editCheckBox(nodeInfoStr, 'show_node_info_version', False)
|
||||||
|
|
||||||
if getConfigParam(base_dir, "verify_all_signatures"):
|
if get_config_param(base_dir, "verify_all_signatures"):
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
editCheckBox(translate['Verify all signatures'],
|
editCheckBox(translate['Verify all signatures'],
|
||||||
'verifyallsignatures', True)
|
'verifyallsignatures', True)
|
||||||
|
@ -1381,7 +1381,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
||||||
'verifyallsignatures', False)
|
'verifyallsignatures', False)
|
||||||
|
|
||||||
instanceStr += translate['Enabling broch mode'] + '<br>\n'
|
instanceStr += translate['Enabling broch mode'] + '<br>\n'
|
||||||
if getConfigParam(base_dir, "broch_mode"):
|
if get_config_param(base_dir, "broch_mode"):
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
editCheckBox(translate['Broch mode'], 'broch_mode', True)
|
editCheckBox(translate['Broch mode'], 'broch_mode', True)
|
||||||
else:
|
else:
|
||||||
|
@ -1467,7 +1467,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
||||||
peertube_instancesStr, 200, '', False)
|
peertube_instancesStr, 200, '', False)
|
||||||
peertubeStr += \
|
peertubeStr += \
|
||||||
' <br>\n'
|
' <br>\n'
|
||||||
yt_replace_domain = getConfigParam(base_dir, "youtubedomain")
|
yt_replace_domain = get_config_param(base_dir, "youtubedomain")
|
||||||
if not yt_replace_domain:
|
if not yt_replace_domain:
|
||||||
yt_replace_domain = ''
|
yt_replace_domain = ''
|
||||||
peertubeStr += \
|
peertubeStr += \
|
||||||
|
@ -1475,8 +1475,8 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
||||||
'ytdomain', yt_replace_domain)
|
'ytdomain', yt_replace_domain)
|
||||||
peertubeStr += endEditSection()
|
peertubeStr += endEditSection()
|
||||||
|
|
||||||
libretranslateUrl = getConfigParam(base_dir, 'libretranslateUrl')
|
libretranslateUrl = get_config_param(base_dir, 'libretranslateUrl')
|
||||||
libretranslateApiKey = getConfigParam(base_dir, 'libretranslateApiKey')
|
libretranslateApiKey = get_config_param(base_dir, 'libretranslateApiKey')
|
||||||
libretranslateStr = \
|
libretranslateStr = \
|
||||||
_htmlEditProfileLibreTranslate(translate,
|
_htmlEditProfileLibreTranslate(translate,
|
||||||
libretranslateUrl,
|
libretranslateUrl,
|
||||||
|
@ -1581,7 +1581,7 @@ def _htmlEditProfileSharedItems(base_dir: str, nickname: str, domain: str,
|
||||||
"""
|
"""
|
||||||
sharedItemsStr = ''
|
sharedItemsStr = ''
|
||||||
shared_items_federated_domainsStr = \
|
shared_items_federated_domainsStr = \
|
||||||
getConfigParam(base_dir, 'shared_items_federated_domains')
|
get_config_param(base_dir, 'shared_items_federated_domains')
|
||||||
if shared_items_federated_domainsStr:
|
if shared_items_federated_domainsStr:
|
||||||
shared_items_federated_domainsList = \
|
shared_items_federated_domainsList = \
|
||||||
shared_items_federated_domainsStr.split(',')
|
shared_items_federated_domainsStr.split(',')
|
||||||
|
@ -2178,19 +2178,19 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
if os.path.isfile(accountDir + '/.hideReactionButton'):
|
if os.path.isfile(accountDir + '/.hideReactionButton'):
|
||||||
hideReactionButton = 'checked'
|
hideReactionButton = 'checked'
|
||||||
|
|
||||||
media_instance = getConfigParam(base_dir, "media_instance")
|
media_instance = get_config_param(base_dir, "media_instance")
|
||||||
if media_instance:
|
if media_instance:
|
||||||
if media_instance is True:
|
if media_instance is True:
|
||||||
media_instanceStr = 'checked'
|
media_instanceStr = 'checked'
|
||||||
blogs_instanceStr = news_instanceStr = ''
|
blogs_instanceStr = news_instanceStr = ''
|
||||||
|
|
||||||
news_instance = getConfigParam(base_dir, "news_instance")
|
news_instance = get_config_param(base_dir, "news_instance")
|
||||||
if news_instance:
|
if news_instance:
|
||||||
if news_instance is True:
|
if news_instance is True:
|
||||||
news_instanceStr = 'checked'
|
news_instanceStr = 'checked'
|
||||||
blogs_instanceStr = media_instanceStr = ''
|
blogs_instanceStr = media_instanceStr = ''
|
||||||
|
|
||||||
blogs_instance = getConfigParam(base_dir, "blogs_instance")
|
blogs_instance = get_config_param(base_dir, "blogs_instance")
|
||||||
if blogs_instance:
|
if blogs_instance:
|
||||||
if blogs_instance is True:
|
if blogs_instance is True:
|
||||||
blogs_instanceStr = 'checked'
|
blogs_instanceStr = 'checked'
|
||||||
|
@ -2208,7 +2208,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
graphicsStr = ''
|
graphicsStr = ''
|
||||||
sharesFederationStr = ''
|
sharesFederationStr = ''
|
||||||
|
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
|
|
||||||
if isArtist(base_dir, nickname) or \
|
if isArtist(base_dir, nickname) or \
|
||||||
path.startswith('/users/' + str(adminNickname) + '/'):
|
path.startswith('/users/' + str(adminNickname) + '/'):
|
||||||
|
@ -2232,7 +2232,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
|
||||||
news_instanceStr)
|
news_instanceStr)
|
||||||
systemMonitorStr = _htmlSystemMonitor(nickname, translate)
|
systemMonitorStr = _htmlSystemMonitor(nickname, translate)
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
editProfileForm = \
|
editProfileForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import urllib.parse
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from utils import get_base_content_from_post
|
from utils import get_base_content_from_post
|
||||||
from utils import isAccountDir
|
from utils import isAccountDir
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import is_editor
|
from utils import is_editor
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
|
@ -63,7 +63,7 @@ def htmlSearchEmoji(cssCache: {}, translate: {},
|
||||||
|
|
||||||
# create header
|
# create header
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
emojiForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
emojiForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
emojiForm += '<center><h1>' + \
|
emojiForm += '<center><h1>' + \
|
||||||
translate['Emoji Search'] + \
|
translate['Emoji Search'] + \
|
||||||
|
@ -239,7 +239,7 @@ def htmlSearchSharedItems(cssCache: {}, translate: {},
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
sharedItemsForm = \
|
sharedItemsForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
if sharesFileType == 'shares':
|
if sharesFileType == 'shares':
|
||||||
|
@ -346,7 +346,7 @@ def htmlSearchEmojiTextEntry(cssCache: {}, translate: {},
|
||||||
cssFilename = base_dir + '/follow.css'
|
cssFilename = base_dir + '/follow.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
emojiStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
emojiStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
emojiStr += '<div class="follow">\n'
|
emojiStr += '<div class="follow">\n'
|
||||||
emojiStr += ' <div class="followAvatar">\n'
|
emojiStr += ' <div class="followAvatar">\n'
|
||||||
|
@ -385,7 +385,7 @@ def htmlSearch(cssCache: {}, translate: {},
|
||||||
if os.path.isfile(base_dir + '/search.css'):
|
if os.path.isfile(base_dir + '/search.css'):
|
||||||
cssFilename = base_dir + '/search.css'
|
cssFilename = base_dir + '/search.css'
|
||||||
|
|
||||||
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
|
instanceTitle = get_config_param(base_dir, 'instanceTitle')
|
||||||
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
# show a banner above the search box
|
# show a banner above the search box
|
||||||
|
@ -547,7 +547,7 @@ def htmlSkillsSearch(actor: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
skillSearchForm = \
|
skillSearchForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
skillSearchForm += \
|
skillSearchForm += \
|
||||||
|
@ -624,7 +624,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, base_dir: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
historySearchForm = \
|
historySearchForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
|
@ -766,7 +766,7 @@ def htmlHashtagSearch(cssCache: {},
|
||||||
|
|
||||||
# add the page title
|
# add the page title
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
hashtagSearchForm = \
|
hashtagSearchForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
if nickname:
|
if nickname:
|
||||||
|
|
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
||||||
__module_group__ = "Web Interface"
|
__module_group__ = "Web Interface"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ def htmlSuspended(cssCache: {}, base_dir: str) -> str:
|
||||||
cssFilename = base_dir + '/suspended.css'
|
cssFilename = base_dir + '/suspended.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
suspendedForm = \
|
suspendedForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
suspendedForm += \
|
suspendedForm += \
|
||||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import getBannerFile
|
from webapp_utils import getBannerFile
|
||||||
|
@ -191,7 +191,7 @@ def htmlThemeDesigner(cssCache: {}, base_dir: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
themeForm = \
|
themeForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
bannerFile, bannerFilename = \
|
bannerFile, bannerFilename = \
|
||||||
|
|
|
@ -12,7 +12,7 @@ import time
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import isArtist
|
from utils import isArtist
|
||||||
from utils import dangerousMarkup
|
from utils import dangerousMarkup
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
from utils import is_editor
|
from utils import is_editor
|
||||||
from utils import removeIdEnding
|
from utils import removeIdEnding
|
||||||
|
@ -58,11 +58,11 @@ def _getHelpForTimeline(base_dir: str, boxName: str) -> str:
|
||||||
helpFilename = base_dir + '/accounts/help_' + boxName + '.md'
|
helpFilename = base_dir + '/accounts/help_' + boxName + '.md'
|
||||||
if not os.path.isfile(helpFilename):
|
if not os.path.isfile(helpFilename):
|
||||||
language = \
|
language = \
|
||||||
getConfigParam(base_dir, 'language')
|
get_config_param(base_dir, 'language')
|
||||||
if not language:
|
if not language:
|
||||||
language = 'en'
|
language = 'en'
|
||||||
theme_name = \
|
theme_name = \
|
||||||
getConfigParam(base_dir, 'theme')
|
get_config_param(base_dir, 'theme')
|
||||||
defaultFilename = None
|
defaultFilename = None
|
||||||
if theme_name:
|
if theme_name:
|
||||||
defaultFilename = \
|
defaultFilename = \
|
||||||
|
@ -83,7 +83,7 @@ def _getHelpForTimeline(base_dir: str, boxName: str) -> str:
|
||||||
# show help text
|
# show help text
|
||||||
if os.path.isfile(helpFilename):
|
if os.path.isfile(helpFilename):
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
if not instanceTitle:
|
if not instanceTitle:
|
||||||
instanceTitle = 'Epicyon'
|
instanceTitle = 'Epicyon'
|
||||||
with open(helpFilename, 'r') as helpFile:
|
with open(helpFilename, 'r') as helpFile:
|
||||||
|
@ -674,7 +674,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
'</span></button></a>'
|
'</span></button></a>'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
tlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
tlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
|
||||||
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4')
|
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4')
|
||||||
|
@ -1055,7 +1055,7 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
|
||||||
shared_items_federated_domains, sharesFileType)
|
shared_items_federated_domains, sharesFileType)
|
||||||
domain_full = get_full_domain(domain, port)
|
domain_full = get_full_domain(domain, port)
|
||||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
adminActor = ''
|
adminActor = ''
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
adminActor = \
|
adminActor = \
|
||||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import local_actor_url
|
from utils import local_actor_url
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
@ -20,7 +20,7 @@ def htmlTermsOfService(cssCache: {}, base_dir: str,
|
||||||
http_prefix: str, domain_full: str) -> str:
|
http_prefix: str, domain_full: str) -> str:
|
||||||
"""Show the terms of service screen
|
"""Show the terms of service screen
|
||||||
"""
|
"""
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if not os.path.isfile(base_dir + '/accounts/tos.md'):
|
if not os.path.isfile(base_dir + '/accounts/tos.md'):
|
||||||
copyfile(base_dir + '/default_tos.md',
|
copyfile(base_dir + '/default_tos.md',
|
||||||
base_dir + '/accounts/tos.md')
|
base_dir + '/accounts/tos.md')
|
||||||
|
@ -41,7 +41,7 @@ def htmlTermsOfService(cssCache: {}, base_dir: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
TOSForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
TOSForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
TOSForm += '<div class="container">' + TOSText + '</div>\n'
|
TOSForm += '<div class="container">' + TOSText + '</div>\n'
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
|
|
|
@ -16,7 +16,7 @@ from utils import removeHtml
|
||||||
from utils import getProtocolPrefixes
|
from utils import getProtocolPrefixes
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getCachedPostFilename
|
from utils import getCachedPostFilename
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import isfloat
|
from utils import isfloat
|
||||||
|
@ -54,7 +54,7 @@ def htmlFollowingList(cssCache: {}, base_dir: str,
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
followingListHtml = \
|
followingListHtml = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
for followingAddress in followingList:
|
for followingAddress in followingList:
|
||||||
|
@ -76,7 +76,7 @@ def htmlHashtagBlocked(cssCache: {}, base_dir: str, translate: {}) -> str:
|
||||||
cssFilename = base_dir + '/suspended.css'
|
cssFilename = base_dir + '/suspended.css'
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
blockedHashtagForm = \
|
blockedHashtagForm = \
|
||||||
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
blockedHashtagForm += '<div><center>\n'
|
blockedHashtagForm += '<div><center>\n'
|
||||||
|
@ -1202,7 +1202,7 @@ def getPostAttachmentsAsHtml(post_json_object: {}, boxName: str, translate: {},
|
||||||
def htmlPostSeparator(base_dir: str, column: str) -> str:
|
def htmlPostSeparator(base_dir: str, column: str) -> str:
|
||||||
"""Returns the html for a timeline post separator image
|
"""Returns the html for a timeline post separator image
|
||||||
"""
|
"""
|
||||||
theme = getConfigParam(base_dir, 'theme')
|
theme = get_config_param(base_dir, 'theme')
|
||||||
filename = 'separator.png'
|
filename = 'separator.png'
|
||||||
separatorClass = "postSeparatorImage"
|
separatorClass = "postSeparatorImage"
|
||||||
if column:
|
if column:
|
||||||
|
@ -1472,7 +1472,7 @@ def htmlSearchResultShare(base_dir: str, sharedItem: {}, translate: {},
|
||||||
elif isModerator(base_dir, nickname):
|
elif isModerator(base_dir, nickname):
|
||||||
showRemoveButton = True
|
showRemoveButton = True
|
||||||
else:
|
else:
|
||||||
adminNickname = getConfigParam(base_dir, 'admin')
|
adminNickname = get_config_param(base_dir, 'admin')
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
if actor.endswith('/users/' + adminNickname):
|
if actor.endswith('/users/' + adminNickname):
|
||||||
showRemoveButton = True
|
showRemoveButton = True
|
||||||
|
@ -1568,7 +1568,7 @@ def htmlShowShare(base_dir: str, domain: str, nickname: str,
|
||||||
if os.path.isfile(base_dir + '/epicyon.css'):
|
if os.path.isfile(base_dir + '/epicyon.css'):
|
||||||
cssFilename = base_dir + '/epicyon.css'
|
cssFilename = base_dir + '/epicyon.css'
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
|
|
||||||
return htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
|
return htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
|
||||||
shareStr + htmlFooter()
|
shareStr + htmlFooter()
|
||||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "Onboarding"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
|
@ -71,7 +71,7 @@ def htmlWelcomeScreen(base_dir: str, nickname: str,
|
||||||
copyfile(defaultFilename, welcomeFilename)
|
copyfile(defaultFilename, welcomeFilename)
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
if not instanceTitle:
|
if not instanceTitle:
|
||||||
instanceTitle = 'Epicyon'
|
instanceTitle = 'Epicyon'
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Onboarding"
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from markdown import markdownToHtml
|
from markdown import markdownToHtml
|
||||||
|
@ -46,7 +46,7 @@ def htmlWelcomeFinal(base_dir: str, nickname: str, domain: str,
|
||||||
copyfile(defaultFilename, finalFilename)
|
copyfile(defaultFilename, finalFilename)
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
if not instanceTitle:
|
if not instanceTitle:
|
||||||
instanceTitle = 'Epicyon'
|
instanceTitle = 'Epicyon'
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getConfigParam
|
from utils import get_config_param
|
||||||
from utils import getImageExtensions
|
from utils import getImageExtensions
|
||||||
from utils import getImageFormats
|
from utils import getImageFormats
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
|
@ -52,7 +52,7 @@ def htmlWelcomeProfile(base_dir: str, nickname: str, domain: str,
|
||||||
copyfile(defaultFilename, profileFilename)
|
copyfile(defaultFilename, profileFilename)
|
||||||
|
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
if not instanceTitle:
|
if not instanceTitle:
|
||||||
instanceTitle = 'Epicyon'
|
instanceTitle = 'Epicyon'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue