public override void ApplyToInnovatorComponent(InnovatorComponent innovatorComponent) { if (HasSomethingToDeploy(innovatorComponent)) { RunArasUpdateCmdForComponent(innovatorComponent); } }
public override void Connect(IReadOnlyCollection <Component> instanceComponents) { Logger.Instance.Log(LogLevel.Info, "\nConfiguring component ({0}) to work with component({1}):\n", AgentComponentId, InnovatorComponentId); AgentComponent agentComponent = instanceComponents.Single(c => c.Id == AgentComponentId) as AgentComponent; InnovatorComponent innovatorComponent = instanceComponents.Single(c => c.Id == InnovatorComponentId) as InnovatorComponent; innovatorComponent.TargetFileSystem.XmlHelper.XmlPoke(innovatorComponent.PathToConfig, "/Innovator/AgentService/@InnovatorToServiceAddress", agentComponent.Url); }
public override void Connect(IReadOnlyCollection <Component> instanceComponents) { Logger.Instance.Log(LogLevel.Info, "\nConfiguring component ({0}) to work with component({1}):\n", OAuthComponentId, InnovatorComponentId); OAuthComponent oauthComponent = instanceComponents.Single(c => c.Id == OAuthComponentId) as OAuthComponent; InnovatorComponent innovatorComponent = instanceComponents.Single(c => c.Id == InnovatorComponentId) as InnovatorComponent; SetupRedirectUris(oauthComponent, innovatorComponent); }
public override void Connect(IReadOnlyCollection <Component> instanceComponents) { Logger.Instance.Log(LogLevel.Info, "\nConfiguring component ({0}) to work with component({1}):\n", DatabaseComponentId, InnovatorComponentId); DatabaseComponent databaseComponent = instanceComponents.Single(c => c.Id == DatabaseComponentId) as DatabaseComponent; InnovatorComponent innovatorComponent = instanceComponents.Single(c => c.Id == InnovatorComponentId) as InnovatorComponent; innovatorComponent.TargetFileSystem.XmlHelper.AppendFragment( GetDBConnectionString(databaseComponent), innovatorComponent.TargetFileSystem.XmlHelper.GetNode(innovatorComponent.PathToConfig, "/Innovator")); }
public override void ApplyToInnovatorComponent(InnovatorComponent innovatorComponent) { ApplyToWebComponent(innovatorComponent); string deploymentPackageSourcePath = Path.Combine(PathToDeploymentPackage, innovatorComponent.DeploymentPackageDirectoryName); if (Directory.Exists(Path.Combine(deploymentPackageSourcePath, "Client"))) { IncreamentClientWebConfigFilesRevision(innovatorComponent); } innovatorComponent.SetupNtfsPermissions(); }
private void SetupRedirectUris(OAuthComponent oauthComponent, InnovatorComponent innovatorComponent) { ICollection <string> innovatorClientUrls = new List <string>(); Uri innovatorServerUri = new Uri(innovatorComponent.Url); // innovatorServerUri.Host may contain localhost, IP, Computername or FQDN // GetHostEntry allow to get FQDN by any of this values string dnsHostName = Dns.GetHostEntry(innovatorServerUri.Host).HostName; ICollection <string> innovatorServerHosts = new HashSet <string>(); // Add always "localhost" innovatorServerHosts.Add("localhost"); // Add host name (computer name) innovatorServerHosts.Add(dnsHostName.Split('.')[0]); // Add FQDN innovatorServerHosts.Add(dnsHostName); // Get IP addresses for FQDN (IPv4 only) foreach (IPAddress ipAddress in Dns.GetHostAddresses(dnsHostName).Where(hostName => IsInterNetwork(hostName))) { innovatorServerHosts.Add(ipAddress.ToString()); } string webAlias = ParseInnovatorServerWebAlias(innovatorServerUri); foreach (string innovatorServerHost in innovatorServerHosts) { innovatorClientUrls.Add(string.Format(CultureInfo.InvariantCulture, "{0}://{1}{2}Client", innovatorServerUri.Scheme, innovatorServerHost, webAlias)); } // Create redirectUris content based on redirectUris values StringBuilder redirectUrisContent = new StringBuilder(); StringBuilder postLogoutRedirectUrisContent = new StringBuilder(); foreach (string innovatorClientUrl in innovatorClientUrls) { redirectUrisContent.AppendLine(string.Format(CultureInfo.InvariantCulture, "\t\t\t\t\t<redirectUri value='{0}/OAuth/RedirectCallback' />", innovatorClientUrl)); redirectUrisContent.AppendLine(string.Format(CultureInfo.InvariantCulture, "\t\t\t\t\t<redirectUri value='{0}/OAuth/SilentCallback' />", innovatorClientUrl)); redirectUrisContent.AppendLine(string.Format(CultureInfo.InvariantCulture, "\t\t\t\t\t<redirectUri value='{0}/OAuth/PopupCallback' />", innovatorClientUrl)); postLogoutRedirectUrisContent.AppendLine(string.Format(CultureInfo.InvariantCulture, "\t\t\t\t\t<redirectUri value='{0}/OAuth/PostLogoutCallback' />", innovatorClientUrl)); } string pathToOAuthConfig = BaseFileSystem.CombinePaths(oauthComponent.InstallationPath, "OAuth.config"); oauthComponent.TargetFileSystem.XmlHelper.AppendFragment( redirectUrisContent.ToString(), oauthComponent.TargetFileSystem.XmlHelper.GetNode(pathToOAuthConfig, "/oauth/server/clientRegistries/clientRegistry[@id='InnovatorClient']/redirectUris")); oauthComponent.TargetFileSystem.XmlHelper.AppendFragment( postLogoutRedirectUrisContent.ToString(), oauthComponent.TargetFileSystem.XmlHelper.GetNode(pathToOAuthConfig, "/oauth/server/clientRegistries/clientRegistry[@id='InnovatorClient']/postLogoutRedirectUris")); }
private void IncreamentClientWebConfigFilesRevision(InnovatorComponent innovatorComponent) { string pathToClientWebConfig = Path.Combine(innovatorComponent.InstallationPath, "Client\\web.config"); string filesRevisionXpath = "/configuration/cachingModule/@filesRevision"; string currentRevision = innovatorComponent.TargetFileSystem.XmlHelper.XmlPeek(pathToClientWebConfig, filesRevisionXpath); int nextRevision; if (int.TryParse(currentRevision, NumberStyles.Integer, CultureInfo.InvariantCulture, out nextRevision)) { nextRevision++; } else { nextRevision = 2; } Logger.Instance.Log(LogLevel.Info, "Updating files revision from '{0}' to '{1}' for client web.config", currentRevision, nextRevision); innovatorComponent.TargetFileSystem.XmlHelper.XmlPoke(pathToClientWebConfig, filesRevisionXpath, nextRevision.ToString(CultureInfo.InvariantCulture)); }
public override void Connect(IReadOnlyCollection <Component> instanceComponents) { Logger.Instance.Log(LogLevel.Info, "\nConfiguring WinAuth for component ({0}):\n", InnovatorComponentId); InnovatorComponent innovatorComponent = instanceComponents.Single(c => c.Id == InnovatorComponentId) as InnovatorComponent; OAuthComponent oauthComponent = instanceComponents.Single(c => c.Id == OAuthComponentId) as OAuthComponent; Logger.Instance.Log(LogLevel.Info, "Enabling Windows authentication for login.aspx and IOMlogin.aspx"); innovatorComponent.SetupWinAuth(); if (!innovatorComponent.TargetFileSystem.XmlHelper.CheckIfExists(innovatorComponent.PathToConfig, "/Innovator/ClientConfig")) { Logger.Instance.Log(LogLevel.Info, "Appending 'ClientConfig' node to InnovatorServerConfig.xml"); innovatorComponent.TargetFileSystem.XmlHelper.AppendFragment(ClientConfigNodeContent, innovatorComponent.TargetFileSystem.XmlHelper.GetNode(innovatorComponent.PathToConfig, "/Innovator")); } if (!innovatorComponent.TargetFileSystem.XmlHelper.CheckIfExists(innovatorComponent.PathToConfig, "/Innovator/ClientLogon")) { Logger.Instance.Log(LogLevel.Info, "Appending 'ClientLogon' node to InnovatorServerConfig.xml"); innovatorComponent.TargetFileSystem.XmlHelper.AppendFragment(ClientLogonNodeContent, innovatorComponent.TargetFileSystem.XmlHelper.GetNode(innovatorComponent.PathToConfig, "/Innovator")); } string pathToClientOAuthConfig = Path.Combine(innovatorComponent.InstallationPath, "Client\\OAuth.config"); if (!innovatorComponent.TargetFileSystem.XmlHelper.CheckIfExists(pathToClientOAuthConfig, "/oauth/client/serverLocation")) { Logger.Instance.Log(LogLevel.Info, "Specifying correct OAuth Url ({0}) in the Innovator\\Client\\OAuth.config", oauthComponent.Url); innovatorComponent.TargetFileSystem.XmlHelper.AppendFragment(string.Format("<serverLocation url=\"{0}\" />", oauthComponent.Url), innovatorComponent.TargetFileSystem.XmlHelper.GetNode(pathToClientOAuthConfig, "/oauth/client")); } }
public abstract void ApplyToInnovatorComponent(InnovatorComponent innovatorComponent);