mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
7cbc13d6e8
82
daemon.py
82
daemon.py
|
@ -15720,10 +15720,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'_GET', 'fonts',
|
'_GET', 'fonts',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
|
||||||
if self.path == '/sharedInbox' or \
|
if self.path in ('/sharedInbox', '/users/inbox', '/actor/inbox',
|
||||||
self.path == '/users/inbox' or \
|
'/users/' + self.server.domain):
|
||||||
self.path == '/actor/inbox' or \
|
|
||||||
self.path == '/users/' + self.server.domain:
|
|
||||||
# if shared inbox is not enabled
|
# if shared inbox is not enabled
|
||||||
if not self.server.enable_shared_inbox:
|
if not self.server.enable_shared_inbox:
|
||||||
self._503()
|
self._503()
|
||||||
|
@ -15812,7 +15810,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.followingItemsPerPage,
|
self.server.followingItemsPerPage,
|
||||||
self.server.debug, 'following')
|
self.server.debug, 'following')
|
||||||
return
|
return
|
||||||
elif '/followers?page=' in self.path:
|
if '/followers?page=' in self.path:
|
||||||
self._get_following_json(self.server.base_dir,
|
self._get_following_json(self.server.base_dir,
|
||||||
self.path,
|
self.path,
|
||||||
calling_domain, referer_domain,
|
calling_domain, referer_domain,
|
||||||
|
@ -15822,7 +15820,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.followingItemsPerPage,
|
self.server.followingItemsPerPage,
|
||||||
self.server.debug, 'followers')
|
self.server.debug, 'followers')
|
||||||
return
|
return
|
||||||
elif '/followrequests?page=' in self.path:
|
if '/followrequests?page=' in self.path:
|
||||||
self._get_following_json(self.server.base_dir,
|
self._get_following_json(self.server.base_dir,
|
||||||
self.path,
|
self.path,
|
||||||
calling_domain, referer_domain,
|
calling_domain, referer_domain,
|
||||||
|
@ -15996,36 +15994,33 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'_GET', 'graph',
|
'_GET', 'graph',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return
|
return
|
||||||
else:
|
graph = graph.replace('.json', '')
|
||||||
graph = graph.replace('.json', '')
|
if graph == 'post':
|
||||||
if graph == 'post':
|
graph = '_POST'
|
||||||
graph = '_POST'
|
elif graph == 'inbox':
|
||||||
elif graph == 'inbox':
|
graph = 'INBOX'
|
||||||
graph = 'INBOX'
|
elif graph == 'get':
|
||||||
elif graph == 'get':
|
graph = '_GET'
|
||||||
graph = '_GET'
|
watch_points_json = \
|
||||||
watch_points_json = \
|
sorted_watch_points(self.server.fitness, graph)
|
||||||
sorted_watch_points(self.server.fitness, graph)
|
msg_str = json.dumps(watch_points_json,
|
||||||
msg_str = json.dumps(watch_points_json,
|
ensure_ascii=False)
|
||||||
ensure_ascii=False)
|
msg_str = self._convert_domains(calling_domain,
|
||||||
msg_str = self._convert_domains(calling_domain,
|
referer_domain,
|
||||||
referer_domain,
|
msg_str)
|
||||||
msg_str)
|
msg = msg_str.encode('utf-8')
|
||||||
msg = msg_str.encode('utf-8')
|
msglen = len(msg)
|
||||||
msglen = len(msg)
|
self._set_headers('application/json', msglen,
|
||||||
self._set_headers('application/json', msglen,
|
None, calling_domain, False)
|
||||||
None, calling_domain, False)
|
self._write(msg)
|
||||||
self._write(msg)
|
fitness_performance(getreq_start_time, self.server.fitness,
|
||||||
fitness_performance(getreq_start_time, self.server.fitness,
|
'_GET', 'graph json',
|
||||||
'_GET', 'graph json',
|
self.server.debug)
|
||||||
self.server.debug)
|
return
|
||||||
return
|
|
||||||
|
|
||||||
# show the main blog page
|
# show the main blog page
|
||||||
if html_getreq and (self.path == '/blog' or
|
if html_getreq and \
|
||||||
self.path == '/blog/' or
|
self.path in ('/blog', '/blog/', '/blogs', '/blogs/'):
|
||||||
self.path == '/blogs' or
|
|
||||||
self.path == '/blogs/'):
|
|
||||||
if '/rss.xml' not in self.path:
|
if '/rss.xml' not in self.path:
|
||||||
curr_session = \
|
curr_session = \
|
||||||
self._establish_session("show the main blog page",
|
self._establish_session("show the main blog page",
|
||||||
|
@ -16593,8 +16588,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'_GET', 'show welcome profile screen',
|
'_GET', 'show welcome profile screen',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return
|
return
|
||||||
else:
|
self.path = self.path.replace('/welcome_profile', '')
|
||||||
self.path = self.path.replace('/welcome_profile', '')
|
|
||||||
|
|
||||||
# the final welcome screen
|
# the final welcome screen
|
||||||
if html_getreq and authorized and \
|
if html_getreq and authorized and \
|
||||||
|
@ -16618,8 +16612,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'_GET', 'show welcome final screen',
|
'_GET', 'show welcome final screen',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return
|
return
|
||||||
else:
|
self.path = self.path.replace('/welcome_final', '')
|
||||||
self.path = self.path.replace('/welcome_final', '')
|
|
||||||
|
|
||||||
# if not authorized then show the login screen
|
# if not authorized then show the login screen
|
||||||
if html_getreq and self.path != '/login' and \
|
if html_getreq and self.path != '/login' and \
|
||||||
|
@ -16643,15 +16636,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# manifest images used to create a home screen icon
|
# manifest images used to create a home screen icon
|
||||||
# when selecting "add to home screen" in browsers
|
# when selecting "add to home screen" in browsers
|
||||||
# which support progressive web apps
|
# which support progressive web apps
|
||||||
if self.path == '/logo72.png' or \
|
if self.path in ('/logo72.png', '/logo96.png', '/logo128.png',
|
||||||
self.path == '/logo96.png' or \
|
'/logo144.png', '/logo150.png', '/logo192.png',
|
||||||
self.path == '/logo128.png' or \
|
'/logo256.png', '/logo512.png',
|
||||||
self.path == '/logo144.png' or \
|
'/apple-touch-icon.png'):
|
||||||
self.path == '/logo150.png' or \
|
|
||||||
self.path == '/logo192.png' or \
|
|
||||||
self.path == '/logo256.png' or \
|
|
||||||
self.path == '/logo512.png' or \
|
|
||||||
self.path == '/apple-touch-icon.png':
|
|
||||||
media_filename = \
|
media_filename = \
|
||||||
self.server.base_dir + '/img' + self.path
|
self.server.base_dir + '/img' + self.path
|
||||||
if os.path.isfile(media_filename):
|
if os.path.isfile(media_filename):
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue