Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.41 #36

Merged
merged 2 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
- 'Apache 2.4'
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 @@ -135,6 +135,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 |
| COMPAT | str | - | Set this value to `5.2` to enable PHP-FPM 5.2 compatbility mode. (Only when using PHP-FPM 5.2) |

##### 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 @@ -145,3 +174,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 @@ -87,6 +87,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 @@ -158,6 +163,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