diff --git a/abra.sh b/abra.sh index e6c130b..db2dfdb 100644 --- a/abra.sh +++ b/abra.sh @@ -1 +1 @@ -export ENTRYPOINT_VERSION=v1 +export ENTRYPOINT_VERSION=v4 diff --git a/compose.yml b/compose.yml index 28606d9..9a05f11 100644 --- a/compose.yml +++ b/compose.yml @@ -16,7 +16,7 @@ services: - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4 - SYMFONY__ENV__MAILER_HOST - SYMFONY__ENV__MAILER_USER - - SYMFONY__ENV__MAILER_PASSWORD=/run/secrets/smtp_password + - SYMFONY__ENV__MAILER_PASSWORD_FILE=/run/secrets/smtp_password - SYMFONY__ENV__FROM_EMAIL - SYMFONY__ENV__DOMAIN_NAME=https://${DOMAIN} - SYMFONY__ENV__FOSUSER_REGISTRATION @@ -28,7 +28,6 @@ services: - internal secrets: - db_password - #- admin_password - app_secret - smtp_password entrypoint: /custom-entrypoint.sh diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 97bdd3e..094b321 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -1,31 +1,9 @@ -#!/bin/bash +#!/bin/sh -set -eu +export SYMFONY__ENV__DATABASE_PASSWORD=$(cat $SYMFONY__ENV__DATABASE_PASSWORD_FILE) +export SYMFONY__ENV__SECRET=$(cat $SYMFONY__ENV__SECRET_FILE) -file_env() { - local var="$1" - local fileVar="${var}_FILE" - local def="${2:-}" - - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - echo >&2 "error: both $var and $fileVar are set (but are exclusive)" - exit 1 - fi - - local val="$def" - - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" - fi - - export "$var"="$val" - unset "$fileVar" -} - -file_env "SYMFONY__ENV__DATABASE_PASSWORD" -file_env "SYMFONY__ENV__SECRET" +export SYMFONY__ENV__MAILER_DSN=smtp://${SYMFONY__ENV__MAILER_USER}:$(cat ${SYMFONY__ENV__MAILER_PASSWORD_FILE})@${SYMFONY__ENV__MAILER_HOST}:465 # https://github.com/wallabag/docker/blob/master/root/entrypoint.sh sh -c "/entrypoint.sh migrate"