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.
This commit is contained in:
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

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}" \