Commit | Line | Data |
---|---|---|
6bb366c5 AC |
1 | {{The most common kinds of domain configuration}} |
2 | ||
6eeb3bf9 | 3 | val default_node : (node) = "mire"; |
60695e99 | 4 | val web_node : (web_node) = "mire"; |
15e529d6 AC |
5 | |
6 | val webAt = | |
ae272cb5 AC |
7 | \ n : (web_node) -> |
8 | \ host : (host) -> | |
9 | \\ config : Vhost -> begin | |
cfedb922 | 10 | dns (dnsA (literal host) (ip_of_node (web_node_to_node n))); |
15e529d6 | 11 | |
ae272cb5 AC |
12 | vhost host where |
13 | WebPlaces = [web_place_default n] | |
14 | with | |
15 | config | |
16 | end | |
17 | end; | |
15e529d6 AC |
18 | |
19 | val web = webAt web_node; | |
6bb366c5 | 20 | |
2e87719c | 21 | val webAtIp = |
ae272cb5 AC |
22 | \ ip : (your_ip) -> |
23 | \ host : (host) -> | |
24 | \\ config : Vhost -> begin | |
cfedb922 | 25 | dns (dnsA (literal host) (your_ip_to_ip ip)); |
2e87719c | 26 | |
ae272cb5 AC |
27 | vhost host where |
28 | WebPlaces = [web_place web_node ip] | |
29 | with | |
30 | config | |
31 | end | |
32 | end; | |
2e87719c | 33 | |
a356587a | 34 | val addDefaultAlias = begin |
d4e42f2a | 35 | mailbox <- Mailbox; |
a356587a | 36 | defaultAlias mailbox |
d4e42f2a AC |
37 | end; |
38 | ||
39 | val addWww = begin | |
40 | web "www" with | |
41 | serverAliasDefault; | |
42 | www : [Vhost] <- WWW; | |
43 | www | |
44 | end | |
45 | end; | |
46 | ||
a356587a | 47 | val dom = |
ae272cb5 AC |
48 | \ d : (your_domain) -> |
49 | \\ config : Domain -> | |
50 | domain d with | |
51 | dns (dnsNS "ns1.hcoop.net"); | |
52 | dns (dnsNS "ns3.hcoop.net"); | |
6bb366c5 | 53 | |
cfedb922 | 54 | dns (dnsA default (ip_of_node (web_node_to_node web_node))); |
6eeb3bf9 | 55 | |
ae272cb5 AC |
56 | handleMail; |
57 | dns (dnsMX 1 "deleuze.hcoop.net"); | |
6bb366c5 | 58 | |
ae272cb5 AC |
59 | createWWW : bool <- CreateWWW; |
60 | if createWWW then | |
61 | addWww | |
62 | else | |
63 | Skip | |
64 | end; | |
d4e42f2a | 65 | |
ae272cb5 AC |
66 | defAl : bool <- DefaultAlias; |
67 | if defAl then | |
68 | addDefaultAlias | |
69 | else | |
70 | Skip | |
71 | end; | |
d4e42f2a | 72 | |
ae272cb5 AC |
73 | config |
74 | end; | |
6b718954 | 75 | |
8c142ff5 | 76 | val nameserver = \host -> dns (dnsNS host); |
cfedb922 AC |
77 | val dnsIP = \from -> \to -> dns (dnsA (literal from) to); |
78 | val dnsIPv6 = \from -> \to -> dns (dnsAAAA (literal from) to); | |
8c142ff5 | 79 | val dnsMail = \num -> \host -> dns (dnsMX num host); |
cfedb922 AC |
80 | val dnsAlias = \from -> \to -> dns (dnsCNAME (literal from) to); |
81 | val dnsDefault = \to -> dns (dnsA default to); | |
82 | val dnsDefaultv6 = \to -> dns (dnsAAAA default to); | |
63ac3b82 AC |
83 | val dnsText = \from -> \to -> dns (dnsTXT (srv_literal from) to); |
84 | val dnsDefaultText = \to -> dns (dnsTXT srv_default to); |