home · contact · privacy
Fix PeerTube config DB password bug.
[config] / buster / setup_scripts / restore_peertube.sh
1 #!/bin/sh
2 set -e
3
4 service peertube stop
5 mv /home/plom/peertube_backup.tar /tmp/
6 cd /tmp
7 tar xf peertube_backup.tar
8 cp -a peertube_backup/storage/* /var/www/peertube/storage/
9 cp -a peertube_backup/config/* /var/www/peertube/config/
10 su postgres -c 'pg_restore -c -C -d postgres peertube_backup/peertube_prod-dump.db'
11
12 db_pw=$(cat /var/www/peertube/config/production.yaml | grep password | head -1 | sed "s/[ ]*password\: *//g" | sed "s/'//g")
13 su postgres -lc "psql -c \"ALTER USER peertube WITH PASSWORD '${db_pw}';\""
14
15 service peertube start