Respect SkipAddingByondFirewallException for OD

This commit is contained in:
Jordan Dominion
2023-10-16 09:31:07 -04:00
parent 33f0933b0d
commit dfff65cad7
3 changed files with 9 additions and 6 deletions
@@ -64,7 +64,7 @@ namespace Tgstation.Server.Host.Components.Engine
/// <summary>
/// The <see cref="GeneralConfiguration"/> for the <see cref="OpenDreamInstaller"/>.
/// </summary>
readonly GeneralConfiguration generalConfiguration;
protected GeneralConfiguration GeneralConfiguration { get; }
/// <summary>
/// Initializes a new instance of the <see cref="OpenDreamInstaller"/> class.
@@ -74,7 +74,7 @@ namespace Tgstation.Server.Host.Components.Engine
/// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/>.</param>
/// <param name="processExecutor">The value of <see cref="ProcessExecutor"/>.</param>
/// <param name="repositoryManager">The value of <see cref="repositoryManager"/>.</param>
/// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="generalConfiguration"/>.</param>
/// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing value of <see cref="GeneralConfiguration"/>.</param>
public OpenDreamInstaller(
IIOManager ioManager,
ILogger<OpenDreamInstaller> logger,
@@ -87,7 +87,7 @@ namespace Tgstation.Server.Host.Components.Engine
this.platformIdentifier = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier));
ProcessExecutor = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor));
this.repositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager));
generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
GeneralConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
}
/// <inheritdoc />
@@ -116,7 +116,7 @@ namespace Tgstation.Server.Host.Components.Engine
var progressSection1 = jobProgressReporter?.CreateSection("Updating OpenDream git repository", 0.5f);
var repo = await repositoryManager.CloneRepository(
generalConfiguration.OpenDreamGitUrl,
GeneralConfiguration.OpenDreamGitUrl,
null,
null,
null,
@@ -142,7 +142,7 @@ namespace Tgstation.Server.Host.Components.Engine
var progressSection2 = jobProgressReporter?.CreateSection("Checking out OpenDream version", 0.5f);
var committish = version.SourceSHA
?? $"{generalConfiguration.OpenDreamGitTagPrefix}{version.Version.Semver()}";
?? $"{GeneralConfiguration.OpenDreamGitTagPrefix}{version.Version.Semver()}";
await repo.CheckoutObject(
committish,
@@ -91,6 +91,9 @@ namespace Tgstation.Server.Host.Components.Engine
/// <returns>A <see cref="ValueTask"/> representing the running operation.</returns>
async ValueTask AddServerFirewallException(EngineVersion version, string path, CancellationToken cancellationToken)
{
if (GeneralConfiguration.SkipAddingByondFirewallException)
return;
GetExecutablePaths(path, out var serverExePath, out _);
int exitCode;
+1 -1
View File
@@ -14,7 +14,7 @@ General:
InstanceLimit: 10 # Maximum number of allowed instances
ValidInstancePaths: # An array of directories instances may be created in (either directly or as a subdirectory). null removes the restriction
HostApiDocumentation: false # Make HTTP API documentation available at /swagger/v1/swagger.json
SkipAddingByondFirewallException: false # Windows Only: Prevent running netsh.exe to add a firewall exception for installed DreamDaemon binaries
SkipAddingByondFirewallException: false # Windows Only: Prevent running netsh.exe to add a firewall exception for installed engine binaries
DeploymentDirectoryCopyTasksPerCore: 100 # Maximum number of concurrent file copy operations PER available CPU core
OpenDreamGitUrl: https://github.com/OpenDreamProject/OpenDream # The repository to retrieve OpenDream from
OpenDreamGitTagPrefix: v # The prefix to the OpenDream semver as tags appear in the git repository