Add cgiExtension
[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
b5f2d506 13 WebPlaces = [web_place_default n]
15e529d6
AC
14 with
15 config
16 end);
17
18val web = webAt web_node;
6bb366c5 19
2e87719c
AC
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
cd040866
AC
33val catchAllAlias = \ mailbox -> aliasPrim catchAllSource (addressTarget mailbox);
34
35val addCatchAllAlias = begin
d4e42f2a 36 mailbox <- Mailbox;
cd040866 37 catchAllAlias mailbox
d4e42f2a
AC
38end;
39
40val addWww = begin
41 web "www" with
42 serverAliasDefault;
43 www : [Vhost] <- WWW;
44 www
45 end
46end;
47
48val domNoWwwNoDefaultAlias =
6bb366c5
AC
49 \ d : (your_domain) ->
50 \\ config : Domain ->
51 domain d with
94b7b11a
AC
52 dns (dnsNS "ns1.hcoop.net");
53 dns (dnsNS "ns3.hcoop.net");
6bb366c5 54
16465a9a 55 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
6eeb3bf9 56
6bb366c5 57 handleMail;
1c5aa57d 58 dns (dnsMX 1 "deleuze.hcoop.net");
6bb366c5 59
6bb366c5
AC
60 config
61 end;
8c142ff5 62
d4e42f2a
AC
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;
cd040866 76 addCatchAllAlias;
d4e42f2a
AC
77 end;
78
6b718954
AC
79val dom =
80 \ d : (your_domain) ->
81 \\ config : Domain ->
82 domNoDefaultAlias d with
83 config;
cd040866 84 addCatchAllAlias;
6b718954
AC
85 end;
86
8c142ff5
AC
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);
eda33894 91val dnsDefault = \to -> dns (dnsDefaultA to);