diff options
author | Evangelos Foutras <evangelos@foutrelis.com> | 2015-12-31 03:25:41 +0200 |
---|---|---|
committer | Evangelos Foutras <evangelos@foutrelis.com> | 2015-12-31 03:26:35 +0200 |
commit | e4381ff3b71062d49fbb8c267c6b1b4f9ce517fd (patch) | |
tree | 7767379143766066259930b244ab9548e9fc80ed | |
parent | 38684410ee23535741c61c32a7d89ef4950bc1fd (diff) |
Allow linking to the PGP server over HTTPS
Signed-off-by: Evangelos Foutras <evangelos@foutrelis.com>
-rw-r--r-- | main/templatetags/pgp.py | 6 | ||||
-rw-r--r-- | settings.py | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index 455e8f9c..16b63232 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -36,8 +36,10 @@ def pgp_key_link(key_id, link_text=None): pgp_server = getattr(settings, 'PGP_SERVER', None) if not pgp_server: return format_key(key_id) - url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ - (pgp_server, key_id) + pgp_server_secure = getattr(settings, 'PGP_SERVER_SECURE', False) + scheme = 'https' if pgp_server_secure else 'http' + url = '%s://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ + (scheme, pgp_server, key_id) if link_text is None: link_text = '0x%s' % key_id[-8:] values = (url, format_key(key_id), link_text) diff --git a/settings.py b/settings.py index 6ffed75b..79271772 100644 --- a/settings.py +++ b/settings.py @@ -157,6 +157,7 @@ LOGGING = { ## Server used for linking to PGP keysearch results PGP_SERVER = 'pgp.mit.edu' +PGP_SERVER_SECURE = True # URL to fetch a current list of available ISOs ISO_LIST_URL = 'https://releng.archlinux.org/isos/' |