Merge branch 'master' into gutenberg2

gut2-dev
eric 2019-05-10 18:23:11 -04:00
commit 9e387cf955
3 changed files with 25 additions and 8 deletions

View File

@ -420,19 +420,21 @@ class OpenSearch (object):
host = cherrypy.request.headers.get ('X-Forwarded-Host', cherrypy.config['host'])
self.host = host.split (',')[-1].strip () # keep only the last hub
# turns out X-Forwarded-Protocol (X-Forwarded-Proto is the defacto standaard)
# is not a thing and has to be set in HAProxy
self.protocol = cherrypy.request.headers.get ('X-Forwarded-Protocol', 'https')
# sanity check
if self.host not in (cherrypy.config['all_hosts']):
self.host = cherrypy.config['host']
if self.protocol not in VALID_PROTOCOLS:
self.protocol = 'http'
self.protocol = 'https'
self.urlgen = routes.URLGenerator (
cherrypy.routes_mapper,
{
'HTTP_HOST': self.host,
'HTTPS': 1 if self.protocol == 'https' else 0,
'HTTPS': 1 ,
}
)
@ -898,7 +900,7 @@ class OpenSearch (object):
def format_canonical_bibrec_url (self, row):
""" Generate the rel=canonical bibrec url for a book. """
return self.url ('bibrec', host = self.file_host, protocol = 'http', id = row.pk, format = None)
return self.url ('bibrec', host = self.file_host, protocol = 'https', id = row.pk, format = None)
def format_thumb_url (self, row):
""" Generate the thumb url in results. """

View File

@ -70,3 +70,18 @@ sudo chown -R autocat:pgweb /var/run/autocat
sudo systemctl enable /var/lib/autocat/autocat3/autocat3.service
sudo systemctl start autocat3
## updates
su - autocat
# or sudo su - autocat if you can sudo
cd autocat3
git pull
git checkout remotes/origin/master
# for gutenberg2
# git checkout remotes/origin/gutenberg2
pipenv install --ignore-pipfile
sudo systemctl restart autocat3

View File

@ -80,24 +80,24 @@
<div class="h1"
title="Credits">Credits</div>
<a href="http://www.ibiblio.org" rel="nofollow"
<a href="https://www.ibiblio.org" rel="nofollow"
title="Project Gutenberg is hosted by ibiblio.">
<span class ="icon icon_hosted" />
</a>
<p>This web site uses only free software.</p>
<a href="http://httpd.apache.org/" rel="nofollow"
<a href="https://httpd.apache.org/" rel="nofollow"
title="Powered by Apache">
<span class="icon icon_apache" />
</a>
<a href="http://www.python.org" rel="nofollow"
<a href="https://www.python.org" rel="nofollow"
title="Powered by Python">
<span class="icon icon_python" />
</a>
<a href="http://www.postgresql.org" rel="nofollow"
<a href="https://www.postgresql.org" rel="nofollow"
title="Powered by PostgreSQL">
<span class="icon icon_postgres" />
</a>
@ -114,7 +114,7 @@
<div id="fb-root" />
<div id="print-head" class="noscreen">
<div class="center">http:${os.desktop_url}<br/><br/>${os.tagline}</div>
<div class="center">https:${os.desktop_url}<br/><br/>${os.tagline}</div>
</div>
<div id="screen-head" class="noprint">