5 if [ "$#" -ne 2 ]; then
6 echo 'Need domain name and mail.'
12 # Install configs, set up firewall.
13 config_tree_prefix="${HOME}/config/buster"
14 ./install_for_target.sh web dumpsite
15 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web dumpsite
16 nft -f /etc/nftables.conf
18 # Set up letsencrypt certificate. TODO: Is it auto-renewed?
19 ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
20 certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}"
21 rm /etc/nginx/sites-enabled/default
25 chown plom:plom /var/www-dump
28 su -lc "mkdir ${dump_dir} ${geheim_dir}"
29 su -lc "ln -s /home/plom/${dump_dir} /var/www-dump/${dump_dir}" plom
30 su -lc "ln -s /home/plom/${geheim_dir} /var/www-dump/${geheim_dir}" plom
31 password_geheim=$(pwgen -1)
32 echo "foo:{PLAIN}${password_geheim}" > /var/www-dump/password_geheim
33 echo "geheim password is: ${password_geheim}"
36 sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx
37 ln -s /etc/nginx/sites-available/dumpsite.nginx /etc/nginx/sites-enabled/dumpsite.nginx