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.
pull/2864/merge
RS 2023-08-23 04:03:39 +02:00 committed by GitHub
parent 04f0fb6dfd
commit ac9e6a7190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -66,6 +66,14 @@ if [ -n "${CONTACT_ADDRESS+set}" ] ; then
cat config.json.tmp > config.json cat config.json.tmp > config.json
fi 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 if [ -n "${DB_FILE_PATH+set}" ] ; then
jq -r \ jq -r \
--arg DB_FILE_PATH "${DB_FILE_PATH}" \ --arg DB_FILE_PATH "${DB_FILE_PATH}" \