val confDir = "/var/domtool/vhosts"
-val webNodes = ["deleuze"]
+val webNodes_all = ["mire"]
+val webNodes_admin = ["deleuze"]
+
+val webNodes_default = ["mire"]
val proxyTargets = ["http://hcoop.net/cgi-bin/mailman",
"http://hcoop.net/pipermail"]
val confDir : string
- val webNodes : string list
+ val webNodes_all : string list
+ val webNodes_admin : string list
+ val webNodes_default : string list
val proxyTargets : string list
{{Apache web server configuration}}
+extern type web_node;
+{{Nodes that accept Apache configuration from you}}
+
+extern val web_node_to_node : web_node -> node;
+
context Vhost;
{{A WWW virtual host}}
extern val vhost : host -> Vhost => [Domain]
- {WebNodes : [node],
+ {WebNodes : [web_node],
SSL : bool,
User : your_user,
Group : your_group,
{{The most common kinds of domain configuration}}
-val web_node : (node) = "mire";
+val web_node : (web_node) = "mire";
val webAt =
- \ n : (node) ->
+ \ n : (web_node) ->
\ host : (host) ->
\\ config : Vhost ->
- (dns (dnsA host (ip_of_node n));
+ (dns (dnsA host (ip_of_node (web_node_to_node n)));
vhost host where
WebNodes = [n]
(* UNIX users, groups, and paths the user may act with *)
val set_context : OpenSSL.context -> unit
+
+ val inGroup : string -> bool
end
fn cl => "Temp file cleanup failed: " ^ cl))
end)
+fun inGroup group = Acl.query {user = getUser (), class = "group", value = "root"}
+ orelse Acl.query {user = getUser (), class = "group", value = group}
+
end
open Ast
+val _ = Env.type_one "web_node"
+ Env.string
+ (fn node =>
+ List.exists (fn x => x = node) Config.Apache.webNodes_all
+ orelse (Domain.inGroup "www"
+ andalso List.exists (fn x => x = node) Config.Apache.webNodes_admin))
+
val _ = Env.type_one "proxy_port"
Env.int
(fn n => n > 1024)
val dl = ErrorMsg.dummyLoc
+val _ = Env.registerFunction ("web_node_to_node",
+ fn [e] => SOME e
+ | _ => NONE)
+
val _ = Defaults.registerDefault ("WebNodes",
- (TList (TBase "node", dl), dl),
- (fn () => (EList (map (fn s => (EString s, dl)) Config.Apache.webNodes), dl)))
+ (TList (TBase "web_node", dl), dl),
+ (fn () => (EList (map (fn s => (EString s, dl)) Config.Apache.webNodes_default), dl)))
val _ = Defaults.registerDefault ("SSL",
(TBase "bool", dl),