Skip to content

Commit

Permalink
SQL init script can't work, DB check to last one
Browse files Browse the repository at this point in the history
Signed-off-by: Carsten Schafer <[email protected]>
  • Loading branch information
Carsten Schafer authored and Carsten Schafer committed Jul 26, 2024
1 parent 1c43883 commit dceb24d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions docker-compose/.env.letsencrypt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.lb.letsencrypt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.lb.selfsigned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions docker-compose/postgresql/init-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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', '[email protected]', 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

0 comments on commit dceb24d

Please sign in to comment.