Skip to content

Commit 100ef36

Browse files
authored
Addition/jupyterhub ssl proxy config (#107)
* Add the ability to specify the optional JUPYTER_SERVICES_PROXY_CONFIG argument to the image build that can be used to customise the generated apache reverse proxy configuration when an optional backend jupyter service is associated with the MiGrid service * Add support for the JUPYTER_SERVICES_ENABLE_PROXY_HTTPS option
1 parent 9c03019 commit 100ef36

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

.spellcheck-wordlist.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,6 @@ OPENSTACKSDK
364364
openstacksdk
365365
HTML
366366
html
367+
balancer
368+
JupyterHub
369+
SSLProxyCACertificateFile

Dockerfile.centos7

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ ARG QUOTA_GOCRYPTFS_SOCK="/dev/null"
225225

226226
# Jupyter Arguments
227227
ARG JUPYTER_SERVICES=""
228+
ARG JUPYTER_SERVICES_ENABLE_PROXY_HTTPS=True
229+
ARG JUPYTER_SERVICES_PROXY_CONFIG="{}"
228230
ARG JUPYTER_SERVICES_DESC="{}"
229231
# Cloud Arguments
230232
ARG CLOUD_SERVICES=""
@@ -1151,6 +1153,8 @@ ARG IO_ACCOUNT_EXPIRE
11511153
ARG DATASAFETY_LINK
11521154
ARG DATASAFETY_TEXT
11531155
ARG JUPYTER_SERVICES
1156+
ARG JUPYTER_SERVICES_ENABLE_PROXY_HTTPS
1157+
ARG JUPYTER_SERVICES_PROXY_CONFIG
11541158
ARG JUPYTER_SERVICES_DESC
11551159
ARG CLOUD_SERVICES
11561160
ARG CLOUD_SERVICES_DESC
@@ -1196,6 +1200,8 @@ RUN if [ "${PREFER_PYTHON3}" = "True" ]; then \
11961200
WORKDIR $MIG_ROOT/mig/install
11971201

11981202
RUN echo "Designated jupyter services: ${JUPYTER_SERVICES}"
1203+
RUN echo "Designated jupyter services proxy enable https: ${JUPYTER_SERVICES_ENABLE_PROXY_HTTPS}"
1204+
RUN echo "Designated jupyter services proxy config: ${JUPYTER_SERVICES_PROXY_CONFIG}"
11991205
RUN echo "Designated jupyter services descriptions: ${JUPYTER_SERVICES_DESC}"
12001206
RUN echo "Designated cloud services: ${CLOUD_SERVICES}"
12011207
RUN echo "Designated cloud services descriptions: ${CLOUD_SERVICES_DESC}"
@@ -1321,6 +1327,8 @@ RUN python2 ./generateconfs.py --source=. \
13211327
--wwwserve_max_bytes=${WWWSERVE_MAX_BYTES} \
13221328
--password_policy=${MIG_PASSWORD_POLICY} \
13231329
--jupyter_services="${JUPYTER_SERVICES}" \
1330+
--jupyter_services_enable_proxy_https="${JUPYTER_SERVICES_ENABLE_PROXY_HTTPS}" \
1331+
--jupyter_services_proxy_config="${JUPYTER_SERVICES_PROXY_CONFIG}" \
13241332
--jupyter_services_desc="${JUPYTER_SERVICES_DESC}" \
13251333
--cloud_services="${CLOUD_SERVICES}" \
13261334
--cloud_services_desc="${CLOUD_SERVICES_DESC}" \

Dockerfile.rocky8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ ARG QUOTA_GOCRYPTFS_SOCK="/dev/null"
230230

231231
# Jupyter Arguments
232232
ARG JUPYTER_SERVICES=""
233+
ARG JUPYTER_SERVICES_ENABLE_PROXY_HTTPS=True
234+
ARG JUPYTER_SERVICES_PROXY_CONFIG="{}"
233235
ARG JUPYTER_SERVICES_DESC="{}"
234236
# Cloud Arguments
235237
ARG CLOUD_SERVICES=""
@@ -1169,6 +1171,8 @@ ARG IO_ACCOUNT_EXPIRE
11691171
ARG DATASAFETY_LINK
11701172
ARG DATASAFETY_TEXT
11711173
ARG JUPYTER_SERVICES
1174+
ARG JUPYTER_SERVICES_ENABLE_PROXY_HTTPS
1175+
ARG JUPYTER_SERVICES_PROXY_CONFIG
11721176
ARG JUPYTER_SERVICES_DESC
11731177
ARG CLOUD_SERVICES
11741178
ARG CLOUD_SERVICES_DESC
@@ -1214,6 +1218,8 @@ RUN if [ "${PREFER_PYTHON3}" = "True" ]; then \
12141218
WORKDIR $MIG_ROOT/mig/install
12151219

12161220
RUN echo "Designated jupyter services: ${JUPYTER_SERVICES}"
1221+
RUN echo "Designated jupyter services proxy enable https: ${JUPYTER_SERVICES_ENABLE_PROXY_HTTPS}"
1222+
RUN echo "Designated jupyter services proxy config: ${JUPYTER_SERVICES_PROXY_CONFIG}"
12171223
RUN echo "Designated jupyter services descriptions: ${JUPYTER_SERVICES_DESC}"
12181224
RUN echo "Designated cloud services: ${CLOUD_SERVICES}"
12191225
RUN echo "Designated cloud services descriptions: ${CLOUD_SERVICES_DESC}"
@@ -1339,6 +1345,8 @@ RUN ./generateconfs.py --source=. \
13391345
--wwwserve_max_bytes=${WWWSERVE_MAX_BYTES} \
13401346
--password_policy=${MIG_PASSWORD_POLICY} \
13411347
--jupyter_services="${JUPYTER_SERVICES}" \
1348+
--jupyter_services_enable_proxy_https="${JUPYTER_SERVICES_ENABLE_PROXY_HTTPS}" \
1349+
--jupyter_services_proxy_config="${JUPYTER_SERVICES_PROXY_CONFIG}" \
13421350
--jupyter_services_desc="${JUPYTER_SERVICES_DESC}" \
13431351
--cloud_services="${CLOUD_SERVICES}" \
13441352
--cloud_services_desc="${CLOUD_SERVICES_DESC}" \

Dockerfile.rocky9

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ ARG QUOTA_GOCRYPTFS_SOCK="/dev/null"
230230

231231
# Jupyter Arguments
232232
ARG JUPYTER_SERVICES=""
233+
ARG JUPYTER_SERVICES_ENABLE_PROXY_HTTPS=True
234+
ARG JUPYTER_SERVICES_PROXY_CONFIG="{}"
233235
ARG JUPYTER_SERVICES_DESC="{}"
234236
# Cloud Arguments
235237
ARG CLOUD_SERVICES=""
@@ -1061,6 +1063,8 @@ ARG IO_ACCOUNT_EXPIRE
10611063
ARG DATASAFETY_LINK
10621064
ARG DATASAFETY_TEXT
10631065
ARG JUPYTER_SERVICES
1066+
ARG JUPYTER_SERVICES_ENABLE_PROXY_HTTPS
1067+
ARG JUPYTER_SERVICES_PROXY_CONFIG
10641068
ARG JUPYTER_SERVICES_DESC
10651069
ARG CLOUD_SERVICES
10661070
ARG CLOUD_SERVICES_DESC
@@ -1095,6 +1099,8 @@ RUN echo "PATH=$HOME/.local/bin:${PATH}" >> ~/.bash_profile \
10951099
WORKDIR $MIG_ROOT/mig/install
10961100

10971101
RUN echo "Designated jupyter services: ${JUPYTER_SERVICES}"
1102+
RUN echo "Designated jupyter services proxy enable https: ${JUPYTER_SERVICES_ENABLE_PROXY_HTTPS}"
1103+
RUN echo "Designated jupyter services proxy config: ${JUPYTER_SERVICES_PROXY_CONFIG}"
10981104
RUN echo "Designated jupyter services descriptions: ${JUPYTER_SERVICES_DESC}"
10991105
RUN echo "Designated cloud services: ${CLOUD_SERVICES}"
11001106
RUN echo "Designated cloud services descriptions: ${CLOUD_SERVICES_DESC}"
@@ -1215,6 +1221,8 @@ RUN ./generateconfs.py --source=. \
12151221
--wwwserve_max_bytes=${WWWSERVE_MAX_BYTES} \
12161222
--password_policy=${MIG_PASSWORD_POLICY} \
12171223
--jupyter_services="${JUPYTER_SERVICES}" \
1224+
--jupyter_services_enable_proxy_https="${JUPYTER_SERVICES_ENABLE_PROXY_HTTPS}" \
1225+
--jupyter_services_proxy_config="${JUPYTER_SERVICES_PROXY_CONFIG}" \
12181226
--jupyter_services_desc="${JUPYTER_SERVICES_DESC}" \
12191227
--cloud_services="${CLOUD_SERVICES}" \
12201228
--cloud_services_desc="${CLOUD_SERVICES_DESC}" \

doc/source/sections/configuration/variables.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,13 @@ Variables
613613
- The number of worker processes started in the Apache service to handle all incoming web requests.Increase to allow handling more concurrent clients if needed but at the cost of higher system resource requirements.
614614
* - JUPYTER_SERVICES
615615
- ""
616-
- Where the optional external Jupyter nodes can be reached
616+
- Where the optional external Jupyter nodes can be reached. Expects the format "SERVICE_NAME.http(s)://URL-or-IP-to-the-jupyter(hub)-node SERVICE_NAME.http(s)://URL-or-IP-to-any-additional-jupyter(hub)-node"
617+
* - JUPYTER_SERVICES_ENABLE_PROXY_HTTPS
618+
- True
619+
- Whether or not the internal Apache reverse proxy configuration should use HTTPS or not when connecting to the designated JupyterHub service.
620+
* - JUPYTER_SERVICES_PROXY_CONFIG
621+
- "{}"
622+
- Can be set to add any additional Apache proxy balancer configuration options that should be used when establishing the HTTP(S) connection to the designated JupyterHub service. It is expected to be structured as a string formatted dictionary that accepts any key attribute that is supported as an Apache mod_proxy_balancer proxy section option as can be seen at https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html. Therefore a potential config value could be "{'SSLProxyCACertificateFile': 'path/to/local/ca-certificate.pem'}"
617623
* - JUPYTER_SERVICES_DESC
618624
- "{}"
619625
- A text to describe the optional external Jupyter nodes

0 commit comments

Comments
 (0)