Some more mod_autoindex directives
[hcoop/domtool2.git] / lib / easy_domain.dtl
... / ...
CommitLineData
1{{The most common kinds of domain configuration}}
2
3val default_node : (node) = "mire";
4val web_node : (web_node) = "mire";
5
6val webAt =
7 \ n : (web_node) ->
8 \ host : (host) ->
9 \\ config : Vhost -> begin
10 dns (dnsA host (ip_of_node (web_node_to_node n)));
11
12 vhost host where
13 WebPlaces = [web_place_default n]
14 with
15 config
16 end
17 end;
18
19val web = webAt web_node;
20
21val webAtIp =
22 \ ip : (your_ip) ->
23 \ host : (host) ->
24 \\ config : Vhost -> begin
25 dns (dnsA host (your_ip_to_ip ip));
26
27 vhost host where
28 WebPlaces = [web_place web_node ip]
29 with
30 config
31 end
32 end;
33
34val addDefaultAlias = begin
35 mailbox <- Mailbox;
36 defaultAlias mailbox
37end;
38
39val addWww = begin
40 web "www" with
41 serverAliasDefault;
42 www : [Vhost] <- WWW;
43 www
44 end
45end;
46
47val dom =
48 \ d : (your_domain) ->
49 \\ config : Domain ->
50 domain d with
51 dns (dnsNS "ns1.hcoop.net");
52 dns (dnsNS "ns3.hcoop.net");
53
54 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
55
56 handleMail;
57 dns (dnsMX 1 "deleuze.hcoop.net");
58
59 createWWW : bool <- CreateWWW;
60 if createWWW then
61 addWww
62 else
63 Skip
64 end;
65
66 defAl : bool <- DefaultAlias;
67 if defAl then
68 addDefaultAlias
69 else
70 Skip
71 end;
72
73 config
74 end;
75
76val nameserver = \host -> dns (dnsNS host);
77val dnsIP = \from -> \to -> dns (dnsA from to);
78val dnsIPv6 = \from -> \to -> dns (dnsAAAA from to);
79val dnsMail = \num -> \host -> dns (dnsMX num host);
80val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
81val dnsDefault = \to -> dns (dnsDefaultA to);
82val dnsDefaultv6 = \to -> dns (dnsDefaultAAAA to);
83val dnsText = \from -> \to -> dns (dnsTXT from to);
84val dnsDefaultText = \to -> dns (dnsDefaultTXT to);