Catch-all aliases working again
[hcoop/zz_old/domtool2-proto.git] / lib / easy_domain.dtl
CommitLineData
bf9b0bc3 1{{The most common kinds of domain configuration}}
2
a54ae325 3val default_node : (node) = "mire";
4cb2e7e7 4val web_node : (web_node) = "mire";
ae175ff1 5
6val webAt =
4cb2e7e7 7 \ n : (web_node) ->
ae175ff1 8 \ host : (host) ->
9 \\ config : Vhost ->
4cb2e7e7 10 (dns (dnsA host (ip_of_node (web_node_to_node n)));
ae175ff1 11
12 vhost host where
7cfb21d8 13 WebPlaces = [web_place_default n]
ae175ff1 14 with
15 config
16 end);
17
18val web = webAt web_node;
bf9b0bc3 19
f4018a6e 20val webAtIp =
21 \ ip : (your_ip) ->
22 \ host : (host) ->
23 \\ config : Vhost -> begin
24 dns (dnsA host (your_ip_to_ip ip));
25
26 vhost host where
27 WebPlaces = [web_place web_node ip]
28 with
29 config
30 end
31 end;
32
3f71121b 33val catchAllAlias = \ mailbox -> aliasPrim catchAllSource (addressTarget mailbox);
34
35val addCatchAllAlias = begin
446f4d45 36 mailbox <- Mailbox;
3f71121b 37 catchAllAlias mailbox
446f4d45 38end;
39
40val addWww = begin
41 web "www" with
42 serverAliasDefault;
43 www : [Vhost] <- WWW;
44 www
45 end
46end;
47
48val domNoWwwNoDefaultAlias =
bf9b0bc3 49 \ d : (your_domain) ->
50 \\ config : Domain ->
51 domain d with
e28c342c 52 dns (dnsNS "ns1.hcoop.net");
53 dns (dnsNS "ns3.hcoop.net");
bf9b0bc3 54
733f6a28 55 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
a54ae325 56
bf9b0bc3 57 handleMail;
c842ace6 58 dns (dnsMX 1 "deleuze.hcoop.net");
bf9b0bc3 59
bf9b0bc3 60 config
61 end;
695b8c37 62
446f4d45 63val domNoDefaultAlias =
64 \ d : (your_domain) ->
65 \\ config : Domain ->
66 domNoWwwNoDefaultAlias d with
67 addWww;
68 config
69 end;
70
71val domNoWww =
72 \ d : (your_domain) ->
73 \\ config : Domain ->
74 domNoWwwNoDefaultAlias d with
75 config;
3f71121b 76 addCatchAllAlias;
446f4d45 77 end;
78
9b3f6729 79val dom =
80 \ d : (your_domain) ->
81 \\ config : Domain ->
82 domNoDefaultAlias d with
83 config;
3f71121b 84 addCatchAllAlias;
9b3f6729 85 end;
86
695b8c37 87val nameserver = \host -> dns (dnsNS host);
88val dnsIP = \from -> \to -> dns (dnsA from to);
89val dnsMail = \num -> \host -> dns (dnsMX num host);
90val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
d71ae374 91val dnsDefault = \to -> dns (dnsDefaultA to);