mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
✅ Core Stability Achievements: - Demo user login working (demo@omnivore.app / demo_password) - PDF upload, viewing, highlighting, and notes fully functional - Database persistence across container restarts - Redis connection issues resolved 🔧 Infrastructure Improvements: - Added PostgreSQL persistent volumes (postgres_data, postgres_replica_data) - Fixed Redis configuration with proper URLs and missing MQ_REDIS_URL - Enhanced demo user creation with corrected ON CONFLICT clause - Improved PDF content handler with better title extraction 🐛 Bug Fixes: - Fixed demo user authentication by correcting setup.sh ON CONFLICT - Resolved Redis connection errors in API and content-fetch services - Enhanced RSS handler Redis client with null-check safety - Added mail server data to gitignore 📚 Documentation: - Added development vs production guide - Added troubleshooting documentation - Added Cursor AI rules for consistent development 🎯 Next Phase Ready: Stable foundation established for implementing link upload/saving functionality.
43 lines
No EOL
2 KiB
Bash
Executable file
43 lines
No EOL
2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Check if PGDATA is empty
|
|
if [ -z "$(ls -A $PGDATA 2>/dev/null)" ]; then
|
|
echo "PGDATA is empty. Performing basebackup..."
|
|
pg_basebackup -h $PG_HOST -D $PGDATA -U replicator -Fp -Xs -P -R
|
|
echo "Basebackup completed."
|
|
else
|
|
echo "PGDATA is not empty. Skipping basebackup and proceeding with normal standby start."
|
|
fi
|
|
|
|
psql --host $PG_HOST --username $POSTGRES_USER --command "CREATE DATABASE $PG_DB;" || true
|
|
echo "create $PG_DB database"
|
|
|
|
psql --host $PG_HOST --username $POSTGRES_USER --command "CREATE USER app_user WITH ENCRYPTED PASSWORD '$PG_PASSWORD';" || true
|
|
echo "created app_user"
|
|
|
|
psql --host $PG_HOST --username $POSTGRES_USER --command "CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD 'replicator_password';" || true
|
|
echo "created replicator"
|
|
|
|
psql --host $PG_HOST --username $POSTGRES_USER --command "SELECT pg_create_physical_replication_slot('replication_slot');" || true
|
|
echo "created replication_slot"
|
|
|
|
PG_USER=$POSTGRES_USER PG_PASSWORD=$PGPASSWORD yarn workspace @omnivore/db migrate
|
|
|
|
psql --host $PG_HOST --username $POSTGRES_USER --dbname $PG_DB --command "GRANT omnivore_user TO app_user;" || true
|
|
echo "granted omnivore_user to app_user"
|
|
|
|
# create demo user with email: demo@omnivore.app, password: demo_password
|
|
if [ -z "${NO_DEMO_USER}" ]; then
|
|
USER_ID=$(uuidgen)
|
|
PASSWORD='$2a$10$41G6b1BDUdxNjH1QFPJYDOM29EE0C9nTdjD1FoseuQ8vZU1NWtrh6'
|
|
psql --host $PG_HOST --username $POSTGRES_USER --dbname $PG_DB --command "
|
|
INSERT INTO omnivore.user (id, source, email, source_user_id, name, password)
|
|
VALUES ('$USER_ID', 'EMAIL', 'demo@omnivore.app', 'demo@omnivore.app', 'Demo User', '$PASSWORD')
|
|
ON CONFLICT (email) DO NOTHING;
|
|
|
|
INSERT INTO omnivore.user_profile (user_id, username)
|
|
SELECT id, 'demo_user' FROM omnivore.user WHERE email = 'demo@omnivore.app'
|
|
ON CONFLICT (username) DO NOTHING;
|
|
"
|
|
echo "created demo user with email: demo@omnivore.app, password: demo_password"
|
|
fi |