Skip to content

Commit

Permalink
Merge pull request #37 from devilbox/release-0.41
Browse files Browse the repository at this point in the history
Release 0.41
  • Loading branch information
cytopia authored Feb 15, 2022
2 parents dfd2c8b + 9b67bd7 commit 3c7fc11
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- 'linux/arm/v6'
refs:
- 'master'
- '0.40'
- '0.41'
steps:

# ------------------------------------------------------------
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- 'Nginx stable'
refs:
- 'master'
- '0.40'
- '0.41'
steps:

# ------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ This Docker container adds a lot of injectables in order to customize it to your
| PHP_FPM_SERVER_ADDR | string | `` | IP address or hostname of remote PHP-FPM server.<br/><strong>Required when enabling PHP.</strong> |
| PHP_FPM_SERVER_PORT | int | `9000` | Port of remote PHP-FPM server |
| PHP_FPM_TIMEOUT | int | `180` | Timeout in seconds to upstream PHP-FPM server |
| HTTP2_ENABLE | int | `1` | Enabled or disabled HTTP2 support.<br/>Values:<br/>`0`: Disabled<br/>`1`: Enabled<br/>Defaults to Enabled |

##### Optional environmental variables (default vhost)

Expand Down
45 changes: 45 additions & 0 deletions data/docker-entrypoint.d/07-vhost-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,35 @@ set -o pipefail
# Functions
############################################################


###
### Ensure HTTP2_ENABLE is exported
###
export_http2_enable() {
local varname="${1}"
local debug="${2}"
local value="1"

if ! env_set "${varname}"; then
log "info" "\$${varname} not set. Enabling http2." "${debug}"
else
value="$( env_get "${varname}" )"
if [ "${value}" = "0" ]; then
log "info" "http2: Disabled" "${debug}"
elif [ "${value}" = "1" ]; then
log "info" "http2: Enabled" "${debug}"
else
log "err" "Invalid value for \$${varname}: ${value}"
log "err" "Must be '1' (for On) or '0' (for Off)"
exit 1
fi
fi

# Ensure variable is exported
eval "export ${varname}=${value}"
}


###
### Copy custom vhost-gen template
###
Expand Down Expand Up @@ -147,3 +176,19 @@ vhost_gen_mass_vhost_tld() {
run "sed -i'' 's/__TLD__/${tld}/g' ${config}" "${debug}"
fi
}


###
### Set HTTP2_ENABLE
###
vhost_gen_http2() {
local enable="${1}"
local config="${2}"
local debug="${3}"

if [ "${enable}" -eq "1" ]; then
run "sed -i'' 's/__HTTP2_ENABLE__/True/g' ${config}" "${debug}"
else
run "sed -i'' 's/__HTTP2_ENABLE__/False/g' ${config}" "${debug}"
fi
}
12 changes: 12 additions & 0 deletions data/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ export_php_fpm_server_addr "PHP_FPM_SERVER_ADDR" "${DEBUG_LEVEL}"
export_php_fpm_server_port "PHP_FPM_SERVER_PORT" "${DEBUG_LEVEL}"
export_php_fpm_timeout "PHP_FPM_TIMEOUT" "${DEBUG_LEVEL}"

###
### Ensure global main/mass variables are eported
###
export_http2_enable "HTTP2_ENABLE" "${DEBUG_LEVEL}"


###
### Ensure MAIN_VHOST variables are exported
Expand Down Expand Up @@ -151,6 +156,13 @@ vhost_gen_docker_logs "${DOCKER_LOGS}" "/etc/vhost-gen/main.yml" "${DEBUG_LEVEL}
vhost_gen_docker_logs "${DOCKER_LOGS}" "/etc/vhost-gen/mass.yml" "${DEBUG_LEVEL}"


###
### Set HTTP2 support
###
vhost_gen_http2 "${HTTP2_ENABLE}" "/etc/vhost-gen/main.yml" "${DEBUG_LEVEL}"
vhost_gen_http2 "${HTTP2_ENABLE}" "/etc/vhost-gen/mass.yml" "${DEBUG_LEVEL}"


###
### Main vhost settings
###
Expand Down
2 changes: 1 addition & 1 deletion data/vhost-gen/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ vhost:
- index.htm
# SSL Definition
ssl:
http2: True
http2: __HTTP2_ENABLE__
dir_crt: /etc/httpd/cert/main
dir_key: /etc/httpd/cert/main
protocols: 'TLSv1 TLSv1.1 TLSv1.2'
Expand Down
2 changes: 1 addition & 1 deletion data/vhost-gen/mass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ vhost:
- index.htm
# SSL Definition
ssl:
http2: True
http2: __HTTP2_ENABLE__
dir_crt: /etc/httpd/cert/mass
dir_key: /etc/httpd/cert/mass
protocols: 'TLSv1 TLSv1.1 TLSv1.2'
Expand Down

0 comments on commit 3c7fc11

Please sign in to comment.