From: Adam Chlipala Date: Sun, 18 Nov 2007 18:09:56 +0000 (+0000) Subject: your_ip_to_ip X-Git-Tag: release_2010-11-19~116 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/2e87719caa8c0cc98c573a2071a3c9c7cd503632?hp=b5f2d506092c97a597d8f275776dcb76c2525796 your_ip_to_ip --- diff --git a/lib/domain.dtl b/lib/domain.dtl index 8946633..2b17089 100644 --- a/lib/domain.dtl +++ b/lib/domain.dtl @@ -10,6 +10,7 @@ extern type ip; {{An IP address}} extern type your_ip; +extern val your_ip_to_ip : your_ip -> ip; {{An IP address that you're authorized to use; e.g., for an SSL web host}} extern type host; diff --git a/lib/easy_domain.dtl b/lib/easy_domain.dtl index 82c66bf..c4b3d4f 100644 --- a/lib/easy_domain.dtl +++ b/lib/easy_domain.dtl @@ -17,6 +17,19 @@ val webAt = val web = webAt web_node; +val webAtIp = + \ ip : (your_ip) -> + \ host : (host) -> + \\ config : Vhost -> begin + dns (dnsA host (your_ip_to_ip ip)); + + vhost host where + WebPlaces = [web_place web_node ip] + with + config + end + end; + val addDefaultAlias = begin mailbox <- Mailbox; defaultAlias mailbox diff --git a/src/domain.sml b/src/domain.sml index 6d7f2ac..3998b83 100644 --- a/src/domain.sml +++ b/src/domain.sml @@ -191,6 +191,10 @@ val _ = Env.type_one "node" Env.string validNode +val _ = Env.registerFunction ("your_ip_to_ip", + fn [e] => SOME e + | _ => NONE) + val _ = Env.registerFunction ("dns_node_to_node", fn [e] => SOME e | _ => NONE)