Improve easy_domain
authorAdam Chlipala <adamc@hcoop.net>
Sun, 10 Dec 2006 17:54:53 +0000 (17:54 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sun, 10 Dec 2006 17:54:53 +0000 (17:54 +0000)
Makefile
lib/domain.dtl
lib/easy_domain.dtl

index dbc2c88..4cbd293 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -95,3 +95,8 @@ install:
        cp bin/domtool-server /usr/local/sbin/
        cp bin/domtool-slave /usr/local/sbin/
        cp bin/domtool-client /usr/local/bin/domtool
+
+.PHONY: grab_lib
+
+grab_lib:
+       rsync --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/
index f2d3150..3050fa2 100644 (file)
@@ -24,6 +24,9 @@ extern type your_domain_host;
 extern type node;
 {{The name of a server controlled by domtool}}
 
+extern val ip_of_node : node -> ip;
+{{Look up the IP address of a node.}}
+
 extern type user;
 extern type group;
 {{UNIX users and groups}}
index 9a1ace5..6bc7ee0 100644 (file)
@@ -1,6 +1,20 @@
 {{The most common kinds of domain configuration}}
 
-val web_ip : (ip) = "1.2.3.4";
+val web_node : (node) = "mire";
+
+val webAt =
+       \ n : (node) ->
+       \ host : (host) ->
+       \\ config : Vhost ->
+               (dns (dnsA host (ip_of_node n));
+
+               vhost host where
+                       WebNodes = [n]
+               with
+                       config
+               end);
+
+val web = webAt web_node;
 
 val dom =
        \ d : (your_domain) ->
@@ -9,13 +23,11 @@ val dom =
                        dns (dnsNS "ns.hcoop.net");
                        dns (dnsNS "ns2.hcoop.net");
 
-                       dns (dnsA "www" web_ip);
-
                        handleMail;
                        mailbox <- Mailbox;
                        catchAllAlias mailbox;
 
-                       vhost "www" with
+                       web "www" with
                        end;
 
                        config