Skip to content

Commit 8696926

Browse files
spadgettjwforres
authored andcommitted
Add rewrite rule for config.js
Rewrite requests for config.js instead of copying the config.js on startup. This lets you edit config.js in the config map without redeploying.
1 parent e61e9dc commit 8696926

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.s2i/bin/run

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22

3-
if [ -f /openshift-web-console-config/config.js ]; then
4-
cp -f /openshift-web-console-config/config.js config.js
5-
else
3+
if [ ! -f /openshift-web-console-config/config.js ]; then
64
echo "No config.js is mounted, the console can not run without a configuration defined."
75
exit -1
86
fi

httpd-cfg/openshift-web-console.conf

+5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ Listen 0.0.0.0:8443
55
SSLCertificateFile "${HTTPD_CONFIGURATION_PATH}/tls/tls.crt"
66
SSLCertificateKeyFile "${HTTPD_CONFIGURATION_PATH}/tls/tls.key"
77

8+
<Directory "/openshift-web-console-config">
9+
Require all granted
10+
</Directory>
11+
812
RewriteEngine on
913
# First strip the context root
1014
RewriteRule ^${OSC_CONTEXT_ROOT}(.*) /$1
15+
RewriteRule ^/config\.js$ /openshift-web-console-config/config.js [L]
1116
RewriteRule ^/java$ ${OSC_ASSET_PUBLIC_URL}java/ [R,L]
1217
RewriteCond %{DOCUMENT_ROOT}/java/$1 !-f
1318
RewriteRule ^/java/(.*)$ /java/index.html [L,PT]

0 commit comments

Comments
 (0)