Set defaults for some environment variables

This commit is contained in:
fanyx 2022-06-26 19:37:19 +02:00
parent 2836dfbeba
commit aaa1092615
2 changed files with 5 additions and 5 deletions

View File

@ -4,16 +4,16 @@ config=( )
playlist=( ) playlist=( )
# Mandatory # Mandatory
SERVER_SA_PASSWORD=${SERVER_SA_PASSWORD:?ERROR | SuperAdminPassword needs to be set. Generate with pwgen if needed.} && \
config+=( "SERVER_SA_PASSWORD" )
SERVER_ADM_PASSWORD=${SERVER_ADM_PASSWORD:?ERROR | AdminPassword needs to be set. Generate with pwgen if needed.} && \
config+=( "SERVER_ADM_PASSWORD" )
SERVER_LOGIN=${SERVER_LOGIN?:ERROR | ServerLogin is missing. Server cannot start.} && \ SERVER_LOGIN=${SERVER_LOGIN?:ERROR | ServerLogin is missing. Server cannot start.} && \
config+=( "SERVER_LOGIN" ) config+=( "SERVER_LOGIN" )
SERVER_LOGIN_PASSWORD=${SERVER_LOGIN_PASSWORD?:ERROR | ServerLoginPassword is missing. Server cannot start.} && \ SERVER_LOGIN_PASSWORD=${SERVER_LOGIN_PASSWORD?:ERROR | ServerLoginPassword is missing. Server cannot start.} && \
config+=( "SERVER_LOGIN_PASSWORD" ) config+=( "SERVER_LOGIN_PASSWORD" )
# Optional # Optional
SERVER_SA_PASSWORD=${SERVER_SA_PASSWORD:-$(pwgen -s 24 1)} && config+=( "SERVER_SA_PASSWORD" )
echo "INFO | SERVER_SA_PASSWORD: ${SERVER_SA_PASSWORD}"
SERVER_ADM_PASSWORD=${SERVER_ADM_PASSWORD:-$(pwgen -s 24 1)} && config+=( "SERVER_ADM_PASSWORD" )
echo "INFO | SERVER_ADM_PASSWORD: ${SERVER_ADM_PASSWORD}"
SERVER_PORT=${SERVER_PORT:-2350} && config+=( "SERVER_PORT" ) SERVER_PORT=${SERVER_PORT:-2350} && config+=( "SERVER_PORT" )
echo "INFO | SERVER_PORT: ${SERVER_PORT}" echo "INFO | SERVER_PORT: ${SERVER_PORT}"
SERVER_P2P_PORT=${SERVER_P2P_PORT:-3450} && config+=( "SERVER_P2P_PORT" ) SERVER_P2P_PORT=${SERVER_P2P_PORT:-3450} && config+=( "SERVER_P2P_PORT" )

View File

@ -21,7 +21,7 @@ echo "INFO | TMSERVER_PORT: ${TMSERVER_PORT}"
MYSQL_HOST=${MYSQL_HOST:-db} && \ MYSQL_HOST=${MYSQL_HOST:-db} && \
database+=( "MYSQL_HOST" ) database+=( "MYSQL_HOST" )
echo "INFO | MYSQL_HOST: ${MYSQL_HOST}" echo "INFO | MYSQL_HOST: ${MYSQL_HOST}"
MYSQL_LOGIN=${MYSQL_LOGIN:?ERROR | MySQL username was not given...} && \ MYSQL_LOGIN=${MYSQL_LOGIN:?-trackmani} && \
database+=( "MYSQL_LOGIN" ) database+=( "MYSQL_LOGIN" )
echo "INFO | MYSQL_LOGIN: ${MYSQL_LOGIN}" echo "INFO | MYSQL_LOGIN: ${MYSQL_LOGIN}"
MYSQL_PASSWORD=${MYSQL_PASSWORD:?ERROR | MySQL password was not given...} && \ MYSQL_PASSWORD=${MYSQL_PASSWORD:?ERROR | MySQL password was not given...} && \