1 using Microsoft.Extensions.Logging;
3 using Newtonsoft.Json.Converters;
17 public const string Section =
"General";
22 public const ushort DefaultApiPort = 5000;
27 public static readonly Version CurrentConfigVersion =
new Version(2, 0, 0);
32 const uint DefaultMinimumPasswordLength = 15;
37 const uint DefaultInstanceLimit = 10;
42 const uint DefaultUserLimit = 100;
47 const uint DefaultByondTopicTimeout = 5000;
52 const uint DefaultRestartTimeout = 60000;
57 public Version ConfigVersion {
get;
set; }
62 public ushort ApiPort {
get;
set; }
67 public string GitHubAccessToken {
get;
set; }
78 public uint ByondTopicTimeout {
get;
set; } = DefaultByondTopicTimeout;
83 public uint RestartTimeout {
get;
set; } = DefaultRestartTimeout;
88 public bool UseBasicWatchdog {
get;
set; }
95 MinimumPasswordLength = DefaultMinimumPasswordLength;
96 InstanceLimit = DefaultInstanceLimit;
97 UserLimit = DefaultUserLimit;
107 throw new ArgumentNullException(nameof(logger));
109 if (ConfigVersion == null)
111 "No `ConfigVersion` specified, your configuration may be out of date! The current version is \"{0}\"",
112 CurrentConfigVersion);
113 else if (ConfigVersion != CurrentConfigVersion)
114 if (ConfigVersion.Major != CurrentConfigVersion.Major)
116 "Your `ConfigVersion` is majorly out-of-date and may potentially cause issues running the server. Please follow migration instructions from the TGS release notes.",
117 CurrentConfigVersion);
119 logger.LogWarning(
"Your `ConfigVersion` is out-of-date. Please follow migration instructions from the TGS release notes.");
void CheckCompatibility(ILogger logger)
Validates the current ConfigVersion's compatibility and provides migration instructions.
Use server authentication
SetupWizardMode
Determines if the Setup.SetupWizard will run
GeneralConfiguration()
Initializes a new instance of the GeneralConfiguration .
General configuration options