structure Mailman :> MAILMAN = struct
+open Ast
+
+val () = Env.type_one "mailman_web_node"
+ Env.string
+ (fn node => Apache.webNode node orelse node = Config.Mailman.node)
+
+val dl = ErrorMsg.dummyLoc
+
+val () = Env.registerFunction ("mailman_web_node",
+ fn [] => SOME (EString Config.Mailman.node, dl)
+ | _ => NONE)
+
+val () = Env.registerFunction ("mailman_web_node_to_node",
+ fn [e] => SOME e
+ | _ => NONE)
+
+val () = Defaults.registerDefault
+ ("MailmanWebNodes",
+ (TList (TBase "mailman_web_node", dl), dl),
+ (fn () => (EList [(EString Config.Mailman.node, dl)], dl)))
+
val files = ref ([] : TextIO.outstream list)
val write = ref (fn _ : string => ())
("host", Env.string)
(fn (env, host) =>
let
- val nodes = Env.env (Env.list Env.string) (env, "WebNodes")
+ val nodes = Env.env (Env.list Env.string) (env, "MailmanWebNodes")
val ssl = Env.env Apache.ssl (env, "SSL")
val user = Env.env Env.string (env, "User")
val ld = Apache.logDir {user = user, node = node, vhostId = vhostId}
in
+ print "# Owner: ";
+ print user;
+ print "\n";
print "<VirtualHost ";
print (Domain.nodeIp node);
print ":";
print (case ssl of
SOME _ => "443"
| NONE => "80");
- print "\n";
+ print ">\n";
print " ServerName $LISTDOMAIN\n";
print " ServerAdmin ";
print user;
print " Order allow,deny\n";
print " Allow from all\n";
print " </Directory>\n";
+
+ Apache.doPre {user = user, nodes = nodes, id = vhostId, hostname = fullHost};
+
print "</VirtualHost>\n";
- TextIO.closeOut file
+ TextIO.closeOut file;
+
+ Apache.doPost ()
end) nodes
end)