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}';\""
 
 
 
 # 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