Initial commit

This commit is contained in:
Yas Opisso
2025-12-12 14:56:50 -05:00
commit ebd684dc53
20 changed files with 24382 additions and 0 deletions

22
pocketbase/initialize.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
echo "Starting PocketBase initialization..."
DB_FILE="./pb_data/data.db"
# Step 1: Ensure the database file exists
if [ ! -f "$DB_FILE" ]; then
# echo "Database not found. Copying default data..."
# cp -r ./pb_data_default/. ./pb_data/
# This is only needed if we don't copy the default data
./pocketbase serve --http 0.0.0.0:8090 --automigrate=0 & sleep 4
kill $(pidof pocketbase)
# Creates the admin user or updates if already exists
echo "Creating admin user"
./pocketbase superuser upsert "$POCKETBASE_ADMIN_USERNAME" "$POCKETBASE_ADMIN_PASSWORD"
fi
# Step 3: Start PocketBase normally
echo "Starting PocketBase..."
./pocketbase serve --http 0.0.0.0:8090