Example #1
0
        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));
        }
Example #2
0
        public static string WriteConfig()
        {
            var model = EasyInstallConfigFile.Get();

            return(ConfigWriter.WriteConfig(model));
        }
Example #3
0
 public static void Save(InstallViewModel model)
 {
     EasyInstallConfigFile.Save(model);
 }
Example #4
0
        public static string TestRedis()
        {
            var model = EasyInstallConfigFile.Get();

            return(RedisConnectionTester.Test(model.RedisConnectionString));
        }
Example #5
0
        public static string TestSqlServer()
        {
            var model = EasyInstallConfigFile.Get();

            return(SqlServerConnectionTester.Test(model.SqlServer));
        }
Example #6
0
        public static string TestPostgreSQL()
        {
            var model = EasyInstallConfigFile.Get();

            return(PostgreSQLConnectionTester.Test(model.PostgreSQL));
        }