2023-06-11 11:16:54 +02:00
|
|
|
all: build
|
|
|
|
|
2023-06-15 20:14:27 +02:00
|
|
|
# For requests where authentication is required.
|
|
|
|
LOGIN ?=
|
|
|
|
ifeq ($(LOGIN),)
|
|
|
|
LOGIN_OPT =
|
|
|
|
else
|
|
|
|
LOGIN_OPT = -l $(LOGIN)
|
|
|
|
endif
|
2023-05-08 21:42:05 +02:00
|
|
|
|
|
|
|
# No idea why, but I need that to run applications. Ignore that.
|
2023-06-27 20:31:02 +02:00
|
|
|
#LD_P ?= LD_PRELOAD=/usr/local/lib/libipc.so.0
|
|
|
|
|
|
|
|
Q ?= @
|
2023-05-08 21:42:05 +02:00
|
|
|
|
2023-06-15 20:14:27 +02:00
|
|
|
####################
|
|
|
|
### REQUEST EXAMPLES
|
|
|
|
####################
|
2023-05-08 21:42:05 +02:00
|
|
|
|
2023-06-15 20:14:27 +02:00
|
|
|
DOMAIN ?= example.com
|
2023-06-28 02:26:12 +02:00
|
|
|
build-write-zone-file: tools/write-zone-file.cr
|
|
|
|
$(Q)-([ ! -f bin/write-zone-file ] || [ tools/write-zone-file.cr -nt bin/write-zone-file ]) && shards build write-zone-file
|
|
|
|
zone-file: build-write-zone-file
|
|
|
|
$(Q)./bin/write-zone-file $(DOMAIN)
|
|
|
|
|
|
|
|
build-write-template-zone-file: tools/write-template-zone-file.cr
|
|
|
|
$(Q)-([ ! -f bin/write-template-zone-file ] || [ tools/write-template-zone-file.cr -nt bin/write-template-zone-file ]) && shards build write-template-zone-file
|
|
|
|
zone-basic-template-file: build-write-template-zone-file
|
|
|
|
$(Q)./bin/write-template-zone-file $(DOMAIN)
|
2023-05-08 21:42:05 +02:00
|
|
|
|
|
|
|
VERBOSITY ?= 4
|
|
|
|
run-client-verbosity:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client admin maintenance verbosity $(VERBOSITY) $(LOGIN_OPT)
|
2023-05-08 21:42:05 +02:00
|
|
|
|
2023-06-27 13:00:26 +02:00
|
|
|
run-client-domain-add:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user domain add $(DOMAIN) $(LOGIN_OPT)
|
2023-06-27 13:00:26 +02:00
|
|
|
|
|
|
|
run-client-domain-del:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user domain del $(DOMAIN) $(LOGIN_OPT)
|
2023-06-27 13:00:26 +02:00
|
|
|
|
2023-06-27 13:06:05 +02:00
|
|
|
run-client-domain-list:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user domain list $(LOGIN_OPT)
|
2023-06-27 13:06:05 +02:00
|
|
|
|
2023-05-08 21:42:05 +02:00
|
|
|
run-client-zone-add:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user zone add $(DOMAIN).json $(LOGIN_OPT)
|
2023-05-08 21:42:05 +02:00
|
|
|
|
2023-06-27 13:06:05 +02:00
|
|
|
run-client-zone-get:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user zone get $(DOMAIN) $(LOGIN_OPT)
|
2023-06-27 13:06:05 +02:00
|
|
|
|
2023-05-08 21:42:05 +02:00
|
|
|
RRID ?= 1
|
|
|
|
NAME ?=
|
|
|
|
TTL ?= 3600
|
|
|
|
TARGET ?=
|
|
|
|
run-client-rr-add-a:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user rr add A $(DOMAIN) $(NAME) $(TTL) $(TARGET) $(LOGIN_OPT)
|
2023-06-16 00:06:14 +02:00
|
|
|
|
2023-05-08 21:42:05 +02:00
|
|
|
run-client-rr-update-a:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user rr update A $(DOMAIN) $(RRID) $(NAME) $(TTL) $(TARGET) $(LOGIN_OPT)
|
2023-05-08 21:42:05 +02:00
|
|
|
|
|
|
|
run-client-rr-del:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanager-client user rr del $(DOMAIN) $(RRID) $(LOGIN_OPT)
|
2023-05-08 21:42:05 +02:00
|
|
|
|
2023-06-15 20:14:27 +02:00
|
|
|
##################
|
|
|
|
### SETUP COMMANDS
|
|
|
|
##################
|
2023-05-08 21:42:05 +02:00
|
|
|
|
|
|
|
run-dnsmanagerd:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)$(LD_P) ./bin/dnsmanagerd -v $(VERBOSITY) -r /tmp/DATA-dnsmanagerd
|
2023-06-15 20:14:27 +02:00
|
|
|
|
|
|
|
build-server:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)shards build dnsmanagerd
|
2023-06-15 20:14:27 +02:00
|
|
|
|
|
|
|
build-client:
|
2023-06-27 20:31:02 +02:00
|
|
|
$(Q)shards build dnsmanager-client
|
2023-06-15 20:14:27 +02:00
|
|
|
|
|
|
|
build: build-server build-client
|
2023-06-15 13:06:55 +02:00
|
|
|
|
|
|
|
print-messages:
|
|
|
|
cat src/requests/*.cr | ./bin/get-messages.awk
|
|
|
|
print-message-numbers:
|
|
|
|
make -s print-messages | grep -E "^[0-9]" | sort -n
|
|
|
|
print-messages-without-comments:
|
|
|
|
make -s print-messages | grep -vE '^[[:blank:]]+#'
|
|
|
|
print-response-messages:
|
|
|
|
cat src/responses/*.cr | ./bin/get-messages.awk
|
|
|
|
print-response-message-numbers:
|
|
|
|
make -s print-response-messages | grep -E "^[0-9]" | sort -n
|
|
|
|
print-response-messages-without-comments:
|
|
|
|
make -s print-response-messages | grep -vE '^[[:blank:]]+#'
|