aaah
This commit is contained in:
parent
e443c28fc4
commit
fde087d1ed
@ -1,3 +1,4 @@
|
||||
PB_ADMIN_EMAIL=admin@example.com
|
||||
PB_ADMIN_PASSWORD=secret-password
|
||||
PB_URL=http://pocketbase:8080
|
||||
PB_DATA_DIR=/pb/pb_data
|
@ -12,8 +12,9 @@ set -e
|
||||
|
||||
# if there are no users yet, create the superuser
|
||||
# we check the sqlite file for any existing record in the users table
|
||||
if ! sqlite3 "/pb/pb_data/data.db" \
|
||||
"SELECT id FROM users WHERE email='${PB_ADMIN_EMAIL}' LIMIT 1;" \
|
||||
if [ ! -f "${PB_DATA_DIR}/pb_data.db" ] \
|
||||
! sqlite3 "${PB_DATA_DIR}/data.db" \
|
||||
"SELECT id FROM _superusers WHERE email='${PB_ADMIN_EMAIL}' LIMIT 1;" \
|
||||
| grep -q .; then
|
||||
|
||||
echo ">>> Creating PocketBase superuser: ${PB_ADMIN_EMAIL}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user