X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/15e529d64183f2116fd7455c2bc495963fba68c6..4f9c5b51c146b0d87a975157d1e90ba316470326:/lib/easy_domain.dtl diff --git a/lib/easy_domain.dtl b/lib/easy_domain.dtl index 6bc7ee0..cb63932 100644 --- a/lib/easy_domain.dtl +++ b/lib/easy_domain.dtl @@ -1,12 +1,13 @@ {{The most common kinds of domain configuration}} -val web_node : (node) = "mire"; +val default_node : (node) = "mire"; +val web_node : (web_node) = "mire"; val webAt = - \ n : (node) -> + \ n : (web_node) -> \ host : (host) -> \\ config : Vhost -> - (dns (dnsA host (ip_of_node n)); + (dns (dnsA host (ip_of_node (web_node_to_node n))); vhost host where WebNodes = [n] @@ -16,19 +17,60 @@ val webAt = val web = webAt web_node; -val dom = +val addDefaultAlias = begin + mailbox <- Mailbox; + defaultAlias mailbox +end; + +val addWww = begin + web "www" with + serverAliasDefault; + www : [Vhost] <- WWW; + www + end +end; + +val domNoWwwNoDefaultAlias = \ d : (your_domain) -> \\ config : Domain -> domain d with - dns (dnsNS "ns.hcoop.net"); - dns (dnsNS "ns2.hcoop.net"); + dns (dnsNS "ns1.hcoop.net"); + dns (dnsNS "ns3.hcoop.net"); - handleMail; - mailbox <- Mailbox; - catchAllAlias mailbox; + dns (dnsDefaultA (ip_of_node (web_node_to_node web_node))); - web "www" with - end; + handleMail; + dns (dnsMX 1 "deleuze.hcoop.net"); config end; + +val domNoDefaultAlias = + \ d : (your_domain) -> + \\ config : Domain -> + domNoWwwNoDefaultAlias d with + addWww; + config + end; + +val domNoWww = + \ d : (your_domain) -> + \\ config : Domain -> + domNoWwwNoDefaultAlias d with + config; + addDefaultAlias; + end; + +val dom = + \ d : (your_domain) -> + \\ config : Domain -> + domNoDefaultAlias d with + config; + addDefaultAlias; + end; + +val nameserver = \host -> dns (dnsNS host); +val dnsIP = \from -> \to -> dns (dnsA from to); +val dnsMail = \num -> \host -> dns (dnsMX num host); +val dnsAlias = \from -> \to -> dns (dnsCNAME from to); +val dnsDefault = \to -> dns (dnsDefaultA to);