Initial mod_waklog support
[hcoop/domtool2.git] / src / plugins / apache.sml
index 4ea0389..511901c 100644 (file)
@@ -228,10 +228,15 @@ fun findVhostUser fname =
 val webNodes_full = Config.Apache.webNodes_all @ Config.Apache.webNodes_admin
 
 fun isVersion1 node =
-    List.exists (fn x => x = (node, true)) webNodes_full
+    List.exists (fn (n, {version = ConfigTypes.APACHE_1_3, ...}) => n = node
+                 | _ => false) webNodes_full
 
 fun imVersion1 () = isVersion1 (Slave.hostname ())
 
+fun isWaklog node =
+    List.exists (fn (n, {auth = ConfigTypes.MOD_WAKLOG, ...}) => n = node
+                 | _ => false) webNodes_full
+
 fun down () = if imVersion1 () then Config.Apache.down1 else Config.Apache.down
 fun undown () = if imVersion1 () then Config.Apache.undown1 else Config.Apache.undown
 fun reload () = if imVersion1 () then Config.Apache.reload1 else Config.Apache.reload
@@ -442,6 +447,13 @@ val () = Env.containerV_one "vhost"
                                                    TextIO.output (file, group))
                                           else
                                               ();
+                                          if isWaklog node then
+                                              (TextIO.output (file, "\n\tWaklogProtected on\n\tWaklogPrincipal ");
+                                               TextIO.output (file, user);
+                                               TextIO.output (file, "/cgi@HCOOP.NET /etc/keytabs/cgi/");
+                                               TextIO.output (file, user))
+                                          else
+                                              ();
                                           (Domain.homedirOf user ^ "/apache/log/"
                                            ^ node ^ "/" ^ vhostId, file)
                                       end)