Skip to content

Commit b252172

Browse files
Add means to enable HTTPS for re-encrypt if supplied certificates.
1 parent deacbbf commit b252172

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

app.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22

3+
set -x
4+
35
PORT=${PORT:-8080}
6+
SSL_PORT=${SSL_PORT:-8443}
47

58
ARGS=""
69

@@ -9,6 +12,17 @@ ARGS="$ARGS --port $PORT"
912
ARGS="$ARGS --document-root htdocs"
1013
ARGS="$ARGS --url-alias /media media"
1114

15+
if [ -f /opt/app-root/cert/tls.key ]; then
16+
ARGS="$ARGS --ssl-port $SSL_PORT"
17+
ARGS="$ARGS --ssl-certificate /opt/app-root/cert/tls"
18+
19+
NAMESPACE=`cat /var/run/secrets/kubernetes.io/serviceaccount/namespace`
20+
SERVICE=`echo $HOSTNAME | sed -e 's/^\(.*\)-[0-9]*-[a-z0-9]*$/\1/'`
21+
22+
ARGS="$ARGS --server-name $SERVICE.$NAMESPACE.svc"
23+
ARGS="$ARGS --server-alias '*'"
24+
fi
25+
1226
if [ x"$MOD_WSGI_PROCESSES" != x"" ]; then
1327
ARGS="$ARGS --processes $MOD_WSGI_PROCESSES"
1428
fi

0 commit comments

Comments
 (0)