diff --git a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
index e7cd7ac52e..8070da2382 100644
--- a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
+++ b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
@@ -149,6 +149,12 @@ namespace Tgstation.Server.Host.Controllers
if (model == null)
throw new ArgumentNullException(nameof(model));
+ if (model.PrimaryPort == 0)
+ return BadRequest(new ErrorMessage { Message = "Primary port cannot be 0!" });
+
+ if (model.SecurityLevel == DreamDaemonSecurity.Ultrasafe)
+ return BadRequest(new ErrorMessage { Message = "This version of TGS does not support the ultrasafe DreamDaemon configuration!" });
+
//alias for changing DD settings
var current = await DatabaseContext.Instances.Where(x => x.Id == Instance.Id).Select(x => x.DreamDaemonSettings).FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);
@@ -185,8 +191,8 @@ namespace Tgstation.Server.Host.Controllers
|| CheckModified(x => x.StartupTimeout, DreamDaemonRights.SetStartupTimeout))
return Forbid();
- if (current.SecurityLevel == DreamDaemonSecurity.Ultrasafe)
- return BadRequest(new ErrorMessage { Message = "This version of TGS does not support the ultrasafe DreamDaemon configuration!" });
+ if (current.PrimaryPort == current.SecondaryPort)
+ return BadRequest(new ErrorMessage { Message = "Primary port and secondary port cannot be the same!" });
var wd = instanceManager.GetInstance(Instance).Watchdog;
diff --git a/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs b/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs
index b847fef9e2..1f4a9bb81c 100644
--- a/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs
+++ b/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs
@@ -7,6 +7,7 @@ using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Tgstation.Server.Api;
+using Tgstation.Server.Api.Models;
using Tgstation.Server.Api.Rights;
using Tgstation.Server.Host.Components;
using Tgstation.Server.Host.Core;
@@ -85,9 +86,9 @@ namespace Tgstation.Server.Host.Controllers
///
[TgsAuthorize(DreamMakerRights.Compile)]
- public override async Task Create([FromBody] Api.Models.DreamMaker model, CancellationToken cancellationToken)
+ public override async Task Create([FromBody] DreamMaker model, CancellationToken cancellationToken)
{
- var job = new Job
+ var job = new Models.Job
{
Description = "Compile active repository code",
StartedBy = AuthenticationContext.User,
@@ -101,8 +102,11 @@ namespace Tgstation.Server.Host.Controllers
///
[TgsAuthorize(DreamMakerRights.SetDme | DreamMakerRights.SetApiValidationPort)]
- public override async Task Update([FromBody] Api.Models.DreamMaker model, CancellationToken cancellationToken)
+ public override async Task Update([FromBody] DreamMaker model, CancellationToken cancellationToken)
{
+ if (model.ApiValidationPort == 0)
+ return BadRequest(new ErrorMessage { Message = "API Validation port cannot be 0!" });
+
var hostModel = await DatabaseContext.DreamMakerSettings.Where(x => x.InstanceId == Instance.Id).FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);
if (hostModel == null)
return StatusCode((int)HttpStatusCode.Gone);