From 2e87719caa8c0cc98c573a2071a3c9c7cd503632 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 18 Nov 2007 18:09:56 +0000 Subject: [PATCH] your_ip_to_ip --- lib/domain.dtl | 1 + lib/easy_domain.dtl | 13 +++++++++++++ src/domain.sml | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/lib/domain.dtl b/lib/domain.dtl index 8946633..2b17089 100644 --- a/lib/domain.dtl +++ b/lib/domain.dtl @@ -10,6 +10,7 @@ extern type ip; {{An IP address}} extern type your_ip; +extern val your_ip_to_ip : your_ip -> ip; {{An IP address that you're authorized to use; e.g., for an SSL web host}} extern type host; diff --git a/lib/easy_domain.dtl b/lib/easy_domain.dtl index 82c66bf..c4b3d4f 100644 --- a/lib/easy_domain.dtl +++ b/lib/easy_domain.dtl @@ -17,6 +17,19 @@ val webAt = val web = webAt web_node; +val webAtIp = + \ ip : (your_ip) -> + \ host : (host) -> + \\ config : Vhost -> begin + dns (dnsA host (your_ip_to_ip ip)); + + vhost host where + WebPlaces = [web_place web_node ip] + with + config + end + end; + val addDefaultAlias = begin mailbox <- Mailbox; defaultAlias mailbox diff --git a/src/domain.sml b/src/domain.sml index 6d7f2ac..3998b83 100644 --- a/src/domain.sml +++ b/src/domain.sml @@ -191,6 +191,10 @@ val _ = Env.type_one "node" Env.string validNode +val _ = Env.registerFunction ("your_ip_to_ip", + fn [e] => SOME e + | _ => NONE) + val _ = Env.registerFunction ("dns_node_to_node", fn [e] => SOME e | _ => NONE) -- 2.20.1