Missing server

main
Bob Mottram 2020-12-09 12:35:43 +00:00
parent a08f3d2cd7
commit 3a7074cebf
1 changed files with 14 additions and 18 deletions

View File

@ -3823,8 +3823,8 @@ class PubServer(BaseHTTPRequestHandler):
# change theme # change theme
if fields.get('themeDropdown'): if fields.get('themeDropdown'):
self.themeName = fields['themeDropdown'] self.server.themeName = fields['themeDropdown']
setTheme(baseDir, self.themeName, domain, setTheme(baseDir, self.server.themeName, domain,
allowLocalNetworkAccess) allowLocalNetworkAccess)
self.server.showPublishAsIcon = \ self.server.showPublishAsIcon = \
getConfigParam(self.server.baseDir, getConfigParam(self.server.baseDir,
@ -4196,7 +4196,7 @@ class PubServer(BaseHTTPRequestHandler):
'.etag') '.etag')
currTheme = getTheme(baseDir) currTheme = getTheme(baseDir)
if currTheme: if currTheme:
self.themeName = currTheme self.server.themeName = currTheme
setTheme(baseDir, currTheme, domain, setTheme(baseDir, currTheme, domain,
self.server.allowLocalNetworkAccess) self.server.allowLocalNetworkAccess)
self.server.showPublishAsIcon = \ self.server.showPublishAsIcon = \
@ -4566,12 +4566,13 @@ class PubServer(BaseHTTPRequestHandler):
if 'image/avif' in self.headers['Accept']: if 'image/avif' in self.headers['Accept']:
favType = 'image/avif' favType = 'image/avif'
favFilename = 'favicon.avif' favFilename = 'favicon.avif'
themeName = getConfigParam(baseDir, 'theme') if not self.server.themeName:
if not themeName: self.themeName = getConfigParam(baseDir, 'theme')
if not self.server.themeName:
themeName = 'default' themeName = 'default'
# custom favicon # custom favicon
faviconFilename = \ faviconFilename = \
baseDir + '/theme/' + themeName + '/icons/' + favFilename baseDir + '/theme/' + self.server.themeName + '/icons/' + favFilename
if not os.path.isfile(faviconFilename): if not os.path.isfile(faviconFilename):
# default favicon # default favicon
faviconFilename = \ faviconFilename = \
@ -5060,10 +5061,10 @@ class PubServer(BaseHTTPRequestHandler):
if path.endswith('.png'): if path.endswith('.png'):
mediaStr = path.split('/icons/')[1] mediaStr = path.split('/icons/')[1]
if '/' not in mediaStr: if '/' not in mediaStr:
if not self.themeName: if not self.server.themeName:
theme = 'default' theme = 'default'
else: else:
theme = self.themeName theme = self.server.themeName
iconFilename = mediaStr iconFilename = mediaStr
else: else:
theme = mediaStr.split('/')[0] theme = mediaStr.split('/')[0]
@ -13069,11 +13070,11 @@ def runDaemon(maxNewswirePosts: int,
createNewsInbox(baseDir, domain, port, httpPrefix) createNewsInbox(baseDir, domain, port, httpPrefix)
# set the avatar for the news account # set the avatar for the news account
themeName = getConfigParam(baseDir, 'theme') httpd.themeName = getConfigParam(baseDir, 'theme')
if not themeName: if not httpd.themeName:
themeName = 'default' httpd.themeName = 'default'
setNewsAvatar(baseDir, setNewsAvatar(baseDir,
themeName, httpd.themeName,
httpPrefix, httpPrefix,
domain, domain,
httpd.domainFull) httpd.domainFull)
@ -13116,11 +13117,6 @@ def runDaemon(maxNewswirePosts: int,
else: else:
httpd.thrPostsQueue.start() httpd.thrPostsQueue.start()
# get the current theme
httpd.themeName = getConfigParam(baseDir, 'theme')
if not httpd.themeName:
httpd.themeName = 'default'
print('Creating expire thread for shared items') print('Creating expire thread for shared items')
httpd.thrSharesExpire = \ httpd.thrSharesExpire = \
threadWithTrace(target=runSharesExpire, threadWithTrace(target=runSharesExpire,