Files
dmzconf/wg.mk

25 lines
706 B
Makefile

public_key = $(shell cat /etc/wireguard/dmz_public_key)
name := $(shell git config list | grep user.nam | cut -d= -f2)
# Local keys
wireguard/dmz_private_key: | /bin/wg wireguard/
wg genkey > $@
chmod 700 $@
wireguard/dmz_public_key: wireguard/dmz_private_key | /bin/wg
$| pubkey < $< > $@
##############################
wgkeys.rec: wireguard/dmz_public_key
$(info Adding wireguard key as '$(name)')
recins --verbose $@ -t $(basename $@) -f name -v '$(name)' -f pubkey -v '$(shell cat $<)'
git add $@
git commit -m"add wireguard key for $(name)"
$(info Remember to git push)
wireguard/dmz.conf: xecut/nimbus/dmz.conf | wireguard/dmz_private_key
sed 's/PRIVATE_KEY/$(shell cat $|)/' $< > $@