X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/291eacbf162d2823f4667cbb3f9330528c4acf99..37051a6c6eec6662c44658e5e12a5e5b8f98a576:/src/plugins/apache.sml diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index 3b535c3..52470c8 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -1,5 +1,6 @@ (* HCoop Domtool (http://hcoop.sourceforge.net/) * Copyright (c) 2006-2009, Adam Chlipala + * Copyright (c) 2013 Clinton Ebadi * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -117,10 +118,18 @@ fun validCert s = Acl.query {user = Domain.getUser (), class = "cert", value = s} +fun validCaCert s = Acl.query {user = Domain.getUser (), + class = "cacert", + value = s} + val _ = Env.type_one "ssl_cert_path" Env.string validCert +val _ = Env.type_one "ssl_cacert_path" + Env.string + validCaCert + fun ssl e = case e of (EVar "no_ssl", _) => SOME NONE | (EApp ((EVar "use_cert", _), s), _) => Option.map SOME (Env.string s) @@ -158,7 +167,7 @@ val defaults = [("WebPlaces", (fn () => (EVar "true", dl))), ("PhpVersion", (TBase "php_version", dl), - (fn () => (EVar "php4", dl)))] + (fn () => (EVar "php5", dl)))] val () = app Defaults.registerDefault defaults @@ -206,6 +215,7 @@ val apache_option = fn (EVar "execCGI", _) => SOME "ExecCGI" | (EVar "includesNOEXEC", _) => SOME "IncludesNOEXEC" | (EVar "indexes", _) => SOME "Indexes" | (EVar "followSymLinks", _) => SOME "FollowSymLinks" + | (EVar "multiViews", _) => SOME "MultiViews" | _ => NONE val autoindex_width = fn (EVar "autofit", _) => SOME "*" @@ -476,8 +486,7 @@ fun vhostPost () = (!post (); write "\n"; app (TextIO.closeOut o #2) (!vhostFiles)) -val php_version = fn (EVar "php4", _) => SOME 4 - | (EVar "php5", _) => SOME 5 +val php_version = fn (EVar "php5", _) => SOME 5 | _ => NONE fun vhostBody (env, makeFullHost) = @@ -1125,6 +1134,16 @@ val () = Env.action_two "addOutputFilter" write "\n") | _ => ()) +val () = Env.action_one "sslCertificateChainFile" + ("ssl_cacert_path", Env.string) + (fn cacert => + if !sslEnabled then + (write "\tSSLCertificateChainFile \""; + write cacert; + write "\"\n") + else + print "WARNING: Skipped sslCertificateChainFile because this isn't an SSL vhost.\n") + val () = Domain.registerResetLocal (fn () => ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/vhosts/*")))