From ac9e6a719004a1cf08cf1585a996372dbd301c9f Mon Sep 17 00:00:00 2001 From: RS Date: Wed, 23 Aug 2023 04:03:39 +0200 Subject: [PATCH] Add DB_NAME to run.sh to support mysql (#2850) Adding environment variable DB_NAME to run.sh so that Gophish Container can be set up with mysql/mariadb. db_name has to be changed in config to mysql for mysql connection to work. --- docker/run.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker/run.sh b/docker/run.sh index bdfc22fa..76dee78b 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -66,6 +66,14 @@ if [ -n "${CONTACT_ADDRESS+set}" ] ; then cat config.json.tmp > config.json fi +# db_name has to be changed to mysql for mysql connection to work +if [ -n "${DB_NAME+set}" ] ; then + jq -r \ + --arg DB_NAME "${DB_NAME}" \ + '.db_name = $DB_NAME' config.json > config.json.tmp && \ + cat config.json.tmp > config.json +fi + if [ -n "${DB_FILE_PATH+set}" ] ; then jq -r \ --arg DB_FILE_PATH "${DB_FILE_PATH}" \