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