chiark / gitweb /
hosts.lisp: Fix IPv6 network address for Jump.
[zones] / Makefile
index 8c65965c32d04af855f2fa1e7f604b73643601aa..9199918eadb4e27290c47bbc797a1eee98712eae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,6 @@ CHECKZONE              = named-checkzone -i full \
 MASTER                  = localhost
 inside_MASTER           = precision
 
-
 ifeq ($(MASTER),localhost)
 ZONEINST                = userv zoneconf install
 else
@@ -63,33 +62,45 @@ ZONESETS             =
 ZONESETS               += distorted
 
 distorted_VIEWS                 = inside outside
-distorted_outside_NETS  = dmz jump
-distorted_inside_NETS   = unsafe colo
+distorted_outside_NETS  = dmz
+distorted_inside_NETS   = any unsafe vpn upn
 
 distorted_all_ZONES    += distorted.org.uk
-distorted_all_ZONES    += 199.29.172.in-addr.arpa
 
-###--------------------------------------------------------------------------
-### The harlequin.org.uk zones.
+distorted_all_ZONES    += 195.113.2.81.in-addr.arpa
+distorted_all_ZONES    += 128-143.238.187.81.in-addr.arpa
+distorted_all_ZONES    += 64-79.12.169.217.in-addr.arpa
+distorted_all_ZONES    += 2.9.c.0.0.b.8.0.1.0.0.2.ip6.arpa
 
-ZONESETS               += harlequin
+distorted_all_ZONES    += 199.29.172.in-addr.arpa
 
-harlequin_VIEWS                 = outside
-harlequin_all_ZONES     = harlequin.org.uk
+distorted_outside_NSDIFF = -sradius.dmz.distorted.org.uk
 
 ###--------------------------------------------------------------------------
-### The felixpearce.com zones.
+### Other zones.
+
+## binswood.org.uk
+ZONESETS               += binswood
+binswood_VIEWS          = outside
+binswood_all_ZONES     += binswood.org.uk
+binswood_all_ZONES     += 27.165.10.in-addr.arpa
 
-ZONESETS               += felixpearce
+## escorted.org.uk
+ZONESETS               += escorted
+escorted_VIEWS          = outside
+escorted_all_ZONES     += escorted.org.uk
 
-felixpearce_VIEWS       = outside
-felixpearce_all_ZONES   = felixpearce.com
+## odin.gg
+ZONESETS               += odin
+odin_VIEWS              = outside
+odin_all_ZONES          = odin.gg
 
 ###--------------------------------------------------------------------------
 ### Zone construction machinery.
 
 ZONE                    = zone
 V_ZONE                  = $(call v_tag,ZONE)$(ZONE)
+ZONEOPTS                =
 
 .SECONDEXPANSION: #sorry
 
@@ -101,7 +112,7 @@ $(ALL_ZONESTAMPS) : %.zonestamp : $$(notdir $$*).lisp hosts.lisp
        $(V_AT)mkdir -p $(dir $*)
        $(V_ZONE) -d$(dir $*) -fview/$(call dir-nosl,$*)$(hack \
                hack) $(addprefix -s, \
-               $($(notdir $*)_$(call dir-nosl,$*)_NETS)) $<
+               $($(notdir $*)_$(call dir-nosl,$*)_NETS)) $(ZONEOPTS) $<
        $(V_AT)touch $@
 all: $(ALL_ZONESTAMPS)
 CLEANFILES += $(sort $(foreach s,$(ZONESETS), \
@@ -119,6 +130,12 @@ $(foreach s,$(ZONESETS), \
     $(foreach z,$($s_all_ZONES) $($s_$v_ZONES), \
       $(eval $v/$z.zone: $v/$s.zonestamp))))
 
+## Prepare a mapping from zone names back to their owning zonesets.
+$(foreach s,$(ZONESETS), \
+  $(foreach z,$(sort $(foreach v,$($s_VIEWS), \
+       $($s_all_ZONES) $($s_$v_ZONES))), \
+    $(eval $z_ZONESET = $s)))
+
 ## Now we have to check the individual zone files.
 ALL_ZONECHECKS = $(foreach s,$(ZONESETS), \
        $(foreach v,$($s_VIEWS), \
@@ -131,6 +148,21 @@ $(ALL_ZONECHECKS) : %.check : %.zone
 check: $(ALL_ZONECHECKS)
 .PHONY: check $(ALL_ZONECHECKS)
 
+## If nsdiff(1) is available then we can show what changes we will make if
+## we install the new zone files.
+ALL_ZONEDIFFS = $(foreach s,$(ZONESETS), \
+       $(foreach v,$($s_VIEWS), \
+         $(foreach z,$($s_all_ZONES) $($s_$v_ZONES), \
+           $v/$z.zonediff)))
+run-nsdiff = nsdiff -v "" $2 \
+       $($($(call notdir,$1)_ZONESET)_$(call dir-nosl,$1)_NSDIFF) \
+       $(call notdir,$1) $1.zone
+$(ALL_ZONEDIFFS) : %.zonediff : %.zone
+       $(call v_tag,NSDIFF)$(call run-nsdiff,$*,-q); \
+       rc=$$?; case $$rc in 1) $(call run-nsdiff,$*); rc=$$? ;; esac; \
+       case $$rc in 0 | 1) : ;; *) exit $$rc ;; esac
+diff: $(ALL_ZONEDIFFS)
+
 ## Finally we have to install the zone files.
 ALL_INSTALLS = $(foreach s,$(ZONESETS), \
        $(foreach v,$($s_VIEWS), \