File tree Expand file tree Collapse file tree 6 files changed +62
-4
lines changed Expand file tree Collapse file tree 6 files changed +62
-4
lines changed Original file line number Diff line number Diff line change 3636 - ' linux/arm/v6'
3737 refs :
3838 - ' master'
39- - ' 0.40 '
39+ - ' 0.41 '
4040 steps :
4141
4242 # ------------------------------------------------------------
@@ -128,7 +128,7 @@ jobs:
128128 - ' Nginx mainline'
129129 refs :
130130 - ' master'
131- - ' 0.40 '
131+ - ' 0.41 '
132132 steps :
133133
134134 # ------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ This Docker container adds a lot of injectables in order to customize it to your
142142| PHP_FPM_SERVER_ADDR | string | `` | IP address or hostname of remote PHP-FPM server.<br /><strong >Required when enabling PHP.</strong > |
143143| PHP_FPM_SERVER_PORT | int | ` 9000 ` | Port of remote PHP-FPM server |
144144| PHP_FPM_TIMEOUT | int | ` 180 ` | Timeout in seconds to upstream PHP-FPM server |
145+ | HTTP2_ENABLE | int | ` 1 ` | Enabled or disabled HTTP2 support.<br />Values:<br />` 0 ` : Disabled<br />` 1 ` : Enabled<br />Defaults to Enabled |
145146
146147##### Optional environmental variables (default vhost)
147148
Original file line number Diff line number Diff line change @@ -9,6 +9,35 @@ set -o pipefail
99# Functions
1010# ###########################################################
1111
12+
13+ # ##
14+ # ## Ensure HTTP2_ENABLE is exported
15+ # ##
16+ export_http2_enable () {
17+ local varname=" ${1} "
18+ local debug=" ${2} "
19+ local value=" 1"
20+
21+ if ! env_set " ${varname} " ; then
22+ log " info" " \$ ${varname} not set. Enabling http2." " ${debug} "
23+ else
24+ value=" $( env_get " ${varname} " ) "
25+ if [ " ${value} " = " 0" ]; then
26+ log " info" " http2: Disabled" " ${debug} "
27+ elif [ " ${value} " = " 1" ]; then
28+ log " info" " http2: Enabled" " ${debug} "
29+ else
30+ log " err" " Invalid value for \$ ${varname} : ${value} "
31+ log " err" " Must be '1' (for On) or '0' (for Off)"
32+ exit 1
33+ fi
34+ fi
35+
36+ # Ensure variable is exported
37+ eval " export ${varname} =${value} "
38+ }
39+
40+
1241# ##
1342# ## Copy custom vhost-gen template
1443# ##
@@ -147,3 +176,19 @@ vhost_gen_mass_vhost_tld() {
147176 run " sed -i'' 's/__TLD__/${tld} /g' ${config} " " ${debug} "
148177 fi
149178}
179+
180+
181+ # ##
182+ # ## Set HTTP2_ENABLE
183+ # ##
184+ vhost_gen_http2 () {
185+ local enable=" ${1} "
186+ local config=" ${2} "
187+ local debug=" ${3} "
188+
189+ if [ " ${enable} " -eq " 1" ]; then
190+ run " sed -i'' 's/__HTTP2_ENABLE__/True/g' ${config} " " ${debug} "
191+ else
192+ run " sed -i'' 's/__HTTP2_ENABLE__/False/g' ${config} " " ${debug} "
193+ fi
194+ }
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ export_php_fpm_server_addr "PHP_FPM_SERVER_ADDR" "${DEBUG_LEVEL}"
9292export_php_fpm_server_port " PHP_FPM_SERVER_PORT" " ${DEBUG_LEVEL} "
9393export_php_fpm_timeout " PHP_FPM_TIMEOUT" " ${DEBUG_LEVEL} "
9494
95+ # ##
96+ # ## Ensure global main/mass variables are eported
97+ # ##
98+ export_http2_enable " HTTP2_ENABLE" " ${DEBUG_LEVEL} "
99+
95100
96101# ##
97102# ## Ensure MAIN_VHOST variables are exported
@@ -151,6 +156,13 @@ vhost_gen_docker_logs "${DOCKER_LOGS}" "/etc/vhost-gen/main.yml" "${DEBUG_LEVEL}
151156vhost_gen_docker_logs " ${DOCKER_LOGS} " " /etc/vhost-gen/mass.yml" " ${DEBUG_LEVEL} "
152157
153158
159+ # ##
160+ # ## Set HTTP2 support
161+ # ##
162+ vhost_gen_http2 " ${HTTP2_ENABLE} " " /etc/vhost-gen/main.yml" " ${DEBUG_LEVEL} "
163+ vhost_gen_http2 " ${HTTP2_ENABLE} " " /etc/vhost-gen/mass.yml" " ${DEBUG_LEVEL} "
164+
165+
154166# ##
155167# ## Main vhost settings
156168# ##
Original file line number Diff line number Diff line change 9494 - index.htm
9595 # SSL Definition
9696 ssl :
97- http2 : True
97+ http2 : __HTTP2_ENABLE__
9898 dir_crt : /etc/httpd/cert/main
9999 dir_key : /etc/httpd/cert/main
100100 protocols : ' TLSv1 TLSv1.1 TLSv1.2'
Original file line number Diff line number Diff line change 9494 - index.htm
9595 # SSL Definition
9696 ssl :
97- http2 : True
97+ http2 : __HTTP2_ENABLE__
9898 dir_crt : /etc/httpd/cert/mass
9999 dir_key : /etc/httpd/cert/mass
100100 protocols : ' TLSv1 TLSv1.1 TLSv1.2'
You can’t perform that action at this time.
0 commit comments