diff --git a/backend/docker/database/docker-entrypoint-initdb.d/init-user-db.sh b/backend/docker/database/docker-entrypoint-initdb.d/init-user-db.sh index 9b9f4ef..ca03242 100755 --- a/backend/docker/database/docker-entrypoint-initdb.d/init-user-db.sh +++ b/backend/docker/database/docker-entrypoint-initdb.d/init-user-db.sh @@ -2,10 +2,10 @@ set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE USER idfm_matrix_bot; - CREATE DATABASE bot; - CREATE DATABASE idfm; - GRANT ALL PRIVILEGES ON DATABASE bot TO idfm_matrix_bot; - GRANT ALL PRIVILEGES ON DATABASE idfm TO idfm_matrix_bot; + CREATE USER cer_user WITH ENCRYPTED password 'cer_password'; + CREATE DATABASE cer_db; + \c cer_db; + CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA "public"; + GRANT CREATE ON SCHEMA public to cer_user; EOSQL diff --git a/backend/main.py b/backend/main.py index e06f843..d5a6f14 100644 --- a/backend/main.py +++ b/backend/main.py @@ -24,7 +24,7 @@ API_KEY = environ.get("API_KEY") # TODO: Add error message if no key is given. # TODO: Remove postgresql+asyncpg from environ variable -DB_PATH = "postgresql+asyncpg://postgres:postgres@127.0.0.1:5438/idfm" +DB_PATH = "postgresql+asyncpg://cer_user:cer_password@127.0.0.1:5438/cer_db" app = FastAPI()