2using System.Collections.Frozen;
3using System.Collections.Generic;
4using System.Globalization;
5using System.Threading.Tasks;
8using Cyberboss.AspNetCore.AsyncInitializer;
10using Elastic.CommonSchema.Serilog;
12using HotChocolate.AspNetCore;
13using HotChocolate.Subscriptions;
14using HotChocolate.Types;
16using Microsoft.AspNetCore.Authentication;
17using Microsoft.AspNetCore.Authentication.Cookies;
18using Microsoft.AspNetCore.Authentication.JwtBearer;
19using Microsoft.AspNetCore.Authentication.OpenIdConnect;
20using Microsoft.AspNetCore.Builder;
21using Microsoft.AspNetCore.Cors.Infrastructure;
22using Microsoft.AspNetCore.Hosting;
23using Microsoft.AspNetCore.Http;
24using Microsoft.AspNetCore.Http.Connections;
25using Microsoft.AspNetCore.HttpOverrides;
26using Microsoft.AspNetCore.Identity;
27using Microsoft.AspNetCore.Mvc.Infrastructure;
28using Microsoft.AspNetCore.SignalR;
29using Microsoft.Extensions.Configuration;
30using Microsoft.Extensions.DependencyInjection;
31using Microsoft.Extensions.Hosting;
32using Microsoft.Extensions.Logging;
33using Microsoft.Extensions.Options;
34using Microsoft.IdentityModel.Protocols.OpenIdConnect;
42using Serilog.Formatting.Display;
43using Serilog.Sinks.Elasticsearch;
88#pragma warning disable CA1506
94 readonly IWebHostEnvironment hostingEnvironment;
110 assemblyInformationProvider,
120 static void AddWatchdog<TSystemWatchdogFactory>(IServiceCollection services,
IPostSetupServices postSetupServices)
123 if (postSetupServices.GeneralConfiguration.UseBasicWatchdog)
134 static string GetOidcScheme(
string schemeKey)
135 => AuthenticationContextFactory.OpenIDConnectAuthenticationSchemePrefix + schemeKey;
143 IConfiguration configuration,
144 IWebHostEnvironment hostingEnvironment)
145 : base(configuration)
147 this.hostingEnvironment = hostingEnvironment ??
throw new ArgumentNullException(nameof(hostingEnvironment));
157 public void ConfigureServices(
158 IServiceCollection services,
163 ConfigureServices(services, assemblyInformationProvider, ioManager);
165 ArgumentNullException.ThrowIfNull(postSetupServices);
175 services.AddOptions();
178 services.Configure<HostOptions>(
181 static LogEventLevel? ConvertSeriLogLevel(LogLevel logLevel) =>
184 LogLevel.Critical => LogEventLevel.Fatal,
185 LogLevel.Debug => LogEventLevel.Debug,
186 LogLevel.Error => LogEventLevel.Error,
187 LogLevel.Information => LogEventLevel.Information,
188 LogLevel.Trace => LogEventLevel.Verbose,
189 LogLevel.Warning => LogEventLevel.Warning,
190 LogLevel.None =>
null,
191 _ =>
throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture,
"Invalid log level {0}", logLevel)),
196 services.SetupLogging(
199 if (microsoftEventLevel.HasValue)
201 config.MinimumLevel.Override(
"Microsoft", microsoftEventLevel.Value);
202 config.MinimumLevel.Override(
"System.Net.Http.HttpClient", microsoftEventLevel.Value);
212 assemblyInformationProvider,
217 var formatter =
new MessageTemplateTextFormatter(
220 +
"): [{Level:u3}] {SourceContext:l}: {Message} ({EventId:x8}){NewLine}{Exception}",
223 logPath = ioManager.
ConcatPath(logPath,
"tgs-.log");
224 var rollingFileConfig = sinkConfig.File(
227 logEventLevel ?? LogEventLevel.Verbose,
229 flushToDiskInterval: TimeSpan.FromSeconds(2),
230 rollingInterval: RollingInterval.Day,
231 rollOnFileSizeLimit: true);
233 elasticsearchConfiguration.Enable
234 ?
new ElasticsearchSinkOptions(elasticsearchConfiguration.Host ??
throw new InvalidOperationException($
"Missing {ElasticsearchConfiguration.Section}:{nameof(elasticsearchConfiguration.Host)}!"))
238 ModifyConnectionSettings = connectionConfigration => (!String.IsNullOrWhiteSpace(elasticsearchConfiguration.Username) && !String.IsNullOrWhiteSpace(elasticsearchConfiguration.Password))
239 ? connectionConfigration
240 .BasicAuthentication(
241 elasticsearchConfiguration.Username,
242 elasticsearchConfiguration.Password)
243 .ServerCertificateValidationCallback((o, certificate, chain, errors) =>
true)
245 CustomFormatter = new EcsTextFormatter(),
246 AutoRegisterTemplate = true,
247 AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv7,
248 IndexFormat =
"tgs-logs",
258 var jsonVersionConverterList =
new List<JsonConverter>
263 void ConfigureNewtonsoftJsonSerializerSettingsForApi(JsonSerializerSettings settings)
265 settings.NullValueHandling = NullValueHandling.Ignore;
266 settings.CheckAdditionalContent =
true;
267 settings.MissingMemberHandling = MissingMemberHandling.Error;
268 settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
269 settings.Converters = jsonVersionConverterList;
275 options.ReturnHttpNotAcceptable =
true;
276 options.RespectBrowserAcceptHeader =
true;
278 .AddNewtonsoftJson(options =>
280 options.AllowInputFormatterExceptionMessages =
true;
281 ConfigureNewtonsoftJsonSerializerSettingsForApi(options.SerializerSettings);
289 .AddNewtonsoftJsonProtocol(options =>
291 ConfigureNewtonsoftJsonSerializerSettingsForApi(options.PayloadSerializerSettings);
299 var assemblyDocumentationPath = GetDocumentationFilePath(GetType().Assembly.Location);
300 var apiDocumentationPath = GetDocumentationFilePath(typeof(
ApiHeaders).Assembly.Location);
302 services.AddSwaggerGenNewtonsoftSupport();
309 services.AddHttpClient();
315 services.AddSingleton<IMetricFactory>(_ => Metrics.DefaultFactory);
316 services.AddSingleton<ICollectorRegistry>(_ => Metrics.DefaultRegistry);
319 services.AddMetricServer(options => options.Port = prometheusPort.Value);
321 services.UseHttpClientMetrics();
323 var healthChecksBuilder = services
325 .ForwardToPrometheus();
337 .RequireAuthenticatedUser()
343 builder.RequireAuthenticatedUser();
344 builder.AuthenticationSchemes.Add(CookieAuthenticationDefaults.AuthenticationScheme);
347 .ModifyOptions(options =>
349 options.EnsureAllNodesCanBeResolved =
true;
350 options.EnableFlagEnums =
true;
353 .ModifyCostOptions(options =>
355 options.EnforceCostLimits =
false;
358 .AddMutationConventions()
359 .AddInMemorySubscriptions(
360 new SubscriptionOptions
362 TopicBufferCapacity = 1024,
364 .AddGlobalObjectIdentification()
365 .AddQueryFieldToMutationPayloads()
366 .ModifyOptions(options =>
368 options.EnableDefer =
true;
370 .ModifyPagingOptions(pagingOptions =>
372 pagingOptions.IncludeTotalCount =
true;
373 pagingOptions.RequirePagingBoundaries =
false;
381 .AddType<StandaloneNode>()
383 .AddType<RemoteGateway>()
384 .AddType<GraphQL.Types.UserName>()
385 .AddType<UnsignedIntType>()
387 .TryAddTypeInterceptor<RightsTypeInterceptor>()
388 .AddQueryType<
Query>()
389 .AddMutationType<Mutation>()
392 void AddTypedContext<TContext>()
397 services.AddDbContextPool<TContext>((serviceProvider, builder) =>
399 if (hostingEnvironment.IsDevelopment())
400 builder.EnableSensitiveDataLogging();
402 var databaseConfigOptions = serviceProvider.GetRequiredService<IOptions<DatabaseConfiguration>>();
403 var databaseConfig = databaseConfigOptions.Value ??
throw new InvalidOperationException(
"DatabaseConfiguration missing!");
404 configureAction(builder, databaseConfig);
406 services.AddScoped<
IDatabaseContext>(x => x.GetRequiredService<TContext>());
409 .AddDbContextCheck<TContext>();
418 AddTypedContext<MySqlDatabaseContext>();
421 AddTypedContext<SqlServerDatabaseContext>();
424 AddTypedContext<SqliteDatabaseContext>();
427 AddTypedContext<PostgresSqlDatabaseContext>();
430 throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture,
"Invalid {0}: {1}!", nameof(
DatabaseType), dbType));
443 services.AddSingleton<IPasswordHasher<Models.User>, PasswordHasher<Models.User>>();
448 AddWatchdog<WindowsWatchdogFactory>(services, postSetupServices);
462 AddWatchdog<PosixWatchdogFactory>(services, postSetupServices);
473 services.AddSingleton(x =>
new Lazy<IProcessExecutor>(() => x.GetRequiredService<
IProcessExecutor>(),
true));
481 var openDreamRepositoryDirectory = ioManager.
ConcatPath(
482 ioManager.GetPathInLocalDirectory(assemblyInformationProvider),
483 "OpenDreamRepository");
484 services.AddSingleton(
486 .GetRequiredService<IRepositoryManagerFactory>()
487 .CreateRepositoryManager(
490 openDreamRepositoryDirectory),
493 services.AddSingleton(
494 serviceProvider =>
new Dictionary<EngineType, IEngineInstaller>
499 .ToFrozenDictionary());
525 services.AddChatProviderFactory();
527 services.AddSingleton<IServerUpdater, ServerUpdater>();
528 services.AddSingleton<IServerUpdateInitiator, ServerUpdateInitiator>();
543 services.AddSingleton<IServerPortProvider, ServerPortProivder>();
545 services.AddHostedService<CommandPipeManager>();
546 services.AddHostedService<VersionReportingService>();
548 services.AddFileDownloader();
549 services.AddGitHub();
580 public void Configure(
581 IApplicationBuilder applicationBuilder,
582 IServerControl serverControl,
584 IServerPortProvider serverPortProvider,
586 IOptions<ControlPanelConfiguration> controlPanelConfigurationOptions,
587 IOptions<GeneralConfiguration> generalConfigurationOptions,
588 IOptions<DatabaseConfiguration> databaseConfigurationOptions,
589 IOptions<SecurityConfiguration> securityConfigurationOptions,
590 IOptions<SwarmConfiguration> swarmConfigurationOptions,
591 IOptions<InternalConfiguration> internalConfigurationOptions,
592 ILogger<Application> logger)
594 ArgumentNullException.ThrowIfNull(applicationBuilder);
595 ArgumentNullException.ThrowIfNull(serverControl);
597 this.tokenFactory = tokenFactory ??
throw new ArgumentNullException(nameof(tokenFactory));
599 ArgumentNullException.ThrowIfNull(serverPortProvider);
600 ArgumentNullException.ThrowIfNull(assemblyInformationProvider);
602 var controlPanelConfiguration = controlPanelConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(controlPanelConfigurationOptions));
603 var generalConfiguration = generalConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(generalConfigurationOptions));
604 var databaseConfiguration = databaseConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(databaseConfigurationOptions));
605 var swarmConfiguration = swarmConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(swarmConfigurationOptions));
606 var internalConfiguration = internalConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(internalConfigurationOptions));
608 ArgumentNullException.ThrowIfNull(logger);
610 logger.LogDebug(
"Database provider: {provider}", databaseConfiguration.DatabaseType);
611 logger.LogDebug(
"Content Root: {contentRoot}", hostingEnvironment.ContentRootPath);
612 logger.LogTrace(
"Web Root: {webRoot}", hostingEnvironment.WebRootPath);
616 applicationBuilder.UseAdditionalRequestLoggingContext(swarmConfiguration);
619 applicationBuilder.UseServerErrorHandling();
622 var forwardedHeaderOptions =
new ForwardedHeadersOptions
624 ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost,
627 forwardedHeaderOptions.KnownNetworks.Clear();
628 forwardedHeaderOptions.KnownNetworks.Add(
630 global::System.Net.IPAddress.Any,
633 applicationBuilder.UseForwardedHeaders(forwardedHeaderOptions);
636 applicationBuilder.UseHttpMetrics();
639 applicationBuilder.UseServerBranding(assemblyInformationProvider);
642 applicationBuilder.UseDisabledNginxProxyBuffering();
645 applicationBuilder.UseCancelledRequestSuppression();
649 (instanceManager, cancellationToken) => instanceManager.
Ready.WaitAsync(cancellationToken));
651 if (generalConfiguration.HostApiDocumentation)
653 var siteDocPath = Routes.ApiRoot + $
"doc/{SwaggerConfiguration.DocumentName}.json";
654 if (!String.IsNullOrWhiteSpace(controlPanelConfiguration.PublicPath))
655 siteDocPath = controlPanelConfiguration.PublicPath.TrimEnd(
'/') + siteDocPath;
657 applicationBuilder.UseSwagger(options =>
659 options.RouteTemplate = Routes.ApiRoot +
"doc/{documentName}.{json|yaml}";
661 applicationBuilder.UseSwaggerUI(options =>
664 options.SwaggerEndpoint(siteDocPath,
"TGS API");
666 logger.LogTrace(
"Swagger API generation enabled");
670 if (controlPanelConfiguration.Enable)
672 logger.LogInformation(
"Web control panel enabled.");
673 applicationBuilder.UseFileServer(
new FileServerOptions
676 EnableDefaultFiles =
true,
677 EnableDirectoryBrowsing =
false,
678 RedirectToAppendTrailingSlash =
false,
683 logger.LogDebug(
"Web control panel was not included in TGS build!");
685 logger.LogTrace(
"Web control panel disabled!");
689 applicationBuilder.UseRouting();
692 Action<CorsPolicyBuilder>? corsBuilder =
null;
693 if (controlPanelConfiguration.AllowAnyOrigin)
695 logger.LogTrace(
"Access-Control-Allow-Origin: *");
696 corsBuilder = builder => builder.SetIsOriginAllowed(_ =>
true);
698 else if (controlPanelConfiguration.AllowedOrigins?.Count > 0)
700 logger.LogTrace(
"Access-Control-Allow-Origin: {allowedOrigins}", String.Join(
',', controlPanelConfiguration.AllowedOrigins));
701 corsBuilder = builder => builder.WithOrigins([.. controlPanelConfiguration.AllowedOrigins]);
704 var originalBuilder = corsBuilder;
705 corsBuilder = builder =>
711 .SetPreflightMaxAge(TimeSpan.FromDays(1));
712 originalBuilder?.Invoke(builder);
714 applicationBuilder.UseCors(corsBuilder);
717 applicationBuilder.UseApiCompatibility();
720 applicationBuilder.UseAuthentication();
723 applicationBuilder.UseAuthorization();
726 applicationBuilder.UseDbConflictHandling();
729 applicationBuilder.UseEndpoints(endpoints =>
736 options.Transports = HttpTransportType.ServerSentEvents;
737 options.CloseOnAuthenticationExpiration =
true;
739 .RequireAuthorization()
740 .RequireCors(corsBuilder);
743 endpoints.MapControllers();
745 if (internalConfiguration.EnableGraphQL)
747 logger.LogWarning(
"Enabling GraphQL. This API is experimental and breaking changes may occur at any time!");
748 var gqlOptions =
new GraphQLServerOptions
750 EnableBatching =
true,
753 gqlOptions.Tool.Enable = generalConfiguration.HostApiDocumentation;
757 .WithOptions(gqlOptions);
760 if (generalConfiguration.PrometheusPort.HasValue)
761 if (generalConfiguration.PrometheusPort == generalConfiguration.ApiPort)
763 endpoints.MapMetrics();
764 logger.LogDebug(
"Prometheus being hosted alongside server");
767 logger.LogDebug(
"Prometheus being hosted on port {prometheusPort}", generalConfiguration.PrometheusPort);
769 logger.LogTrace(
"Prometheus disabled");
771 endpoints.MapHealthChecks(
"/health");
773 var oidcConfig = securityConfigurationOptions.Value.OpenIDConnect;
774 if (oidcConfig ==
null)
777 foreach (var kvp
in oidcConfig)
779 $
"/oidc/{kvp.Key}/signin",
780 context => context.ChallengeAsync(
781 GetOidcScheme(kvp.Key),
782 new AuthenticationProperties
784 RedirectUri = $
"/oidc/{kvp.Key}/landing",
792 if (controlPanelConfiguration.Enable)
795 logger.LogDebug(
"Starting hosting on port {httpApiPort}...", serverPortProvider.HttpApiPort);
799 protected override void ConfigureHostedService(IServiceCollection services)
807 void ConfigureAuthenticationPipeline(IServiceCollection services,
SecurityConfiguration securityConfiguration)
809 services.AddHttpContextAccessor();
819 services.AddScoped(provider => (provider
820 .GetRequiredService<IHttpContextAccessor>()
821 .HttpContext ??
throw new InvalidOperationException($
"Unable to resolve {nameof(IAuthenticationContext)} due to no HttpContext being available!"))
823 .GetRequiredService<AuthenticationContextFactory>()
824 .CurrentAuthenticationContext);
827 var authBuilder = services
828 .AddAuthentication(options =>
830 options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
832 .AddJwtBearer(jwtBearerOptions =>
836 jwtBearerOptions.TokenValidationParameters = tokenFactory?.
ValidationParameters ??
throw new InvalidOperationException(
"tokenFactory not initialized!");
837 jwtBearerOptions.MapInboundClaims =
false;
838 jwtBearerOptions.Events =
new JwtBearerEvents
840 OnMessageReceived = context =>
842 if (String.IsNullOrWhiteSpace(context.Token))
844 var accessToken = context.Request.Query[
"access_token"];
845 var path = context.HttpContext.Request.Path;
847 if (!String.IsNullOrWhiteSpace(accessToken) &&
848 path.StartsWithSegments(
Routes.
HubsRoot, StringComparison.OrdinalIgnoreCase))
850 context.Token = accessToken;
854 return Task.CompletedTask;
856 OnTokenValidated = context => context
869 if (oidcConfig ==
null || oidcConfig.Count == 0)
872 authBuilder.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme);
874 foreach (var kvp
in oidcConfig)
876 var configName = kvp.Key;
879 GetOidcScheme(configName),
882 var config = kvp.Value;
884 options.Authority = config.Authority?.ToString();
885 options.ClientId = config.ClientId;
886 options.ClientSecret = config.ClientSecret;
888 options.Events =
new OpenIdConnectEvents
890 OnRemoteFailure = context =>
892 context.HandleResponse();
893 context.HttpContext.Response.Redirect($
"{config.ReturnPath}?error={HttpUtility.UrlEncode(context.Failure?.Message ?? $"{options.Events.OnRemoteFailure} was called without an {nameof(
Exception)}!
")}&state=oidc.{HttpUtility.UrlEncode(configName)}");
894 return Task.CompletedTask;
896 OnTicketReceived = context =>
898 var services = context
901 var tokenFactory = services
903 var authenticationContext = services
905 context.HandleResponse();
906 context.HttpContext.Response.Redirect($
"{config.ReturnPath}?code={HttpUtility.UrlEncode(tokenFactory.CreateToken(authenticationContext.User, true))}&state=oidc.{HttpUtility.UrlEncode(configName)}");
907 return Task.CompletedTask;
911 Task CompleteAuth(RemoteAuthenticationContext<OpenIdConnectOptions> context)
926 options.GetClaimsFromUserInfoEndpoint =
true;
927 options.ClaimActions.MapUniqueJsonKey(config.GroupIdClaim, config.GroupIdClaim);
928 options.TokenValidationParameters =
new Microsoft.IdentityModel.Tokens.TokenValidationParameters
930 NameClaimType = config.UsernameClaim,
931 RoleClaimType =
"roles",
934 options.Scope.Add(OpenIdConnectScope.Profile);
935 options.Events.OnUserInformationReceived = CompleteAuth;
938 options.Events.OnTokenValidated = CompleteAuth;
940 options.Scope.Add(OpenIdConnectScope.OpenId);
941 options.Scope.Add(OpenIdConnectScope.OfflineAccess);
944 options.RequireHttpsMetadata =
false;
947 options.SaveTokens =
true;
948 options.ResponseType = OpenIdConnectResponseType.Code;
949 options.MapInboundClaims =
false;
951 options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
953 var basePath = $
"/oidc/{configName}/";
954 options.CallbackPath =
new PathString(basePath +
"signin-callback");
955 options.SignedOutCallbackPath =
new PathString(basePath +
"signout-callback");
956 options.RemoteSignOutPath =
new PathString(basePath +
"signout");
Routes to a server actions.
const string GraphQL
The GraphQL route.
const string HubsRoot
The root route of all hubs.
const string JobsHub
The root route of all hubs.
Base implementation of IEngineInstaller for EngineType.Byond.
Implementation of IEngineInstaller that forwards calls to different IEngineInstaller based on their a...
Implementation of IEngineInstaller for EngineType.OpenDream.
IEngineInstaller for Posix systems.
IEngineInstaller for windows systems.
Implementation of OpenDreamInstaller for Windows systems.
No-op implementation of IEventConsumer.
Constants used for communication with the DMAPI.
static readonly Version InteropVersion
The DMAPI InteropVersion being used.
Configuration options for the web control panel.
DatabaseType DatabaseType
The Configuration.DatabaseType to create.
File logging configuration options.
LogLevel MicrosoftLogLevel
The minimum Microsoft.Extensions.Logging.LogLevel to display in logs for Microsoft library sources.
string GetFullLogDirectory(IIOManager ioManager, IAssemblyInformationProvider assemblyInformationProvider, IPlatformIdentifier platformIdentifier)
Gets the evaluated log Directory.
LogLevel LogLevel
The minimum Microsoft.Extensions.Logging.LogLevel to display in logs.
bool Disable
If file logging is disabled.
General configuration options.
static readonly Version CurrentConfigVersion
The current ConfigVersion.
bool HostApiDocumentation
If the swagger documentation and UI should be made avaiable.
uint RestartTimeoutMinutes
The timeout minutes for restarting the server.
ushort? PrometheusPort
The port Prometheus metrics are published on, if any.
ushort ApiPort
The port the TGS API listens on.
Unstable configuration options used internally by TGS.
bool UsingSystemD
If the server is running under SystemD.
Configuration options pertaining to user security.
IDictionary< string, OidcConfiguration >? OpenIDConnect
OIDC provider settings keyed by scheme name.
bool OidcStrictMode
If OIDC strict mode should be enabled. This mode enforces the existence of at least one OpenIDConnect...
Configuration options for the game sessions.
Configuration for the server swarm system.
Configuration options for telemetry.
Configuration for the automatic update system.
Base Controller for API functions.
const ushort MaximumPageSize
Maximum size of Paginated<TModel> results.
const ushort DefaultPageSize
Default size of Paginated<TModel> results.
Controller for the web control panel.
const string ControlPanelRoute
Route to the ControlPanelController.
IActionResultExecutor<TResult> for LimitedStreamResults.
Backend abstract implementation of IDatabaseContext.
IErrorFilter for transforming ErrorMessageResponse-like Exception.
GraphQL query global::System.Type.
A ScalarType<TRuntimeType, TLiteral> for semantic Versions.
Root type for GraphQL subscriptions.
IGateway for the SwarmNode this query is executing on.
IIOManager that resolves paths to Environment.CurrentDirectory.
IFilesystemLinkFactory for POSIX systems.
IPostWriteHandler for POSIX systems.
An IIOManager that resolve relative paths from another IIOManager to a subdirectory of that.
IFilesystemLinkFactory for windows systems.
IPostWriteHandler for Windows systems.
Handles mapping groups for the JobsHub.
A SignalR Hub for pushing job updates.
Attribute for bringing in the master versions list from MSBuild that aren't embedded into assemblies ...
string RawWebpanelVersion
The Version string of the control panel version built.
static MasterVersionsAttribute Instance
Return the Assembly's instance of the MasterVersionsAttribute.
A IClaimsTransformation that maps Claims using an IAuthenticationContext.
An IHubFilter that denies method calls and connections if the IAuthenticationContext is not valid for...
ISystemIdentityFactory for posix systems.
Helper for using the AuthorizeAttribute with the Api.Rights system.
const string PolicyName
Policy used to apply global requirement of UserEnabledRole.
const string UserEnabledRole
Role used to indicate access to the server is allowed.
ISystemIdentityFactory for windows systems. Uses long running tasks due to potential networked domain...
Implementation of IServerFactory.
DI root for configuring a SetupWizard.
Helps keep servers connected to the same database in sync by coordinating updates.
Implements the SystemD notify service protocol.
Implementation of the file transfer service.
Helpers for manipulating the Serilog.Context.LogContext.
static string Template
Common template used for adding our custom log context to serilog.
Implements various filters for Swashbuckle.
const string DocumentationSiteRouteExtension
The path to the hosted documentation site.
static void Configure(SwaggerGenOptions swaggerGenOptions, string assemblyDocumentationPath, string apiDocumentationPath)
Configure the swagger settings.
JsonConverter and IYamlTypeConverter for serializing global::System.Versions in semver format.
SignalR client methods for receiving JobResponses.
IAuthority for administrative server operations.
Invokes TAuthority s from GraphQL endpoints.
IAuthority for authenticating with the server.
IAuthority for managing PermissionSets.
Invokes TAuthority methods and generates IActionResult responses.
IAuthority for managing Users.
IAuthority for managing UserGroups.
For creating IChatManagers.
Factory for creating IRemoteDeploymentManagers.
For downloading and installing game engines for a given system.
Factory for creating IInstances.
Task Ready
Task that completes when the IInstanceManager finishes initializing.
Handler for BridgeParameters.
Factory for creating IGitRemoteFeatures.
For low level interactions with a LibGit2Sharp.IRepository.
Factory for creating LibGit2Sharp.IRepositorys.
Factory for creating IRepositoryManagers.
Factory for ITopicClients.
Factory for scoping usage of IDatabaseContexts. Meant for use by Components.
For initially setting up a database.
For creating filesystem symbolic links.
Interface for using filesystems.
string ConcatPath(params string[] paths)
Combines an array of strings into a path.
string GetDirectoryName(string path)
Gets the directory portion of a given path .
string GetFileNameWithoutExtension(string path)
Gets the file name portion of a path with.
Handles changing file modes/permissions after writing.
For accessing the disk in a synchronous manner.
Manages the runtime of Jobs.
The service that manages everything to do with jobs.
Allows manually triggering jobs hub updates.
For creating and accessing authentication contexts.
Contains various cryptographic functions.
For caching ISystemIdentitys.
Receives notifications about permissions updates.
Handles invalidating user sessions.
Factory for ISystemIdentitys.
For creating TokenResponses.
TokenValidationParameters ValidationParameters
The TokenValidationParameters for the ITokenFactory.
Handles validating authentication tokens.
Contains IOAuthValidators.
Set of objects needed to configure an Core.Application.
GeneralConfiguration GeneralConfiguration
The Configuration.GeneralConfiguration.
ElasticsearchConfiguration ElasticsearchConfiguration
The Configuration.ElasticsearchConfiguration.
FileLoggingConfiguration FileLoggingConfiguration
The Configuration.FileLoggingConfiguration.
DatabaseConfiguration DatabaseConfiguration
The Configuration.DatabaseConfiguration.
SecurityConfiguration SecurityConfiguration
The Configuration.SecurityConfiguration.
InternalConfiguration InternalConfiguration
The Configuration.InternalConfiguration.
IPlatformIdentifier PlatformIdentifier
The IPlatformIdentifier.
Swarm service operations for the Controllers.SwarmController.
Start and stop controllers for a swarm service.
Used for swarm operations. Functions may be no-op based on configuration.
Service for managing the dotnet-dump installation.
On Windows, DreamDaemon will show an unskippable prompt when using /world/proc/OpenPort()....
Abstraction for suspending and resuming processes.
Reads and writes to Streams associated with FileTicketResponses.
Service for temporarily storing files to be downloaded or uploaded.
Gets unassigned ports for use by TGS.
EngineType
The type of engine the codebase is using.
@ Configuration
ConfigurationRights.
DatabaseType
Type of database to user.