X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=inline;f=buster%2Fsetup_scripts%2Fsetup_peertube.sh;h=fb9afc95b333adfbc484f008ebc56cb2332fd34d;hb=33482474cac87e876802cc8a0bd140170feb35cf;hp=2465cfe8ba427cb85dc19de3403bdeea3fcf1607;hpb=351f9b0436306281916820c3ec7f46ce5f14fe27;p=config
diff --git a/buster/setup_scripts/setup_peertube.sh b/buster/setup_scripts/setup_peertube.sh
index 2465cfe..fb9afc9 100755
--- a/buster/setup_scripts/setup_peertube.sh
+++ b/buster/setup_scripts/setup_peertube.sh
@@ -15,15 +15,10 @@ mail="$2"
# Install dependencies, set up firewall.
config_tree_prefix="${HOME}/config/buster"
-./install_for_target.sh peertube
+./install_for_target.sh web peertube
./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web
nft -f /etc/nftables.conf
-# Set up letsencrypt certificate. TODO: Is it auto-renewed?
-ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
-certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}"
-rm /etc/nginx/sites-enabled/default
-
# Get NodeJS. See
#
curl -sL https://deb.nodesource.com/setup_10.x | bash -
@@ -54,14 +49,21 @@ 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
+chown peertube:peertube /var/www/peertube/config/production.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
+# Set up letsencrypt certificate. TODO: Is it auto-renewed?
+ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
+certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}"
+rm /etc/nginx/sites-enabled/default
+
# 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
+sed -i -E 's/^([[:space:]]*)(access_log|error_log)([[:space:]])/\1# \2\3/g' /etc/nginx/sites-available/peertube
ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
# Configure systemd and start PeerTube through it.