val keyDir = "/afs/hcoop.net/common/etc/domtool/keys"
val dispatcherName = "deleuze.hcoop.net"
+
+val homeBase = "/afs/hcoop.net/usr"
val keyDir : string
val dispatcherName : string
+
+val homeBase : string
structure Webalizer :> WEBALIZER_CONFIG = struct
val configDir = "/etc/webalizer"
-val outputDir = "/tmp/webalizer"
+val outputDir = "/afs/hcoop.net/common/etc/domtool/webalizer"
end
val validHost : string -> bool
val validDomain : string -> bool
+ val ip : string Env.arg
+
val registerBefore : (string -> unit) -> unit
val registerAfter : (string -> unit) -> unit
(* Register handlers to run just before and after entering a domain
ExternalMaster of string
| InternalMaster of string
-val master = fn (EApp ((EVar "externalMaster", _), e), _) => Option.map ExternalMaster (Env.string e)
- | (EApp ((EVar "internalMaster", _), e), _) => Option.map InternalMaster (Env.string e)
+val ip = fn (EApp ((EVar "ip_of_node", _), e), _) => Option.map nodeIp (Env.string e)
+ | e => Env.string e
+
+val master = fn (EApp ((EVar "externalMaster", _), e), _) => Option.map ExternalMaster (ip e)
+ | (EApp ((EVar "internalMaster", _), e), _) => Option.map InternalMaster (ip e)
| _ => NONE
datatype dnsKind =
TextIO.closeOut outf;
(eval outname;
Msg.send (bio, MsgOk))
- handle ErrorMsg.Error =>
- (print "Compilation error\n";
- Msg.send (bio,
- MsgError "Error during configuration evaluation"))
- | OpenSSL.OpenSSL s =>
- (print "OpenSSL error\n";
- Msg.send (bio,
- MsgError
- ("Error during configuration evaluation: "
- ^ s)));
- OS.FileSys.remove outname;
- (ignore (OpenSSL.readChar bio);
- OpenSSL.close bio)
- handle OpenSSL.OpenSSL _ => ();
- loop ()
+ handle ErrorMsg.Error =>
+ (print "Compilation error\n";
+ Msg.send (bio,
+ MsgError "Error during configuration evaluation"))
+ | OpenSSL.OpenSSL s =>
+ (print "OpenSSL error\n";
+ Msg.send (bio,
+ MsgError
+ ("Error during configuration evaluation: "
+ ^ s)));
+ OS.FileSys.remove outname;
+ (ignore (OpenSSL.readChar bio);
+ OpenSSL.close bio)
+ handle OpenSSL.OpenSSL _ => ();
+ loop ()
end
| _ =>
(Msg.send (bio, MsgError "Unexpected command")
in
cmdLoop ()
end
+ handle OpenSSL.OpenSSL s =>
+ (print ("OpenSSL error: " ^ s ^ "\n");
+ OpenSSL.close bio
+ handle OpenSSL.OpenSSL _ => ();
+ loop ())
+ | OS.SysErr (s, _) =>
+ (print ("System error: " ^ s ^ "\n");
+ OpenSSL.close bio
+ handle OpenSSL.OpenSSL _ => ();
+ loop ())
in
print "Listening for connections....\n";
loop ();
val _ = Defaults.registerDefault ("DocumentRoot",
(TBase "your_path", dl),
- (fn () => (EString ("/home/" ^ Domain.getUser () ^ "/public_html"), dl)))
+ (fn () => (EString (Config.homeBase ^ "/" ^ Domain.getUser () ^ "/public_html"), dl)))
val _ = Defaults.registerDefault ("ServerAdmin",
(TBase "email", dl),
| NS of string
val record = fn (EApp ((EApp ((EVar "dnsA", _), e1), _), e2), _) =>
- (case (Env.string e1, Env.string e2) of
+ (case (Env.string e1, Domain.ip e2) of
(SOME v1, SOME v2) => SOME (A (v1, v2))
| _ => NONE)
| (EApp ((EApp ((EVar "dnsCNAME", _), e1), _), e2), _) =>