From ec2a7aa991f74340022e0e5e33ba32b651e2c747 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Fri, 12 Nov 2021 11:53:15 +0100 Subject: * Don't switch to main brach, we're already there. * Look for public key in /opt/cert. * Add variable to compose. --- src/wsgi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/wsgi.py') diff --git a/src/wsgi.py b/src/wsgi.py index e090876..1b257cd 100755 --- a/src/wsgi.py +++ b/src/wsgi.py @@ -29,13 +29,13 @@ else: def get_pubkey(): try: - keypath = os.environ['JWT_PUBKEY_PATH'] + if 'keypath' in os.environ: + keypath = os.environ['JWT_PUBKEY_PATH'] + else: + keypath = '/opt/cert/public.pem' with open(keypath, "r") as fd: pubkey = fd.read() - except KeyError: - print("Could not find environment variable JWT_PUBKEY_PATH") - sys.exit(-1) except FileNotFoundError: print(f"Could not find JWT certificate in {keypath}") sys.exit(-1) -- cgit v1.1