mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-31 16:00:39 +08:00
don't create a user for hangarauth
Signed-off-by: MiniDigger <admin@minidigger.me>
This commit is contained in:
parent
81b0f17114
commit
890b6ffbfc
@ -3,20 +3,19 @@
|
||||
set -e
|
||||
set -u
|
||||
|
||||
function create_user_and_database() {
|
||||
function create_database() {
|
||||
local database=$1
|
||||
echo " Creating user and database '$database'"
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
|
||||
CREATE USER $database WITH PASSWORD '$database';
|
||||
CREATE DATABASE $database;
|
||||
GRANT ALL PRIVILEGES ON DATABASE $database TO $database;
|
||||
GRANT ALL PRIVILEGES ON DATABASE $database TO $POSTGRES_USER;
|
||||
EOSQL
|
||||
}
|
||||
|
||||
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
|
||||
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
|
||||
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
|
||||
create_user_and_database $db
|
||||
create_database $db
|
||||
done
|
||||
echo "Multiple databases created"
|
||||
fi
|
||||
fi
|
||||
|
@ -1,6 +1,6 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:postgresql://db:5432/hangar
|
||||
url: jdbc:postgresql://hangar_db:5432/hangar
|
||||
username: hangar
|
||||
password: hangar
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user