Remove Config.{dispatcher,defaultNode}
authorClinton Ebadi <clinton@unknownlamer.org>
Fri, 25 Apr 2014 22:58:03 +0000 (18:58 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Fri, 25 Apr 2014 22:59:25 +0000 (18:59 -0400)
defaultNode was punned to dispatcherName, and dispatcher relied on
other values in the file. I.e. you had to set all three to change the
dispatcher! Consolidate all into dispatcherName.

configDefault/domtool.cfg
configDefault/domtool.cfs
src/domain.sml
src/mail/vmail.sml
src/main.sml

index f580bdb..eeaebad 100644 (file)
@@ -15,7 +15,7 @@ val defaultExpiry = 1209600
 val defaultMinimum = 3600
 
 val nodeIps = [("deleuze", "69.90.123.67"), ("hopper", "69.90.123.74"), ("fritz", "69.90.123.75"), ("navajos", "69.90.123.70"), ("bog", "69.90.123.72"), ("outpost", "151.236.216.192")]
-val defaultNode = "fritz"
+val dispatcherName = "fritz"
 
 val dnsNodes_all = ["deleuze", "outpost"]
 val dnsNodes_admin = []
@@ -29,7 +29,6 @@ val testUser = "test"
 
 val defaultDomain = "hcoop.net"
 
-val dispatcher = defaultNode ^ "."  ^ defaultDomain
 val dispatcherPort = 1234
 val slavePort = 1235
 val queueSize = 5
@@ -42,8 +41,6 @@ val certDir = ConfigCore.sharedRoot ^ "/certs"
 val keyDir = ConfigCore.sharedRoot ^ "/keys"
 val caDir = "/etc/domtool/ca"
 
-val dispatcherName = defaultNode
-
 fun domtoolDir user =
     case user of
        "domtool" => ConfigCore.sharedRoot ^ "/.domtool"
index 15b3114..4cf7fee 100644 (file)
@@ -22,7 +22,7 @@ val defaultMinimum : int
 
 (* Names of machines who will receive configuration *)
 val nodeIps : (string * string) list
-val defaultNode : string
+val dispatcherName : string
 
 val aclFile : string
 (* Place to serialize ACL information *)
@@ -31,7 +31,6 @@ val testUser : string
 
 val defaultDomain : string
 
-val dispatcher : string
 val dispatcherPort : int
 val slavePort : int
 val queueSize : int
@@ -44,8 +43,6 @@ val certDir : string
 val keyDir : string
 val caDir : string
 
-val dispatcherName : string
-
 val dnsNodes_all : string list
 val dnsNodes_admin : string list
 
index 82367f3..2b93535 100644 (file)
@@ -712,7 +712,7 @@ fun handleSite (site, files) =
        
     in
        print ("New configuration for node " ^ site ^ "\n");
-       if site = Config.defaultNode then
+       if site = Config.dispatcherName then
            Slave.handleChanges files
        else let
                val bio = OpenSSL.connect true (valOf (!ssl_context),
index 1d5262d..48d2287 100644 (file)
@@ -26,7 +26,7 @@ fun rebuild () =
     let
        fun doNode (site, ok) =
            (print ("New vmail data for node " ^ site ^ "\n");
-            if site = Config.defaultNode then
+            if site = Config.dispatcherName then
                 Slave.shell [Config.Courier.postReload] andalso ok
             else let
                     val bio = OpenSSL.connect true (Domain.get_context (),
index be50982..1552791 100644 (file)
@@ -208,7 +208,7 @@ fun eval G evs fname =
       | (G, NONE) => (G, evs)
 
 val dispatcher =
-    Config.dispatcher ^ ":" ^ Int.toString Config.dispatcherPort
+    Domain.nodeIp Config.dispatcherName ^ ":" ^ Int.toString Config.dispatcherPort
 
 val self =
     "localhost:" ^ Int.toString Config.slavePort
@@ -1091,7 +1091,7 @@ fun regenerateEither tc checker context =
        val ok = ref true
  
        fun contactNode (node, ip) =
-           if node = Config.defaultNode then
+           if node = Config.dispatcherName then
                Domain.resetLocal ()
            else let
                    val bio = OpenSSL.connect true (context,