+++ /dev/null
-server {
- listen 443 ssl;
- server_name REPLACE_fqdn_ECALPER;
- ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
- root /var/www/status.plomlompom.com/;
-
- location = / {
- return 301 /users/plomlompom.html;
- }
-
- # re-direct to .html endings
- location ~ ^/(notice|users)/([^\.]*)/?$ {
- rewrite ^/(notice|users)/([^\./]*)/?$ /$1/$2.html permanent;
- }
-}
--- /dev/null
+server {
+ listen 443 ssl;
+ server_name REPLACE_fqdn_ECALPER;
+ ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
+ root /var/www/status.plomlompom.com/;
+
+ location = / {
+ return 301 /users/plomlompom.html;
+ }
+
+ # re-direct to .html endings
+ location ~ ^/(notice|users)/([^\.]*)/?$ {
+ rewrite ^/(notice|users)/([^\./]*)/?$ /$1/$2.html permanent;
+ }
+}
--- /dev/null
+server {
+ listen 443 ssl;
+ server_name REPLACE_fqdn_ECALPER;
+ ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
+ root /var/www/tube.plomlompom.com/;
+
+ # re-direct to .html endings
+ location ~ ^/videos/watch/([^\.]*)/?$ {
+ rewrite ^/videos/watch/([^\./]*)/?$ /videos/watch/$1.html permanent;
+ }
+}
domain="$1"
fi
# Install configs, set up firewall.
-./install_for_target.sh static_websites
-./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" static_websites
+./install_for_target.sh status.plomlompom.com
+./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" status.plomlompom.com
nft -f /etc/nftables.conf
# Set up letsencrypt certificate. TODO: Is it auto-renewed?
--- /dev/null
+#!/bin/sh
+set -e
+. ./misc.sh
+
+expect_setup_finished_file setup_web_has_been_run setup_web.sh
+
+if [ -z "$1"]; then
+ domain="tube.plomlompom.com"
+else
+ domain="$1"
+fi
+# Install configs, set up firewall.
+./install_for_target.sh tube.plomlompom.com
+./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" tube.plomlompom.com
+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
+
+# Prepare NGINX for tube.plomlompom.com.
+sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/tube.plomlompom.com.nginx
+ln -s /etc/nginx/sites-available/tube.plomlompom.com.nginx /etc/nginx/sites-enabled/tube.plomlompom.com.nginx
+
+service nginx restart
+