-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapache-foreground
More file actions
executable file
·41 lines (35 loc) · 912 Bytes
/
apache-foreground
File metadata and controls
executable file
·41 lines (35 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
source /etc/apache2/envvars
mkdir /var/run/apache2
# pull in vault value if we have them
if [ -f /vault/secrets/config ]; then
. /vault/secrets/config
fi
# set oidc parameters
required_vars=(OIDC_METADATA_URL OIDC_CLIENT_ID OIDC_CLIENT_SECRET OIDC_CRYPTO_PASSPHRASE)
oidc_enabled=1
for var in ${required_vars[@]}; do
echo $var
if [ -z "${!var}" ]; then
echo "missing ${var} disabling oidc"
oidc_enabled=0
else
echo "setting ${var}"
sed -i "s,${var},${!var},g" /etc/apache2/conf-available/oidc.conf
fi
done
echo $oidc_enabled
if [ $oidc_enabled == 1 ]; then
echo "enabling oidc config"
a2enconf oidc
else
a2enmod cosign
fi
a2enmod ldap
a2enmod rewrite
a2enmod authnz_ldap
a2dismod mpm_event
a2dismod mpm_worker
a2enmod mpm_prefork
a2enmod proxy proxy_balancer proxy_hcheck lbmethod_byrequests proxy_http headers proxy_connect proxy_html
apache2 -DFOREGROUND