ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
root /var/www-dump/;
- index index.html index.htm index.nginx-debian.html;
location /dump/ {
autoindex on;
auth_basic_user_file /var/www-dump/password_geheim;
autoindex on;
}
+
+ location /zettel/ {
+ # rewrite non-suffixed filenames to .html ones
+ rewrite ^(/zettel/(.*/)*[^./]+)$ $1.html;
+ autoindex on;
+ }
}
set -e
set -x
-if [ "$#" -ne 2 ]; then
- echo 'Need domain name and mail.'
+if [ "$#" -ne 3 ]; then
+ echo 'Need domain name and mail and old server.'
false
fi
domain="$1"
mail="$2"
+old_server="$3"
# Install configs, set up firewall.
config_tree_prefix="${HOME}/config/buster"
echo "foo:{PLAIN}${password_geheim}" > /var/www-dump/password_geheim
echo "geheim password is: ${password_geheim}"
+# Set up zettel and redo.
+wget http://news.dieweltistgarnichtso.net/bin/archives/redo-sh.tar.gz
+tar -moxzf redo-sh.tar.gz -C /usr/local
+cp "${config_tree_prefix}/setup_scripts/prepare_to_meet_server.sh" /home/plom/
+chown plom:plom /home/plom/prepare_to_meet_server.sh
+su -lc "./prepare_to_meet_server.sh ${old_server}" plom
+su -lc "cd /var/repos && git clone --mirror ${old_server}:zettel.git" plom
+cp "${config_tree_prefix}/other_files/zettel_hook_post-receive" /home/plom/zettel.git/hooks/
+su -lc "git clone ~/zettel.git" plom
+rm /home/plom/prepare_to_meet_server.sh
+
# Prepare NGINX.
sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx
ln -s /etc/nginx/sites-available/dumpsite.nginx /etc/nginx/sites-enabled/dumpsite.nginx