rsyncd password handled by gopass

main
Ricard Illa 2022-09-23 10:32:48 +02:00
parent 06e219f94c
commit e6a8714e62
1 changed files with 8 additions and 3 deletions

View File

@ -23,15 +23,20 @@ KEY=$(CERT_PATH)/$(DOMAIN).key
$(CERT): sync_certs $(CERT): sync_certs
$(KEY): sync_certs $(KEY): sync_certs
REMOTE_ACME_PATH=rsync://user@narwhal/acme RSYNCD_HOST=narwhal
RSYNCD_PASSWD=/srv/secrets/rsyncd_password RSYNCD_USER=user
GOPASS=doas -u gopass gopass
RSYNC_PASSWORD = $(shell $(GOPASS) $(RSYNCD_HOST)/rsyncd/$(RSYNCD_USER))
REMOTE_ACME_PATH=rsync://$(RSYNCD_USER)@$(RSYNCD_HOST)/acme
RSYNC_OPTS=--archive --delete --acls --xattrs --compress --verbose --human-readable RSYNC_OPTS=--archive --delete --acls --xattrs --compress --verbose --human-readable
sync_certs: sync_certs:
mkdir -p $(ACME_DIR) mkdir -p $(ACME_DIR)
RSYNC_PASSWORD=$(RSYNC_PASSWORD); \
rsync \ rsync \
$(RSYNC_OPTS) \ $(RSYNC_OPTS) \
--password-file=$(RSYNCD_PASSWD) \
$(REMOTE_ACME_PATH) \ $(REMOTE_ACME_PATH) \
$(ACME_DIR) $(ACME_DIR)