/// <summary>
 /// Construct an <see cref="AdministrationController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="gitHubClientFactory">The value of <see cref="gitHubClientFactory"/></param>
 /// <param name="serverUpdater">The value of <see cref="serverUpdater"/></param>
 /// <param name="application">The value of <see cref="application"/></param>
 /// <param name="ioManager">The value of <see cref="ioManager"/></param>
 /// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/></param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param>
 /// <param name="updatesConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="updatesConfiguration"/></param>
 /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="generalConfiguration"/></param>
 public AdministrationController(
     IDatabaseContext databaseContext,
     IAuthenticationContextFactory authenticationContextFactory,
     IGitHubClientFactory gitHubClientFactory,
     IServerControl serverUpdater,
     IApplication application,
     IIOManager ioManager,
     IPlatformIdentifier platformIdentifier,
     ILogger <AdministrationController> logger,
     IOptions <UpdatesConfiguration> updatesConfigurationOptions,
     IOptions <GeneralConfiguration> generalConfigurationOptions)
     : base(
         databaseContext,
         authenticationContextFactory,
         logger,
         false,
         true)
 {
     this.gitHubClientFactory = gitHubClientFactory ?? throw new ArgumentNullException(nameof(gitHubClientFactory));
     this.serverUpdater       = serverUpdater ?? throw new ArgumentNullException(nameof(serverUpdater));
     this.application         = application ?? throw new ArgumentNullException(nameof(application));
     this.ioManager           = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
     this.platformIdentifier  = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier));
     updatesConfiguration     = updatesConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(updatesConfigurationOptions));
     generalConfiguration     = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AdministrationController"/> class.
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/>.</param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/>.</param>
 /// <param name="gitHubClientFactory">The value of <see cref="gitHubClientFactory"/>.</param>
 /// <param name="serverControl">The value of <see cref="serverControl"/>.</param>
 /// <param name="serverUpdater">The value of <see cref="serverUpdater"/>.</param>
 /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/>.</param>
 /// <param name="ioManager">The value of <see cref="ioManager"/>.</param>
 /// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/>.</param>
 /// <param name="fileTransferService">The value of <see cref="fileTransferService"/>.</param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/>.</param>
 /// <param name="updatesConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="updatesConfiguration"/>.</param>
 /// <param name="fileLoggingConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="fileLoggingConfiguration"/>.</param>
 public AdministrationController(
     IDatabaseContext databaseContext,
     IAuthenticationContextFactory authenticationContextFactory,
     IGitHubClientFactory gitHubClientFactory,
     IServerControl serverControl,
     IServerUpdateInitiator serverUpdater,
     IAssemblyInformationProvider assemblyInformationProvider,
     IIOManager ioManager,
     IPlatformIdentifier platformIdentifier,
     IFileTransferTicketProvider fileTransferService,
     ILogger <AdministrationController> logger,
     IOptions <UpdatesConfiguration> updatesConfigurationOptions,
     IOptions <FileLoggingConfiguration> fileLoggingConfigurationOptions)
     : base(
         databaseContext,
         authenticationContextFactory,
         logger,
         true)
 {
     this.gitHubClientFactory         = gitHubClientFactory ?? throw new ArgumentNullException(nameof(gitHubClientFactory));
     this.serverControl               = serverControl ?? throw new ArgumentNullException(nameof(serverControl));
     this.serverUpdater               = serverUpdater ?? throw new ArgumentNullException(nameof(serverUpdater));
     this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
     this.ioManager           = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
     this.platformIdentifier  = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier));
     this.fileTransferService = fileTransferService ?? throw new ArgumentNullException(nameof(fileTransferService));
     updatesConfiguration     = updatesConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(updatesConfigurationOptions));
     fileLoggingConfiguration = fileLoggingConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(fileLoggingConfigurationOptions));
 }
 /// <summary>
 /// Construct an <see cref="AdministrationController"/>
 /// </summary>
 /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param>
 /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param>
 /// <param name="gitHubClient">The value of <see cref="gitHubClient"/></param>
 /// <param name="serverUpdater">The value of <see cref="serverUpdater"/></param>
 /// <param name="application">The value of <see cref="application"/></param>
 /// <param name="ioManager">The value of <see cref="ioManager"/></param>
 /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param>
 /// <param name="updatesConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="updatesConfiguration"/></param>
 public AdministrationController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, IGitHubClient gitHubClient, IServerControl serverUpdater, IApplication application, IIOManager ioManager, ILogger <AdministrationController> logger, IOptions <UpdatesConfiguration> updatesConfigurationOptions) : base(databaseContext, authenticationContextFactory, logger, false)
 {
     this.gitHubClient    = gitHubClient ?? throw new ArgumentNullException(nameof(gitHubClient));
     this.serverUpdater   = serverUpdater ?? throw new ArgumentNullException(nameof(serverUpdater));
     this.application     = application ?? throw new ArgumentNullException(nameof(application));
     this.ioManager       = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
     updatesConfiguration = updatesConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(updatesConfigurationOptions));
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerUpdateInitiator"/> class.
 /// </summary>
 /// <param name="gitHubClientFactory">The value of <see cref="gitHubClientFactory"/>.</param>
 /// <param name="ioManager">The value of <see cref="ioManager"/>.</param>
 /// <param name="serverControl">The value of <see cref="serverControl"/>.</param>
 /// <param name="logger">The value of <see cref="logger"/>.</param>
 /// <param name="updatesConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="updatesConfiguration"/>.</param>
 public ServerUpdateInitiator(
     IGitHubClientFactory gitHubClientFactory,
     IIOManager ioManager,
     IServerControl serverControl,
     ILogger <ServerUpdateInitiator> logger,
     IOptions <UpdatesConfiguration> updatesConfigurationOptions)
 {
     this.gitHubClientFactory = gitHubClientFactory ?? throw new ArgumentNullException(nameof(gitHubClientFactory));
     this.ioManager           = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
     this.serverControl       = serverControl ?? throw new ArgumentNullException(nameof(serverControl));
     this.logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     updatesConfiguration = updatesConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(updatesConfigurationOptions));
 }
예제 #5
0
        private RavenConfiguration(string resourceName, ResourceType resourceType, string customConfigPath = null, bool skipEnvironmentVariables = false)
        {
            _logger = LoggingSource.Instance.GetLogger <RavenConfiguration>(resourceName);

            ResourceName      = resourceName;
            ResourceType      = resourceType;
            _customConfigPath = customConfigPath;
            PathSettingBase <string> .ValidatePath(_customConfigPath);

            _configBuilder = new ConfigurationBuilder();
            if (skipEnvironmentVariables == false)
            {
                AddEnvironmentVariables();
            }
            AddJsonConfigurationVariables(customConfigPath);

            Settings = _configBuilder.Build();

            Core = new CoreConfiguration();

            Http             = new HttpConfiguration();
            Replication      = new ReplicationConfiguration();
            Cluster          = new ClusterConfiguration();
            Etl              = new EtlConfiguration();
            Storage          = new StorageConfiguration();
            Security         = new SecurityConfiguration();
            Backup           = new BackupConfiguration();
            PerformanceHints = new PerformanceHintsConfiguration();
            Indexing         = new IndexingConfiguration(this);
            Monitoring       = new MonitoringConfiguration();
            Queries          = new QueryConfiguration();
            Patching         = new PatchingConfiguration();
            Logs             = new LogsConfiguration();
            Server           = new ServerConfiguration();
            Embedded         = new EmbeddedConfiguration();
            Databases        = new DatabaseConfiguration(Storage.ForceUsing32BitsPager);
            Memory           = new MemoryConfiguration();
            Studio           = new StudioConfiguration();
            Licensing        = new LicenseConfiguration();
            Tombstones       = new TombstoneConfiguration();
            Subscriptions    = new SubscriptionsConfiguration();
            TransactionMergerConfiguration = new TransactionMergerConfiguration(Storage.ForceUsing32BitsPager);
            Notifications = new NotificationsConfiguration();
            Updates       = new UpdatesConfiguration();
            Migration     = new MigrationConfiguration();
            Integrations  = new IntegrationsConfiguration();
        }
예제 #6
0
        public void Initialize(UpdatesConfiguration configuration)
        {
            if (configuration.BackgroundChecksDisabled)
            {
                return;
            }

            if (_timer != null)
            {
                return;
            }

            lock (_locker)
            {
                if (_timer != null)
                {
                    return;
                }

                _releaseChannel = configuration.Channel.ToString();
                _timer          = new Timer(async state => await PerformAsync(), null, (int)TimeSpan.FromMinutes(5).TotalMilliseconds, (int)TimeSpan.FromHours(12).TotalMilliseconds);
            }
        }