From d26eaf5dab6bc617cf7c6966985dab320b4f24f0 Mon Sep 17 00:00:00 2001 From: ktb-jcm <85756464+ktb-jcm@users.noreply.github.com> Date: Fri, 29 Oct 2021 17:06:00 -0400 Subject: [PATCH] Update run.sh to include fixing database name in config.php If for any reason the name of the database for using misp isn't named "misp", connectivity will fail because database.php does not get updated with the correct name from .env Ran into this when using a forked version of this project where the web container is run in Docker but MySQL database is running in prod database cluster and required a specific naming convention. Other parameters in .env are also not updated or translated into database.php --- web/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/run.sh b/web/run.sh index ccc9a2b..0787f02 100755 --- a/web/run.sh +++ b/web/run.sh @@ -92,7 +92,8 @@ if [ -r /.firstboot.tmp ]; then echo "Creating MISP configuration files" cd /var/www/MISP/app/Config cp -a database.default.php database.php - sed -i "s/localhost/$MYSQL_HOST/" database.php + sed -i "s/'database' => 'misp'/'database' => '$MYSQL_DATABASE'/" database.php + sed -i "s/localhost/$MYSQL_HOST/" database.php sed -i "s/db\s*login/$MYSQL_USER/" database.php sed -i "s/8889/3306/" database.php sed -i "s/db\s*password/$MYSQL_PASSWORD/" database.php