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 user.
adduser --system --shell /bin/false --home /opt/pleroma pleroma
cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx
sed -i "s/example\.tld/${domain}/g" /etc/nginx/sites-available/pleroma.nginx
ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx
-rm /etc/nginx/sites-enabled/default
# Systemd integration.
cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service