diff --git a/build/TestCommon.props b/build/TestCommon.props
index c48c4b6acb..f0d0217523 100644
--- a/build/TestCommon.props
+++ b/build/TestCommon.props
@@ -3,7 +3,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -18,9 +18,9 @@
-
+
-
+
diff --git a/build/Version.props b/build/Version.props
index e189ea46d8..be264f4cef 100644
--- a/build/Version.props
+++ b/build/Version.props
@@ -5,12 +5,12 @@
6.12.3
5.4.0
- 10.12.0
+ 10.12.1
0.5.0
7.0.0
- 17.0.0
+ 17.0.1
20.0.0
- 7.3.0
+ 7.3.1
5.10.0
1.6.0
8.0.0
diff --git a/build/package/nix/tgstation-server.nix b/build/package/nix/tgstation-server.nix
index fa9f659657..6079ea037f 100644
--- a/build/package/nix/tgstation-server.nix
+++ b/build/package/nix/tgstation-server.nix
@@ -1,6 +1,7 @@
inputs@{
config,
lib,
+ systemdUtils,
nixpkgs,
pkgs,
writeShellScriptBin,
@@ -53,7 +54,7 @@ in
};
username = lib.mkOption {
- type = lib.types.str;
+ type = lib.types.nonEmptyStr;
default = "tgstation-server";
description = ''
The name of the user used to execute tgstation-server.
@@ -61,7 +62,7 @@ in
};
groupname = lib.mkOption {
- type = lib.types.str;
+ type = lib.types.nonEmptyStr;
default = "tgstation-server";
description = ''
The name of group the user used to execute tgstation-server will belong to.
@@ -69,7 +70,7 @@ in
};
home-directory = lib.mkOption {
- type = lib.types.str;
+ type = lib.types.nonEmptyStr;
default = "/home/tgstation-server";
description = ''
The home directory of TGS. Should be persistent.
@@ -99,6 +100,14 @@ in
Environment file as defined in {manpage}`systemd.exec(5)`
'';
};
+
+ wants = lib.mkOption {
+ type = lib.types.listOf systemdUtils.lib.unitNameType;
+ default = [];
+ description = ''
+ Start the specified units when this unit is started.
+ '';
+ };
};
};
diff --git a/build/stylecop.json b/build/stylecop.json
index d18cd8693c..1ce8caabbd 100644
--- a/build/stylecop.json
+++ b/build/stylecop.json
@@ -5,7 +5,8 @@
"documentPrivateElements": true,
"documentPrivateFields": true,
"excludeFromPunctuationCheck": [
- "remarks"
+ "remarks",
+ "example"
]
},
"indentation": {
diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm
index 42f2d5fc31..7e1ba820dd 100644
--- a/src/DMAPI/tgs.dm
+++ b/src/DMAPI/tgs.dm
@@ -1,7 +1,7 @@
// tgstation-server DMAPI
// The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF RFC 2119.
-#define TGS_DMAPI_VERSION "7.3.0"
+#define TGS_DMAPI_VERSION "7.3.1"
// All functions and datums outside this document are subject to change with any version and should not be relied on.
@@ -58,6 +58,11 @@
#define TGS_FILE2TEXT_NATIVE file2text
#endif
+// SpacemanDMM compatibility
+#ifndef CAN_BE_REDEFINED
+#define CAN_BE_REDEFINED(X)
+#endif
+
// EVENT CODES
/// Before a reboot mode change, extras parameters are the current and new reboot mode enums.
@@ -160,6 +165,7 @@
* * http_handler - Optional user defined [/datum/tgs_http_handler].
*/
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE, datum/tgs_http_handler/http_handler)
+ CAN_BE_REDEFINED(TRUE)
return
/**
@@ -170,6 +176,7 @@
* This function should not be called before ..() in [/world/proc/New].
*/
/world/proc/TgsInitializationComplete()
+ CAN_BE_REDEFINED(TRUE)
return
/// Consumers MUST run this macro at the start of [/world/proc/Topic].
@@ -177,6 +184,7 @@
/// Consumers MUST call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
/world/proc/TgsReboot()
+ CAN_BE_REDEFINED(TRUE)
return
// DATUM DEFINITIONS
@@ -214,6 +222,7 @@
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
*/
/datum/tgs_version/proc/Wildcard()
+ CAN_BE_REDEFINED(TRUE)
return
/**
@@ -222,6 +231,7 @@
* other_version - The [/datum/tgs_version] to compare against.
*/
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
+ CAN_BE_REDEFINED(TRUE)
return
/// Represents a merge of a GitHub pull request.
@@ -459,16 +469,19 @@
/// Returns the maximum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMaximumApiVersion()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the minimum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMinimumApiVersion()
+ CAN_BE_REDEFINED(TRUE)
return
/**
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
*/
/world/proc/TgsAvailable()
+ CAN_BE_REDEFINED(TRUE)
return
// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
@@ -480,6 +493,7 @@
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again.
*/
/world/proc/TgsEndProcess()
+ CAN_BE_REDEFINED(TRUE)
return
/**
@@ -490,6 +504,7 @@
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
*/
/world/proc/TgsTargetedChatBroadcast(datum/tgs_message_content/message, admin_only = FALSE)
+ CAN_BE_REDEFINED(TRUE)
return
/**
@@ -500,6 +515,7 @@
* user: The [/datum/tgs_chat_user] to PM.
*/
/world/proc/TgsChatPrivateMessage(datum/tgs_message_content/message, datum/tgs_chat_user/user)
+ CAN_BE_REDEFINED(TRUE)
return
/**
@@ -510,42 +526,52 @@
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
*/
/world/proc/TgsChatBroadcast(datum/tgs_message_content/message, list/channels = null)
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the current [/datum/tgs_version] of TGS if it is running the server, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVersion()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the running engine type
/world/proc/TgsEngine()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the current [/datum/tgs_version] of the DMAPI being used if it was activated, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsApiVersion()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the name of the TGS instance running the game if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsInstanceName()
+ CAN_BE_REDEFINED(TRUE)
return
/// Return the current [/datum/tgs_revision_information] of the running server if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsRevision()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the current BYOND security level as a TGS_SECURITY_ define if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsSecurityLevel()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVisibility()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsTestMerges()
+ CAN_BE_REDEFINED(TRUE)
return
/// Returns a list of connected [/datum/tgs_chat_channel]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsChatChannelInfo()
+ CAN_BE_REDEFINED(TRUE)
return
/**
@@ -556,6 +582,7 @@
* wait_for_completion - If set, this function will not return until the event has run to completion.
*/
/world/proc/TgsTriggerEvent(event_name, list/parameters, wait_for_completion = FALSE)
+ CAN_BE_REDEFINED(TRUE)
return
/*
diff --git a/src/Tgstation.Server.Api/ApiHeaders.cs b/src/Tgstation.Server.Api/ApiHeaders.cs
index 2f670f5029..00b7733715 100644
--- a/src/Tgstation.Server.Api/ApiHeaders.cs
+++ b/src/Tgstation.Server.Api/ApiHeaders.cs
@@ -244,7 +244,7 @@ namespace Tgstation.Server.Api
else
{
var auth = authorization.First();
- var splits = new List(auth.Split(' '));
+ var splits = new List(auth?.Split(' ') ?? Enumerable.Empty());
var scheme = splits.First();
if (String.IsNullOrWhiteSpace(scheme))
AddError(HeaderErrorTypes.AuthorizationInvalid, "Missing authentication scheme!");
diff --git a/src/Tgstation.Server.Api/Models/ChatChannel.cs b/src/Tgstation.Server.Api/Models/ChatChannel.cs
index 3192603e2b..064711d76c 100644
--- a/src/Tgstation.Server.Api/Models/ChatChannel.cs
+++ b/src/Tgstation.Server.Api/Models/ChatChannel.cs
@@ -14,6 +14,7 @@ namespace Tgstation.Server.Api.Models
/// For , it's the IRC channel name and optional password colon separated.
/// For , it's the stringified Discord channel snowflake.
///
+ /// 124823852418
[Required]
[StringLength(Limits.MaximumIndexableStringLength, MinimumLength = 1)]
public string? ChannelData { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/EngineVersion.cs b/src/Tgstation.Server.Api/Models/EngineVersion.cs
index 6196610597..c84ee37eec 100644
--- a/src/Tgstation.Server.Api/Models/EngineVersion.cs
+++ b/src/Tgstation.Server.Api/Models/EngineVersion.cs
@@ -26,12 +26,14 @@ namespace Tgstation.Server.Api.Models
///
/// The of the engine. Currently only valid when is .
///
+ /// 516.1651.0
[ResponseOptions]
public Version? Version { get; set; }
///
/// The git commit SHA of the engine. Currently only valid when is .
///
+ /// caa1e1f400c8b6a535e03cff28cf57f919e9378c
[ResponseOptions]
[StringLength(Limits.MaximumCommitShaLength, MinimumLength = Limits.MaximumCommitShaLength)]
public string? SourceSHA { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/EntityId.cs b/src/Tgstation.Server.Api/Models/EntityId.cs
index 43ac2e7eda..c7660d399e 100644
--- a/src/Tgstation.Server.Api/Models/EntityId.cs
+++ b/src/Tgstation.Server.Api/Models/EntityId.cs
@@ -8,6 +8,7 @@
///
/// The ID of the entity.
///
+ /// 1
[RequestOptions(FieldPresence.Required)]
[RequestOptions(FieldPresence.Ignored, PutOnly = true)]
public virtual long? Id { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/ChatBotSettings.cs b/src/Tgstation.Server.Api/Models/Internal/ChatBotSettings.cs
index 4f6a9e2fac..ecdd0a3110 100644
--- a/src/Tgstation.Server.Api/Models/Internal/ChatBotSettings.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/ChatBotSettings.cs
@@ -16,6 +16,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The time interval in minutes the chat bot attempts to reconnect if and disconnected. Must not be zero.
///
+ /// 60
[Required]
[Range(1, UInt32.MaxValue)]
public uint? ReconnectionInterval { get; set; }
@@ -23,6 +24,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The maximum number of s the may contain.
///
+ /// 5
[Required]
public ushort? ChannelLimit { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/ChatChannelBase.cs b/src/Tgstation.Server.Api/Models/Internal/ChatChannelBase.cs
index eee19f244f..cc0501d2b5 100644
--- a/src/Tgstation.Server.Api/Models/Internal/ChatChannelBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/ChatChannelBase.cs
@@ -10,18 +10,21 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// If the is an admin channel.
///
+ /// false
[Required]
public bool? IsAdminChannel { get; set; }
///
/// If the is a watchdog channel.
///
+ /// false
[Required]
public bool? IsWatchdogChannel { get; set; }
///
/// If the is an updates channel.
///
+ /// false
[Required]
public bool? IsUpdatesChannel { get; set; }
@@ -34,6 +37,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// A custom tag users can define to group channels together.
///
+ /// system-channel-only
[ResponseOptions]
[StringLength(Limits.MaximumStringLength)]
public string? Tag { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/CompileJob.cs b/src/Tgstation.Server.Api/Models/Internal/CompileJob.cs
index eb8862a86c..386a65a9fb 100644
--- a/src/Tgstation.Server.Api/Models/Internal/CompileJob.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/CompileJob.cs
@@ -12,6 +12,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The .dme file used for compilation.
///
+ /// tgstation.dme
[Required]
public string? DmeName { get; set; }
@@ -36,6 +37,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The DMAPI .
///
+ /// 7.3.0
[NotMapped]
[ResponseOptions]
public virtual Version? DMApiVersion { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs b/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs
index c0c6f63374..116f27425d 100644
--- a/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// An incrementing ID for representing current server execution.
///
+ /// 1
[ResponseOptions]
public long? SessionId { get; set; }
@@ -22,12 +23,14 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The last known count of connected players. Requires to not be 0 and a game server interop version >= 5.10.0 to populate.
///
+ /// 30
[ResponseOptions]
public uint? ClientCount { get; set; }
///
/// If the server is undergoing a soft reset. This may be automatically set by changes to other fields.
///
+ /// false
[ResponseOptions]
public bool? SoftRestart { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/DreamDaemonLaunchParameters.cs b/src/Tgstation.Server.Api/Models/Internal/DreamDaemonLaunchParameters.cs
index 05bef48a50..dca2356a9d 100644
--- a/src/Tgstation.Server.Api/Models/Internal/DreamDaemonLaunchParameters.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/DreamDaemonLaunchParameters.cs
@@ -11,6 +11,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// If the BYOND web client can be used to connect to the game server. No-op for .
///
+ /// false
[Required]
[ResponseOptions]
public bool? AllowWebClient { get; set; }
@@ -25,6 +26,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The level of DreamDaemon. No-op for .
///
+ /// 2
[Required]
[ResponseOptions]
[EnumDataType(typeof(DreamDaemonVisibility))]
@@ -33,6 +35,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The level of DreamDaemon. No-op for .
///
+ /// 1
[Required]
[ResponseOptions]
[EnumDataType(typeof(DreamDaemonSecurity))]
@@ -41,6 +44,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The port DreamDaemon uses. This should be publically accessible.
///
+ /// 1337
[Required]
[ResponseOptions]
[Range(1, UInt16.MaxValue)]
@@ -49,6 +53,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The port used by for its topic port.
///
+ /// 2337
[Required]
[ResponseOptions]
public ushort? OpenDreamTopicPort { get; set; }
@@ -56,6 +61,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The DreamDaemon startup timeout in seconds.
///
+ /// 5
[Required]
[ResponseOptions]
[Range(1, UInt32.MaxValue)]
@@ -64,6 +70,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The number of seconds between each watchdog health check. 0 disables.
///
+ /// 5
[Required]
[ResponseOptions]
public uint? HealthCheckSeconds { get; set; }
@@ -78,6 +85,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The timeout for sending and receiving BYOND topics in milliseconds.
///
+ /// 500
[Required]
[ResponseOptions]
[Range(1, UInt32.MaxValue)]
diff --git a/src/Tgstation.Server.Api/Models/Internal/Job.cs b/src/Tgstation.Server.Api/Models/Internal/Job.cs
index 8b3b210c60..29a44c7803 100644
--- a/src/Tgstation.Server.Api/Models/Internal/Job.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/Job.cs
@@ -20,6 +20,7 @@ namespace Tgstation.Server.Api.Models.Internal
/// English description of the .
///
/// May not match the listed on the .
+ /// Installing and configuring important objects.
[Required]
public string? Description { get; set; }
@@ -50,6 +51,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// If the was cancelled.
///
+ /// false
[Required]
public bool? Cancelled { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/ServerInformationBase.cs b/src/Tgstation.Server.Api/Models/Internal/ServerInformationBase.cs
index 15fafe90b1..9341662df3 100644
--- a/src/Tgstation.Server.Api/Models/Internal/ServerInformationBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/ServerInformationBase.cs
@@ -10,26 +10,31 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// Minimum length of database user passwords.
///
+ /// 20
public uint MinimumPasswordLength { get; set; }
///
/// The maximum number of s allowed.
///
+ /// 100
public uint InstanceLimit { get; set; }
///
/// The maximum number of users allowed.
///
+ /// 100
public uint UserLimit { get; set; }
///
/// The maximum number of user groups allowed.
///
+ /// 50
public uint UserGroupLimit { get; set; }
///
/// Limits the locations instances may be created or attached from.
///
+ /// ["/home/tgstation-server/my-server-1", "/home/tgstation-server/my-server-2"]
[ResponseOptions]
public List? ValidInstancePaths { get; set; }
}
diff --git a/src/Tgstation.Server.Api/Models/Internal/SwarmServer.cs b/src/Tgstation.Server.Api/Models/Internal/SwarmServer.cs
index 998c519b19..3682306335 100644
--- a/src/Tgstation.Server.Api/Models/Internal/SwarmServer.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/SwarmServer.cs
@@ -22,6 +22,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The server's identifier.
///
+ /// myserver-us-east
[Required]
public string? Identifier { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/SwarmServerInformation.cs b/src/Tgstation.Server.Api/Models/Internal/SwarmServerInformation.cs
index 89238b3099..6ea4ee92f3 100644
--- a/src/Tgstation.Server.Api/Models/Internal/SwarmServerInformation.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/SwarmServerInformation.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// If the is the controller.
///
+ /// false
public bool Controller { get; set; }
///
diff --git a/src/Tgstation.Server.Api/Models/Internal/TestMergeApiBase.cs b/src/Tgstation.Server.Api/Models/Internal/TestMergeApiBase.cs
index 036124c2a1..7b3a26cf33 100644
--- a/src/Tgstation.Server.Api/Models/Internal/TestMergeApiBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/TestMergeApiBase.cs
@@ -11,6 +11,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The ID of the .
///
+ /// 1
public long Id { get; set; }
///
diff --git a/src/Tgstation.Server.Api/Models/Internal/TestMergeModelBase.cs b/src/Tgstation.Server.Api/Models/Internal/TestMergeModelBase.cs
index 20a2821d07..d936f9f026 100644
--- a/src/Tgstation.Server.Api/Models/Internal/TestMergeModelBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/TestMergeModelBase.cs
@@ -11,18 +11,21 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The title of the test merge source.
///
+ /// Fixes and Breaks everything
[Required]
public string? TitleAtMerge { get; set; }
///
/// The body of the test merge source.
///
+ /// # GitHub markdown\n\rI assume?
[Required]
public string? BodyAtMerge { get; set; }
///
/// The URL of the test merge source.
///
+ /// https://github.com/tgstation/tgstation/pull/31026
[Required]
#pragma warning disable CA1056 // Uri properties should not be strings
public string? Url { get; set; }
@@ -31,6 +34,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The author of the test merge source.
///
+ /// MrStonedOne
[Required]
public string? Author { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Internal/UpdateInformation.cs b/src/Tgstation.Server.Api/Models/Internal/UpdateInformation.cs
index 9f049e4814..ea587a9d63 100644
--- a/src/Tgstation.Server.Api/Models/Internal/UpdateInformation.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/UpdateInformation.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The latest available version of the Tgstation.Server.Host assembly from the upstream repository. If is less than 4 the update cannot be applied due to API changes.
///
+ /// 1.0.0
public Version? LatestVersion { get; set; }
///
diff --git a/src/Tgstation.Server.Api/Models/NamedEntity.cs b/src/Tgstation.Server.Api/Models/NamedEntity.cs
index a138ef7eb5..930ca9c6e3 100644
--- a/src/Tgstation.Server.Api/Models/NamedEntity.cs
+++ b/src/Tgstation.Server.Api/Models/NamedEntity.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models
///
/// The name of the entity represented by the .
///
+ /// MyThingyName
[Required]
[RequestOptions(FieldPresence.Required, PutOnly = true)]
[StringLength(Limits.MaximumIndexableStringLength, MinimumLength = 1)]
diff --git a/src/Tgstation.Server.Api/Models/Request/ServerUpdateRequest.cs b/src/Tgstation.Server.Api/Models/Request/ServerUpdateRequest.cs
index ab34e28bde..c3bf7b8425 100644
--- a/src/Tgstation.Server.Api/Models/Request/ServerUpdateRequest.cs
+++ b/src/Tgstation.Server.Api/Models/Request/ServerUpdateRequest.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models.Request
///
/// Changes the version of tgstation-server to the given version from the upstream repository.
///
+ /// 6.12.3
[RequestOptions(FieldPresence.Required)]
public Version? NewVersion { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Response/AdministrationResponse.cs b/src/Tgstation.Server.Api/Models/Response/AdministrationResponse.cs
index fbdd1f00a1..437dc6132a 100644
--- a/src/Tgstation.Server.Api/Models/Response/AdministrationResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/AdministrationResponse.cs
@@ -12,6 +12,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The GitHub repository the server is built to receive updates from.
///
+ /// https://github.com/tgstation/tgstation
public Uri? TrackedRepositoryUrl { get; set; }
}
}
diff --git a/src/Tgstation.Server.Api/Models/Response/DreamDaemonResponse.cs b/src/Tgstation.Server.Api/Models/Response/DreamDaemonResponse.cs
index d0b86cdaa4..115d2c395e 100644
--- a/src/Tgstation.Server.Api/Models/Response/DreamDaemonResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/DreamDaemonResponse.cs
@@ -24,6 +24,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The current .
///
+ /// 2
[EnumDataType(typeof(WatchdogStatus))]
[ResponseOptions]
public WatchdogStatus? Status { get; set; }
@@ -31,6 +32,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The current . May be upgraded. due to requirements of .
///
+ /// 1
[EnumDataType(typeof(DreamDaemonSecurity))]
[ResponseOptions]
public DreamDaemonSecurity? CurrentSecurity { get; set; }
@@ -38,6 +40,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The current .
///
+ /// 2
[EnumDataType(typeof(DreamDaemonVisibility))]
[ResponseOptions]
public DreamDaemonVisibility? CurrentVisibility { get; set; }
@@ -45,24 +48,28 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The port the running instance is set to.
///
+ /// 1337
[ResponseOptions]
public ushort? CurrentPort { get; set; }
///
/// The topic port the running instance is set to.
///
+ /// 3000
[ResponseOptions]
public ushort? CurrentTopicPort { get; set; }
///
/// The webclient status the running instance is set to.
///
+ /// false
[ResponseOptions]
public bool? CurrentAllowWebclient { get; set; }
///
/// The amount of RAM in use by the game server in bytes.
///
+ /// 1073741824
[ResponseOptions]
public long? ImmediateMemoryUsage { get; set; }
}
diff --git a/src/Tgstation.Server.Api/Models/Response/ErrorMessageResponse.cs b/src/Tgstation.Server.Api/Models/Response/ErrorMessageResponse.cs
index 70cb64c530..1df20f57cb 100644
--- a/src/Tgstation.Server.Api/Models/Response/ErrorMessageResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/ErrorMessageResponse.cs
@@ -13,16 +13,19 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The version of the API the server is using.
///
+ /// 9.3.0
public Version? ServerApiVersion { get; set; }
///
- /// A human readable description of the error.
+ /// A human-readable description of the error.
///
+ /// Oopsie woopsie, we did a fucky wucky!
public string? Message { get; set; }
///
/// Additional data associated with the error message.
///
+ /// Error at thing.app.dependency.class.function in line 32
[ResponseOptions]
public string? AdditionalData { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/Response/JobResponse.cs b/src/Tgstation.Server.Api/Models/Response/JobResponse.cs
index 053fe1f9aa..4e97485e95 100644
--- a/src/Tgstation.Server.Api/Models/Response/JobResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/JobResponse.cs
@@ -8,6 +8,7 @@
///
/// The of the .
///
+ /// 1
public long? InstanceId { get; set; }
///
@@ -24,12 +25,14 @@
///
/// Optional progress between 0 and 100 inclusive.
///
+ /// 25
[ResponseOptions]
public int? Progress { get; set; }
///
- /// Optional description of the job's current .
+ /// Optional description of the job's current progress.
///
+ /// Doing something important
[ResponseOptions]
public string? Stage { get; set; }
}
diff --git a/src/Tgstation.Server.Api/Models/Response/LogFileResponse.cs b/src/Tgstation.Server.Api/Models/Response/LogFileResponse.cs
index 05c05e8aa0..b39867b413 100644
--- a/src/Tgstation.Server.Api/Models/Response/LogFileResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/LogFileResponse.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The name of the log file.
///
+ /// tgs-20250118.log
public string? Name { get; set; }
///
diff --git a/src/Tgstation.Server.Api/Models/Response/PaginatedResponse.cs b/src/Tgstation.Server.Api/Models/Response/PaginatedResponse.cs
index df3d72595f..dc42fa230c 100644
--- a/src/Tgstation.Server.Api/Models/Response/PaginatedResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/PaginatedResponse.cs
@@ -18,16 +18,19 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The total number of pages in the query.
///
+ /// 5
public int TotalPages { get; set; }
///
/// The current size of pages in the query.
///
+ /// 20
public int PageSize { get; set; }
///
/// The total items across all pages.
///
+ /// 100
public int TotalItems { get; set; }
}
}
diff --git a/src/Tgstation.Server.Api/Models/Response/ServerInformationResponse.cs b/src/Tgstation.Server.Api/Models/Response/ServerInformationResponse.cs
index 4e80e80564..82f27e7e7c 100644
--- a/src/Tgstation.Server.Api/Models/Response/ServerInformationResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/ServerInformationResponse.cs
@@ -11,16 +11,19 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The version of the host.
///
+ /// 6.12.3
public Version? Version { get; set; }
///
/// The version of the host.
///
+ /// 10.12.0
public Version? ApiVersion { get; set; }
///
/// The DMAPI interop version the server uses.
///
+ /// 7.3.0
public Version? DMApiVersion { get; set; }
///
@@ -36,6 +39,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// If there is a server update in progress.
///
+ /// false
public bool UpdateInProgress { get; set; }
///
diff --git a/src/Tgstation.Server.Api/Models/Response/ServerUpdateResponse.cs b/src/Tgstation.Server.Api/Models/Response/ServerUpdateResponse.cs
index 48c9b99e6a..46a96d8d49 100644
--- a/src/Tgstation.Server.Api/Models/Response/ServerUpdateResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/ServerUpdateResponse.cs
@@ -12,6 +12,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The version of tgstation-server pending update.
///
+ /// 6.12.3
public Version NewVersion { get; }
///
diff --git a/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs b/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs
index f81066741a..ddc757dfd0 100644
--- a/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs
@@ -10,6 +10,7 @@ namespace Tgstation.Server.Api.Models.Response
///
/// The value of the JWT.
///
+ /// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwibmJmIjoxNzM3MDkzNDgwLCJleHAiOjE3MzcwOTQzODAsImlhdCI6MTczNzA5MzQ4MCwiaXNzIjoiVGdzdGF0aW9uLlNlcnZlci5Ib3N0IiwiYXVkIjoiVGdzdGF0aW9uLlNlcnZlci5BcGkifQ.v64KX34_YOpH-HCbwqlx1p8u-MNbb4L6a9qEyXhcNcU
public string? Bearer { get; set; }
///
diff --git a/src/Tgstation.Server.Api/Models/TestMergeParameters.cs b/src/Tgstation.Server.Api/Models/TestMergeParameters.cs
index 174bb6886b..22b4b5f28e 100644
--- a/src/Tgstation.Server.Api/Models/TestMergeParameters.cs
+++ b/src/Tgstation.Server.Api/Models/TestMergeParameters.cs
@@ -10,18 +10,21 @@ namespace Tgstation.Server.Api.Models
///
/// The number of the test merge source.
///
+ /// 31026
public int Number { get; set; }
///
/// The sha of the test merge revision to merge. If not specified, the latest commit from the source will be used.
///
+ /// caa1e1f400c8b6a535e03cff28cf57f919e9378c
[Required]
- [StringLength(40)]
+ [StringLength(Limits.MaximumCommitShaLength, MinimumLength = Limits.MaximumCommitShaLength)]
public virtual string? TargetCommitSha { get; set; }
///
/// Optional comment about the test.
///
+ /// this will fix everything -Admin
[ResponseOptions]
[StringLength(Limits.MaximumStringLength)]
public string? Comment { get; set; }
diff --git a/src/Tgstation.Server.Api/Models/UserName.cs b/src/Tgstation.Server.Api/Models/UserName.cs
index a3b6be8162..00f9b4772a 100644
--- a/src/Tgstation.Server.Api/Models/UserName.cs
+++ b/src/Tgstation.Server.Api/Models/UserName.cs
@@ -6,6 +6,7 @@
public class UserName : NamedEntity
{
///
+ /// Admin
[RequestOptions(FieldPresence.Optional)]
public override string? Name
{
diff --git a/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj b/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
index 57ca211fbd..27bbd839ba 100644
--- a/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
+++ b/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
@@ -26,12 +26,12 @@
-
+
-
+
-
+
diff --git a/src/Tgstation.Server.Client.GraphQL/Tgstation.Server.Client.GraphQL.csproj b/src/Tgstation.Server.Client.GraphQL/Tgstation.Server.Client.GraphQL.csproj
index 2de8741b51..e9308d8bee 100644
--- a/src/Tgstation.Server.Client.GraphQL/Tgstation.Server.Client.GraphQL.csproj
+++ b/src/Tgstation.Server.Client.GraphQL/Tgstation.Server.Client.GraphQL.csproj
@@ -9,8 +9,8 @@
-
-
+
+
diff --git a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
index 91278a6dcd..0870f67e4a 100644
--- a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
+++ b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj
index 57b784056e..889a862be4 100644
--- a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj
+++ b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj
@@ -13,9 +13,9 @@
-
+
-
+
diff --git a/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj b/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj
index 80a62d106d..ac29220817 100644
--- a/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj
+++ b/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj
@@ -21,21 +21,21 @@
-
+
-
+
-
+
-
+
-
+
diff --git a/src/Tgstation.Server.Host.Watchdog/Watchdog.cs b/src/Tgstation.Server.Host.Watchdog/Watchdog.cs
index 09a985c9dd..9defdd8a5e 100644
--- a/src/Tgstation.Server.Host.Watchdog/Watchdog.cs
+++ b/src/Tgstation.Server.Host.Watchdog/Watchdog.cs
@@ -177,6 +177,10 @@ namespace Tgstation.Server.Host.Watchdog
var watchdogVersion = executingAssembly.GetName().Version?.Semver().ToString();
+ var serializerOptions = new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ };
while (!cancellationToken.IsCancellationRequested)
{
if (!File.Exists(assemblyPath))
@@ -214,10 +218,7 @@ namespace Tgstation.Server.Host.Watchdog
bootstrapperSettingsFile,
JsonSerializer.Serialize(
bootstrapSettings,
- new JsonSerializerOptions
- {
- WriteIndented = true,
- }),
+ serializerOptions),
cancellationToken);
}
}
@@ -258,6 +259,7 @@ namespace Tgstation.Server.Host.Watchdog
process.StartInfo.UseShellExecute = false; // runs in the same console
var killedHostProcess = false;
+ var createdShutdownFile = false;
try
{
Task? processTask = null;
@@ -279,6 +281,7 @@ namespace Tgstation.Server.Host.Watchdog
{
logger.LogInformation("Cancellation requested! Writing shutdown lock file...");
File.WriteAllBytes(updateDirectory, Array.Empty());
+ createdShutdownFile = true;
}
else
logger.LogWarning("Cancellation requested while update directory exists!");
@@ -330,15 +333,16 @@ namespace Tgstation.Server.Host.Watchdog
logger.LogWarning(ex2, "Error killing host process!");
}
- try
- {
- if (File.Exists(updateDirectory))
- File.Delete(updateDirectory);
- }
- catch (Exception ex2)
- {
- logger.LogWarning(ex2, "Error deleting comms file!");
- }
+ if (createdShutdownFile)
+ try
+ {
+ if (File.Exists(updateDirectory))
+ File.Delete(updateDirectory);
+ }
+ catch (Exception ex2)
+ {
+ logger.LogWarning(ex2, "Error deleting comms file!");
+ }
logger.LogInformation("Host exited!");
}
diff --git a/src/Tgstation.Server.Host/Components/Events/EventType.cs b/src/Tgstation.Server.Host/Components/Events/EventType.cs
index 711d6ca246..1dbfdb2b6f 100644
--- a/src/Tgstation.Server.Host/Components/Events/EventType.cs
+++ b/src/Tgstation.Server.Host/Components/Events/EventType.cs
@@ -173,5 +173,11 @@
///
[EventScript("EngineInstallComplete")]
EngineInstallComplete,
+
+ ///
+ /// Before game server process is created. No parameters.
+ ///
+ [EventScript("DreamDaemonPreLaunch")]
+ DreamDaemonPreLaunch,
}
}
diff --git a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs
index 1573d4c48a..0785051b64 100644
--- a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs
+++ b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
@@ -516,6 +517,14 @@ namespace Tgstation.Server.Host.Components.Session
? logFilePath
: null);
+ // If this isnt a staging DD (From a Deployment), fire off events
+ if (!apiValidate)
+ await eventConsumer.HandleEvent(
+ EventType.DreamDaemonPreLaunch,
+ Enumerable.Empty(),
+ false,
+ cancellationToken);
+
var process = await processExecutor.LaunchProcess(
engineLock.ServerExePath,
dmbProvider.Directory,
@@ -539,7 +548,6 @@ namespace Tgstation.Server.Host.Components.Session
if (!engineLock.HasStandardOutput)
networkPromptReaper.RegisterProcess(process);
- // If this isnt a staging DD (From a Deployment), fire off an event
if (!apiValidate)
await eventConsumer.HandleEvent(
EventType.DreamDaemonLaunch,
diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs
index f0cf647c79..dd88ce5d80 100644
--- a/src/Tgstation.Server.Host/Core/Application.cs
+++ b/src/Tgstation.Server.Host/Core/Application.cs
@@ -527,6 +527,7 @@ namespace Tgstation.Server.Host.Core
/// The .
/// The containing the to use.
/// The containing the to use.
+ /// The containing the to use.
/// The containing the to use.
/// The containing the to use.
/// The for the .
@@ -538,6 +539,7 @@ namespace Tgstation.Server.Host.Core
IAssemblyInformationProvider assemblyInformationProvider,
IOptions controlPanelConfigurationOptions,
IOptions generalConfigurationOptions,
+ IOptions databaseConfigurationOptions,
IOptions swarmConfigurationOptions,
IOptions internalConfigurationOptions,
ILogger logger)
@@ -552,11 +554,13 @@ namespace Tgstation.Server.Host.Core
var controlPanelConfiguration = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions));
var generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
+ var databaseConfiguration = databaseConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(databaseConfigurationOptions));
var swarmConfiguration = swarmConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(swarmConfigurationOptions));
var internalConfiguration = internalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(internalConfigurationOptions));
ArgumentNullException.ThrowIfNull(logger);
+ logger.LogDebug("Database provider: {provider}", databaseConfiguration.DatabaseType);
logger.LogDebug("Content Root: {contentRoot}", hostingEnvironment.ContentRootPath);
logger.LogTrace("Web Root: {webRoot}", hostingEnvironment.WebRootPath);
diff --git a/src/Tgstation.Server.Host/Extensions/WebHostBuilderExtensions.cs b/src/Tgstation.Server.Host/Extensions/WebHostBuilderExtensions.cs
index c3bd0d593b..73add394bd 100644
--- a/src/Tgstation.Server.Host/Extensions/WebHostBuilderExtensions.cs
+++ b/src/Tgstation.Server.Host/Extensions/WebHostBuilderExtensions.cs
@@ -65,6 +65,7 @@ namespace Tgstation.Server.Host.Extensions
applicationBuilder.ApplicationServices.GetRequiredService(),
applicationBuilder.ApplicationServices.GetRequiredService>(),
applicationBuilder.ApplicationServices.GetRequiredService>(),
+ applicationBuilder.ApplicationServices.GetRequiredService>(),
applicationBuilder.ApplicationServices.GetRequiredService>(),
applicationBuilder.ApplicationServices.GetRequiredService>(),
applicationBuilder.ApplicationServices.GetRequiredService>());
diff --git a/src/Tgstation.Server.Host/GraphQL/ErrorMessageFilter.cs b/src/Tgstation.Server.Host/GraphQL/ErrorMessageFilter.cs
index cbb9ac05e8..c5184ee05e 100644
--- a/src/Tgstation.Server.Host/GraphQL/ErrorMessageFilter.cs
+++ b/src/Tgstation.Server.Host/GraphQL/ErrorMessageFilter.cs
@@ -38,7 +38,7 @@ namespace Tgstation.Server.Host.GraphQL
return error;
var errorBuilder = ErrorBuilder.FromError(error)
- .RemoveException()
+ .SetException(null)
.ClearExtensions();
const string ErrorCodeFieldName = "errorCode";
diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
index 08a8222357..5f181858d7 100644
--- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
+++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
@@ -100,21 +100,21 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -154,11 +154,11 @@
-
+
-
+
-
+
diff --git a/src/Tgstation.Server.Host/Utils/SwaggerConfiguration.cs b/src/Tgstation.Server.Host/Utils/SwaggerConfiguration.cs
index d415e30ea3..8e5806f30c 100644
--- a/src/Tgstation.Server.Host/Utils/SwaggerConfiguration.cs
+++ b/src/Tgstation.Server.Host/Utils/SwaggerConfiguration.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Net;
using System.Net.Mime;
using System.Reflection;
+using System.Text.RegularExpressions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Net.Http.Headers;
@@ -99,6 +100,7 @@ namespace Tgstation.Server.Host.Utils
In = ParameterLocation.Header,
Type = SecuritySchemeType.Http,
Name = HeaderNames.Authorization,
+ Description = "Username & Password authentication to obtain an JWT token when doing a (POST /api).",
Scheme = ApiHeaders.BasicAuthenticationScheme,
});
@@ -107,16 +109,18 @@ namespace Tgstation.Server.Host.Utils
In = ParameterLocation.Header,
Type = SecuritySchemeType.Http,
Name = HeaderNames.Authorization,
+ Description = "OAuth2 based authentication.",
Scheme = ApiHeaders.OAuthAuthenticationScheme,
});
swaggerGenOptions.AddSecurityDefinition(TokenSecuritySchemeId, new OpenApiSecurityScheme
{
- BearerFormat = "JWT",
In = ParameterLocation.Header,
Type = SecuritySchemeType.Http,
Name = HeaderNames.Authorization,
+ Description = "JWT Bearer token generated by the server (POST /api). You need this for most endpoints to work.",
Scheme = ApiHeaders.BearerAuthenticationScheme,
+ BearerFormat = "JWT",
});
}
@@ -368,14 +372,11 @@ namespace Tgstation.Server.Host.Utils
},
};
- operation.Security = new List
+ operation.Security = new List()
{
new()
{
- {
- tokenScheme,
- new List()
- },
+ { tokenScheme, new List() },
},
};
@@ -493,7 +494,6 @@ namespace Tgstation.Server.Host.Utils
var productHeaderSchema = new OpenApiSchema
{
Type = "string",
- Format = "productheader",
};
swaggerDoc.Components.Parameters.Add(ApiHeaders.ApiVersionHeader, new OpenApiParameter
@@ -541,6 +541,28 @@ namespace Tgstation.Server.Host.Utils
Id = HeaderNames.UserAgent,
},
});
+
+ // flatten (Tgstation.Server.*).MyClass
+ if (operation.Description?.Length > 0)
+ operation.Description = Regex.Replace(operation.Description, @"Tgstation\.Server\.(\w+\.)+(?=\w+)", string.Empty);
+
+ if (operation.Summary?.Length > 0)
+ operation.Summary = Regex.Replace(operation.Summary, @"Tgstation\.Server\.(\w+\.)+(?=\w+)", string.Empty);
+
+ if (operation.RequestBody?.Description != null)
+ operation.RequestBody.Description = Regex.Replace(operation.RequestBody.Description, @"Tgstation\.Server\.(\w+\.)+(?=\w+)", string.Empty);
+
+ foreach (var opPar in operation.Parameters)
+ {
+ if (opPar.Description != null)
+ opPar.Description = Regex.Replace(opPar.Description, @"Tgstation\.Server\.(\w+\.)+(?=\w+)", string.Empty);
+ }
+
+ foreach (var (_, opRes) in operation.Responses)
+ {
+ if (opRes.Description != null)
+ opRes.Description = Regex.Replace(opRes.Description, @"Tgstation\.Server\.(\w+\.)+(?=\w+)", string.Empty);
+ }
}
AddDefaultResponses(swaggerDoc);
diff --git a/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj b/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj
index f93188baa9..bd8bbc1219 100644
--- a/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj
+++ b/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj
@@ -10,11 +10,11 @@
-
+
-
+
-
+
diff --git a/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj b/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj
index 622b82d8cb..2f6f44c567 100644
--- a/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj
+++ b/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj b/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj
index 0e74bf0b36..0c961dac12 100644
--- a/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj
+++ b/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/tests/Tgstation.Server.Host.Tests/Core/TestApplication.cs b/tests/Tgstation.Server.Host.Tests/Core/TestApplication.cs
index 258c0f20ff..ba5469714b 100644
--- a/tests/Tgstation.Server.Host.Tests/Core/TestApplication.cs
+++ b/tests/Tgstation.Server.Host.Tests/Core/TestApplication.cs
@@ -40,39 +40,43 @@ namespace Tgstation.Server.Host.Core.Tests
Assert.ThrowsException(() => app.ConfigureServices(mockServiceCollection, null, null));
- Assert.ThrowsException(() => app.Configure(null, null, null, null, null, null, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(null, null, null, null, null, null, null, null, null, null, null));
var mockAppBuilder = new Mock();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, null, null, null, null, null, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, null, null, null, null, null, null, null, null, null, null));
var mockServerControl = new Mock();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, null, null, null, null, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, null, null, null, null, null, null, null, null, null));
var mockTokenFactory = new Mock();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, null, null, null, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, null, null, null, null, null, null, null, null));
var mockServerPortProvider = new Mock();
mockServerPortProvider.SetupGet(x => x.HttpApiPort).Returns(5345);
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, null, null, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, null, null, null, null, null, null, null));
var mockAssemblyInformationProvider = Mock.Of();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, null, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, null, null, null, null, null, null));
var mockControlPanelOptions = new Mock>();
mockControlPanelOptions.SetupGet(x => x.Value).Returns(new ControlPanelConfiguration()).Verifiable();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, null, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, null, null, null, null, null));
var mockGeneralOptions = new Mock>();
mockGeneralOptions.SetupGet(x => x.Value).Returns(new GeneralConfiguration()).Verifiable();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, null, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, null, null, null, null));
+
+ var mockDatabaseOptions = new Mock>();
+ mockDatabaseOptions.SetupGet(x => x.Value).Returns(new DatabaseConfiguration()).Verifiable();
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, mockDatabaseOptions.Object, null, null, null));
var mockSwarmOptions = new Mock>();
mockSwarmOptions.SetupGet(x => x.Value).Returns(new SwarmConfiguration()).Verifiable();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, mockSwarmOptions.Object, null, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, mockDatabaseOptions.Object, mockSwarmOptions.Object, null, null));
var mockInternalOptions = new Mock>();
mockInternalOptions.SetupGet(x => x.Value).Returns(new InternalConfiguration()).Verifiable();
- Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, mockSwarmOptions.Object, mockInternalOptions.Object, null));
+ Assert.ThrowsException(() => app.Configure(mockAppBuilder.Object, mockServerControl.Object, mockTokenFactory.Object, mockServerPortProvider.Object, mockAssemblyInformationProvider, mockControlPanelOptions.Object, mockGeneralOptions.Object, mockDatabaseOptions.Object, mockSwarmOptions.Object, mockInternalOptions.Object, null));
mockControlPanelOptions.VerifyAll();
mockInternalOptions.VerifyAll();
diff --git a/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj b/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj
index 84fb610491..32edf3de15 100644
--- a/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj
+++ b/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj
@@ -6,7 +6,7 @@
-
+