payment: note that Stripe has instituted an additional 1% fee for non-US cards
[hcoop/portal.git] / sec.sml
diff --git a/sec.sml b/sec.sml
index b064a5f..81ececa 100644 (file)
--- a/sec.sml
+++ b/sec.sml
@@ -45,7 +45,7 @@ fun socketPerms {node, uname} =
     let
        val proc = Unix.execute ("/bin/sh",
                                 ["-c",
-                                 "DOMTOOL_USER=apache2.deleuze.hcoop.net /usr/local/bin/domtool-admin sockperm "
+                                 "DOMTOOL_USER=hcoop.daemon /usr/local/bin/domtool-admin sockperm "
                                  ^ Init.nodeName node ^ " " ^ uname])
                   
        val inf = Unix.textInstreamOf proc
@@ -65,18 +65,17 @@ fun socketPerms {node, uname} =
 
 fun checkIt cmd {node, uname} =
     OS.Process.isSuccess (OS.Process.system
-                             ("DOMTOOL_USER=apache2.deleuze.hcoop.net /usr/local/bin/domtool-admin "
+                             ("DOMTOOL_USER=hcoop.daemon /usr/local/bin/domtool-admin "
                               ^ cmd ^ " " ^ Init.nodeName node ^ " " ^ uname ^ " >/dev/null 2>/dev/null"))
 
 val isTpe = checkIt "tpe"
 val cronAllowed = checkIt "cron"
-val ftpAllowed = checkIt "ftp"
 
 fun findFirewallRules {node, uname} =
     let
        val proc = Unix.execute ("/bin/sh",
                                 ["-c",
-                                 "DOMTOOL_USER=apache2.deleuze.hcoop.net /usr/local/bin/domtool-admin firewall "
+                                 "DOMTOOL_USER=hcoop.daemon /usr/local/bin/domtool-admin firewall "
                                  ^ Init.nodeName node ^ " " ^ uname])
                   
        val inf = Unix.textInstreamOf proc
@@ -137,6 +136,10 @@ fun validRule rule =
        "Client" :: ports :: hosts => validPorts ports andalso validHosts hosts
       | "Server" :: ports :: hosts => validPorts ports andalso validHosts hosts
       | ["LocalServer", ports] => validPorts ports
+      | ["ProxiedServer", ports] => validPorts ports
       | _ => false
 
+fun fulldomain (sub, dom) = 
+    sub ^ (if String.size sub <> 0 then "." else "") ^ dom
+
 end