Ejemplo n.º 1
0
 public TestController(ILanguageService languageService,
     ICurrencyService currencyService, ILocalizationService localizationService,
     IWorkContext workContext, IInstallationService installationService,
     IQueuedEmailService queuedEmailService, IEmailAccountService emailAccountService,            
     IUserService userService, IWebHelper webHelper, ICacheManager cacheManager,
     IPermissionService permissionService, IMobileDeviceHelper mobileDeviceHelper,
     HttpContextBase httpContext, UserSettings userSettings, MediaSettings mediaSettings,
     SiteInformationSettings siteInformationSettings, EmailAccountSettings emailAccountSettings,
     CommonSettings commonSettings, LocalizationSettings localizationSettings)
 {
     this.languageService         = languageService;
     this.currencyService         = currencyService;
     this.localizationService     = localizationService;
     this.workContext             = workContext;
     this.queuedEmailService      = queuedEmailService;
     this.emailAccountService     = emailAccountService;
     this.installationService     = installationService;
     this.userService             = userService;
     this.webHelper               = webHelper;
     this.permissionService       = permissionService;
     this.mobileDeviceHelper      = mobileDeviceHelper;
     this.mediaSettings           = mediaSettings;
     this.httpContext             = httpContext;
     this.userSettings            = userSettings;
     this.siteInformationSettings = siteInformationSettings;
     this.emailAccountSettings    = emailAccountSettings;
     this.cacheManager            = cacheManager;
     this.commonSettings          = commonSettings;
     this.localizationSettings    = localizationSettings;
 }
Ejemplo n.º 2
0
 public InstallController(IInstallationService installationService, IApplicationConfiguration applicationConfiguration, ICryptographyService cryptographyService, ILocalFileProvider localFileProvider)
 {
     _installationService      = installationService;
     _applicationConfiguration = applicationConfiguration;
     _cryptographyService      = cryptographyService;
     _localFileProvider        = localFileProvider;
 }
Ejemplo n.º 3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IWebHostEnvironment env,
                              AtlasDbContext atlasDbContext,
                              ApplicationDbContext applicationDbContext,
                              IInstallationService installationService,
                              IDocumentationService documentationService)
        {
            if (env.IsDevelopment())
            {
                app.UseExceptionHandler("/Error");

                //app.UseDeveloperExceptionPage();
                //app.UseDatabaseErrorPage();
                app.UseWebAssemblyDebugging();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseBlazorFrameworkFiles();
            app.UseStaticFiles();
            //app.UseStaticFiles(new StaticFileOptions
            //{
            //    FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @"Uploads")),
            //    RequestPath = new PathString("/Uploads")
            //});

            app.UseRouting();

            app.UseIdentityServer();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
                endpoints.MapControllers();
                endpoints.MapFallbackToFile("index.html");
            });

            if (Configuration["MigrateDatabases"] == "true")
            {
                atlasDbContext.Database.Migrate();
                applicationDbContext.Database.Migrate();
            }

            if (Configuration["EnsureDefaultSiteInitialized"] == "true")
            {
                installationService.EnsureDefaultSiteInitializedAsync().Wait();
            }

            if (Configuration["GenerateDocumentationOnStartup"] == "true")
            {
                documentationService.Generate(typeof(Site).Assembly);
            }
        }
 public PrerequisitesStepViewModel(IInstallationService installationService)
 {
     Prerequisites = new BindableCollection <PrerequisiteViewModel>(installationService.Prerequisites.Select(p => new PrerequisiteViewModel(installationService, p)));
     foreach (PrerequisiteViewModel prerequisiteViewModel in Prerequisites)
     {
         prerequisiteViewModel.ConductWith(this);
     }
 }
Ejemplo n.º 5
0
 public InstallationModelValidator(IInstallationService installService)
 {
     RuleFor(x => x.AdminEmail).NotEmpty().EmailAddress();
     RuleFor(x => x.AdminPassword).NotEmpty();
     RuleFor(x => x.ConfirmPassword).NotEmpty();
     RuleFor(x => x.AdminPassword).Equal(x => x.ConfirmPassword).WithMessage(installService.GetResource("PasswordsDoNotMatch"));
     RuleFor(x => x.DataProvider).NotEmpty();
     RuleFor(x => x.PrimaryLanguage).NotEmpty();
 }
Ejemplo n.º 6
0
 public InstallHandler(
     IServiceRegistry registry,
     IInstallationService installer,
     ILogger <InstallCommand> logger)
 {
     _registry  = registry;
     _installer = installer;
     _logger    = logger;
 }
Ejemplo n.º 7
0
 public static Task InstallAsync(
     this IInstallationService installer,
     IEnumerable <IService> services,
     bool concurrent  = false,
     string?directory = null,
     CancellationToken cancellationToken = default)
 => concurrent
         ? Task.WhenAll(services.Select(x => installer.InstallAsync(x, directory, cancellationToken)))
         : InstallAsync(installer, services, directory, cancellationToken);
Ejemplo n.º 8
0
 public InstallHelper(IUmbracoContextAccessor umbracoContextAccessor,
                      DatabaseBuilder databaseBuilder,
                      ILogger logger, IGlobalSettings globalSettings, IInstallationService installationService)
 {
     _httpContext         = umbracoContextAccessor.UmbracoContext.HttpContext;
     _logger              = logger;
     _globalSettings      = globalSettings;
     _databaseBuilder     = databaseBuilder;
     _installationService = installationService;
 }
Ejemplo n.º 9
0
 public InstallController(
     IHostApplicationLifetime hostApplicationLifetime,
     IApplicationContext appContext,
     IAsyncState asyncState)
 {
     _installService          = EngineContext.Current.Scope.ResolveOptional <IInstallationService>();
     _hostApplicationLifetime = hostApplicationLifetime;
     _appContext = appContext;
     _asyncState = asyncState;
 }
        public AttendedViewModel(IInstallationService installationService, InstallViewModel installViewModel, ModifyViewModel modifyViewModel, UninstallViewModel uninstallViewModel)
        {
            _installationService = installationService;
            _installViewModel    = installViewModel;
            _modifyViewModel     = modifyViewModel;
            _uninstallViewModel  = uninstallViewModel;

            _installViewModel.Closed   += ChildOnClosed;
            _uninstallViewModel.Closed += ChildOnClosed;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Checks if a command is installed by a batch file
        /// </summary>
        /// <param name="command">The command that checks if the command is installed</param>
        /// <returns>Returns if the command is installed or not</returns>
        protected static async Task <bool> IsCommandInstalled(string command, IInstallationService installationService)
        {
            var result = await installationService.RunIsCommandInstalled(command);

            if (result.Status != CommandStatus.Success)
            {
                return(false);
            }

            return(ParseResult(result.Output));
        }
Ejemplo n.º 12
0
 public static async Task InstallAsync(
     this IInstallationService installer,
     IEnumerable <IService> services,
     string?directory = null,
     CancellationToken cancellationToken = default)
 {
     foreach (var service in services)
     {
         await installer.InstallAsync(service, directory, cancellationToken);
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="applicationSettings">Use solely to detect whether Roadkill is already installed.</param>
        public InstallController(ApplicationSettings applicationSettings, ConfigReaderWriter configReaderWriter, IInstallationService installationService, IDatabaseTester databaseTester)
        {
            _configReaderWriter  = configReaderWriter;
            _installationService = installationService;
            _databaseTester      = databaseTester;

            ApplicationSettings = applicationSettings;

            // These aren't needed for the installer
            Context         = null;
            SettingsService = null;
            UserService     = null;
        }
Ejemplo n.º 14
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="applicationSettings">Use solely to detect whether Roadkill is already installed.</param>
		public InstallController(ApplicationSettings applicationSettings, ConfigReaderWriter configReaderWriter, IInstallationService installationService, IDatabaseTester databaseTester)
		{
			_configReaderWriter = configReaderWriter;
			_installationService = installationService;
			_databaseTester = databaseTester;

			ApplicationSettings = applicationSettings;

			// These aren't needed for the installer
			Context = null;
			SettingsService = null;
			UserService = null;
		}
Ejemplo n.º 15
0
        public InstallationModelValidator(IInstallationService installService)
        {
            RuleFor(x => x.AdminEmail).NotEmpty().WithMessage(installService.GetResource("AdminEmailRequired")).EmailAddress();
            RuleFor(x => x.AdminPassword).NotEmpty().WithMessage(installService.GetResource("AdminPasswordRequired"));
            RuleFor(x => x.ConfirmPassword).NotEmpty().WithMessage(installService.GetResource("ConfirmPasswordRequired"));
            RuleFor(x => x.AdminPassword).Equal(x => x.ConfirmPassword).WithMessage(installService.GetResource("PasswordsDoNotMatch"));
            RuleFor(x => x.DataProvider).NotEmpty();
            RuleFor(x => x.PrimaryLanguage).NotEmpty();

            RuleFor(x => x.DbRawConnectionString).NotEmpty().When(x => x.UseRawConnectionString).WithMessage(installService.GetResource("DbRawConnectionStringRequired"));
            RuleFor(x => x.DbServer).NotEmpty().When(x => !x.UseRawConnectionString).WithMessage(installService.GetResource("DbServerRequired"));
            RuleFor(x => x.DbName).NotEmpty().When(x => !x.UseRawConnectionString).WithMessage(installService.GetResource("DbNameRequired"));

            RuleFor(x => x.DbUserId).NotEmpty()
            .When(x => !x.UseRawConnectionString && x.DbAuthType != "windows")
            .WithMessage(installService.GetResource("DbUserIdRequired"));
        }
Ejemplo n.º 16
0
        public InstallHelper(DatabaseBuilder databaseBuilder,
                             ILogger <InstallHelper> logger,
                             IUmbracoVersion umbracoVersion,
                             IOptionsMonitor <ConnectionStrings> connectionStrings,
                             IInstallationService installationService,
                             ICookieManager cookieManager,
                             IUserAgentProvider userAgentProvider,
                             IUmbracoDatabaseFactory umbracoDatabaseFactory)
        {
            _logger                 = logger;
            _umbracoVersion         = umbracoVersion;
            _databaseBuilder        = databaseBuilder;
            _connectionStrings      = connectionStrings;
            _installationService    = installationService;
            _cookieManager          = cookieManager;
            _userAgentProvider      = userAgentProvider;
            _umbracoDatabaseFactory = umbracoDatabaseFactory;

            // We need to initialize the type already, as we can't detect later, if the connection string is added on the fly.
            GetInstallationType();
        }
Ejemplo n.º 17
0
 public InstallHelper(
     DatabaseBuilder databaseBuilder,
     ILogger <InstallHelper> logger,
     IUmbracoVersion umbracoVersion,
     IOptionsMonitor <ConnectionStrings> connectionStrings,
     IInstallationService installationService,
     ICookieManager cookieManager,
     IUserAgentProvider userAgentProvider,
     IUmbracoDatabaseFactory umbracoDatabaseFactory)
     : this(
         databaseBuilder,
         logger,
         umbracoVersion,
         connectionStrings,
         installationService,
         cookieManager,
         userAgentProvider,
         umbracoDatabaseFactory,
         StaticServiceProvider.Instance.GetRequiredService <IFireAndForgetRunner>())
 {
 }
Ejemplo n.º 18
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (DataSettingsManager.DatabaseIsInstalled)
            {
                return;
            }
            if (!Enum.TryParse(_installationConfiguration["DataProvider"], out DataProviderType dataProviderType))
            {
                throw new DataException("Wrong data provider type.");
            }

            var dataProvider     = DataProviderManager.GetDataProvider(dataProviderType);
            var connectionString = _installationConfiguration["ConnectionString"];

            if (connectionString.IsNullOrEmpty())
            {
                throw new DataException("Connection string is wrong.");
            }

            DataSettingsManager.SaveSettings(new DataSettings()
            {
                DataProvider     = dataProviderType,
                ConnectionString = connectionString
            }, _fileProvider);

            DataSettingsManager.LoadSettings(reloadSettings: true);
            if (!dataProvider.IsDatabaseExists())
            {
                dataProvider.CreateDatabase(_installationConfiguration["Collation"]);
                dataProvider.InitializeDatabase();
                _installationService = EngineContext.Current.Resolve <IInstallationService>();
                _installationService.InstallRequiredData();

                return;
            }
            //update schema
            dataProvider.InitializeDatabase();
        }
Ejemplo n.º 19
0
 public InstallController(IInstallationService installationService)
 {
     _installationService = installationService;
 }
Ejemplo n.º 20
0
 public InstallationController(IInstallationService installationService)
 {
     this.installationService = installationService;
 }
Ejemplo n.º 21
0
 public PrerequisiteViewModel(IInstallationService installationService, IPrerequisite prerequisite)
 {
     _installationService = installationService;
     Prerequisite         = prerequisite;
 }
Ejemplo n.º 22
0
		public InstallControllerStub(ApplicationSettings settings, ConfigReaderWriter configReaderWriter, IInstallationService installationService, IDatabaseTester databaseTester)
			: base(settings, configReaderWriter, installationService, databaseTester)
		{

		}
Ejemplo n.º 23
0
 public InstallController(IInstallationService installationService, IApplicationConfiguration applicationConfiguration, ICryptographyService cryptographyService)
 {
     _installationService      = installationService;
     _applicationConfiguration = applicationConfiguration;
     _cryptographyService      = cryptographyService;
 }
 public InstallationController(IInstallationService installation)
 {
     _installation = installation;
 }
Ejemplo n.º 25
0
 public BaseInstallationHandler(IInstallationService installationService)
 {
     this.installationService = installationService;
 }
Ejemplo n.º 26
0
 public AppInstallation(IInstallationService installService)
 {
     _installService = installService;
 }
 public FinishStepViewModel(IInstallationService installationService)
 {
     _installationService = installationService;
 }
 public InstallationController(ILogger <InstallationController> logger, IHttpContextAccessor iHttpContextAccessor, IInstallationService iInstallationService)
 {
     _logger = logger;
     _httpContextAccessor  = iHttpContextAccessor;
     _iInstallationService = iInstallationService;
 }
Ejemplo n.º 29
0
 public InstallControllerStub(ApplicationSettings settings, ConfigReaderWriter configReaderWriter, IInstallationService installationService, IDatabaseTester databaseTester)
     : base(settings, configReaderWriter, installationService, databaseTester)
 {
 }
 public UninstallationViewModel(IInstallationService installationService)
 {
     _installationService = installationService;
 }
Ejemplo n.º 31
0
 private static Task <bool> IsCommandInstalled(IInstallationService installationService, string nPM_INSTALLATION_CHECK_COMMAND)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 32
0
 public InstallController(IInstallationService installationService)
 {
     _installationService = installationService;
 }
 public OptionsStepViewModel(IInstallationService installationService)
 {
     _installationService = installationService;
 }
Ejemplo n.º 34
0
 public SystemController(IAboutModelFactory aboutModelFactory, IInstallationService installationService)
 {
     _aboutModelFactory   = aboutModelFactory;
     _installationService = installationService;
 }