Use random password for database user

Fix #298
This commit is contained in:
Perflyst 2019-01-21 19:17:07 +01:00
parent 5cb57fb176
commit 629b0a8b41
No known key found for this signature in database
GPG Key ID: B0D9C8E56E999F68
2 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,7 @@ channel_threads: 1
feed_threads: 1
db:
user: kemal
password: kemal
password: replacethispassword
host: localhost
port: 5432
dbname: invidious

View File

@ -1,10 +1,15 @@
#!/bin/bash
dbpass=$(openssl rand -hex 20)
createdb invidious
#createuser kemal
psql -c "CREATE USER kemal WITH PASSWORD 'kemal';"
psql -c "CREATE USER kemal WITH PASSWORD '$dbpass';"
psql invidious < config/sql/channels.sql
psql invidious < config/sql/videos.sql
psql invidious < config/sql/channel_videos.sql
psql invidious < config/sql/users.sql
psql invidious < config/sql/nonces.sql
# change password in config file
sed -i "s/replacethispassword/$dbpass/g" config/config.yml