From 43cf036113470eb35cb35ca6ca5ffa7cc5c46deb Mon Sep 17 00:00:00 2001 From: paul cannon Date: Tue, 7 Apr 2020 10:02:41 -0500 Subject: [PATCH] installer/windows: don't require ca.key file (#3847) As noted by @sixcorners at https://github.com/storj/storj/pull/3819#issuecomment-609025487, the Windows installer code incorrectly fails if the ca.key file is not present. The ca.key file should not be necessary for regular storage node usage, and in fact we recommend that users move the ca.key file to secure storage rather than keeping it on the node. I'm not sure how to run the tests, so I'll get a nod from the SNO Growth team before merging. Change-Id: Ib2fe236de5c75165644e880caa827a2a1a034c87 Co-authored-by: Stefan Benten --- installer/windows/Storj/CustomAction.cs | 5 ----- .../StorjTests/ValidateIdentityDirTests.cs | 17 ----------------- 2 files changed, 22 deletions(-) diff --git a/installer/windows/Storj/CustomAction.cs b/installer/windows/Storj/CustomAction.cs index 9ab48eadf..7100a43d1 100644 --- a/installer/windows/Storj/CustomAction.cs +++ b/installer/windows/Storj/CustomAction.cs @@ -142,11 +142,6 @@ namespace Storj throw new ArgumentException("File 'ca.cert' not found in the selected folder."); } - if (!fs.File.Exists(Path.Combine(identityDir, "ca.key"))) - { - throw new ArgumentException("File 'ca.key' not found in the selected folder."); - } - if (!fs.File.Exists(Path.Combine(identityDir, "identity.cert"))) { throw new ArgumentException("File 'identity.cert' not found in the selected folder."); diff --git a/installer/windows/StorjTests/ValidateIdentityDirTests.cs b/installer/windows/StorjTests/ValidateIdentityDirTests.cs index 2567f11a3..2158d90b4 100644 --- a/installer/windows/StorjTests/ValidateIdentityDirTests.cs +++ b/installer/windows/StorjTests/ValidateIdentityDirTests.cs @@ -36,20 +36,6 @@ namespace StorjTests { var fs = new MockFileSystem(new Dictionary { - { @"X:\\Some\\Identity\\Folder\\ca.key", new MockFileData("") }, - { @"X:\\Some\\Identity\\Folder\\identity.cert", new MockFileData("") }, - { @"X:\\Some\\Identity\\Folder\\identity.key", new MockFileData("") } - }); - new CustomActionRunner(fs).ValidateIdentityDir("X:\\Some\\Identity\\Folder"); - } - - [TestMethod] - [ExpectedExceptionWithMessage(typeof(ArgumentException), "File 'ca.key' not found in the selected folder.")] - public void MissingCAKeyFile() - { - var fs = new MockFileSystem(new Dictionary - { - { @"X:\\Some\\Identity\\Folder\\ca.cert", new MockFileData("") }, { @"X:\\Some\\Identity\\Folder\\identity.cert", new MockFileData("") }, { @"X:\\Some\\Identity\\Folder\\identity.key", new MockFileData("") } }); @@ -63,7 +49,6 @@ namespace StorjTests var fs = new MockFileSystem(new Dictionary { { @"X:\\Some\\Identity\\Folder\\ca.cert", new MockFileData("") }, - { @"X:\\Some\\Identity\\Folder\\ca.key", new MockFileData("") }, { @"X:\\Some\\Identity\\Folder\\identity.key", new MockFileData("") } }); new CustomActionRunner(fs).ValidateIdentityDir("X:\\Some\\Identity\\Folder"); @@ -76,7 +61,6 @@ namespace StorjTests var fs = new MockFileSystem(new Dictionary { { @"X:\\Some\\Identity\\Folder\\ca.cert", new MockFileData("") }, - { @"X:\\Some\\Identity\\Folder\\ca.key", new MockFileData("") }, { @"X:\\Some\\Identity\\Folder\\identity.cert", new MockFileData("") } }); new CustomActionRunner(fs).ValidateIdentityDir("X:\\Some\\Identity\\Folder"); @@ -88,7 +72,6 @@ namespace StorjTests var fs = new MockFileSystem(new Dictionary { { @"X:\\Some\\Identity\\Folder\\ca.cert", new MockFileData("") }, - { @"X:\\Some\\Identity\\Folder\\ca.key", new MockFileData("") }, { @"X:\\Some\\Identity\\Folder\\identity.cert", new MockFileData("") }, { @"X:\\Some\\Identity\\Folder\\identity.key", new MockFileData("") }, });