From dceb24d0bba36d337167b258d4ad71d9e9c7ecbc Mon Sep 17 00:00:00 2001 From: Carsten Schafer Date: Fri, 26 Jul 2024 16:42:33 -0400 Subject: [PATCH] SQL init script can't work, DB check to last one Signed-off-by: Carsten Schafer --- docker-compose/.env.letsencrypt | 1 + docker-compose/docker-compose.lb.letsencrypt.yml | 2 +- docker-compose/docker-compose.lb.selfsigned.yml | 2 +- docker-compose/docker-compose.yml | 2 +- docker-compose/postgresql/init-db.sh | 2 -- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docker-compose/.env.letsencrypt b/docker-compose/.env.letsencrypt index 7a42300..8596eb4 100644 --- a/docker-compose/.env.letsencrypt +++ b/docker-compose/.env.letsencrypt @@ -40,4 +40,5 @@ INTERNAL_OWPROVUI_HOSTNAME=owprov-ui.wlan.local INTERNAL_OWANALYTICS_HOSTNAME=owanalytics.wlan.local INTERNAL_RTTYS_HOSTNAME=rttys.wlan.local INTERNAL_OWSUB_HOSTNAME=owsub.wlan.local +SDKHOSTNAME= #SDKHOSTNAME=openwifi.example.com diff --git a/docker-compose/docker-compose.lb.letsencrypt.yml b/docker-compose/docker-compose.lb.letsencrypt.yml index 247d214..41cec41 100644 --- a/docker-compose/docker-compose.lb.letsencrypt.yml +++ b/docker-compose/docker-compose.lb.letsencrypt.yml @@ -285,7 +285,7 @@ services: - postgresql_data:/var/lib/postgresql/data - ./postgresql/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres -d owgw"] + test: ["CMD-SHELL", "pg_isready -U postgres -d owsub"] interval: 10s retries: 5 start_period: 30s diff --git a/docker-compose/docker-compose.lb.selfsigned.yml b/docker-compose/docker-compose.lb.selfsigned.yml index d739b4e..42a8f4d 100644 --- a/docker-compose/docker-compose.lb.selfsigned.yml +++ b/docker-compose/docker-compose.lb.selfsigned.yml @@ -277,7 +277,7 @@ services: - postgresql_data:/var/lib/postgresql/data - ./postgresql/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres -d owgw"] + test: ["CMD-SHELL", "pg_isready -U postgres -d owsub"] interval: 10s retries: 5 start_period: 30s diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 5f2bd3c..9a1f581 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -258,7 +258,7 @@ services: - postgresql_data:/var/lib/postgresql/data - ./postgresql/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres -d owgw"] + test: ["CMD-SHELL", "pg_isready -U postgres -d owsub"] interval: 10s retries: 5 start_period: 30s diff --git a/docker-compose/postgresql/init-db.sh b/docker-compose/postgresql/init-db.sh index 3ece1ab..8f868dc 100755 --- a/docker-compose/postgresql/init-db.sh +++ b/docker-compose/postgresql/init-db.sh @@ -14,6 +14,4 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL CREATE DATABASE $OWANALYTICS_DB OWNER $OWANALYTICS_DB_USER; CREATE USER $OWSUB_DB_USER WITH ENCRYPTED PASSWORD '$OWSUB_DB_PASSWORD'; CREATE DATABASE $OWSUB_DB OWNER $OWSUB_DB_USER; - \c owsec - INSERT INTO users (id, name, description, avatar, email, validated, validationemail, validationdate, creationdate, validationuri, changepassword, lastlogin, currentloginuri, lastpasswordchange, lastemailcheck, waitingforemailcheck, locale, notes, location, owner, suspended, blacklisted, userrole, usertypeproprietaryinfo, securitypolicy, securitypolicychange, currentpassword, lastpasswords, oauthtype, oauthuserinfo, modified, signingup) VALUES ('11111111-0000-0000-6666-999999999999', 'Default User', 'Default user should be deleted.', '1701287135', 'tip@ucentral.com', true, '', 0, 1683468668, '', true, 1702156150, '', 1683468881, 0, false, '', '[]', '', '', false, false, 'root', '{"authenticatorSecret":"","mfa":{"enabled":false,"method":""},"mobiles":[]}', '', 0, '13268b7daa751240369d125e79c873bd8dd3bef7981bdfd38ea03dbb1fbe7dcf', '["13268b7daa751240369d125e79c873bd8dd3bef7981bdfd38ea03dbb1fbe7dcf","1683468881040646067|bcf145fa6354dbe1baddf1f66f6acc2466c49c2fbc22d2150a7f7a94fa1cfa27"]', '', '', '1683468881', '') ON CONFLICT (id) DO NOTHING; EOSQL