Adding Apache SetEnv
authorAdam Chlipala <adamc@hcoop.net>
Sun, 7 Oct 2007 11:01:21 +0000 (11:01 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sun, 7 Oct 2007 11:01:21 +0000 (11:01 +0000)
lib/easy_domain.dtl
lib/mod_env.dtl [new file with mode: 0644]
src/domain.sml
src/plugins/apache.sml

index 03af55f..fbc5e7a 100644 (file)
@@ -42,3 +42,4 @@ val nameserver = \host -> dns (dnsNS host);
 val dnsIP = \from -> \to -> dns (dnsA from to);
 val dnsMail = \num -> \host -> dns (dnsMX num host);
 val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
 val dnsIP = \from -> \to -> dns (dnsA from to);
 val dnsMail = \num -> \host -> dns (dnsMX num host);
 val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
+val dnsDefault = \to -> dns (dnsDefaultA to);
diff --git a/lib/mod_env.dtl b/lib/mod_env.dtl
new file mode 100644 (file)
index 0000000..21f2021
--- /dev/null
@@ -0,0 +1,5 @@
+{{Support for Apache's mod_env, which deals with UNIX environment variables}}
+
+extern val setEnv : no_spaces -> no_spaces -> [^Vhost];
+{{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_env.html#setenv">the
+  Apache documentation</a>.}}
index ed26bcd..c097128 100644 (file)
@@ -114,10 +114,10 @@ val validGroup = validUser
 
 val _ = Env.type_one "no_spaces"
                     Env.string
 
 val _ = Env.type_one "no_spaces"
                     Env.string
-                    (CharVector.all (fn ch => not (Char.isSpace ch)))
+                    (CharVector.all (fn ch => not (Char.isSpace ch) andalso ch <> #"\"" andalso ch <> #"'"))
 val _ = Env.type_one "no_newlines"
                     Env.string
 val _ = Env.type_one "no_newlines"
                     Env.string
-                    (CharVector.all (fn ch => ch <> #"\n" andalso ch <> #"\r"))
+                    (CharVector.all (fn ch => ch <> #"\n" andalso ch <> #"\r" andalso ch <> #"\"" andalso ch <> #"'"))
 
 val _ = Env.type_one "ip"
        Env.string
 
 val _ = Env.type_one "ip"
        Env.string
index 09dbf98..e4e96ea 100644 (file)
@@ -864,6 +864,14 @@ val () = Env.action_one "readmeName"
                      write name;
                      write "\n"))
 
                      write name;
                      write "\n"))
 
+val () = Env.action_two "setEnv"
+        ("key", Env.string, "value", Env.string)
+        (fn (key, value) => (write "\tSetEnv \"";
+                             write key;
+                             write "\" \"";
+                             write value;
+                             write "\"\n"))
+
 val () = Domain.registerResetLocal (fn () =>
                                       ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/vhosts/*")))
 
 val () = Domain.registerResetLocal (fn () =>
                                       ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/vhosts/*")))