jdormit-infra/prod/syncthing/packer/Makefile
2020-12-31 16:22:41 -05:00

40 lines
1.4 KiB
Makefile

.PHONY: packer reissue-certs
packer-manifest.json: syncthing-config.xml \
syncthing.json \
syncthing.conf \
syncthing@.service \
syncthing-cert.pem \
syncthing-key.pem \
certbot/live/syncthing.jeremydormitzer.com/fullchain.pem \
certbot/live/syncthing.jeremydormitzer.com/privkey.pem
packer build syncthing.json
syncthing-config.xml: syncthing-config.xml.template
sigil -p -f syncthing-config.xml.template > syncthing-config.xml
syncthing-cert.pem: syncthing-cert.pem.template
sigil -p -f syncthing-cert.pem.template > syncthing-cert.pem
syncthing-key.pem: syncthing-key.pem.template
sigil -p -f syncthing-key.pem.template > syncthing-key.pem
certbot/live/syncthing.jeremydormitzer.com/fullchain.pem certbot/live/syncthing.jeremydormitzer.com/privkey.pem &: do.ini
certbot certonly -n \
--agree-tos \
--email ${CERTBOT_EMAIL} \
--dns-digitalocean \
--dns-digitalocean-credentials do.ini \
--config-dir ./certbot \
--work-dir ./certbot \
--logs-dir ./certbot \
-d syncthing.jeremydormitzer.com
do.ini: do.ini.template
sigil -p -f do.ini.template > do.ini
chmod 600 do.ini
reissue-certs:
rm -rf certbot
make