Allow IP address specification for Apache, though no way yet to do anything but defau...
[hcoop/domtool2.git] / lib / easy_domain.dtl
1 {{The most common kinds of domain configuration}}
2
3 val default_node : (node) = "mire";
4 val web_node : (web_node) = "mire";
5
6 val webAt =
7 \ n : (web_node) ->
8 \ host : (host) ->
9 \\ config : Vhost ->
10 (dns (dnsA host (ip_of_node (web_node_to_node n)));
11
12 vhost host where
13 WebNodes = [n]
14 with
15 config
16 end);
17
18 val web = webAt web_node;
19
20 val addDefaultAlias = begin
21 mailbox <- Mailbox;
22 defaultAlias mailbox
23 end;
24
25 val addWww = begin
26 web "www" with
27 serverAliasDefault;
28 www : [Vhost] <- WWW;
29 www
30 end
31 end;
32
33 val domNoWwwNoDefaultAlias =
34 \ d : (your_domain) ->
35 \\ config : Domain ->
36 domain d with
37 dns (dnsNS "ns1.hcoop.net");
38 dns (dnsNS "ns3.hcoop.net");
39
40 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
41
42 handleMail;
43 dns (dnsMX 1 "deleuze.hcoop.net");
44
45 config
46 end;
47
48 val domNoDefaultAlias =
49 \ d : (your_domain) ->
50 \\ config : Domain ->
51 domNoWwwNoDefaultAlias d with
52 addWww;
53 config
54 end;
55
56 val domNoWww =
57 \ d : (your_domain) ->
58 \\ config : Domain ->
59 domNoWwwNoDefaultAlias d with
60 config;
61 addDefaultAlias;
62 end;
63
64 val dom =
65 \ d : (your_domain) ->
66 \\ config : Domain ->
67 domNoDefaultAlias d with
68 config;
69 addDefaultAlias;
70 end;
71
72 val nameserver = \host -> dns (dnsNS host);
73 val dnsIP = \from -> \to -> dns (dnsA from to);
74 val dnsMail = \num -> \host -> dns (dnsMX num host);
75 val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
76 val dnsDefault = \to -> dns (dnsDefaultA to);