Skip to content

Commit

Permalink
pywb-proxy: fixes for no mementos, add new sha256 pywb-ca.pem
Browse files Browse the repository at this point in the history
rename runlocal.sh -> run-local.sh
  • Loading branch information
ikreymer committed Nov 10, 2015
1 parent 875dee7 commit 9d2506b
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 51 deletions.
1 change: 1 addition & 0 deletions pywb/archivereplayview.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def load_archive_info_json(self, url):
except Exception as e:
logging.debug(e)
logging.debug('Proceeding without json archive info')
return

archives = json.loads(stream.read())
for arc in archives:
Expand Down
89 changes: 45 additions & 44 deletions pywb/ca/pywb-ca.pem
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEAvHW2mCI9BMi983hV4gZSzUEuMS60qkogJ4LuPEZCAejDyoOT
FfGFtNEWb5+ckUNv2U+NBWcEpfnCY9Wyv45c++ApyttcT5i0svZ7AoYf+ixxTzFe
1mzvRNOQKjRJwa4um72LSkhUnK9wbBXDf2GZaP++2nlyVfKRu7QfHN/D1hl5NMtA
48h/O4YIjUZ7dF4YO0BclXmz/l/3L5CRDqS4VZX/DcpUIApn6MrQzdMm/9NnR93C
Wf7bM4Ioe3j4bS8ig4FaUTmPURWQcd92sLRaUprnInfU6ZW41mcinWPoXzBBU2FB
gML43msWvaaFfunntByfRzCM7nxQ9uMOvz5nIQIDAQABAoIBAQCvWNLwkAK4HdLm
4pL9/yYxhbDl3/AG9XsfaCojeLdXsWviVDOZWiQujdBTQW3alqVNyz+JxEVF7LGa
VC3BH0OSswoPjbRA9vNCBCWFvqeoDIvMxEHaPncNUc80BXyOsXL6QwyDq/LV6kIu
vr0sGvIzCKlZ+1+Pamd//uJn6ib7XxTnle1S7mVqWlikEHDNYFXi8dNa+5bGYxBC
AITGKu2UvITROgmgOsfyXJ5ECaT57BaW0uS5xPIt7hzazTwZNa7uw8316mPbdYB7
Qjps2GAwtguR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bqWBIEjlnFzczdWXyQxz83gDBaOuuS8d3sl
0xzAg6MCAwEAAaNFMEMwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMC
AQYwHQYDVR0OBBYEFAYZ6wWLjKoUBFzcY1T3Bkes8EnjMA0GCSqGSIb3DQEBCwUA
A4IBAQCRcUxB/L1RYHjIi2eUUWCbcl7Qf1M6paIZKOv87ddwnk9zh0DcrutNuIoY
ii4+VheKc//f6+UkCimrXvE9bf/5C6Pjsi9lbSycIsaORVt+zg7aTEexdQuP0Ha9
8Crp/oiYwTqEGAHJH7H40b3M3eCpQRqGAjUZb7M1oLXO28PbmLdgtqU9zYlxjhxt
PCFdtYFq0cX3aaMpiceUXRioWqrKOtYibXGOWuVimuAXPpOyGCpiLyLghz/XznVH
CQHxkkJlkkMpOErL4dlcld5cuPmCRZd0vzuZV4/Tfr9v5KjYvPL+yWsoiIstVpuI
gjkCSP7We6LJP9yimoj2k8lROJks
-----END CERTIFICATE-----
12 changes: 8 additions & 4 deletions pywb/mementoquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ def __init__(self, paths):
def timegate_query(self, timestamp, url):
url = urllib.quote(url, ':/')
full = self.api_endpoint + timestamp + '/' + url
r = None
try:
r = self.session.get(full)
result = r.json()
except Exception as e:
if r.status_code != 404:
if not r or r.status_code != 404:
import traceback
traceback.print_exc(e)

Expand All @@ -57,18 +58,21 @@ def timegate_query(self, timestamp, url):
def timemap_query(self, url, closest='1'):
url = urllib.quote(url, ':/')
full = self.timemap_endpoint + closest + '/' + url
r = None
try:
r = self.session.get(full)
result = r.json()
except Exception as e:
logging.debug(e)
if r.status_code == 503:
if r and r.status_code == 503:
msg = 'No Mementos Currently Available: <br/>'
msg += r.text
elif r.status_code == 404:
elif r and r.status_code == 404:
return {"list": []}
else:
elif r:
msg = 'Unknown response with: ' + str(r.status_code)
else:
msg = 'No response'

raise NotFoundException(msg, url=url)

Expand Down
4 changes: 4 additions & 0 deletions run-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#export ARCHIVE_JSON=http://webenact.rhizome.org/collinfo.json
export ARCHIVE_JSON=/archives.json
docker-compose --x-networking build
docker-compose --x-networking up -d
3 changes: 0 additions & 3 deletions runlocal.sh

This file was deleted.

0 comments on commit 9d2506b

Please sign in to comment.