val webNodes_all = [("navajos", {version = APACHE_2, auth = MOD_WAKLOG})]
val webNodes_admin = [("deleuze", {version = APACHE_2, auth = MOD_WAKLOG})]
-val webNodes_default = ["navajos"]
-
val proxyTargets = ["http://hcoop.net/cgi-bin/mailman",
"http://hcoop.net/pipermail"]
val webNodes_all : (string * ConfigTypes.apache_info) list
val webNodes_admin : (string * ConfigTypes.apache_info) list
- val webNodes_default : string list
val proxyTargets : string list
(* Specifically exempted URIs for proxying *)
val sudo = "/usr/bin/sudo"
val domtool_publish = "/usr/local/sbin/domtool-publish"
-val defaultNs = "ns1.hcoop.net"
-
-val defaultRefresh = 86400
-val defaultRetry = 1800
-val defaultExpiry = 1209600
-val defaultMinimum = 3600
-
val nodeIps = [("deleuze", "69.90.123.67"), ("hopper", "69.90.123.74"), ("fritz", "69.90.123.75"), ("navajos", "69.90.123.70"), ("bog", "69.90.123.72"), ("outpost", "151.236.216.192")]
val defaultNode = "deleuze"
val sudo : string
val domtool_publish : string
-(* DNS SOA parameter defaults *)
-val defaultNs : string
-val defaultRefresh : int
-val defaultRetry : int
-val defaultExpiry : int
-val defaultMinimum : int
-
(* Names of machines who will receive configuration *)
val nodeIps : (string * string) list
val defaultNode : string
val reload = "/usr/bin/sudo /usr/local/sbin/domtool-publish exim"
-val aliasTo = ["deleuze"]
-
val mainLog = "/var/log/exim4/mainlog"
end
val relayDomains : string
(* File to which to write a comma-separate list of domains to relay mail for *)
-val aliasTo : string list
-(* Default nodes to which alias directives are applied *)
-
val mainLog : string
(* Path to main log file *)
--- /dev/null
+extern val you : your_user;
+extern val defaultMailbox : email;
+extern val defaultServerAdmin : email;
+
+var SSL : ssl = no_ssl;
+
+var User : your_user = you;
+
+var Group : your_group = "nogroup";
+
+var DocumentRoot : your_path = (home "public_html");
+var SuExec : suexec_flag = true;
+var PhpVersion : php_version = php5;
+
+var Mailbox : email = defaultMailbox;
+var ServerAdmin : email = defaultServerAdmin;
+
+var Aliases : [your_domain] = [];
+
+val defaultTTL = 3600;
+val defaultNs : domain = "ns1.hcoop.net";
+val defaultRefresh = 86400;
+val defaultRetry = 1800;
+val defaultExpiry = 1209600;
+val defaultMinimum = 3600;
+
+val dnsMasterNode = (internalMaster dns_master_node);
+val dnsSlaveNodes : [dns_node] = dns_slave_nodes;
+
+var DNS : dnsKind = useDns (soa defaultNs serialAuto defaultRefresh defaultRetry defaultExpiry defaultMinimum) dnsMasterNode dnsSlaveNodes;
+var TTL = defaultTTL;
+
+var WWW : [Vhost] = Skip;
+var CreateWWW = true;
+var DefaultA = true;
+var DefaultAlias = true;
+var DefaultAliasSource = defaultSource;
+var HandleMail = true;
+var AddMX = true;
+
+var MailNodes : [mail_node] = ["deleuze"];
+
+var MailManPlaces : [mailman_place] = [mailman_place_default mailman_node];
+
+var DefaultWebNode : web_node = web_node;
\ No newline at end of file
{{A server not controlled by domtool will serve as master.}}
extern val internalMaster : dns_node -> master;
{{A server controlled by domtool will serve as master.}}
+extern val dns_master_node : dns_node;
+{{Internal master DNS node}}
+extern val dns_slave_nodes : [dns_node];
+{{Internal slave DNS nodes}}
extern type dnsKind;
{{How should DNS for this domain be handled?}}
+++ /dev/null
-(* HCoop Domtool (http://hcoop.sourceforge.net/)
- * Copyright (c) 2006, Adam Chlipala
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *)
-
-(* Default record field database *)
-
-signature DEFAULTS = sig
- val registerDefault : string * Ast.typ * (unit -> Ast.exp) -> unit
-
- val tInit : Ast.file -> Ast.typ
- val eInit : unit -> Env.env_vars
-end
+++ /dev/null
-(* HCoop Domtool (http://hcoop.sourceforge.net/)
- * Copyright (c) 2006, Adam Chlipala
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *)
-
-(* Default record field database *)
-
-structure Defaults :> DEFAULTS = struct
-
-open Ast Print
-
-structure SM = StringMap
-
-val dmy = ErrorMsg.dummyLoc
-
-val defaultT : record ref = ref SM.empty
-val defaultV : (unit -> exp) SM.map ref = ref SM.empty
-
-fun registerDefault (name, t, v) =
- case SM.find (!defaultT, name) of
- NONE => (defaultT := SM.insert (!defaultT, name, t);
- defaultV := SM.insert (!defaultV, name, v))
- | SOME _ => raise Fail "Duplicate default environment variable"
-
-fun allSets (e, _) =
- case e of
- ESkip => true
- | ESet _ => true
- | ESeq es => List.all allSets es
- | _ => false
-
-val dmy = ErrorMsg.dummyLoc
-
-fun bodyType (_, _, SOME e) =
- if allSets e then
- (CPrefix (CRoot, dmy), dmy)
- else
- (CRoot, dmy)
- | bodyType _ = (CRoot, dmy)
-
-fun tInit p =
- (TAction (bodyType p,
- !defaultT,
- StringMap.empty),
- dmy)
-
-fun eInit () = SM.map (fn f => f ()) (!defaultV)
-
-
-end
| _ => NONE)
-val nsD = (EString Config.defaultNs, dl)
-val serialD = (EVar "serialAuto", dl)
-val refD = (EInt Config.defaultRefresh, dl)
-val retD = (EInt Config.defaultRetry, dl)
-val expD = (EInt Config.defaultExpiry, dl)
-val minD = (EInt Config.defaultMinimum, dl)
-
-val soaD = multiApp ((EVar "soa", dl),
- dl,
- [nsD, serialD, refD, retD, expD, minD])
-
-val masterD = (EApp ((EVar "internalMaster", dl),
- (EString Config.masterNode, dl)),
- dl)
-
-val slavesD = (EList (map (fn s => (EString s, dl))
- (List.filter (fn x => List.exists (fn y => y = x) (Config.dnsNodes_all @ Config.dnsNodes_admin)) Config.slaveNodes)), dl)
-
-val _ = Defaults.registerDefault ("Aliases",
- (TList (TBase "your_domain", dl), dl),
- (fn () => (EList [], dl)))
-
-val _ = Defaults.registerDefault ("Mailbox",
- (TBase "email", dl),
- (fn () => (EString (getUser ()), dl)))
-
-val _ = Defaults.registerDefault ("DNS",
- (TBase "dnsKind", dl),
- (fn () => multiApp ((EVar "useDns", dl),
- dl,
- [soaD, masterD, slavesD])))
-
-val _ = Defaults.registerDefault ("TTL",
- (TBase "int", dl),
- (fn () => (EInt Config.Bind.defaultTTL, dl)))
+val _ = Env.registerFunction ("you",
+ fn [] => SOME (EString (getUser ()), dl)
+ | _ => NONE)
+
+val _ = Env.registerFunction ("defaultMailbox",
+ fn [] => SOME (EString (getUser ()), dl)
+ | _ => NONE)
+
type soa = {ns : string,
serial : int option,
val realLogDir : {user : string, node : string, vhostId : string} -> string
(* OK, where is it _really_ located? (Target of log syncing into AFS) *)
- val defaults : (string * Ast.typ * (unit -> Ast.exp)) list
- (* Default environment variables *)
-
val ssl : string option Env.arg
val webPlace : (string * string) Env.arg
Env.string
validExtension
-val defaults = [("WebPlaces",
- (TList (TBase "web_place", dl), dl),
- (fn () => (EList (map webPlaceDefault Config.Apache.webNodes_default), dl))),
- ("SSL",
- (TBase "ssl", dl),
- (fn () => (EVar "no_ssl", dl))),
- ("User",
- (TBase "your_user", dl),
- (fn () => (EString (Domain.getUser ()), dl))),
- ("Group",
- (TBase "your_group", dl),
- (fn () => (EString "nogroup", dl))),
- ("DocumentRoot",
- (TBase "your_path", dl),
- (fn () => (EString (Domain.homedir () ^ "/" ^ Config.Apache.public_html), dl))),
- ("ServerAdmin",
- (TBase "email", dl),
- (fn () => (EString (Domain.getUser () ^ "@" ^ Config.defaultDomain), dl))),
- ("SuExec",
- (TBase "suexec_flag", dl),
- (fn () => (EVar "true", dl))),
- ("PhpVersion",
- (TBase "php_version", dl),
- (fn () => (EVar "php5", dl)))]
-
-val () = app Defaults.registerDefault defaults
+val _ = Env.registerFunction ("defaultServerAdmin",
+ fn [] => SOME (EString (Domain.getUser () ^ "@" ^ Config.defaultDomain), dl)
+ | _ => NONE)
val redirect_code = fn (EVar "temp", _) => SOME "temp"
| (EVar "permanent", _) => SOME "permanent"
Env.string
validSrvDomain
+val _ = Env.registerFunction ("dns_master_node",
+ fn [] => SOME (EString Config.masterNode, dl)
+ | _ => NONE)
+
+val _ = Env.registerFunction ("dns_slave_nodes",
+ fn [] => SOME (EList (map (fn n => (EString n, dl)) Config.slaveNodes), dl)
+ | _ => NONE)
+
end
+++ /dev/null
-(* HCoop Domtool (http://hcoop.sourceforge.net/)
- * Copyright (c) 2006, Adam Chlipala
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *)
-
-(* Derived directives of general use *)
-
-signature EASY_DOMAIN = sig
-
-end
+++ /dev/null
-(* HCoop Domtool (http://hcoop.sourceforge.net/)
- * Copyright (c) 2007, Adam Chlipala
- * Copyright (c) 2014 Clinton Ebadi <clinton@unknownlamer.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *)
-
-(* Derived directives of general use *)
-
-structure EasyDomain :> EASY_DOMAIN = struct
-
-open Ast
-
-val dl = ErrorMsg.dummyLoc
-
-val _ = Defaults.registerDefault ("WWW",
- (TAction ((CConst "Vhost", dl),
- StringMap.empty,
- StringMap.empty), dl),
- (fn () => (ESkip, dl)))
-
-val _ = Defaults.registerDefault ("CreateWWW",
- (TBase "bool", dl),
- (fn () => (EVar "true", dl)))
-
-val _ = Defaults.registerDefault ("DefaultA",
- (TBase "bool", dl),
- (fn () => (EVar "true", dl)))
-
-val _ = Defaults.registerDefault ("DefaultAlias",
- (TBase "bool", dl),
- (fn () => (EVar "true", dl)))
-
-val _ = Defaults.registerDefault ("DefaultAliasSource",
- (TBase "aliasSource", dl),
- (fn () => (EVar "defaultSource", dl)))
-
-val _ = Defaults.registerDefault ("HandleMail",
- (TBase "bool", dl),
- (fn () => (EVar "true", dl)))
-
-val _ = Defaults.registerDefault ("AddMX",
- (TBase "bool", dl),
- (fn () => (EVar "true", dl)))
-
-val _ = Defaults.registerDefault ("DefaultWebNode",
- (TBase "web_node", dl),
- (fn () => (EString "navajos", dl)))
-
-end
open Ast
-val dl = ErrorMsg.dummyLoc
-
-val _ = Defaults.registerDefault ("MailNodes",
- (TList (TBase "mail_node", dl), dl),
- (fn () => (EList (map (fn s => (EString s, dl)) Config.Exim.aliasTo), dl)))
-
val aliasesChanged = ref false
val aliasesDefaultChanged = ref false
val hostsChanged = ref false
SOME (node, ip)
| mailmanPlace _ = NONE
-fun mailmanPlaceDefault node = (EApp ((EVar "mailman_place_default", dl), (EString node, dl)), dl)
-
val _ = Env.registerFunction ("mailman_place_to_web_node",
fn [e] => Option.map (fn (node, _) => (EString node, dl)) (mailmanPlace e)
| _ => NONE)
fn [e] => Option.map (fn (_, ip) => (EString ip, dl)) (mailmanPlace e)
| _ => NONE)
-val () = Defaults.registerDefault
- ("MailmanPlaces",
- (TList (TBase "mailman_place", dl), dl),
- (fn () => (EList [mailmanPlaceDefault Config.Mailman.node], dl)))
-
val files = ref ([] : TextIO.outstream list)
val write = ref (fn _ : string => ())
slave.sig
slave.sml
-defaults.sig
-defaults.sml
-
pcre.sig
pcre.sml
plugins/firewall.sig
plugins/firewall.sml
-plugins/easy_domain.sig
-plugins/easy_domain.sml
-
mail/vmail.sig
mail/vmail.sml