mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #2178 from omnivore-app/fix/rm-user-from-self-host-script
Use POSTGRES_USER in the selfhost script
This commit is contained in:
commit
7dccb27b81
1 changed files with 6 additions and 6 deletions
|
|
@ -1,16 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "creating omnivore database with $(which psql)"
|
||||
psql --host $PG_HOST -U $PG_USER -c "CREATE DATABASE omnivore;"
|
||||
echo "creating omnivore database with $(which psql) and user: $POSTGRES_USER"
|
||||
psql --host $PG_HOST -c "CREATE DATABASE omnivore;"
|
||||
|
||||
echo "creating app_user"
|
||||
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "CREATE USER app_user WITH PASSWORD 'app_pass';"
|
||||
psql --host $PG_HOST -d $PG_DB -c "CREATE USER app_user WITH ENCRYPTED PASSWORD '$PG_PASSWORD';"
|
||||
echo "created app_user"
|
||||
|
||||
echo "running migrations"
|
||||
yarn workspace @omnivore/db migrate
|
||||
echo "running migrations as $POSTGRES_USER"
|
||||
PG_USER=$POSTGRES_USER PG_PASSWORD=$POSTGRES_PASSWORD yarn workspace @omnivore/db migrate
|
||||
|
||||
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "GRANT omnivore_user TO app_user;"
|
||||
psql --host $PG_HOST -d $PG_DB -c "GRANT omnivore_user TO app_user;"
|
||||
echo "granted omnivore_user to app_user"
|
||||
|
||||
yarn workspace @omnivore/api start
|
||||
|
|
|
|||
Loading…
Reference in a new issue