From 8821ee8a466f546d4746a01ac578fc8d5c9dca02 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Mon, 8 May 2023 21:42:05 +0200 Subject: [PATCH] Add a makefile with a lot of examples. --- Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..659af18 --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +all: run-dnsmanagerd + +# No idea why, but I need that to run applications. Ignore that. +LD_P ?= LD_PRELOAD=/usr/local/lib/libipc.so.0 + +DOMAIN ?= example.com +KEY_FILE ?= /tmp/KEY +setup: + @echo -n "coucou" > $(KEY_FILE) + +zone-file: + crystal run ./tools/write-zone-file.cr -- $(DOMAIN) + +build-server: + shards build dnsmanagerd + +build-client: + shards build dnsmanager-client + +VERBOSITY ?= 4 +run-client-verbosity: + @$(LD_P) ./bin/dnsmanager-client admin maintenance -k $(KEY_FILE) verbosity $(VERBOSITY) + +run-client-zone-add: + @$(LD_P) ./bin/dnsmanager-client user zone add $(DOMAIN).json + +run-client-zone-del: + @$(LD_P) ./bin/dnsmanager-client user zone del $(DOMAIN) + +RRID ?= 1 +NAME ?= +TTL ?= 3600 +TARGET ?= +run-client-rr-add-a: + @$(LD_P) ./bin/dnsmanager-client user rr add A $(DOMAIN) $(NAME) $(TTL) $(TARGET) +run-client-rr-update-a: + @$(LD_P) ./bin/dnsmanager-client user rr update A $(DOMAIN) $(RRID) $(NAME) $(TTL) $(TARGET) + +run-client-rr-del: + @$(LD_P) ./bin/dnsmanager-client user rr del $(DOMAIN) $(RRID) + +run-client-zone-get: + @$(LD_P) ./bin/dnsmanager-client user zone get $(DOMAIN) + +run-client-zone-list: + @$(LD_P) ./bin/dnsmanager-client user zone list + +run-dnsmanagerd: + @$(LD_P) ./bin/dnsmanagerd -v 4 -r /tmp/DATA-dnsmanagerd -k $(KEY_FILE)