bf9b0bc3 |
1 | {{The most common kinds of domain configuration}} |
2 | |
a54ae325 |
3 | val default_node : (node) = "mire"; |
4cb2e7e7 |
4 | val web_node : (web_node) = "mire"; |
ae175ff1 |
5 | |
6 | val 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 | |
18 | val web = webAt web_node; |
bf9b0bc3 |
19 | |
f4018a6e |
20 | val 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 |
33 | val addCatchAllAlias = begin |
446f4d45 |
34 | mailbox <- Mailbox; |
3f71121b |
35 | catchAllAlias mailbox |
446f4d45 |
36 | end; |
37 | |
38 | val addWww = begin |
39 | web "www" with |
40 | serverAliasDefault; |
41 | www : [Vhost] <- WWW; |
42 | www |
43 | end |
44 | end; |
45 | |
46 | val domNoWwwNoDefaultAlias = |
bf9b0bc3 |
47 | \ d : (your_domain) -> |
48 | \\ config : Domain -> |
49 | domain d with |
e28c342c |
50 | dns (dnsNS "ns1.hcoop.net"); |
51 | dns (dnsNS "ns3.hcoop.net"); |
bf9b0bc3 |
52 | |
733f6a28 |
53 | dns (dnsDefaultA (ip_of_node (web_node_to_node web_node))); |
a54ae325 |
54 | |
bf9b0bc3 |
55 | handleMail; |
c842ace6 |
56 | dns (dnsMX 1 "deleuze.hcoop.net"); |
bf9b0bc3 |
57 | |
bf9b0bc3 |
58 | config |
59 | end; |
695b8c37 |
60 | |
446f4d45 |
61 | val domNoDefaultAlias = |
62 | \ d : (your_domain) -> |
63 | \\ config : Domain -> |
64 | domNoWwwNoDefaultAlias d with |
65 | addWww; |
66 | config |
67 | end; |
68 | |
69 | val domNoWww = |
70 | \ d : (your_domain) -> |
71 | \\ config : Domain -> |
72 | domNoWwwNoDefaultAlias d with |
73 | config; |
3f71121b |
74 | addCatchAllAlias; |
446f4d45 |
75 | end; |
76 | |
9b3f6729 |
77 | val dom = |
78 | \ d : (your_domain) -> |
79 | \\ config : Domain -> |
80 | domNoDefaultAlias d with |
81 | config; |
3f71121b |
82 | addCatchAllAlias; |
9b3f6729 |
83 | end; |
84 | |
695b8c37 |
85 | val nameserver = \host -> dns (dnsNS host); |
86 | val dnsIP = \from -> \to -> dns (dnsA from to); |
87 | val dnsMail = \num -> \host -> dns (dnsMX num host); |
88 | val dnsAlias = \from -> \to -> dns (dnsCNAME from to); |
d71ae374 |
89 | val dnsDefault = \to -> dns (dnsDefaultA to); |