Permalink
Browse files

Making sure that a nested config will use the same port, token server…

… and certificate as its children
  • Loading branch information...
ayende committed Mar 18, 2012
1 parent 2df28c1 commit 73d351fd2b5fc92814cf82222ebe4d613bdf3f57
Showing with 11 additions and 1 deletion.
  1. +10 −1 Raven.Database/Config/InMemoryRavenConfiguration.cs
  2. +1 −0 Raven.Database/Server/HttpServer.cs
@@ -146,7 +146,8 @@ public void Initialize()
// HTTP settings
HostName = Settings["Raven/HostName"];
- Port = PortUtil.GetPort(Settings["Raven/Port"]);
+ if(string.IsNullOrEmpty(DatabaseName)) // we only use this for root database
+ Port = PortUtil.GetPort(Settings["Raven/Port"]);
SetVirtualDirectory();
bool httpCompressionTemp;
@@ -728,5 +729,13 @@ public void CustomizeValuesForTenant(string tenantId)
if (string.IsNullOrEmpty(Settings["Raven/Esent/LogsPath"]) == false)
Settings["Raven/Esent/LogsPath"] = Path.Combine(Settings["Raven/Esent/LogsPath"], "Tenants", tenantId);
}
+
+ public void CopyParentSettings(InMemoryRavenConfiguration defaultConfiguration)
+ {
+ Port = defaultConfiguration.Port;
+ OAuthTokenCertificate = defaultConfiguration.OAuthTokenCertificate;
+ OAuthTokenServer = defaultConfiguration.OAuthTokenServer;
+ AuthenticationMode = defaultConfiguration.AuthenticationMode;
+ }
}
}
@@ -691,6 +691,7 @@ protected bool TryGetOrCreateResourceStore(string tenantId, out DocumentDatabase
config.DatabaseName = tenantId;
config.Initialize();
+ config.CopyParentSettings(DefaultConfiguration);
var documentDatabase = new DocumentDatabase(config);
documentDatabase.SpinBackgroundWorkers();
return documentDatabase;

0 comments on commit 73d351f

Please sign in to comment.