all: build # For requests where authentication is required. LOGIN ?= ifeq ($(LOGIN),) LOGIN_OPT = else LOGIN_OPT = -l $(LOGIN) endif # No idea why, but I need that to run applications. Ignore that. #LD_P ?= LD_PRELOAD=/usr/local/lib/libipc.so.0 Q ?= @ #################### ### REQUEST EXAMPLES #################### DOMAIN ?= example.com zone-file: crystal run ./tools/write-zone-file.cr -- $(DOMAIN) VERBOSITY ?= 4 run-client-verbosity: $(Q)$(LD_P) ./bin/dnsmanager-client admin maintenance verbosity $(VERBOSITY) $(LOGIN_OPT) run-client-domain-add: $(Q)$(LD_P) ./bin/dnsmanager-client user domain add $(DOMAIN) $(LOGIN_OPT) run-client-domain-del: $(Q)$(LD_P) ./bin/dnsmanager-client user domain del $(DOMAIN) $(LOGIN_OPT) run-client-domain-list: $(Q)$(LD_P) ./bin/dnsmanager-client user domain list $(LOGIN_OPT) run-client-zone-add: $(Q)$(LD_P) ./bin/dnsmanager-client user zone add $(DOMAIN).json $(LOGIN_OPT) run-client-zone-get: $(Q)$(LD_P) ./bin/dnsmanager-client user zone get $(DOMAIN) $(LOGIN_OPT) RRID ?= 1 NAME ?= TTL ?= 3600 TARGET ?= run-client-rr-add-a: $(Q)$(LD_P) ./bin/dnsmanager-client user rr add A $(DOMAIN) $(NAME) $(TTL) $(TARGET) $(LOGIN_OPT) run-client-rr-update-a: $(Q)$(LD_P) ./bin/dnsmanager-client user rr update A $(DOMAIN) $(RRID) $(NAME) $(TTL) $(TARGET) $(LOGIN_OPT) run-client-rr-del: $(Q)$(LD_P) ./bin/dnsmanager-client user rr del $(DOMAIN) $(RRID) $(LOGIN_OPT) ################## ### SETUP COMMANDS ################## run-dnsmanagerd: $(Q)$(LD_P) ./bin/dnsmanagerd -v $(VERBOSITY) -r /tmp/DATA-dnsmanagerd build-server: $(Q)shards build dnsmanagerd build-client: $(Q)shards build dnsmanager-client build: build-server build-client 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:]]+#'