home · contact · privacy
Add local PeerTube config.
[config] / buster / setup_scripts / setup_peertube.sh
old mode 100644 (file)
new mode 100755 (executable)
index 77c9302..5e47f3a
@@ -1,6 +1,6 @@
 #!/bin/sh
 set -e
-set -x
+
 # Heavily inspired by
 # <https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/production.md>
 # and
@@ -54,19 +54,24 @@ su -l peertube -c "ln -s peertube-${VERSION} ./peertube-latest"
 su -l peertube -c "cd peertube-latest && yarn install --production --pure-lockfile"
 
 # Configure PeerTube.
-cd /var/www/peertube && su -l peertube -c "cp peertube-latest/config/production.yaml.example config/production.yaml"
+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: 'peertube'/password: '${db_pw}'/g" config/production.yaml
+sed -i "s/password: 'REPLACE_ME'/password: '${db_pw}'/g" config/db_password.yaml
 
 # Configure NGINX.
 cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
 sed -i "s/peertube.example.com/${domain}/g" /etc/nginx/sites-available/peertube
 ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
-service nginx restart
 
 # Configure systemd and start PeerTube through it.
 cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
 systemctl daemon-reload
 systemctl enable peertube
 systemctl start peertube
+
+# Restart NGINX.
+service nginx restart