mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 07:04:57 +01:00
Delete server settings. Remove soft stop. Posting an Administration API model should always reboot it
This commit is contained in:
@@ -5,14 +5,8 @@ using Tgstation.Server.Api.Rights;
|
||||
namespace Tgstation.Server.Api.Models
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public sealed class Administration : Internal.ServerSettings
|
||||
public sealed class Administration
|
||||
{
|
||||
/// <summary>
|
||||
/// If the <see cref="DreamDaemon"/> instances will not be stopped when the server exits. Resets to <see langword="false"/> when the server restarts
|
||||
/// </summary>
|
||||
[Permissions(ReadRight = AdministrationRights.SoftStop, WriteRight = AdministrationRights.SoftStop)]
|
||||
public bool SoftStop { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The latest available version of the Tgstation.Server.Host assembly from the upstream repository. If <see cref="Version.Minor"/> is higher than <see cref="CurrentVersion"/>'s the update cannot be applied due to API changes
|
||||
/// </summary>
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
using Tgstation.Server.Api.Rights;
|
||||
|
||||
namespace Tgstation.Server.Api.Models.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Metadata about an installation
|
||||
/// </summary>
|
||||
[Model(RightsType.Administration)]
|
||||
public class ServerSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Automatically send unhandled exception data to a public collection service. This will be limited to system information, path data, and game code compilation information.
|
||||
/// </summary>
|
||||
[Permissions(ReadRight = AdministrationRights.ChangeTelemetry, WriteRight = AdministrationRights.ChangeTelemetry)]
|
||||
public bool EnableTelemetry { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The git repository URL to recieve updates to Tgstation.Server.Host from, must include credentials if necessary. If set to <see langword="null"/> upstream pulls will be disabled entirely. Should be https://github.com/tgstation/tgstation-server or a fork of it
|
||||
/// </summary>
|
||||
[Permissions(ReadRight = AdministrationRights.SetUpstreamRepository, WriteRight = AdministrationRights.SetUpstreamRepository)]
|
||||
public string UpstreamRepository { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,6 @@ namespace Tgstation.Server.Host.Models
|
||||
/// <inheritdoc />
|
||||
abstract class DatabaseContext<TParentContext> : DbContext, IDatabaseContext where TParentContext : DbContext
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public DbSet<ServerSettings> ServerSettings { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public DbSet<User> Users { get; set; }
|
||||
|
||||
@@ -126,18 +123,6 @@ namespace Tgstation.Server.Host.Models
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ServerSettings> GetServerSettings(CancellationToken cancellationToken)
|
||||
{
|
||||
var settings = await ServerSettings.FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (settings == default(ServerSettings))
|
||||
{
|
||||
settings = new ServerSettings();
|
||||
ServerSettings.Add(settings);
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task Initialize(CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -59,13 +59,6 @@ namespace Tgstation.Server.Host.Models
|
||||
/// </summary>
|
||||
DbSet<RepositorySettings> RepositorySettings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the <see cref="ServerSettings"/> in the <see cref="IDatabaseContext"/>
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in the <see cref="ServerSettings"/> in the <see cref="IDatabaseContext"/></returns>
|
||||
Task<ServerSettings> GetServerSettings(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Saves changes made to the <see cref="IDatabaseContext"/>
|
||||
/// </summary>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace Tgstation.Server.Host.Models
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public sealed class ServerSettings : Api.Models.Internal.ServerSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// The row Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user