home · contact · privacy
Fix PeerTube config DB password bug.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 16 Feb 2020 23:43:44 +0000 (00:43 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 16 Feb 2020 23:43:44 +0000 (00:43 +0100)
buster/other_files/peertube_db_password.yaml [deleted file]
buster/other_files/peertube_production.yaml
buster/setup_scripts/restore_app.sh
buster/setup_scripts/setup_peertube.sh

diff --git a/buster/other_files/peertube_db_password.yaml b/buster/other_files/peertube_db_password.yaml
deleted file mode 100644 (file)
index 4682ad5..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-database:
-  password: 'REPLACE_ME'
index 3cc2d81340d0659a02bf184bd931012d37cdfc4c..32f905f50c2bd16a012e8fc8b4a0d5e5a1c2047c 100644 (file)
@@ -34,6 +34,7 @@ trust_proxy:
 
 # Your database name will be "peertube"+database.suffix
 database:
+  password: 'peertube'
   hostname: 'localhost'
   port: 5432
   suffix: '_prod'
index a71ed8d737182053a64e39c486a9a78da999bec1..dd1d85624368f11f15513b8f570b0223105154aa 100755 (executable)
@@ -35,7 +35,7 @@ done
 if [ "${app}" = "pleroma" ]; then
     db_pw=$(cat /etc/pleroma/config.exs | grep password | sed 's/[ ]*password\: *//g' | sed 's/,//g' | sed 's/"//g')
 elif [ "${app}" = "peertube" ]; then
-    db_pw=$(cat /var/www/peertube/config/db_password.yaml | grep password | head -1 | sed "s/[ ]*password\: *//g" | sed "s/'//g")
+    db_pw=$(cat /var/www/peertube/config/production.yaml | grep password | head -1 | sed "s/[ ]*password\: *//g" | sed "s/'//g")
 fi
 su postgres -lc "psql -c \"ALTER USER ${app} WITH PASSWORD '${db_pw}';\""
 
index 5e47f3a45cb6e77f6aac35903bf5431fffaccba3..c92be5cc40f9cb405859bfcf0d2dd2e7bae9f184 100755 (executable)
@@ -55,12 +55,10 @@ su -l peertube -c "cd peertube-latest && yarn install --production --pure-lockfi
 
 # Configure PeerTube.
 cp "${config_tree_prefix}/other_files/peertube_production.yaml" /var/www/peertube/config/production.yaml
-cp "${config_tree_prefix}/other_files/peertube_db_password.yaml" /var/www/peertube/config/db_password.yaml
 chown peertube:peertube /var/www/peertube/config/production.yaml
-chown peertube:peertube /var/www/peertube/config/db_password.yaml
 sed -i "s/admin\@example\.com/${mail}/g" config/production.yaml
 sed -i "s/example\.com/${domain}/g" config/production.yaml
-sed -i "s/password: 'REPLACE_ME'/password: '${db_pw}'/g" config/db_password.yaml
+sed -i "s/password: 'peertube'/password: '${db_pw}'/g" config/production.yaml
 
 # Configure NGINX.
 cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube