Adopt new hierarchy pattern
This commit is contained in:
4
services/gotify/secrets/README.md
Normal file
4
services/gotify/secrets/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
Contains the file `admin_password`
|
||||
|
||||
Envirnonment variable file for the default admin password, this is because gotify doesn't support docker secrets yet
|
||||
https://github.com/gotify/server/issues/392
|
||||
1
services/gotify/volumes/data/.gitignore
vendored
Normal file
1
services/gotify/volumes/data/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!entrypoint.sh
|
||||
28
services/gotify/volumes/data/entrypoint.sh
Executable file
28
services/gotify/volumes/data/entrypoint.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||
file_env() {
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||
mysql_error "Both $var and $fileVar are set (but are exclusive)"
|
||||
fi
|
||||
local val="$def"
|
||||
if [ "${!var:-}" ]; then
|
||||
val="${!var}"
|
||||
elif [ "${!fileVar:-}" ]; then
|
||||
val="$(< "${!fileVar}")"
|
||||
fi
|
||||
export "$var"="$val"
|
||||
unset "$fileVar"
|
||||
}
|
||||
|
||||
cd /app
|
||||
|
||||
file_env 'GOTIFY_DEFAULTUSER_PASS'
|
||||
|
||||
./gotify-app "$@"
|
||||
Reference in New Issue
Block a user