add certbot and web deployment scripts

This commit is contained in:
Daniel Micay 2025-10-19 12:21:05 -04:00
parent e84c84db6b
commit 04d0489e57
3 changed files with 55 additions and 0 deletions

23
deploy-web Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
. shared.sh
. hosts.sh
for host in ${hosts_web[@]}; do
remote=root@$host
echo
echo $host
echo
ssh $remote ln -snf /usr/lib/nginx/modules/ /etc/nginx/modules
rsync etc/systemd/system/{create-session-ticket-keys.service,rotate-session-ticket-keys.service,rotate-session-ticket-keys.timer} $remote:/etc/systemd/system/
rsync --chmod=755 create-session-ticket-keys rotate-session-ticket-keys $remote:/usr/local/bin/
rsync -r --delete etc/systemd/system/nginx.service.d/ $remote:/etc/systemd/system/nginx.service.d
ssh $remote "groupadd -fg 2100 tls
mkdir -p -m 750 /etc/session-ticket-keys && chgrp tls /etc/session-ticket-keys
systemctl daemon-reload &&
systemctl enable create-session-ticket-keys.service rotate-session-ticket-keys.timer nginx"
done