diff options
author | Florian Pritz <bluewind@xinu.at> | 2020-09-20 14:57:29 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2020-09-20 15:02:30 +0200 |
commit | ab41e7717fe0df20a4ca516b918b64bd32753361 (patch) | |
tree | 95cc0a33ef9d6d63cdb3317aab2aae1742a2c24d | |
parent | 80577e948a210e60e6738bf6ea3b0b391ab07b48 (diff) |
docker: Always regenerated config files on container startup
We should really regenerate the configs, run migrations and hooks during
each container startup. Otherwise you really can't update anything at
all.
The only thing that we do not do multiple times is adding the admin
user, but the add_user method already checks for that and simply
displayed an error. Hiding that error is probably not worth the effort
so we just add a quick explanatory comment before the potential error.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | docker/add_user.sh | 1 | ||||
-rwxr-xr-x | docker/filebin_starter.sh | 25 |
2 files changed, 11 insertions, 15 deletions
diff --git a/docker/add_user.sh b/docker/add_user.sh index 4342528ef..88618746d 100755 --- a/docker/add_user.sh +++ b/docker/add_user.sh @@ -1,4 +1,5 @@ #!/bin/bash cd ${FILEBIN_DIR} +echo "Creating initial user. If it exists, this will show an error message instead" printf "%s\n%s\n%s\n" admin ${FB_CONTACT_MAIL} admin | php index.php user add_user diff --git a/docker/filebin_starter.sh b/docker/filebin_starter.sh index 2fecc3fe3..38088537e 100755 --- a/docker/filebin_starter.sh +++ b/docker/filebin_starter.sh @@ -64,25 +64,20 @@ while ! nc "$FB_DB_HOSTNAME" 3306 </dev/null >/dev/null; do sleep 0.5 done +set_config +set_database_config +set_mail_config -if [[ ! -e $FILEBIN_DIR/application/config/config-local.php ]]; then - echo "no config found, new config will be generated" +CONTACT_INFO_FILE=${FILEBIN_DIR}/data/local/contact-info.php +cp $FILEBIN_DIR/data/local/examples/contact-info.php ${CONTACT_INFO_FILE} - set_config - set_database_config - set_mail_config +sed -i "s/John Doe/${FB_CONTACT_NAME}/" ${CONTACT_INFO_FILE} +sed -i "s/john.doe@example.com/${FB_CONTACT_MAIL}/" ${CONTACT_INFO_FILE} - CONTACT_INFO_FILE=${FILEBIN_DIR}/data/local/contact-info.php - cp $FILEBIN_DIR/data/local/examples/contact-info.php ${CONTACT_INFO_FILE} +${FILEBIN_DIR}/scripts/install-git-hooks.sh +${FILEBIN_DIR}/git-hooks/post-merge - sed -i "s/John Doe/${FB_CONTACT_NAME}/" ${CONTACT_INFO_FILE} - sed -i "s/john.doe@example.com/${FB_CONTACT_MAIL}/" ${CONTACT_INFO_FILE} - - ${FILEBIN_DIR}/scripts/install-git-hooks.sh - ${FILEBIN_DIR}/git-hooks/post-merge - - ${FILEBIN_HOME_DIR}/add_user.sh -fi +${FILEBIN_HOME_DIR}/add_user.sh cd $FILEBIN_DIR/public_html php -S 0.0.0.0:8080 |