Skip to content

Commit

Permalink
DB_SKIP_SSL env var
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Dec 25, 2024
1 parent 7e49108 commit f3761c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ linux/arm64
* `DB_PREFIX`: MySQL database prefix (default `flarum_`)
* `DB_NOPREFIX`: Enforce no prefix for the MySQL database (default `false`)
* `DB_TIMEOUT`: Time in seconds after which we stop trying to reach the MySQL server (useful for clusters, default `60`)
* `DB_SKIP_SSL`: Skip SSL connection to MySQL server (default `true`)

> [!NOTE]
> `DB_USER_FILE` and `DB_PASSWORD_FILE` can be used to fill in the value from a
Expand Down
6 changes: 5 additions & 1 deletion rootfs/etc/cont-init.d/03-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ DB_USER=${DB_USER:-flarum}
DB_PREFIX=${DB_PREFIX:-flarum_}
DB_NOPREFIX=${DB_NOPREFIX:-false}
DB_TIMEOUT=${DB_TIMEOUT:-60}
DB_SKIP_SSL=${DB_SKIP_SSL:-true}

# Timezone
echo "Setting timezone to ${TZ}..."
Expand Down Expand Up @@ -125,7 +126,10 @@ if [ -z "$DB_PASSWORD" ]; then
echo >&2 "ERROR: Either DB_PASSWORD or DB_PASSWORD_FILE must be defined"
exit 1
fi
dbcmd="mysql --skip-ssl -h ${DB_HOST} -P ${DB_PORT} -u "${DB_USER}" "-p${DB_PASSWORD}""
dbcmd="mysql -h ${DB_HOST} -P ${DB_PORT} -u "${DB_USER}" "-p${DB_PASSWORD}""
if [ "$DB_SKIP_SSL" = "true" ]; then
dbcmd="$dbcmd --skip-ssl"
fi

echo "Waiting ${DB_TIMEOUT}s for database to be ready..."
counter=1
Expand Down

0 comments on commit f3761c3

Please sign in to comment.