mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-21 18:55:16 +02:00
feat: add docs seeding function to all-in-one entrypoint
This commit is contained in:
parent
ec145431f2
commit
6f67236143
1 changed files with 20 additions and 0 deletions
|
|
@ -145,9 +145,29 @@ run_migrations() {
|
||||||
echo "✅ Database migrations complete"
|
echo "✅ Database migrations complete"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ================================================
|
||||||
|
# Seed Surfsense documentation
|
||||||
|
# ================================================
|
||||||
|
seed_surfsense_docs() {
|
||||||
|
echo "📚 Seeding Surfsense documentation..."
|
||||||
|
|
||||||
|
# Start PostgreSQL temporarily for seeding
|
||||||
|
su - postgres -c "/usr/lib/postgresql/14/bin/pg_ctl -D /data/postgres -l /tmp/postgres_seed.log start"
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
cd /app/backend
|
||||||
|
python scripts/seed_surfsense_docs.py || echo "⚠️ Docs seeding may have already been done"
|
||||||
|
|
||||||
|
# Stop PostgreSQL
|
||||||
|
su - postgres -c "/usr/lib/postgresql/14/bin/pg_ctl -D /data/postgres stop"
|
||||||
|
|
||||||
|
echo "✅ Surfsense documentation seeded"
|
||||||
|
}
|
||||||
|
|
||||||
# Run migrations on first start or when explicitly requested
|
# Run migrations on first start or when explicitly requested
|
||||||
if [ ! -f /data/.migrations_run ] || [ "${FORCE_MIGRATIONS:-false}" = "true" ]; then
|
if [ ! -f /data/.migrations_run ] || [ "${FORCE_MIGRATIONS:-false}" = "true" ]; then
|
||||||
run_migrations
|
run_migrations
|
||||||
|
seed_surfsense_docs
|
||||||
touch /data/.migrations_run
|
touch /data/.migrations_run
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue