diff --git a/src/Tgstation.Server.Api/Models/Administration.cs b/src/Tgstation.Server.Api/Models/Administration.cs index 7fd8bdfc84..1aed2dad16 100644 --- a/src/Tgstation.Server.Api/Models/Administration.cs +++ b/src/Tgstation.Server.Api/Models/Administration.cs @@ -8,32 +8,14 @@ namespace Tgstation.Server.Api.Models /// Metadata about an installation /// [Model(RightsType.Administration)] - public sealed class Administration + public sealed class Administration : Internal.ServerSettings { - /// - /// Use the specified Windows/UNIX authentication to authorize users. Setting this to enables full administrative anonymous access - /// - [Permissions(ReadRight = AdministrationRights.ChangeAuthenticationGroup, WriteRight = AdministrationRights.ChangeAuthenticationGroup)] - public string SystemAuthenticationGroup { get; set; } - - /// - /// Automatically send unhandled exception data to a public collection service. This will be limited to system information, path data, and game code compilation information. - /// - [Permissions(ReadRight = AdministrationRights.ChangeTelemetry, WriteRight = AdministrationRights.ChangeTelemetry)] - public bool EnableTelemetry { get; set; } - /// /// If the instances will not be stopped when the server exits. Resets to when the server restarts /// [Permissions(ReadRight = AdministrationRights.SoftStop, WriteRight = AdministrationRights.SoftStop)] public bool SoftStop { get; set; } - - /// - /// The git repository to recieve updates to Tgstation.Server.Host from, must include credentials if necessary. If set to upstream pulls will be disabled entirely - /// - [Permissions(ReadRight = AdministrationRights.SetUpstreamRepository, WriteRight = AdministrationRights.SetUpstreamRepository)] - public string UpstreamRepository { get; set; } - + /// /// The latest available version of the Tgstation.Server.Host assembly from the upstream repository. If is higher than 's the update cannot be applied due to API changes /// diff --git a/src/Tgstation.Server.Api/Models/Internal/ServerSettings.cs b/src/Tgstation.Server.Api/Models/Internal/ServerSettings.cs new file mode 100644 index 0000000000..7c30871cea --- /dev/null +++ b/src/Tgstation.Server.Api/Models/Internal/ServerSettings.cs @@ -0,0 +1,25 @@ +using Tgstation.Server.Api.Rights; + +namespace Tgstation.Server.Api.Models.Internal +{ + public class ServerSettings + { + /// + /// Use the specified Windows/UNIX authentication to authorize users. Setting this to enables full administrative anonymous access + /// + [Permissions(ReadRight = AdministrationRights.ChangeAuthenticationGroup, WriteRight = AdministrationRights.ChangeAuthenticationGroup)] + public string SystemAuthenticationGroup { get; set; } + + /// + /// Automatically send unhandled exception data to a public collection service. This will be limited to system information, path data, and game code compilation information. + /// + [Permissions(ReadRight = AdministrationRights.ChangeTelemetry, WriteRight = AdministrationRights.ChangeTelemetry)] + public bool EnableTelemetry { get; set; } + + /// + /// The git repository to recieve updates to Tgstation.Server.Host from, must include credentials if necessary. If set to upstream pulls will be disabled entirely + /// + [Permissions(ReadRight = AdministrationRights.SetUpstreamRepository, WriteRight = AdministrationRights.SetUpstreamRepository)] + public string UpstreamRepository { get; set; } + } +} diff --git a/src/Tgstation.Server.Host/Models/IDatabaseContext.cs b/src/Tgstation.Server.Host/Models/IDatabaseContext.cs index 7b44a65ca6..9cbf54d537 100644 --- a/src/Tgstation.Server.Host/Models/IDatabaseContext.cs +++ b/src/Tgstation.Server.Host/Models/IDatabaseContext.cs @@ -9,12 +9,33 @@ namespace Tgstation.Server.Host.Models /// interface IDatabaseContext { + /// + /// The in the + /// + ServerSettings ServerSettings { get; } + + /// + /// The s in the + /// DbSet Users { get; } + /// + /// The s in the + /// DbSet Instances { get; } + /// + /// Saves changes made to the + /// + /// The for the operation + /// A representing the running operation Task Save(CancellationToken cancellationToken); + /// + /// Creates and migrates the + /// + /// The for the operation + /// A representing the running operation Task Initialize(CancellationToken cancellationToken); } } diff --git a/src/Tgstation.Server.Host/Models/Job.cs b/src/Tgstation.Server.Host/Models/Job.cs index 29c978ce2c..2becf695ff 100644 --- a/src/Tgstation.Server.Host/Models/Job.cs +++ b/src/Tgstation.Server.Host/Models/Job.cs @@ -6,5 +6,7 @@ namespace Tgstation.Server.Host.Models { [Required] new public User StartedBy { get; set; } + + Instance Instance { get; set; } } } diff --git a/src/Tgstation.Server.Host/Models/ServerSettings.cs b/src/Tgstation.Server.Host/Models/ServerSettings.cs new file mode 100644 index 0000000000..60576514ec --- /dev/null +++ b/src/Tgstation.Server.Host/Models/ServerSettings.cs @@ -0,0 +1,7 @@ +namespace Tgstation.Server.Host.Models +{ + sealed class ServerSettings : Api.Models.Internal.ServerSettings + { + long Id { get; set; } + } +}