Skip to content

Commit

Permalink
Add env var to control skipping config validation during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
IJMacD committed Apr 26, 2024
1 parent 67a7478 commit cab315e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,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"
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

0 comments on commit cab315e

Please sign in to comment.