mirror of
https://github.com/bitnami/containers.git
synced 2026-03-05 07:29:11 +08:00
Fix: wwwroot is not configurable (#195)
This commit is contained in:
@@ -335,13 +335,17 @@ moodle_configure_wwwroot() {
|
||||
# sed replacement notes:
|
||||
# - The ampersand ('&') is escaped due to sed replacing any non-escaped ampersand characters with the matched string
|
||||
# - For the replacement text to be multi-line, an \ needs to be specified to escape the newline character
|
||||
local -r MOODLE_HOST="${MOODLE_HOST:+"'${MOODLE_HOST}'"}"
|
||||
local -r host="${MOODLE_HOST:-"\$_SERVER['HTTP_HOST']"}"
|
||||
|
||||
local -r conf_to_replace="if (empty(\$_SERVER['HTTP_HOST'])) {\\
|
||||
\$_SERVER['HTTP_HOST'] = '127.0.0.1:${http_port}';\\
|
||||
\$_SERVER['HTTP_HOST'] = '127.0.0.1:${http_port}';\\
|
||||
}\\
|
||||
if (isset(\$_SERVER['HTTPS']) \&\& \$_SERVER['HTTPS'] == 'on') {\\
|
||||
\$CFG->wwwroot = 'https://' . \$_SERVER['HTTP_HOST'];\\
|
||||
\$CFG->wwwroot = 'https://' . ${host};\\
|
||||
} else {\\
|
||||
\$CFG->wwwroot = 'http://' . \$_SERVER['HTTP_HOST'];\\
|
||||
\$CFG->wwwroot = 'http://' . ${host};\\
|
||||
}"
|
||||
|
||||
replace_in_file "$MOODLE_CONF_FILE" "\\\$CFG->wwwroot\s*=.*" "$conf_to_replace"
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ export MOODLE_SKIP_BOOTSTRAP="${MOODLE_SKIP_BOOTSTRAP:-}" # only used during the
|
||||
export MOODLE_INSTALL_EXTRA_ARGS="${MOODLE_INSTALL_EXTRA_ARGS:-}" # only used during the first initialization
|
||||
export MOODLE_SITE_NAME="${MOODLE_SITE_NAME:-New Site}" # only used during the first initialization
|
||||
export MOODLE_CRON_MINUTES="${MOODLE_CRON_MINUTES:-1}"
|
||||
export MOODLE_HOST="${MOODLE_HOST:-}" # only used during the first initialization
|
||||
|
||||
# Moodle credentials
|
||||
export MOODLE_USERNAME="${MOODLE_USERNAME:-user}" # only used during the first initialization
|
||||
|
||||
Reference in New Issue
Block a user