158 Logger.LogWarning(
e,
"Not found exception while retrieving upstream repository info!");
164 TrackedRepositoryUrl =
repoUrl,
165 GeneratedAt = DateTimeOffset.UtcNow,
169 var ttl = TimeSpan.FromMinutes(30);
187 catch (ApiException
e)
193 AdditionalData = e.Message,
245 catch (ApiException
e)
251 AdditionalData = e.Message,
277 Logger.LogDebug(
"Restart request failed due to lack of host watchdog!");
Represents administrative server information.
Represents an error message returned by the server.
Represents a server log file.
A response to a Request.ServerUpdateRequest.
RequirementsGated< AuthorityResponse< LogFileResponse > > GetLog(string path, CancellationToken cancellationToken)
Get a ticket for downloading a log file at a given path .A RequirementsGated<TResult> LogFileResponse...
readonly IFileTransferTicketProvider fileTransferService
The IFileTransferTicketProvider for the AdministrationAuthority.
readonly IServerControl serverControl
The IServerControl for the AdministrationAuthority.
readonly IOptionsSnapshot< FileLoggingConfiguration > fileLoggingConfigurationOptions
The FileLoggingConfiguration for the AdministrationAuthority.
RequirementsGated< AuthorityResponse > TriggerServerRestart()
Triggers a restart of tgstation-server without terminating running game instances....
readonly IMemoryCache cacheService
The IMemoryCache for the AdministrationAuthority.
RequirementsGated< AuthorityResponse< ServerUpdateResponse > > TriggerServerVersionChange(Version targetVersion, bool uploadZip, CancellationToken cancellationToken)
Triggers a restart of tgstation-server without terminating running game instances,...
RequirementsGated< AuthorityResponse< AdministrationResponse > > GetUpdateInformation(bool forceFresh, CancellationToken cancellationToken)
Gets the AdministrationResponse containing server update information.A RequirementsGated<TResult> Adm...
readonly IPlatformIdentifier platformIdentifier
The IPlatformIdentifier for the AdministrationAuthority.
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the AdministrationAuthority.
const string OctokitException
Default Exception.Message for ApiExceptions.
AdministrationAuthority(IDatabaseContext databaseContext, ILogger< UserAuthority > logger, IGitHubServiceFactory gitHubServiceFactory, IServerControl serverControl, IServerUpdateInitiator serverUpdateInitiator, IFileTransferTicketProvider fileTransferService, IMemoryCache cacheService, IAssemblyInformationProvider assemblyInformationProvider, IPlatformIdentifier platformIdentifier, IIOManager ioManager, IOptionsSnapshot< FileLoggingConfiguration > fileLoggingConfigurationOptions)
Initializes a new instance of the AdministrationAuthority class.
readonly IIOManager ioManager
The IIOManager for the AdministrationAuthority.
readonly IServerUpdateInitiator serverUpdateInitiator
The IServerUpdateInitiator for the AdministrationAuthority.
static readonly object ReadCacheKey
The IMemoryCache key for GetUpdateInformation(bool, CancellationToken).
readonly IGitHubServiceFactory gitHubServiceFactory
The IGitHubServiceFactory for the AdministrationAuthority.
Base implementation of IAuthority.
ILogger< AuthorityBase > Logger
Gets the ILogger for the AuthorityBase.
Represents a response from an authority.
Evaluates a set of IAuthorizationRequirements to be checked before executing a response.
Represents a file on disk to be downloaded.
IAuthority for administrative server operations.
Represents a service that may take an updated Host assembly and run it, stopping the current assembly...
bool WatchdogPresent
true if live updates are supported, false. TryStartUpdate(IServerUpdateExecutor, Version) and Restart...
ValueTask Restart()
Restarts the Host.
Initiates server self updates.
ValueTask< ServerUpdateResult > InitiateUpdate(IFileStreamProvider? fileStreamProvider, Version version, CancellationToken cancellationToken)
Start the process of downloading and applying an update to a new server version .
Interface for using filesystems.
string GetFileName(string path)
Gets the file name portion of a path .
string ConcatPath(params string[] paths)
Combines an array of strings into a path.
Task< DateTimeOffset > GetLastModified(string path, CancellationToken cancellationToken)
Get the DateTimeOffset of when a given path was last modified.
Service for temporarily storing files to be downloaded or uploaded.
FileTicketResponse CreateDownload(FileDownloadProvider fileDownloadProvider)
Create a FileTicketResponse for a download.
IFileUploadTicket CreateUpload(FileUploadStreamKind streamKind)
Create a IFileUploadTicket.
A FileTicketResponse that waits for a pending upload.
Factory for IGitHubServices.
ValueTask< IGitHubService > CreateService(CancellationToken cancellationToken)
Create a IGitHubService.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
@ List
User may list files if the Models.Instance allows it.
AdministrationRights
Administration rights for the server.
HttpFailureResponse
Indicates the type of HTTP status code an failing AuthorityResponse should generate.
HttpSuccessResponse
Indicates the type of HTTP status code a successful AuthorityResponse<TResult> should generate.
ServerUpdateResult
The result of a call to start a server update.
FileUploadStreamKind
Determines the type of global::System.IO.Stream returned from IFileUploadTicket's created from IFileT...