diff --git a/README.md b/README.md index a34000a..fe7b833 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ Based on [`mediawiki-ve-bundle`][mediawiki-ve]. abra secret_generate db_root_password v1 abra secret_generate mediawiki_secret_key v1 "pwgen -n 64 1" ``` -7. `abra deploy` -8. Create an initial admin user: - `abra run app php /var/www/html/maintenance/createAndPromote.php YourUsername YourPassword` +6. `abra deploy` +7. Create an initial admin user: + `abra run app php /var/www/html/maintenance/createAndPromote.php --sysop YourUsername YourPassword` ## SimpleSAMLphp diff --git a/compose.simplesaml.yml b/compose.simplesaml.yml index 9b1f5b3..fe9d991 100644 --- a/compose.simplesaml.yml +++ b/compose.simplesaml.yml @@ -49,7 +49,6 @@ services: - simplesaml:/var/simplesamlphp/ - simplesaml_log:/var/simplesamlphp/log networks: - - internal - proxy entrypoint: /docker-entrypoint.simplesaml.sh #entrypoint: ["tail", "-f", "/dev/null"] diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index d01c37f..02ba64d 100755 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -31,10 +31,17 @@ init_db() { fi PASSWORD=$(cat /run/secrets/db_password) + # FIXME 3wc: replace with sql.php, not sure how to parse output: + # stdClass Object + #( + # [TOTAL] => 58 + #) TABLE_COUNT=$(mysql -u "${DB_USER}" --password="$PASSWORD" -h "${DB_HOST}" "${DB_NAME}" -e "SELECT count(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'mediawiki';" -N -B) if [[ "${TABLE_COUNT}" == "0" ]]; then - mysql -u "${DB_USER}" --password="$PASSWORD" -h "${DB_HOST}" "${DB_NAME}" < /var/www/html/maintenance/tables.sql + php /var/www/html/maintenance/sql.php < /var/www/html/maintenance/tables.sql + php /var/www/html/maintenance/sql.php < /var/www/html/maintenance/interwiki.sql + # FIXME run createAndPromote.php with $ADMIN_USERNAME else php /var/www/html/maintenance/update.php fi