summaryrefslogtreecommitdiff
path: root/Makefile
blob: 29b95776b4e0193b8490863c59ba5f813802c11f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
control: control.sh depends.control .git/refs/heads/master
	./control.sh depends.control > $@

DD_USER = dyndns
DD_GROUP = dyndns

install-dyndns-server:
ifneq ($(shell id -u),0)
	$(SUDO_MAKE) $@
else
	: apt install pdns
	: adduser $(DD_USER)
	chown root:$(DD_GROUP) /etc/powerdns
	chown pdns:$(DD_GROUP) /etc/powerdns/powerdns.sqlite3
	chmod g+rwx /etc/powerdns
	chmod g+rw /etc/powerdns/powerdns.sqlite3
	$(MAKE) ~$(DD_USER)/.ssh/authorized_keys
	install src/samizdat-ssh-command /usr/local/bin/
	install src/dyndns-command.sh ~$(DD_USER)/samizdat-default-command
endif

define dyndns_authorized_keys_contents
command="/usr/local/bin/samizdat-ssh-command /etc/powerdns/dyndns-command.sh",no-port-forwarding * Samizdat - YES WE CAN
endef

~$(DD_USER)/.ssh/authorized_keys:
	: writing file $@  $(file >$@,$(dyndns_authorized_keys_contents))