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 catchAllAlias = \ mailbox -> aliasPrim catchAllSource (addressTarget mailbox); |
34 | |
35 | val addCatchAllAlias = begin |
446f4d45 |
36 | mailbox <- Mailbox; |
3f71121b |
37 | catchAllAlias mailbox |
446f4d45 |
38 | end; |
39 | |
40 | val addWww = begin |
41 | web "www" with |
42 | serverAliasDefault; |
43 | www : [Vhost] <- WWW; |
44 | www |
45 | end |
46 | end; |
47 | |
48 | val 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 |
63 | val domNoDefaultAlias = |
64 | \ d : (your_domain) -> |
65 | \\ config : Domain -> |
66 | domNoWwwNoDefaultAlias d with |
67 | addWww; |
68 | config |
69 | end; |
70 | |
71 | val domNoWww = |
72 | \ d : (your_domain) -> |
73 | \\ config : Domain -> |
74 | domNoWwwNoDefaultAlias d with |
75 | config; |
3f71121b |
76 | addCatchAllAlias; |
446f4d45 |
77 | end; |
78 | |
9b3f6729 |
79 | val dom = |
80 | \ d : (your_domain) -> |
81 | \\ config : Domain -> |
82 | domNoDefaultAlias d with |
83 | config; |
3f71121b |
84 | addCatchAllAlias; |
9b3f6729 |
85 | end; |
86 | |
695b8c37 |
87 | val nameserver = \host -> dns (dnsNS host); |
88 | val dnsIP = \from -> \to -> dns (dnsA from to); |
89 | val dnsMail = \num -> \host -> dns (dnsMX num host); |
90 | val dnsAlias = \from -> \to -> dns (dnsCNAME from to); |
d71ae374 |
91 | val dnsDefault = \to -> dns (dnsDefaultA to); |