Snake case

main
Bob Mottram 2021-12-26 14:08:58 +00:00
parent af628d051c
commit 6604143504
34 changed files with 300 additions and 299 deletions

10
blog.py
View File

@ -23,7 +23,7 @@ from utils import get_base_content_from_post
from utils import get_content_from_post
from utils import isAccountDir
from utils import removeHtml
from utils import getConfigParam
from utils import get_config_param
from utils import get_full_domain
from utils import getMediaFormats
from utils import getNicknameFromActor
@ -457,7 +457,7 @@ def htmlBlogPost(session, authorized: bool,
if os.path.isfile(base_dir + '/blog.css'):
cssFilename = base_dir + '/blog.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
published = post_json_object['object']['published']
modified = published
if post_json_object['object'].get('updated'):
@ -521,7 +521,7 @@ def htmlBlogPage(authorized: bool, session,
if os.path.isfile(base_dir + '/epicyon.css'):
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
_htmlBlogRemoveCwButton(blogStr, translate)
@ -741,7 +741,7 @@ def htmlBlogView(authorized: bool,
if os.path.isfile(base_dir + '/epicyon.css'):
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
blogStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
if _noOfBlogAccounts(base_dir) <= 1:
@ -847,7 +847,7 @@ def htmlEditBlog(media_instance: bool, translate: {},
dateAndLocation += '</div>'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
editBlogForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)

105
daemon.py
View File

@ -284,7 +284,7 @@ from utils import clearFromPostCaches
from utils import containsInvalidChars
from utils import isSystemAccount
from utils import setConfigParam
from utils import getConfigParam
from utils import get_config_param
from utils import removeIdEnding
from utils import undoLikesCollectionEntry
from utils import deletePost
@ -2484,7 +2484,7 @@ class PubServer(BaseHTTPRequestHandler):
# person options screen, permission to post to newswire
# See htmlPersonOptions
if '&submitPostToNews=' in optionsConfirmParams:
adminNickname = getConfigParam(self.server.base_dir, 'admin')
adminNickname = get_config_param(self.server.base_dir, 'admin')
if (chooserNickname != optionsNickname and
(chooserNickname == adminNickname or
(isModerator(self.server.base_dir, chooserNickname) and
@ -2529,7 +2529,7 @@ class PubServer(BaseHTTPRequestHandler):
# person options screen, permission to post to featured articles
# See htmlPersonOptions
if '&submitPostToFeatures=' in optionsConfirmParams:
adminNickname = getConfigParam(self.server.base_dir, 'admin')
adminNickname = get_config_param(self.server.base_dir, 'admin')
if (chooserNickname != optionsNickname and
(chooserNickname == adminNickname or
(isModerator(self.server.base_dir, chooserNickname) and
@ -2575,7 +2575,7 @@ class PubServer(BaseHTTPRequestHandler):
# person options screen, permission to post to newswire
# See htmlPersonOptions
if '&submitModNewsPosts=' in optionsConfirmParams:
adminNickname = getConfigParam(self.server.base_dir, 'admin')
adminNickname = get_config_param(self.server.base_dir, 'admin')
if (chooserNickname != optionsNickname and
(chooserNickname == adminNickname or
(isModerator(self.server.base_dir, chooserNickname) and
@ -2698,7 +2698,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname]
customSubmitText = getConfigParam(base_dir, 'customSubmitText')
customSubmitText = get_config_param(base_dir, 'customSubmitText')
conversationId = None
msg = htmlNewPost(self.server.cssCache,
False, self.server.translate,
@ -2833,7 +2833,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname]
customSubmitText = getConfigParam(base_dir, 'customSubmitText')
customSubmitText = get_config_param(base_dir, 'customSubmitText')
conversationId = None
msg = htmlNewPost(self.server.cssCache,
False, self.server.translate,
@ -3862,7 +3862,7 @@ class PubServer(BaseHTTPRequestHandler):
shareActor = removeShareConfirmParams.split('actor=')[1]
if '&' in shareActor:
shareActor = shareActor.split('&')[0]
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
adminActor = \
local_actor_url(http_prefix, adminNickname, domain_full)
actor = originPathStr
@ -3929,7 +3929,7 @@ class PubServer(BaseHTTPRequestHandler):
shareActor = removeShareConfirmParams.split('actor=')[1]
if '&' in shareActor:
shareActor = shareActor.split('&')[0]
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
adminActor = \
local_actor_url(http_prefix, adminNickname, domain_full)
actor = originPathStr
@ -4154,7 +4154,7 @@ class PubServer(BaseHTTPRequestHandler):
linksFilename)
adminNickname = \
getConfigParam(base_dir, 'admin')
get_config_param(base_dir, 'admin')
if nickname == adminNickname:
if fields.get('editedAbout'):
aboutStr = fields['editedAbout']
@ -4733,7 +4733,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.POSTbusy = False
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
actorChanged = True
@ -5024,20 +5024,20 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsCache = {}
self.server.fontsCache = {}
self.server.show_publish_as_icon = \
getConfigParam(self.server.base_dir,
'show_publish_as_icon')
get_config_param(self.server.base_dir,
'show_publish_as_icon')
self.server.full_width_tl_button_header = \
getConfigParam(self.server.base_dir,
'full_width_tl_button_header')
get_config_param(self.server.base_dir,
'full_width_tl_button_header')
self.server.icons_as_buttons = \
getConfigParam(self.server.base_dir,
'icons_as_buttons')
get_config_param(self.server.base_dir,
'icons_as_buttons')
self.server.rss_icon_at_top = \
getConfigParam(self.server.base_dir,
'rss_icon_at_top')
get_config_param(self.server.base_dir,
'rss_icon_at_top')
self.server.publish_button_at_top = \
getConfigParam(self.server.base_dir,
'publish_button_at_top')
get_config_param(self.server.base_dir,
'publish_button_at_top')
setNewsAvatar(base_dir,
fields['themeDropdown'],
http_prefix,
@ -5131,7 +5131,7 @@ class PubServer(BaseHTTPRequestHandler):
# change instance title
if fields.get('instanceTitle'):
currInstanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
if fields['instanceTitle'] != currInstanceTitle:
setConfigParam(base_dir, 'instanceTitle',
fields['instanceTitle'])
@ -5181,7 +5181,7 @@ class PubServer(BaseHTTPRequestHandler):
# change custom post submit button text
currCustomSubmitText = \
getConfigParam(base_dir, 'customSubmitText')
get_config_param(base_dir, 'customSubmitText')
if fields.get('customSubmitText'):
if fields['customSubmitText'] != \
currCustomSubmitText:
@ -5196,8 +5196,8 @@ class PubServer(BaseHTTPRequestHandler):
# libretranslate URL
currLibretranslateUrl = \
getConfigParam(base_dir,
'libretranslateUrl')
get_config_param(base_dir,
'libretranslateUrl')
if fields.get('libretranslateUrl'):
if fields['libretranslateUrl'] != \
currLibretranslateUrl:
@ -5214,8 +5214,8 @@ class PubServer(BaseHTTPRequestHandler):
# libretranslate API Key
currLibretranslateApiKey = \
getConfigParam(base_dir,
'libretranslateApiKey')
get_config_param(base_dir,
'libretranslateApiKey')
if fields.get('libretranslateApiKey'):
if fields['libretranslateApiKey'] != \
currLibretranslateApiKey:
@ -5248,8 +5248,8 @@ class PubServer(BaseHTTPRequestHandler):
# change instance short description
currInstanceDescriptionShort = \
getConfigParam(base_dir,
'instanceDescriptionShort')
get_config_param(base_dir,
'instanceDescriptionShort')
if fields.get('instanceDescriptionShort'):
if fields['instanceDescriptionShort'] != \
currInstanceDescriptionShort:
@ -5264,7 +5264,7 @@ class PubServer(BaseHTTPRequestHandler):
# change instance description
currInstanceDescription = \
getConfigParam(base_dir, 'instanceDescription')
get_config_param(base_dir, 'instanceDescription')
if fields.get('instanceDescription'):
if fields['instanceDescription'] != \
currInstanceDescription:
@ -5546,7 +5546,7 @@ class PubServer(BaseHTTPRequestHandler):
redirectPath = 'previewAvatar'
adminNickname = \
getConfigParam(base_dir, 'admin')
get_config_param(base_dir, 'admin')
if adminNickname:
# whether to require jsonld signatures
@ -5585,7 +5585,7 @@ class PubServer(BaseHTTPRequestHandler):
if fields['broch_mode'] == 'on':
broch_mode = True
currBrochMode = \
getConfigParam(base_dir, "broch_mode")
get_config_param(base_dir, "broch_mode")
if broch_mode != currBrochMode:
setBrochMode(self.server.base_dir,
self.server.domain_full,
@ -5598,8 +5598,8 @@ class PubServer(BaseHTTPRequestHandler):
fed_domains_variable = \
"shared_items_federated_domains"
fed_domains_str = \
getConfigParam(base_dir,
fed_domains_variable)
get_config_param(base_dir,
fed_domains_variable)
if not fed_domains_str:
fed_domains_str = ''
sharedItemsFormStr = ''
@ -5964,21 +5964,21 @@ class PubServer(BaseHTTPRequestHandler):
self.server.iconsCache = {}
self.server.fontsCache = {}
self.server.show_publish_as_icon = \
getConfigParam(base_dir,
'show_publish_as_icon')
get_config_param(base_dir,
'show_publish_as_icon')
self.server.full_width_tl_button_header = \
getConfigParam(base_dir,
'fullWidthTimeline' +
'ButtonHeader')
get_config_param(base_dir,
'fullWidthTimeline' +
'ButtonHeader')
self.server.icons_as_buttons = \
getConfigParam(base_dir,
'icons_as_buttons')
get_config_param(base_dir,
'icons_as_buttons')
self.server.rss_icon_at_top = \
getConfigParam(base_dir,
'rss_icon_at_top')
get_config_param(base_dir,
'rss_icon_at_top')
self.server.publish_button_at_top = \
getConfigParam(base_dir,
'publish_button_at_top')
get_config_param(base_dir,
'publish_button_at_top')
# only receive DMs from accounts you follow
followDMsFilename = \
@ -6212,7 +6212,7 @@ class PubServer(BaseHTTPRequestHandler):
if path.startswith('/users/' + adminNickname + '/') or \
isArtist(base_dir, nickname):
currLowBandwidth = \
getConfigParam(base_dir, 'low_bandwidth')
get_config_param(base_dir, 'low_bandwidth')
low_bandwidth = False
if fields.get('low_bandwidth'):
if fields['low_bandwidth'] == 'on':
@ -6682,7 +6682,7 @@ class PubServer(BaseHTTPRequestHandler):
favType = 'image/avif'
favFilename = favFilename.split('.')[0] + '.avif'
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:
self.server.theme_name = 'default'
# custom favicon
@ -12964,7 +12964,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname]
customSubmitText = getConfigParam(base_dir, 'customSubmitText')
customSubmitText = get_config_param(base_dir, 'customSubmitText')
post_json_object = None
if inReplyToUrl:
@ -16552,7 +16552,7 @@ class PubServer(BaseHTTPRequestHandler):
return -1
submitText = self.server.translate['Submit']
customSubmitText = \
getConfigParam(self.server.base_dir, 'customSubmitText')
get_config_param(self.server.base_dir, 'customSubmitText')
if customSubmitText:
submitText = customSubmitText
if fields.get('submitPost'):
@ -17965,8 +17965,9 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.debug:
print('SharesCatalog header: ' + self.headers['SharesCatalog'])
if not self.server.shared_items_federated_domains:
siDomainsStr = getConfigParam(self.server.base_dir,
'shared_items_federated_domains')
siDomainsStr = \
get_config_param(self.server.base_dir,
'shared_items_federated_domains')
if siDomainsStr:
if self.server.debug:
print('Loading shared items federated domains list')
@ -18818,11 +18819,11 @@ def runDaemon(content_license_url: str,
if lists_enabled:
httpd.lists_enabled = lists_enabled
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)
# 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:
httpd.theme_name = 'default'
if isNewsThemeName(base_dir, httpd.theme_name):

View File

@ -70,7 +70,7 @@ from utils import getPortFromDomain
from utils import has_users_path
from utils import get_full_domain
from utils import setConfigParam
from utils import getConfigParam
from utils import get_config_param
from utils import getDomainFromActor
from utils import getNicknameFromActor
from utils import followPerson
@ -694,7 +694,7 @@ if args.libretranslateApiKey:
if args.posts:
if not args.domain:
originDomain = getConfigParam(base_dir, 'domain')
originDomain = get_config_param(base_dir, 'domain')
else:
originDomain = args.domain
if debug:
@ -763,7 +763,7 @@ if args.postDomains:
args.language = 'en'
signing_priv_key_pem = None
if not args.domain:
originDomain = getConfigParam(base_dir, 'domain')
originDomain = get_config_param(base_dir, 'domain')
else:
originDomain = args.domain
if args.secure_mode:
@ -882,7 +882,7 @@ if args.socnet:
if not args.language:
args.language = 'en'
if not args.domain:
args.domain = getConfigParam(base_dir, 'domain')
args.domain = get_config_param(base_dir, 'domain')
domain = ''
if args.domain:
domain = args.domain
@ -904,7 +904,7 @@ if args.socnet:
if args.postsraw:
if not args.domain:
originDomain = getConfigParam(base_dir, 'domain')
originDomain = get_config_param(base_dir, 'domain')
else:
originDomain = args.domain
if debug:
@ -939,7 +939,7 @@ if args.json:
'Accept': 'application/ld+json; profile="' + profileStr + '"'
}
if not args.domain:
args.domain = getConfigParam(base_dir, 'domain')
args.domain = get_config_param(base_dir, 'domain')
domain = ''
if args.domain:
domain = args.domain
@ -963,7 +963,7 @@ if args.htmlpost:
'Accept': 'text/html; profile="' + profileStr + '"'
}
if not args.domain:
args.domain = getConfigParam(base_dir, 'domain')
args.domain = get_config_param(base_dir, 'domain')
domain = ''
if args.domain:
domain = args.domain
@ -992,13 +992,13 @@ if not os.path.isdir(base_dir + '/cache/announce'):
os.mkdir(base_dir + '/cache/announce')
# set the theme in config.json
theme_name = getConfigParam(base_dir, 'theme')
theme_name = get_config_param(base_dir, 'theme')
if not theme_name:
setConfigParam(base_dir, 'theme', 'default')
theme_name = 'default'
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:
args.mediainstance = media_instance
if args.mediainstance:
@ -1006,7 +1006,7 @@ if not args.mediainstance:
args.newsinstance = False
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:
args.newsinstance = news_instance
if args.newsinstance:
@ -1014,7 +1014,7 @@ if not args.newsinstance:
args.mediainstance = False
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:
args.blogsinstance = blogs_instance
if args.blogsinstance:
@ -1022,18 +1022,18 @@ if not args.blogsinstance:
args.newsinstance = False
# set the instance title in config.json
title = getConfigParam(base_dir, 'instanceTitle')
title = get_config_param(base_dir, 'instanceTitle')
if not title:
setConfigParam(base_dir, 'instanceTitle', 'Epicyon')
# set the instance description in config.json
descFull = getConfigParam(base_dir, 'instanceDescription')
descFull = get_config_param(base_dir, 'instanceDescription')
if not descFull:
setConfigParam(base_dir, 'instanceDescription',
'Just another ActivityPub server')
# set the short instance description in config.json
descShort = getConfigParam(base_dir, 'instanceDescriptionShort')
descShort = get_config_param(base_dir, 'instanceDescriptionShort')
if not descShort:
setConfigParam(base_dir, 'instanceDescriptionShort',
'Just another ActivityPub server')
@ -1069,7 +1069,7 @@ if args.i2p_domain:
setConfigParam(base_dir, 'i2p_domain', i2p_domain)
if not args.language:
languageCode = getConfigParam(base_dir, 'language')
languageCode = get_config_param(base_dir, 'language')
if languageCode:
args.language = languageCode
else:
@ -1077,7 +1077,7 @@ if not args.language:
# maximum number of new registrations
if not args.maxRegistrations:
maxRegistrations = getConfigParam(base_dir, 'maxRegistrations')
maxRegistrations = get_config_param(base_dir, 'maxRegistrations')
if not maxRegistrations:
maxRegistrations = 10
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
@ -1088,7 +1088,7 @@ else:
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
# 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':
setConfigParam(base_dir, 'registration', 'open')
setConfigParam(base_dir, 'maxRegistrations', str(maxRegistrations))
@ -1100,35 +1100,35 @@ if args.resetregistrations:
print('Number of new registrations reset to ' + str(maxRegistrations))
# 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:
instance_id = createPassword(32)
setConfigParam(base_dir, 'instance_id', instance_id)
print('Instance ID: ' + instance_id)
# get domain name from configuration
configDomain = getConfigParam(base_dir, 'domain')
configDomain = get_config_param(base_dir, 'domain')
if configDomain:
domain = configDomain
else:
domain = 'localhost'
# get onion domain name from configuration
configOnionDomain = getConfigParam(base_dir, 'onion')
configOnionDomain = get_config_param(base_dir, 'onion')
if configOnionDomain:
onion_domain = configOnionDomain
else:
onion_domain = None
# 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:
i2p_domain = configi2p_domain
else:
i2p_domain = None
# get port number from configuration
configPort = getConfigParam(base_dir, 'port')
configPort = get_config_param(base_dir, 'port')
if configPort:
port = configPort
else:
@ -1138,7 +1138,7 @@ else:
else:
port = 443
configProxyPort = getConfigParam(base_dir, 'proxy_port')
configProxyPort = get_config_param(base_dir, 'proxy_port')
if configProxyPort:
proxy_port = configProxyPort
else:
@ -1162,7 +1162,7 @@ if args.federation_list:
federation_list = args.federation_list.copy()
setConfigParam(base_dir, 'federation_list', federation_list)
else:
configFederationList = getConfigParam(base_dir, 'federation_list')
configFederationList = get_config_param(base_dir, 'federation_list')
if configFederationList:
federation_list = configFederationList
@ -1187,7 +1187,7 @@ if args.approve:
cached_webfingers = {}
person_cache = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1215,7 +1215,7 @@ if args.deny:
cached_webfingers = {}
person_cache = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1308,7 +1308,7 @@ if args.message:
followersOnly = False
isArticle = False
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1346,7 +1346,7 @@ if args.announce:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1390,7 +1390,7 @@ if args.box:
elif args.gnunet:
proxy_type = 'gnunet'
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1451,7 +1451,7 @@ if args.itemName:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1494,7 +1494,7 @@ if args.undoItemName:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1556,7 +1556,7 @@ if args.wantedItemName:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1599,7 +1599,7 @@ if args.undoWantedItemName:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1633,7 +1633,7 @@ if args.like:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1672,7 +1672,7 @@ if args.react:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1705,7 +1705,7 @@ if args.undolike:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1745,7 +1745,7 @@ if args.undoreact:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1779,7 +1779,7 @@ if args.bookmark:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1813,7 +1813,7 @@ if args.unbookmark:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1846,7 +1846,7 @@ if args.delete:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1891,7 +1891,7 @@ if args.follow:
if args.follow.startswith('https'):
followHttpPrefix = 'https'
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1937,7 +1937,7 @@ if args.unfollow:
if args.follow.startswith('https'):
followHttpPrefix = 'https'
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -1972,7 +1972,7 @@ if args.followingList:
cached_webfingers = {}
followHttpPrefix = http_prefix
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2005,7 +2005,7 @@ if args.followersList:
cached_webfingers = {}
followHttpPrefix = http_prefix
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2039,7 +2039,7 @@ if args.followRequestsList:
cached_webfingers = {}
followHttpPrefix = http_prefix
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2091,7 +2091,7 @@ if args.migrations:
port = 443
session = createSession(proxy_type)
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2106,7 +2106,7 @@ if args.migrations:
if args.actor:
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
if debug:
print('base_dir: ' + str(base_dir))
@ -2260,11 +2260,11 @@ if args.addaccount:
domain = args.addaccount.split('@')[1]
else:
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')
sys.exit()
configuredDomain = getConfigParam(base_dir, 'domain')
configuredDomain = get_config_param(base_dir, 'domain')
if configuredDomain:
if domain != configuredDomain:
print('The account domain is expected to be ' + configuredDomain)
@ -2308,7 +2308,7 @@ if args.addgroup:
domain = args.addgroup.split('@')[1]
else:
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')
sys.exit()
if nickname.startswith('!'):
@ -2350,15 +2350,15 @@ if args.rmaccount:
domain = args.rmaccount.split('@')[1]
else:
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')
sys.exit()
if args.domain:
domain = args.domain
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 domain != configuredDomain:
print('The account domain is expected to be ' + configuredDomain)
@ -2384,7 +2384,7 @@ if args.activate:
domain = args.activate.split('@')[1]
else:
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')
sys.exit()
if activateAccount(base_dir, nickname, domain):
@ -2403,7 +2403,7 @@ if args.changepassword:
domain = args.changepassword[0].split('@')[1]
else:
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')
sys.exit()
newPassword = args.changepassword[1]
@ -2499,7 +2499,7 @@ if args.skill:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2534,7 +2534,7 @@ if args.availability:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2614,7 +2614,7 @@ if args.shared_items_federated_domains:
fed_domains_str)
else:
fed_domains_str = \
getConfigParam(base_dir, 'shared_items_federated_domains')
get_config_param(base_dir, 'shared_items_federated_domains')
if fed_domains_str:
fed_domains_list = fed_domains_str.split(',')
for sharedFederatedDomain in fed_domains_list:
@ -2648,7 +2648,7 @@ if args.block:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2680,7 +2680,7 @@ if args.mute:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2712,7 +2712,7 @@ if args.unmute:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -2756,7 +2756,7 @@ if args.unblock:
person_cache = {}
cached_webfingers = {}
if not domain:
domain = getConfigParam(base_dir, 'domain')
domain = get_config_param(base_dir, 'domain')
signing_priv_key_pem = None
if args.secure_mode:
signing_priv_key_pem = getInstanceActorKey(base_dir, domain)
@ -3001,11 +3001,11 @@ if args.testdata:
if args.max_mentions < 4:
args.max_mentions = 4
registration = getConfigParam(base_dir, 'registration')
registration = get_config_param(base_dir, 'registration')
if not registration:
registration = False
minimumvotes = getConfigParam(base_dir, 'minvotes')
minimumvotes = get_config_param(base_dir, 'minvotes')
if minimumvotes:
args.minimumvotes = int(minimumvotes)
@ -3014,127 +3014,127 @@ if args.content_license_url:
content_license_url = args.content_license_url
setConfigParam(base_dir, 'content_license_url', content_license_url)
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:
args.votingtime = votingtime
# only show the date at the bottom of posts
dateonly = getConfigParam(base_dir, 'dateonly')
dateonly = get_config_param(base_dir, 'dateonly')
if dateonly:
args.dateonly = dateonly
# set the maximum number of newswire posts per account or rss feed
max_newswire_postsPerSource = \
getConfigParam(base_dir, 'max_newswire_postsPerSource')
get_config_param(base_dir, 'max_newswire_postsPerSource')
if max_newswire_postsPerSource:
args.max_newswire_postsPerSource = int(max_newswire_postsPerSource)
# set the maximum number of newswire posts appearing in the right column
max_newswire_posts = \
getConfigParam(base_dir, 'max_newswire_posts')
get_config_param(base_dir, 'max_newswire_posts')
if max_newswire_posts:
args.max_newswire_posts = int(max_newswire_posts)
# set the maximum size of a newswire rss/atom feed in Kilobytes
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:
args.max_newswire_feed_size_kb = int(max_newswire_feed_size_kb)
max_mirrored_articles = \
getConfigParam(base_dir, 'max_mirrored_articles')
get_config_param(base_dir, 'max_mirrored_articles')
if max_mirrored_articles is not None:
args.max_mirrored_articles = int(max_mirrored_articles)
max_news_posts = \
getConfigParam(base_dir, 'max_news_posts')
get_config_param(base_dir, 'max_news_posts')
if max_news_posts is not None:
args.max_news_posts = int(max_news_posts)
max_followers = \
getConfigParam(base_dir, 'max_followers')
get_config_param(base_dir, 'max_followers')
if max_followers is not None:
args.max_followers = int(max_followers)
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:
args.max_feed_item_size_kb = int(max_feed_item_size_kb)
dormant_months = \
getConfigParam(base_dir, 'dormant_months')
get_config_param(base_dir, 'dormant_months')
if dormant_months is not None:
args.dormant_months = int(dormant_months)
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:
args.send_threads_timeout_mins = int(send_threads_timeout_mins)
max_like_count = \
getConfigParam(base_dir, 'max_like_count')
get_config_param(base_dir, 'max_like_count')
if max_like_count is not None:
args.max_like_count = int(max_like_count)
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:
args.show_publish_as_icon = bool(show_publish_as_icon)
icons_as_buttons = \
getConfigParam(base_dir, 'icons_as_buttons')
get_config_param(base_dir, 'icons_as_buttons')
if icons_as_buttons is not None:
args.icons_as_buttons = bool(icons_as_buttons)
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:
args.rss_icon_at_top = bool(rss_icon_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:
args.publish_button_at_top = bool(publish_button_at_top)
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:
args.full_width_tl_button_header = bool(full_width_tl_button_header)
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:
args.allow_local_network_access = bool(allow_local_network_access)
verify_all_signatures = \
getConfigParam(base_dir, 'verify_all_signatures')
get_config_param(base_dir, 'verify_all_signatures')
if verify_all_signatures is not None:
args.verify_all_signatures = bool(verify_all_signatures)
broch_mode = \
getConfigParam(base_dir, 'broch_mode')
get_config_param(base_dir, 'broch_mode')
if broch_mode is not None:
args.broch_mode = bool(broch_mode)
log_login_failures = \
getConfigParam(base_dir, 'log_login_failures')
get_config_param(base_dir, 'log_login_failures')
if log_login_failures is not None:
args.log_login_failures = bool(log_login_failures)
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:
args.show_node_info_accounts = bool(show_node_info_accounts)
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:
args.show_node_info_version = bool(show_node_info_version)
low_bandwidth = \
getConfigParam(base_dir, 'low_bandwidth')
get_config_param(base_dir, 'low_bandwidth')
if low_bandwidth is not None:
args.low_bandwidth = bool(low_bandwidth)
@ -3144,7 +3144,7 @@ if args.userAgentBlocks:
setConfigParam(base_dir, 'user_agents_blocked', user_agents_blockedStr)
else:
user_agents_blockedStr = \
getConfigParam(base_dir, 'user_agents_blocked')
get_config_param(base_dir, 'user_agents_blocked')
if user_agents_blockedStr:
agentBlocksList = user_agents_blockedStr.split(',')
for agentBlockStr in agentBlocksList:
@ -3155,14 +3155,14 @@ if args.lists_enabled:
lists_enabled = args.lists_enabled
setConfigParam(base_dir, 'lists_enabled', lists_enabled)
else:
lists_enabled = getConfigParam(base_dir, 'lists_enabled')
lists_enabled = get_config_param(base_dir, 'lists_enabled')
city = \
getConfigParam(base_dir, 'city')
get_config_param(base_dir, 'city')
if city is not None:
args.city = city
YTDomain = getConfigParam(base_dir, 'youtubedomain')
YTDomain = get_config_param(base_dir, 'youtubedomain')
if YTDomain:
if '://' in YTDomain:
YTDomain = YTDomain.split('://')[1]
@ -3171,7 +3171,7 @@ if YTDomain:
if '.' in YTDomain:
args.yt_replace_domain = YTDomain
twitterDomain = getConfigParam(base_dir, 'twitterdomain')
twitterDomain = get_config_param(base_dir, 'twitterdomain')
if twitterDomain:
if '://' in twitterDomain:
twitterDomain = twitterDomain.split('://')[1]
@ -3187,7 +3187,7 @@ if setTheme(base_dir, theme_name, domain,
# whether new registrations are open or closed
if args.registration:
if args.registration.lower() == 'open':
registration = getConfigParam(base_dir, 'registration')
registration = get_config_param(base_dir, 'registration')
if not registration:
setConfigParam(base_dir, 'registrationsRemaining',
str(maxRegistrations))
@ -3201,7 +3201,7 @@ if args.registration:
setConfigParam(base_dir, 'registration', 'closed')
print('New registrations closed')
defaultCurrency = getConfigParam(base_dir, 'defaultCurrency')
defaultCurrency = get_config_param(base_dir, 'defaultCurrency')
if not defaultCurrency:
setConfigParam(base_dir, 'defaultCurrency', 'EUR')
if args.defaultCurrency:

View File

@ -11,7 +11,7 @@ import os
import time
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from utils import getConfigParam
from utils import get_config_param
from utils import saveJson
@ -75,7 +75,7 @@ def htmlWatchPointsGraph(base_dir: str, fitness: {}, fitnessId: str,
cssFilename = base_dir + '/graph.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
htmlStr += \
'<table class="graph">\n' + \

View File

@ -35,7 +35,7 @@ from utils import getPortFromDomain
from utils import has_object_dict
from utils import dmAllowedFromDomain
from utils import isRecentPost
from utils import getConfigParam
from utils import get_config_param
from utils import has_users_path
from utils import valid_post_date
from utils import get_full_domain
@ -303,8 +303,8 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, max_recent_posts: int,
boxname = 'inbox'
notDM = not isDM(post_json_object)
yt_replace_domain = getConfigParam(base_dir, 'youtubedomain')
twitter_replacement_domain = getConfigParam(base_dir, 'twitterdomain')
yt_replace_domain = get_config_param(base_dir, 'youtubedomain')
twitter_replacement_domain = get_config_param(base_dir, 'twitterdomain')
individualPostAsHtml(signing_priv_key_pem,
True, recentPostsCache, max_recent_posts,
translate, pageNumber,
@ -2631,7 +2631,7 @@ def _sendToGroupMembers(session, base_dir: str, handle: str, port: int,
sharedItemFederationTokens = {}
shared_items_federated_domains = []
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:
siFederatedDomainsList = \
shared_items_federated_domainsStr.split(',')
@ -4207,7 +4207,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
'accounts': {}
}
# 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:
verify_all_signatures = verifyAllSigs
# 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):
saveJson(queueJson['post'], sharedInboxPostFilename)
lists_enabled = getConfigParam(base_dir, "lists_enabled")
content_license_url = getConfigParam(base_dir, "content_license_url")
lists_enabled = get_config_param(base_dir, "lists_enabled")
content_license_url = get_config_param(base_dir, "content_license_url")
# for posts addressed to specific accounts
for handle, capsId in recipientsDict.items():

View File

@ -13,7 +13,7 @@ from urllib import request, parse
from utils import get_actor_languages_list
from utils import removeHtml
from utils import has_object_dict
from utils import getConfigParam
from utils import get_config_param
from utils import local_actor_url
from cache import getPersonFromCache
@ -118,9 +118,10 @@ def understoodPostLanguage(base_dir: str, nickname: str, domain: str,
if msgObject['contentMap'].get(lang):
return True
# is the language for this post supported by libretranslate?
libretranslateUrl = getConfigParam(base_dir, "libretranslateUrl")
libretranslateUrl = get_config_param(base_dir, "libretranslateUrl")
if libretranslateUrl:
libretranslateApiKey = getConfigParam(base_dir, "libretranslateApiKey")
libretranslateApiKey = \
get_config_param(base_dir, "libretranslateApiKey")
lang_list = \
libretranslateLanguages(libretranslateUrl, libretranslateApiKey)
for lang in lang_list:
@ -287,10 +288,10 @@ def autoTranslatePost(base_dir: str, post_json_object: {},
return ''
# is the language for this post supported by libretranslate?
libretranslateUrl = getConfigParam(base_dir, "libretranslateUrl")
libretranslateUrl = get_config_param(base_dir, "libretranslateUrl")
if not libretranslateUrl:
return ''
libretranslateApiKey = getConfigParam(base_dir, "libretranslateApiKey")
libretranslateApiKey = get_config_param(base_dir, "libretranslateApiKey")
lang_list = \
libretranslateLanguages(libretranslateUrl, libretranslateApiKey)
for lang in lang_list:

View File

@ -9,7 +9,7 @@ __module_group__ = "API"
import os
from utils import loadJson
from utils import getConfigParam
from utils import get_config_param
from utils import acct_dir
from metadata import metaDataInstance
@ -196,17 +196,16 @@ def mastoApiV1Response(path: str, callingDomain: str,
sendJsonStr = \
'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':
instanceDescriptionShort = \
getConfigParam(base_dir,
'instanceDescriptionShort')
get_config_param(base_dir, 'instanceDescriptionShort')
if not instanceDescriptionShort:
instanceDescriptionShort = \
translate['Yet another Epicyon Instance']
instanceDescription = getConfigParam(base_dir,
'instanceDescription')
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceDescription = \
get_config_param(base_dir, 'instanceDescription')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
if callingDomain.endswith('.onion') and onion_domain:
domain_full = onion_domain

View File

@ -49,7 +49,7 @@ from utils import validNickname
from utils import loadJson
from utils import saveJson
from utils import setConfigParam
from utils import getConfigParam
from utils import get_config_param
from utils import refresh_newswire
from utils import getProtocolPrefixes
from utils import has_users_path
@ -605,7 +605,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
# remaining registrations counter
if nickname != 'news':
remainingConfigExists = \
getConfigParam(base_dir, 'registrationsRemaining')
get_config_param(base_dir, 'registrationsRemaining')
if remainingConfigExists:
registrationsRemaining = int(remainingConfigExists)
if registrationsRemaining <= 0:
@ -625,7 +625,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
manual_follower,
group_account,
password)
if not getConfigParam(base_dir, 'admin'):
if not get_config_param(base_dir, 'admin'):
if nickname != 'news':
# print(nickname+' becomes the instance admin and a moderator')
setConfigParam(base_dir, 'admin', nickname)
@ -668,7 +668,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
except OSError:
print('EX: unable to write ' + notifyReactionsFilename)
theme = getConfigParam(base_dir, 'theme')
theme = get_config_param(base_dir, 'theme')
if not theme:
theme = 'default'
@ -822,7 +822,7 @@ def personUpgradeActor(base_dir: str, personJson: {},
# roles are configured
rolesList = getActorRolesList(personJson)
if not rolesList:
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if personJson['id'].endswith('/users/' + adminName):
rolesList = ["admin", "moderator", "editor"]
setRolesFromList(personJson, rolesList)
@ -1060,7 +1060,7 @@ def suspendAccount(base_dir: str, nickname: str, domain: str) -> None:
"""Suspends the given account
"""
# Don't suspend the admin
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if not adminNickname:
return
if nickname == adminNickname:
@ -1118,7 +1118,7 @@ def canRemovePost(base_dir: str, nickname: str,
domain_full = get_full_domain(domain, port)
# is the post by the admin?
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if not adminNickname:
return False
if domain_full + '/users/' + adminNickname + '/' in postId:
@ -1176,7 +1176,7 @@ def removeAccount(base_dir: str, nickname: str,
"""Removes an account
"""
# Don't remove the admin
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if not adminNickname:
return False
if nickname == adminNickname:

View File

@ -61,7 +61,7 @@ from utils import validNickname
from utils import locatePost
from utils import loadJson
from utils import saveJson
from utils import getConfigParam
from utils import get_config_param
from utils import locateNewsVotes
from utils import locateNewsArrival
from utils import votesOnNewswireItem
@ -96,7 +96,7 @@ def isModerator(base_dir: str, nickname: str) -> bool:
moderatorsFile = base_dir + '/accounts/moderators.txt'
if not os.path.isfile(moderatorsFile):
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if not adminName:
return False
if adminName == nickname:
@ -106,7 +106,7 @@ def isModerator(base_dir: str, nickname: str) -> bool:
with open(moderatorsFile, 'r') as f:
lines = f.readlines()
if len(lines) == 0:
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if not adminName:
return False
if adminName == nickname:
@ -2153,7 +2153,7 @@ def createReportPost(base_dir: str,
moderatorsList.append(moderatorActor)
if len(moderatorsList) == 0:
# 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:
localActor = \
local_actor_url(http_prefix, adminNickname, domain_full)

View File

@ -25,7 +25,7 @@ from session import createSession
from utils import hasObjectStringType
from utils import dateStringToSeconds
from utils import dateSecondsToString
from utils import getConfigParam
from utils import get_config_param
from utils import get_full_domain
from utils import validNickname
from utils import loadJson
@ -1711,7 +1711,7 @@ def runFederatedSharesDaemon(base_dir: str, httpd, http_prefix: str,
_generateNextSharesTokenUpdate(base_dir, minDays, maxDays)
while True:
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:
time.sleep(fileCheckIntervalSec)
continue

View File

@ -292,7 +292,7 @@ def is_editor(base_dir: str, nickname: str) -> bool:
editorsFile = base_dir + '/accounts/editors.txt'
if not os.path.isfile(editorsFile):
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if not adminName:
return False
if adminName == nickname:
@ -302,7 +302,7 @@ def is_editor(base_dir: str, nickname: str) -> bool:
with open(editorsFile, 'r') as f:
lines = f.readlines()
if len(lines) == 0:
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if not adminName:
return False
if adminName == nickname:
@ -320,7 +320,7 @@ def isArtist(base_dir: str, nickname: str) -> bool:
artistsFile = base_dir + '/accounts/artists.txt'
if not os.path.isfile(artistsFile):
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if not adminName:
return False
if adminName == nickname:
@ -330,7 +330,7 @@ def isArtist(base_dir: str, nickname: str) -> bool:
with open(artistsFile, 'r') as f:
lines = f.readlines()
if len(lines) == 0:
adminName = getConfigParam(base_dir, 'admin')
adminName = get_config_param(base_dir, 'admin')
if not adminName:
return False
if adminName == nickname:
@ -516,7 +516,7 @@ def setConfigParam(base_dir: str, variableName: str, variableValue) -> None:
saveJson(configJson, configFilename)
def getConfigParam(base_dir: str, variableName: str):
def get_config_param(base_dir: str, variableName: str):
"""Gets a configuration value
"""
_createConfig(base_dir)
@ -531,7 +531,7 @@ def getConfigParam(base_dir: str, variableName: str):
def isSuspended(base_dir: str, nickname: str) -> bool:
"""Returns true if the given nickname is suspended
"""
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if not adminNickname:
return False
if nickname == adminNickname:

View File

@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
import os
from shutil import copyfile
from utils import getConfigParam
from utils import get_config_param
from webapp_utils import htmlHeaderWithWebsiteMarkup
from webapp_utils import htmlFooter
from markdown import markdownToHtml
@ -20,7 +20,7 @@ def htmlAbout(cssCache: {}, base_dir: str, http_prefix: str,
system_language: str) -> str:
"""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'):
copyfile(base_dir + '/default_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'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
aboutForm = \
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
http_prefix, domain_full,

View File

@ -10,7 +10,7 @@ __module_group__ = "Accessibility"
import os
from utils import isAccountDir
from utils import loadJson
from utils import getConfigParam
from utils import get_config_param
from utils import acct_dir
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
@ -59,7 +59,7 @@ def htmlAccessKeys(cssCache: {}, base_dir: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
accessKeysForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
accessKeysForm += '<div class="container">\n'

View File

@ -11,7 +11,7 @@ import os
from datetime import datetime
from datetime import date
from utils import getDisplayName
from utils import getConfigParam
from utils import get_config_param
from utils import getNicknameFromActor
from utils import getDomainFromActor
from utils import locatePost
@ -57,7 +57,7 @@ def htmlCalendarDeleteConfirm(cssCache: {}, translate: {}, base_dir: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
deletePostStr = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
deletePostStr += \
@ -119,7 +119,7 @@ def _htmlCalendarDay(person_cache: {}, cssCache: {}, translate: {},
if '/users/' in actor:
calActor = '/users/' + actor.split('/users/')[1]
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
calendarStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
calendarStr += '<main><table class="calendar">\n'
calendarStr += '<caption class="calendar__banner--month">\n'
@ -339,7 +339,7 @@ def htmlCalendar(person_cache: {}, cssCache: {}, translate: {},
calActor = '/users/' + actor.split('/users/')[1]
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
headerStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
# the main graphical calendar as a table

View File

@ -8,7 +8,7 @@ __status__ = "Production"
__module_group__ = "Web Interface Columns"
import os
from utils import getConfigParam
from utils import get_config_param
from utils import getNicknameFromActor
from utils import is_editor
from utils import isArtist
@ -377,7 +377,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str,
domain = removeDomainPort(domain_full)
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
bannerFile, bannerFilename = \
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)
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
editLinksForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
@ -495,7 +495,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, base_dir: str, path: str,
'</div>'
# 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 nickname == adminNickname:
aboutFilename = base_dir + '/accounts/about.md'

View File

@ -19,7 +19,7 @@ from utils import loadJson
from utils import votesOnNewswireItem
from utils import getNicknameFromActor
from utils import is_editor
from utils import getConfigParam
from utils import get_config_param
from utils import removeDomainPort
from utils import acct_dir
from posts import isModerator
@ -364,7 +364,7 @@ def htmlCitations(base_dir: str, nickname: str, domain: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
# top banner
@ -479,7 +479,7 @@ def htmlNewswireMobile(cssCache: {}, base_dir: str, nickname: str,
showPublishButton = editor
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
bannerFile, bannerFilename = \
@ -546,7 +546,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, base_dir: str, path: str,
getBannerFile(base_dir, nickname, domain, theme)
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
editNewswireForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
@ -671,7 +671,7 @@ def htmlEditNewsPost(cssCache: {}, translate: {}, base_dir: str, path: str,
cssFilename = base_dir + '/links.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
editNewsPostForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
editNewsPostForm += \

View File

@ -14,7 +14,7 @@ from utils import getNicknameFromActor
from utils import getDomainFromActor
from utils import locatePost
from utils import loadJson
from utils import getConfigParam
from utils import get_config_param
from utils import getAltPath
from utils import acct_dir
from webapp_utils import setCustomBackground
@ -61,7 +61,7 @@ def htmlConfirmDelete(cssCache: {},
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
deletePostStr = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
deletePostStr += \
@ -138,7 +138,7 @@ def htmlConfirmRemoveSharedItem(cssCache: {}, translate: {}, base_dir: str,
if os.path.isfile(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 += '<div class="follow">\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'):
cssFilename = base_dir + '/follow.css'
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
followStr += '<div class="follow">\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'):
cssFilename = base_dir + '/follow.css'
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
followStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
followStr += '<div class="follow">\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'):
cssFilename = base_dir + '/follow.css'
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
blockStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
blockStr += '<div class="block">\n'
blockStr += ' <div class="blockAvatar">\n'

View File

@ -13,7 +13,7 @@ from utils import isPublicPostFromUrl
from utils import getNicknameFromActor
from utils import getDomainFromActor
from utils import getMediaFormats
from utils import getConfigParam
from utils import get_config_param
from utils import acct_dir
from utils import getCurrencies
from utils import getCategoryTypes
@ -489,7 +489,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
for symbol, currName in currencies.items():
currencyList.append(currName + ' ' + symbol)
currencyList.sort()
defaultCurrency = getConfigParam(base_dir, 'defaultCurrency')
defaultCurrency = get_config_param(base_dir, 'defaultCurrency')
if not defaultCurrency:
defaultCurrency = "EUR"
for currName in currencyList:
@ -554,7 +554,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
for symbol, currName in currencies.items():
currencyList.append(currName + ' ' + symbol)
currencyList.sort()
defaultCurrency = getConfigParam(base_dir, 'defaultCurrency')
defaultCurrency = get_config_param(base_dir, 'defaultCurrency')
if not defaultCurrency:
defaultCurrency = "EUR"
for currName in currencyList:
@ -636,7 +636,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
editTextField(translate['Location'], 'location', '')
dateAndLocation += '</div>\n'
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
newPostForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
newPostForm += \

View File

@ -10,7 +10,7 @@ __module_group__ = "Timeline"
import os
from utils import isSystemAccount
from utils import getDomainFromActor
from utils import getConfigParam
from utils import get_config_param
from person import personBoxJson
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
@ -206,7 +206,7 @@ def htmlFrontScreen(signing_priv_key_pem: str,
'</table>\n'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
profileStr = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
profileStr + profileFooterStr + htmlFooter()

View File

@ -10,7 +10,7 @@ __module_group__ = "Web Interface"
import os
from datetime import datetime
from utils import getNicknameFromActor
from utils import getConfigParam
from utils import get_config_param
from categories import getHashtagCategories
from categories import getHashtagCategory
from webapp_utils import setCustomBackground
@ -208,7 +208,7 @@ def htmlSearchHashtagCategory(cssCache: {}, translate: {},
cssFilename = base_dir + '/search.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
htmlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
# show a banner above the search box

View File

@ -10,7 +10,7 @@ __module_group__ = "Web Interface"
import os
import time
from shutil import copyfile
from utils import getConfigParam
from utils import get_config_param
from utils import noOfAccounts
from utils import getNicknameValidationPattern
from webapp_utils import setCustomBackground
@ -119,8 +119,8 @@ def htmlLogin(cssCache: {}, translate: {},
# show the register button
registerButtonStr = ''
if getConfigParam(base_dir, 'registration') == 'open':
if int(getConfigParam(base_dir, 'registrationsRemaining')) > 0:
if get_config_param(base_dir, 'registration') == 'open':
if int(get_config_param(base_dir, 'registrationsRemaining')) > 0:
if accounts > 0:
idx = 'Welcome. Please login or register a new account.'
loginText = \
@ -149,14 +149,14 @@ def htmlLogin(cssCache: {}, translate: {},
autocompletePasswordStr = 'autocomplete="off" value=""'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
loginForm = \
htmlHeaderWithWebsiteMarkup(cssFilename, instanceTitle,
http_prefix, domain,
system_language)
nicknamePattern = getNicknameValidationPattern()
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
loginForm += \
'<br>\n' + \
'<form method="POST" action="/login">\n' + \

View File

@ -15,7 +15,7 @@ from utils import is_editor
from utils import loadJson
from utils import getNicknameFromActor
from utils import getDomainFromActor
from utils import getConfigParam
from utils import get_config_param
from utils import local_actor_url
from posts import downloadFollowCollection
from posts import getPublicPostInfo
@ -100,7 +100,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
searchNickname = getNicknameFromActor(searchHandle)
@ -287,7 +287,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
infoForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
infoForm += \

View File

@ -13,7 +13,7 @@ from petnames import getPetName
from person import isPersonSnoozed
from posts import isModerator
from utils import get_full_domain
from utils import getConfigParam
from utils import get_config_param
from utils import is_dormant
from utils import removeHtml
from utils import getDomainFromActor
@ -129,7 +129,7 @@ def htmlPersonOptions(defaultTimeline: str,
translate['Donate'] + '</button></a>\n'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
optionsStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
optionsStr += htmlKeyboardNavigation(text_mode_banner, {}, {})
optionsStr += '<br><br>\n'
@ -289,7 +289,7 @@ def htmlPersonOptions(defaultTimeline: str,
# checkbox for permission to post to newswire
newswirePostsPermitted = False
if optionsDomainFull == domain_full:
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if (nickname == adminNickname or
(isModerator(base_dir, nickname) and
not isModerator(base_dir, optionsNickname))):
@ -330,7 +330,7 @@ def htmlPersonOptions(defaultTimeline: str,
# checkbox for permission to post to featured articles
if news_instance and optionsDomainFull == domain_full:
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if (nickname == adminNickname or
(isModerator(base_dir, nickname) and
not isModerator(base_dir, optionsNickname))):

View File

@ -34,7 +34,7 @@ from utils import isPGPEncrypted
from utils import isDM
from utils import rejectPostId
from utils import isRecentPost
from utils import getConfigParam
from utils import get_config_param
from utils import get_full_domain
from utils import is_editor
from utils import locatePost
@ -2146,7 +2146,7 @@ def htmlIndividualPost(cssCache: {},
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
metadataStr = _htmlPostMetadataOpenGraph(domain, originalPostJson)
headerStr = htmlHeaderWithExternalStyle(cssFilename,
instanceTitle, metadataStr)
@ -2197,7 +2197,7 @@ def htmlPostReplies(cssCache: {},
if os.path.isfile(base_dir + '/epicyon.css'):
cssFilename = base_dir + '/epicyon.css'
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
metadata = ''
headerStr = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, metadata)
@ -2275,7 +2275,7 @@ def htmlEmojiReactionPicker(cssCache: {},
bannerFile, _ = \
getBannerFile(base_dir, nickname, domain, theme_name)
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
metadata = ''
headerStr = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, metadata)

View File

@ -23,7 +23,7 @@ from utils import getDomainFromActor
from utils import isSystemAccount
from utils import removeHtml
from utils import loadJson
from utils import getConfigParam
from utils import get_config_param
from utils import getImageFormats
from utils import acct_dir
from utils import getSupportedLanguages
@ -356,7 +356,7 @@ def htmlProfileAfterSearch(cssCache: {},
break
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
return htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
profileStr + htmlFooter()
@ -1016,7 +1016,7 @@ def htmlProfile(signing_priv_key_pem: str,
profileStr += '</div>'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
profileStr = \
htmlHeaderWithPersonMarkup(cssFilename, instanceTitle,
profile_json, city,
@ -1242,7 +1242,7 @@ def _htmlThemesDropdown(base_dir: str, translate: {}) -> str:
themesDropdown += \
editCheckBox(translate['Remove the custom font'],
'removeCustomFont', False)
theme_name = getConfigParam(base_dir, 'theme')
theme_name = get_config_param(base_dir, 'theme')
themesDropdown = \
themesDropdown.replace('<option value="' + theme_name + '">',
'<option value="' + theme_name +
@ -1257,7 +1257,7 @@ def _htmlEditProfileGraphicDesign(base_dir: str, translate: {}) -> str:
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:
low_bandwidth = False
graphicsStr += _htmlThemesDropdown(base_dir, translate)
@ -1290,7 +1290,7 @@ def _htmlEditProfileTwitter(base_dir: str, translate: {},
twitterStr += \
editCheckBox(translate['Remove Twitter posts'],
'removeTwitter', removeTwitter)
twitter_replacement_domain = getConfigParam(base_dir, "twitterdomain")
twitter_replacement_domain = get_config_param(base_dir, "twitterdomain")
if not twitter_replacement_domain:
twitter_replacement_domain = ''
twitterStr += \
@ -1311,15 +1311,15 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
# Instance details section
instanceDescription = \
getConfigParam(base_dir, 'instanceDescription')
get_config_param(base_dir, 'instanceDescription')
customSubmitText = \
getConfigParam(base_dir, 'customSubmitText')
get_config_param(base_dir, 'customSubmitText')
instanceDescriptionShort = \
getConfigParam(base_dir, 'instanceDescriptionShort')
get_config_param(base_dir, 'instanceDescriptionShort')
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
content_license_url = \
getConfigParam(base_dir, 'content_license_url')
get_config_param(base_dir, 'content_license_url')
if not content_license_url:
content_license_url = 'https://creativecommons.org/licenses/by/4.0'
@ -1355,7 +1355,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
nodeInfoStr = \
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 += \
editCheckBox(nodeInfoStr, 'show_node_info_accounts', True)
else:
@ -1364,14 +1364,14 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
nodeInfoStr = \
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 += \
editCheckBox(nodeInfoStr, 'show_node_info_version', True)
else:
instanceStr += \
editCheckBox(nodeInfoStr, 'show_node_info_version', False)
if getConfigParam(base_dir, "verify_all_signatures"):
if get_config_param(base_dir, "verify_all_signatures"):
instanceStr += \
editCheckBox(translate['Verify all signatures'],
'verifyallsignatures', True)
@ -1381,7 +1381,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
'verifyallsignatures', False)
instanceStr += translate['Enabling broch mode'] + '<br>\n'
if getConfigParam(base_dir, "broch_mode"):
if get_config_param(base_dir, "broch_mode"):
instanceStr += \
editCheckBox(translate['Broch mode'], 'broch_mode', True)
else:
@ -1467,7 +1467,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
peertube_instancesStr, 200, '', False)
peertubeStr += \
' <br>\n'
yt_replace_domain = getConfigParam(base_dir, "youtubedomain")
yt_replace_domain = get_config_param(base_dir, "youtubedomain")
if not yt_replace_domain:
yt_replace_domain = ''
peertubeStr += \
@ -1475,8 +1475,8 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
'ytdomain', yt_replace_domain)
peertubeStr += endEditSection()
libretranslateUrl = getConfigParam(base_dir, 'libretranslateUrl')
libretranslateApiKey = getConfigParam(base_dir, 'libretranslateApiKey')
libretranslateUrl = get_config_param(base_dir, 'libretranslateUrl')
libretranslateApiKey = get_config_param(base_dir, 'libretranslateApiKey')
libretranslateStr = \
_htmlEditProfileLibreTranslate(translate,
libretranslateUrl,
@ -1581,7 +1581,7 @@ def _htmlEditProfileSharedItems(base_dir: str, nickname: str, domain: str,
"""
sharedItemsStr = ''
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:
shared_items_federated_domainsList = \
shared_items_federated_domainsStr.split(',')
@ -2178,19 +2178,19 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
if os.path.isfile(accountDir + '/.hideReactionButton'):
hideReactionButton = 'checked'
media_instance = getConfigParam(base_dir, "media_instance")
media_instance = get_config_param(base_dir, "media_instance")
if media_instance:
if media_instance is True:
media_instanceStr = 'checked'
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 is True:
news_instanceStr = 'checked'
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 is True:
blogs_instanceStr = 'checked'
@ -2208,7 +2208,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
graphicsStr = ''
sharesFederationStr = ''
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if isArtist(base_dir, nickname) or \
path.startswith('/users/' + str(adminNickname) + '/'):
@ -2232,7 +2232,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
news_instanceStr)
systemMonitorStr = _htmlSystemMonitor(nickname, translate)
instanceTitle = getConfigParam(base_dir, 'instanceTitle')
instanceTitle = get_config_param(base_dir, 'instanceTitle')
editProfileForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)

View File

@ -13,7 +13,7 @@ import urllib.parse
from datetime import datetime
from utils import get_base_content_from_post
from utils import isAccountDir
from utils import getConfigParam
from utils import get_config_param
from utils import get_full_domain
from utils import is_editor
from utils import loadJson
@ -63,7 +63,7 @@ def htmlSearchEmoji(cssCache: {}, translate: {},
# create header
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
emojiForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
emojiForm += '<center><h1>' + \
translate['Emoji Search'] + \
@ -239,7 +239,7 @@ def htmlSearchSharedItems(cssCache: {}, translate: {},
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
sharedItemsForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
if sharesFileType == 'shares':
@ -346,7 +346,7 @@ def htmlSearchEmojiTextEntry(cssCache: {}, translate: {},
cssFilename = base_dir + '/follow.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
emojiStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
emojiStr += '<div class="follow">\n'
emojiStr += ' <div class="followAvatar">\n'
@ -385,7 +385,7 @@ def htmlSearch(cssCache: {}, translate: {},
if os.path.isfile(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)
# show a banner above the search box
@ -547,7 +547,7 @@ def htmlSkillsSearch(actor: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
skillSearchForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
skillSearchForm += \
@ -624,7 +624,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, base_dir: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
historySearchForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
@ -766,7 +766,7 @@ def htmlHashtagSearch(cssCache: {},
# add the page title
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
hashtagSearchForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
if nickname:

View File

@ -8,7 +8,7 @@ __status__ = "Production"
__module_group__ = "Web Interface"
import os
from utils import getConfigParam
from utils import get_config_param
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
@ -22,7 +22,7 @@ def htmlSuspended(cssCache: {}, base_dir: str) -> str:
cssFilename = base_dir + '/suspended.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
suspendedForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
suspendedForm += \

View File

@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
import os
from utils import loadJson
from utils import getConfigParam
from utils import get_config_param
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import getBannerFile
@ -191,7 +191,7 @@ def htmlThemeDesigner(cssCache: {}, base_dir: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
themeForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
bannerFile, bannerFilename = \

View File

@ -12,7 +12,7 @@ import time
from shutil import copyfile
from utils import isArtist
from utils import dangerousMarkup
from utils import getConfigParam
from utils import get_config_param
from utils import get_full_domain
from utils import is_editor
from utils import removeIdEnding
@ -58,11 +58,11 @@ def _getHelpForTimeline(base_dir: str, boxName: str) -> str:
helpFilename = base_dir + '/accounts/help_' + boxName + '.md'
if not os.path.isfile(helpFilename):
language = \
getConfigParam(base_dir, 'language')
get_config_param(base_dir, 'language')
if not language:
language = 'en'
theme_name = \
getConfigParam(base_dir, 'theme')
get_config_param(base_dir, 'theme')
defaultFilename = None
if theme_name:
defaultFilename = \
@ -83,7 +83,7 @@ def _getHelpForTimeline(base_dir: str, boxName: str) -> str:
# show help text
if os.path.isfile(helpFilename):
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
if not instanceTitle:
instanceTitle = 'Epicyon'
with open(helpFilename, 'r') as helpFile:
@ -674,7 +674,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
'</span></button></a>'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
tlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4')
@ -1055,7 +1055,7 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
shared_items_federated_domains, sharesFileType)
domain_full = get_full_domain(domain, port)
actor = local_actor_url(http_prefix, nickname, domain_full)
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
adminActor = ''
if adminNickname:
adminActor = \

View File

@ -9,7 +9,7 @@ __module_group__ = "Web Interface"
import os
from shutil import copyfile
from utils import getConfigParam
from utils import get_config_param
from utils import local_actor_url
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
@ -20,7 +20,7 @@ def htmlTermsOfService(cssCache: {}, base_dir: str,
http_prefix: str, domain_full: str) -> str:
"""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'):
copyfile(base_dir + '/default_tos.md',
base_dir + '/accounts/tos.md')
@ -41,7 +41,7 @@ def htmlTermsOfService(cssCache: {}, base_dir: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
TOSForm = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
TOSForm += '<div class="container">' + TOSText + '</div>\n'
if adminNickname:

View File

@ -16,7 +16,7 @@ from utils import removeHtml
from utils import getProtocolPrefixes
from utils import loadJson
from utils import getCachedPostFilename
from utils import getConfigParam
from utils import get_config_param
from utils import acct_dir
from utils import getNicknameFromActor
from utils import isfloat
@ -54,7 +54,7 @@ def htmlFollowingList(cssCache: {}, base_dir: str,
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
followingListHtml = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
for followingAddress in followingList:
@ -76,7 +76,7 @@ def htmlHashtagBlocked(cssCache: {}, base_dir: str, translate: {}) -> str:
cssFilename = base_dir + '/suspended.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
blockedHashtagForm = \
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
blockedHashtagForm += '<div><center>\n'
@ -1202,7 +1202,7 @@ def getPostAttachmentsAsHtml(post_json_object: {}, boxName: str, translate: {},
def htmlPostSeparator(base_dir: str, column: str) -> str:
"""Returns the html for a timeline post separator image
"""
theme = getConfigParam(base_dir, 'theme')
theme = get_config_param(base_dir, 'theme')
filename = 'separator.png'
separatorClass = "postSeparatorImage"
if column:
@ -1472,7 +1472,7 @@ def htmlSearchResultShare(base_dir: str, sharedItem: {}, translate: {},
elif isModerator(base_dir, nickname):
showRemoveButton = True
else:
adminNickname = getConfigParam(base_dir, 'admin')
adminNickname = get_config_param(base_dir, 'admin')
if adminNickname:
if actor.endswith('/users/' + adminNickname):
showRemoveButton = True
@ -1568,7 +1568,7 @@ def htmlShowShare(base_dir: str, domain: str, nickname: str,
if os.path.isfile(base_dir + '/epicyon.css'):
cssFilename = base_dir + '/epicyon.css'
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
return htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None) + \
shareStr + htmlFooter()

View File

@ -9,7 +9,7 @@ __module_group__ = "Onboarding"
import os
from shutil import copyfile
from utils import getConfigParam
from utils import get_config_param
from utils import removeHtml
from utils import acct_dir
from webapp_utils import htmlHeaderWithExternalStyle
@ -71,7 +71,7 @@ def htmlWelcomeScreen(base_dir: str, nickname: str,
copyfile(defaultFilename, welcomeFilename)
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
if not instanceTitle:
instanceTitle = 'Epicyon'

View File

@ -10,7 +10,7 @@ __module_group__ = "Onboarding"
import os
from shutil import copyfile
from utils import removeHtml
from utils import getConfigParam
from utils import get_config_param
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from markdown import markdownToHtml
@ -46,7 +46,7 @@ def htmlWelcomeFinal(base_dir: str, nickname: str, domain: str,
copyfile(defaultFilename, finalFilename)
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
if not instanceTitle:
instanceTitle = 'Epicyon'

View File

@ -11,7 +11,7 @@ import os
from shutil import copyfile
from utils import removeHtml
from utils import loadJson
from utils import getConfigParam
from utils import get_config_param
from utils import getImageExtensions
from utils import getImageFormats
from utils import acct_dir
@ -52,7 +52,7 @@ def htmlWelcomeProfile(base_dir: str, nickname: str, domain: str,
copyfile(defaultFilename, profileFilename)
instanceTitle = \
getConfigParam(base_dir, 'instanceTitle')
get_config_param(base_dir, 'instanceTitle')
if not instanceTitle:
instanceTitle = 'Epicyon'