reuse env variables for setting passwords

pull/273/head
Kris Gesling 2021-07-15 08:16:24 +09:30
parent a1a012de0a
commit 7aa466bdf5
1 changed files with 5 additions and 5 deletions

View File

@ -73,16 +73,16 @@ wget http://download.geonames.org/export/dump/timeZones.txt
wget http://download.geonames.org/export/dump/admin1CodesASCII.txt
wget http://download.geonames.org/export/dump/cities500.zip
```
* Generate secure passwords for the postgres user and selene user on the database
```
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '<new password>'"
sudo -u postgres psql -c "CREATE ROLE selene WITH LOGIN ENCRYPTED PASSWORD '<password>'"
```
* Add environment variables containing these passwords for the bootstrap script
```
export DB_PASSWORD=<selene user password>
export POSTGRES_PASSWORD=<postgres user password>
```
* Generate secure passwords for the postgres user and selene user on the database
```
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$POSTGRES_PASSWORD'"
sudo -u postgres psql -c "CREATE ROLE selene WITH LOGIN ENCRYPTED PASSWORD '$DB_PASSWORD'"
```
* Run the bootstrap script
```
cd /opt/selene/selene-backend/db/scripts