web-app-mediawiki: installer-driven bootstrap, DB readiness, idempotent admin; drop LocalSettings bind-mount

Tasks:
- Enable docker_compose_flush_handlers=true so services come up immediately.
- Add DB readiness guard via maintenance/sql.php (SELECT 1).
- Run maintenance/install.php on empty schema with robust changed_when/failed_when (merge stdout+stderr); keep secrets hidden.
- Run maintenance/update.php for migrations with neutral changed_when unless work is done.
- Make admin creation idempotent: tolerate 'already exists' and 'Account exists', keep async+no_log.

Config changes:
- Remove LocalSettings.php template and its host bind-mount from compose.
- Drop MediaWiki settings path variables and META namespace variable (unused after switch).

Result: First boot is fully automated (schema + admin), subsequent runs are cleanly idempotent.

Ref: ChatGPT conversation (Aug 28, 2025, Europe/Berlin) — https://chatgpt.com/share/68b0d2e1-9bc0-800f-81a5-db03ce0b81e3.
This commit is contained in:
2025-08-29 00:07:00 +02:00
parent d96bfc64a6
commit af1ee64246
4 changed files with 51 additions and 44 deletions

View File

@@ -5,7 +5,6 @@ container_port: 80
# Mediawiki
MEDIAWIKI_SITENAME: "{{ applications | get_app_conf(application_id, 'sitename') }}"
MEDIAWIKI_META_NAMESPACE: "{{ applications | get_app_conf(application_id, 'meta_namespace') }}"
MEDIAWIKI_URL: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
## Docker
@@ -13,8 +12,6 @@ MEDIAWIKI_VERSION: "{{ applications | get_app_conf(application_id
MEDIAWIKI_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.image') }}"
MEDIAWIKI_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.name') }}"
MEDIAWIKI_VOLUME: "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}"
MEDIAWIKI_SETTINGS_HOST_PATH: "{{ [docker_compose.directories.volumes, 'LocalSettings.php'] | path_join }}"
MEDIAWIKI_SETTINGS_DOCK_PATH: "/var/www/html/LocalSettings.php"
MEDIAWIKI_USER: "www-data"
# User