Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon

main
Bob Mottram 2021-06-13 10:31:02 +01:00
commit 424465ae67
6 changed files with 95 additions and 140 deletions

View File

@ -183,8 +183,12 @@ server {
proxy_buffers 16 32k;
proxy_busy_buffers_size 64k;
proxy_redirect off;
proxy_request_buffering on;
proxy_buffering on;
proxy_request_buffering off;
proxy_buffering off;
location ~ ^/accounts/(avatars|headers)/(.*).(png|jpg|gif|webp|svg) {
expires 1d;
proxy_pass http://localhost:7156;
}
proxy_pass http://localhost:7156;
}
}

View File

@ -553,10 +553,6 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Host', callingDomain)
self.send_header('WWW-Authenticate',
'title="Login to Epicyon", Basic realm="epicyon"')
# self.send_header('X-Robots-Tag',
# 'noindex, nofollow, noarchive, nosnippet')
# self.send_header('Cache-Control', 'public')
# self.send_header('Referrer-Policy', 'origin')
self.end_headers()
def _logout_headers(self, fileFormat: str, length: int,
@ -568,10 +564,6 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Host', callingDomain)
self.send_header('WWW-Authenticate',
'title="Login to Epicyon", Basic realm="epicyon"')
# self.send_header('X-Robots-Tag',
# 'noindex, nofollow, noarchive, nosnippet')
# self.send_header('Cache-Control', 'public')
# self.send_header('Referrer-Policy', 'origin')
self.end_headers()
def _logout_redirect(self, redirect: str, cookie: str,
@ -586,10 +578,6 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Host', callingDomain)
self.send_header('InstanceID', self.server.instanceId)
self.send_header('Content-Length', '0')
# self.send_header('X-Robots-Tag',
# 'noindex, nofollow, noarchive, nosnippet')
# self.send_header('Cache-Control', 'public')
# self.send_header('Referrer-Policy', 'origin')
self.end_headers()
def _set_headers_base(self, fileFormat: str, length: int, cookie: str,
@ -607,17 +595,13 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Cookie', cookieStr)
self.send_header('Host', callingDomain)
self.send_header('InstanceID', self.server.instanceId)
self.send_header('X-Robots-Tag',
'noindex, nofollow, noarchive, nosnippet')
self.send_header('X-Clacks-Overhead', 'GNU Natalie Nguyen')
self.send_header('Cache-Control', 'max-age=0')
self.send_header('Cache-Control', 'public')
self.send_header('Referrer-Policy', 'origin')
self.send_header('Accept-Ranges', 'none')
def _set_headers(self, fileFormat: str, length: int, cookie: str,
callingDomain: str) -> None:
self._set_headers_base(fileFormat, length, cookie, callingDomain)
# self.send_header('Cache-Control', 'public, max-age=0')
self.end_headers()
def _set_headers_head(self, fileFormat: str, length: int, etag: str,

View File

@ -900,9 +900,11 @@ else:
# if this is the initial run then allow new registrations
if not getConfigParam(baseDir, 'registration'):
if args.registration.lower() == 'open':
setConfigParam(baseDir, 'registration', 'open')
setConfigParam(baseDir, 'maxRegistrations', str(maxRegistrations))
setConfigParam(baseDir, 'registrationsRemaining', str(maxRegistrations))
setConfigParam(baseDir, 'registrationsRemaining',
str(maxRegistrations))
if args.resetregistrations:
setConfigParam(baseDir, 'registrationsRemaining', str(maxRegistrations))

View File

@ -125,8 +125,6 @@ And paste the following:
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
expires epoch;
proxy_no_cache 1;
proxy_temp_file_write_size 64k;
proxy_connect_timeout 10080s;
proxy_send_timeout 10080;
@ -135,27 +133,10 @@ And paste the following:
proxy_buffers 16 32k;
proxy_busy_buffers_size 64k;
proxy_redirect off;
proxy_request_buffering on;
proxy_buffering on;
proxy_cache my_cache;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
location ~ ^/(icons|images|media|emoji)/(.*)/(.*).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {
expires 7d;
proxy_pass http://localhost:7156;
}
location ~ ^/icons/(.*)/(like|repeat|calendar)(.*).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {
expires epoch;
proxy_no_cache 1;
proxy_pass http://localhost:7156;
}
location ~ ^/icons/(like|repeat|calendar)(.*).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {
expires epoch;
proxy_no_cache 1;
proxy_pass http://localhost:7156;
}
location ~ ^/users/(.*)/(image|banner).png {
expires epoch;
proxy_no_cache 1;
proxy_request_buffering off;
proxy_buffering off;
location ~ ^/accounts/(avatars|headers)/(.*).(png|jpg|gif|webp|svg) {
expires 1d;
proxy_pass http://localhost:7156;
}
proxy_pass http://localhost:7156;

View File

@ -472,9 +472,7 @@ def htmlProfile(rssIconAtTop: bool,
addEmojiToDisplayName(baseDir, httpPrefix,
nickname, domain,
profileJson['name'], True)
domainFull = domain
if port:
domainFull = domain + ':' + str(port)
domainFull = getFullDomain(domain, port)
profileDescription = \
addEmojiToDisplayName(baseDir, httpPrefix,
nickname, domain,
@ -666,6 +664,11 @@ def htmlProfile(rssIconAtTop: bool,
occupationName = getOccupationName(profileJson)
avatarUrl = profileJson['icon']['url']
# use alternate path for local avatars to avoid any caching issues
if '://' + domainFull + '/accounts/avatars/' in avatarUrl:
avatarUrl = \
avatarUrl.replace('://' + domainFull + '/accounts/avatars/',
'://' + domainFull + '/users/')
# get pinned post content
accountDir = baseDir + '/accounts/' + nickname + '@' + domain

View File

@ -1434,8 +1434,6 @@
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;<br>
proxy_set_header X-Forward-Proto http;<br>
proxy_set_header X-Nginx-Proxy true;<br>
expires epoch;<br>
proxy_no_cache 1;<br>
proxy_temp_file_write_size 64k;<br>
proxy_connect_timeout 10080s;<br>
proxy_send_timeout 10080;<br>
@ -1444,27 +1442,10 @@
proxy_buffers 16 32k;<br>
proxy_busy_buffers_size 64k;<br>
proxy_redirect off;<br>
proxy_request_buffering on;<br>
proxy_buffering on;<br>
proxy_cache my_cache;<br>
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;<br>
location ~ ^/(icons|images|media|emoji)/(.*)/(.*).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {<br>
expires 7d;<br>
proxy_pass http://localhost:7156;<br>
}<br>
location ~ ^/icons/(.*)/(like|repeat|calendar)(.*).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {<br>
expires epoch;<br>
proxy_no_cache 1;<br>
proxy_pass http://localhost:7156;<br>
}<br>
location ~ ^/icons/(like|repeat|calendar)(.*).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {<br>
expires epoch;<br>
proxy_no_cache 1;<br>
proxy_pass http://localhost:7156;<br>
}<br>
location ~ ^/users/(.*)/(image|banner).(png|jpg|gif|webp|mp3|ogv|ogg|mp4) {<br>
expires epoch;<br>
proxy_no_cache 1;<br>
proxy_request_buffering off;<br>
proxy_buffering off;<br>
location ~ ^/accounts/(avatars|headers)/(.*).(png|jpg|gif|webp|svg) {<br>
expires 1d;<br>
proxy_pass http://localhost:7156;<br>
}<br>
proxy_pass http://localhost:7156;<br>