public ActionResult Index() { bool easyInstall = System.Configuration.ConfigurationManager.AppSettings["EasyInstall"].ToLowerInvariant() == "true"; if (!easyInstall) { return(this.Failed("Access is denied. In order to use this feature, please enter a key named EasyInstall with value true on Web.config/AppSettings.", System.Net.HttpStatusCode.Conflict)); } if (!Directory.Exists(HostingEnvironment.MapPath("~/Resources/_Configs"))) { return(this.Failed("Cannot continue. The configuration template directory: /Resources/_Configs was not found.", System.Net.HttpStatusCode.Conflict)); } var model = EasyInstallConfigFile.Get(); if (model == null) { model = new InstallViewModel { DomainName = this.Request.Url.Host, DatabaseName = ByConvention.ConvertToTenantName(this.Request.Url.Host), SqlServer = new SqlServerConfig(), PostgreSQL = new PostgreSQLConfig() }; } return(this.View("~/Views/EasyInstall.cshtml", model)); }
public static string WriteConfig() { var model = EasyInstallConfigFile.Get(); return(ConfigWriter.WriteConfig(model)); }
public static string TestSqlServer() { var model = EasyInstallConfigFile.Get(); return(SqlServerConnectionTester.Test(model.SqlServer)); }
public static string TestRedis() { var model = EasyInstallConfigFile.Get(); return(RedisConnectionTester.Test(model.RedisConnectionString)); }
public static string TestPostgreSQL() { var model = EasyInstallConfigFile.Get(); return(PostgreSQLConnectionTester.Test(model.PostgreSQL)); }