easy_domain: enable ipv6
authorClinton Ebadi <clinton@unknownlamer.org>
Wed, 26 Dec 2018 02:44:32 +0000 (21:44 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Wed, 26 Dec 2018 02:44:32 +0000 (21:44 -0500)
web and dom will generate AAAA records by default now.

Adapt for ipv6 changes to web_place; this makes webAtIp somewhat
awkward -- users have to be assigned both an IPv4 and IPv6 address,
and specify both.

lib/easy_domain.dtl

index 5335fbe..fbee762 100644 (file)
@@ -3,6 +3,7 @@
 val web_node : (web_node) = "shelob";
 val default_node : (node) = web_node_to_node web_node;
 val web_ip = ip_of_node (web_node_to_node web_node);
+val web_ipv6 = ipv6_of_node (web_node_to_node web_node);
 
 var WebPlaces = [web_place_default web_node];
 
@@ -11,6 +12,7 @@ val webAt =
   \ host : (host) ->
   \\ config : Vhost -> begin
     dns (dnsA (literal host) (ip_of_node (web_node_to_node n)));
+    dns (dnsAAAA (literal host) (ipv6_of_node (web_node_to_node n)));
 
     vhost host where
       WebPlaces = [web_place_default n]
@@ -26,12 +28,14 @@ end;
 
 val webAtIp =
   \ ip : (your_ip) ->
+  \ ipv6 : (your_ipv6) ->
   \ host : (host) ->
   \\ config : Vhost -> begin
     dns (dnsA (literal host) (your_ip_to_ip ip));
+    dns (dnsAAAA (literal host) (your_ipv6_to_ipv6 ip));
 
     vhost host where
-      WebPlaces = [web_place web_node ip]
+      WebPlaces = [web_place web_node ip ipv6]
     with
       config
     end
@@ -82,7 +86,8 @@ val dom =
 
     defa : bool <- DefaultA;
     if defa then
-      dns (dnsA default (ip_of_node (web_node_to_node user_web_node)))
+      dns (dnsA default (ip_of_node (web_node_to_node user_web_node)));
+      dns (dnsAAAA default (ipv6_of_node (web_node_to_node user_web_node)))
     else
       Skip
     end;