summaryrefslogtreecommitdiff
path: root/src/wsgi.py
diff options
context:
space:
mode:
authorKristofer Hallin <kristofer@sunet.se>2021-11-12 11:53:15 +0100
committerKristofer Hallin <kristofer@sunet.se>2021-11-12 11:53:15 +0100
commitec2a7aa991f74340022e0e5e33ba32b651e2c747 (patch)
treeeaef55f699be86b180c19af0899a6c63781b0d13 /src/wsgi.py
parent5bde93857966e9007d09b96bbfdadbb6135cd113 (diff)
* Don't switch to main brach, we're already there.
* Look for public key in /opt/cert. * Add variable to compose.
Diffstat (limited to 'src/wsgi.py')
-rwxr-xr-xsrc/wsgi.py8
1 files changed, 4 insertions, 4 deletions
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)