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

[bitnami/mediawiki] Add env var to control skipping config validation during startup #65729

Merged
merged 3 commits into from
May 7, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ mediawiki_initialize() {
else
info "An already initialized MediaWiki database was provided, configuration will be skipped"
# Perform MediaWiki database schema upgrade
debug_execute php "${MEDIAWIKI_BASE_DIR}/maintenance/update.php"
local -a update_args=()
if is_boolean_yes "$MEDIAWIKI_SKIP_CONFIG_VALIDATION"; then
update_args+=( "--skip-config-validation" )
fi
debug_execute php "${MEDIAWIKI_BASE_DIR}/maintenance/update.php" "${update_args[@]}"
fi

# Configure MediaWiki based on environment variables
Expand All @@ -151,7 +155,12 @@ mediawiki_initialize() {
db_port="$MEDIAWIKI_DATABASE_PORT_NUMBER"
mediawiki_wait_for_db_connection "$db_host" "$db_port" "$db_name" "$db_user" "$db_pass"
# Perform MediaWiki database schema upgrade
debug_execute php "${MEDIAWIKI_BASE_DIR}/maintenance/update.php"
info "Performing database schema upgrade if needed"
local -a update_args=()
if is_boolean_yes "$MEDIAWIKI_SKIP_CONFIG_VALIDATION"; then
update_args+=( "--skip-config-validation" )
fi
debug_execute php "${MEDIAWIKI_BASE_DIR}/maintenance/update.php" "${update_args[@]}"
fi

# Avoid exit code of previous commands to affect the result of this function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ mediawiki_env_vars=(
MEDIAWIKI_DATABASE_NAME
MEDIAWIKI_DATABASE_USER
MEDIAWIKI_DATABASE_PASSWORD
MEDIAWIKI_SKIP_CONFIG_VALIDATION
SMTP_HOST
SMTP_HOST_ID
SMTP_PORT
Expand Down Expand Up @@ -76,6 +77,7 @@ export MEDIAWIKI_CONF_FILE="${MEDIAWIKI_BASE_DIR}/LocalSettings.php"
# MediaWiki persistence configuration
export MEDIAWIKI_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/mediawiki"
export MEDIAWIKI_DATA_TO_PERSIST="${MEDIAWIKI_DATA_TO_PERSIST:-images extensions skins LocalSettings.php}"
export MEDIAWIKI_SKIP_CONFIG_VALIDATION="${MEDIAWIKI_SKIP_CONFIG_VALIDATION:-no}"

# MediaWiki site configuration
export MEDIAWIKI_SKIP_BOOTSTRAP="${MEDIAWIKI_SKIP_BOOTSTRAP:-}" # only used during the first initialization
Expand Down
1 change: 1 addition & 0 deletions bitnami/mediawiki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ docker run -d --name mediawiki \
| `MEDIAWIKI_DATABASE_NAME` | Database name. | `bitnami_mediawiki` |
| `MEDIAWIKI_DATABASE_USER` | Database user name. | `bn_mediawiki` |
| `MEDIAWIKI_DATABASE_PASSWORD` | Database user password. | `nil` |
| `MEDIAWIKI_SKIP_CONFIG_VALIDATION` | Skip config validation during startup. Allows the use of deprecated values in MediaWiki configuration file. Valid values: `yes`, `no`. | `no` |

#### Read-only environment variables

Expand Down
Loading