From e9a9a2e67b6c0ff3a330d350813eb78933fc5675 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 1 Nov 2017 16:18:02 -0400 Subject: [PATCH 1/7] Fixes missing bad certificate override in Control Panel --- TGCommandLine/Program.cs | 23 +++++++++++------------ TGControlPanel/Program.cs | 1 + TGServiceInterface/Interface.cs | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/TGCommandLine/Program.cs b/TGCommandLine/Program.cs index 494cbd8bd6..0d45e1573a 100644 --- a/TGCommandLine/Program.cs +++ b/TGCommandLine/Program.cs @@ -97,17 +97,6 @@ namespace TGCommandLine static void ReplaceInterface(Interface I) { - - if (!interactive) - I.SetBadCertificateHandler((message) => - { - foreach (var J in Environment.GetCommandLineArgs()) - if (J.ToLower() == "--disable-ssl-verification") //im just not even going to document this because i hate it so much - return true; - return false; - }); - else - I.SetBadCertificateHandler(BadCertificateInteractive); currentInterface = I; ConsoleCommand.Interface = I; } @@ -161,10 +150,20 @@ namespace TGCommandLine ReplaceInterface(new Interface()); Command.OutputProcVar.Value = Console.WriteLine; if (args.Length != 0) + { + Interface.SetBadCertificateHandler((message) => + { + foreach (var J in args) + if (J.ToLower() == "--disable-ssl-verification") //im just not even going to document this because i hate it so much + return true; + return false; + }); return (int)RunCommandLine(new List(args)); + } - Console.WriteLine("Type 'remote' to connect to a remote service"); //interactive mode + Interface.SetBadCertificateHandler(BadCertificateInteractive); + Console.WriteLine("Type 'remote' to connect to a remote service"); while (true) { Console.Write("Enter command: "); diff --git a/TGControlPanel/Program.cs b/TGControlPanel/Program.cs index 0c012c7123..1121948ccb 100644 --- a/TGControlPanel/Program.cs +++ b/TGControlPanel/Program.cs @@ -19,6 +19,7 @@ namespace TGControlPanel } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); + Interface.SetBadCertificateHandler(BadCertificateHandler); using(var L = new Login()) Application.Run(L); } diff --git a/TGServiceInterface/Interface.cs b/TGServiceInterface/Interface.cs index 954b4cc064..8c5533d72d 100644 --- a/TGServiceInterface/Interface.cs +++ b/TGServiceInterface/Interface.cs @@ -101,7 +101,7 @@ namespace TGServiceInterface /// Sets the function called when a remote login fails due to the server having an invalid SSL cert /// /// The to be called when a remote login is attempted while the server posesses a bad certificate. Passed a of error information about the and should return if it the connection should be made anyway - public void SetBadCertificateHandler(Func handler) + public static void SetBadCertificateHandler(Func handler) { ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => { @@ -123,7 +123,7 @@ namespace TGServiceInterface ErrorMessage = "An unknown error occurred."; break; } - ErrorMessage = String.Format("The certificate failed to verify for {0}:{1}. {2} {3}", HTTPSURL, HTTPSPort, ErrorMessage, cert.ToString()); + ErrorMessage = String.Format("The certificate failed to verify! Error: {2} Cert: {3}", ErrorMessage, cert.ToString()); return handler(ErrorMessage); }; } From dc534aae1c2eb6645ef51225e4625c146ae4c3b5 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 1 Nov 2017 16:20:15 -0400 Subject: [PATCH 2/7] Move SetBadCertificateHandler --- TGServiceInterface/Interface.cs | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/TGServiceInterface/Interface.cs b/TGServiceInterface/Interface.cs index 8c5533d72d..4c87303b6c 100644 --- a/TGServiceInterface/Interface.cs +++ b/TGServiceInterface/Interface.cs @@ -77,26 +77,6 @@ namespace TGServiceInterface return query.ToList(); } - /// - /// Construct an for a local connection - /// - public Interface() { } - - /// - /// Construct an for a remote connection - /// - /// The address of the remote server - /// The port the remote server runs on - /// Windows account username for the remote server - /// Windows account password for the remote server - public Interface(string address, ushort port, string username, string password) - { - HTTPSURL = address; - HTTPSPort = port; - HTTPSUsername = username; - HTTPSPassword = password; - } - /// /// Sets the function called when a remote login fails due to the server having an invalid SSL cert /// @@ -128,6 +108,26 @@ namespace TGServiceInterface }; } + /// + /// Construct an for a local connection + /// + public Interface() { } + + /// + /// Construct an for a remote connection + /// + /// The address of the remote server + /// The port the remote server runs on + /// Windows account username for the remote server + /// Windows account password for the remote server + public Interface(string address, ushort port, string username, string password) + { + HTTPSURL = address; + HTTPSPort = port; + HTTPSUsername = username; + HTTPSPassword = password; + } + /// /// Closes all s stored in and clears it /// From d0395286380f91e228ad9105b30e38aa807ad33d Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 1 Nov 2017 16:48:10 -0400 Subject: [PATCH 3/7] Remove unused variable --- TGCommandLine/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/TGCommandLine/Program.cs b/TGCommandLine/Program.cs index 0d45e1573a..20565f33cc 100644 --- a/TGCommandLine/Program.cs +++ b/TGCommandLine/Program.cs @@ -9,7 +9,6 @@ namespace TGCommandLine class Program { - static bool interactive = false; static Interface currentInterface; static Command.ExitCode RunCommandLine(IList argsAsList) { From 181569cf61adcf1f494f673255501fc2a54a7d6d Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Wed, 1 Nov 2017 13:50:56 -0700 Subject: [PATCH 4/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 71029aaa19..615c7ed7ff 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ This process is identical to the above steps in command line mode. You can alway 1. [Bind the SSL certificate to the port](https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-configure-a-port-with-an-ssl-certificate) - e.g. `netsh http add sslcert ipport=0.0.0.0: certhash= appid={F32EDA25-0855-411C-AF5E-F0D042917E2D}` - The `appid` GUID actually doesn't matter, but for sanity, you should use the GUID of TGServerService.exe as printed above + - Power shell users remember to quit the appid: `netsh http add sslcert ipport=0.0.0.0: certhash= appid="{F32EDA25-0855-411C-AF5E-F0D042917E2D}"` as {} has special meaning in powershell 1. Ensure the port can be acccessed from the internet 1. Log in from any computer using a username and password from the service computer in either the CLI or GUI From 08a31380c839efe1f3c122a03df3b2938f11ee38 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 1 Nov 2017 18:14:57 -0400 Subject: [PATCH 5/7] Fixes port selector not saving in Control Panel --- TGControlPanel/Login.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/TGControlPanel/Login.cs b/TGControlPanel/Login.cs index e75498e0d0..aacb6806ee 100644 --- a/TGControlPanel/Login.cs +++ b/TGControlPanel/Login.cs @@ -35,6 +35,7 @@ namespace TGControlPanel { var Config = Properties.Settings.Default; Config.RemoteIP = IPTextBox.Text; + Config.RemotePort = (ushort)PortSelector.Value; Config.RemoteUsername = UsernameTextBox.Text; if (SavePasswordCheckBox.Checked) { From 330ce2b91a6f9ab9dbcc149415900ef2ec10b917 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 1 Nov 2017 18:19:18 -0400 Subject: [PATCH 6/7] Fixes tabbing to Repo whil it's busy crashing the Control Panel --- TGControlPanel/RepoPage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TGControlPanel/RepoPage.cs b/TGControlPanel/RepoPage.cs index d6f6bc9bae..e33799692e 100644 --- a/TGControlPanel/RepoPage.cs +++ b/TGControlPanel/RepoPage.cs @@ -238,7 +238,7 @@ namespace TGControlPanel } void DoAsyncOp(RepoAction ra, string message) { - if (ra != RepoAction.Wait && RepoBusyCheck()) + if (RepoBGW.IsBusy || (ra != RepoAction.Wait && RepoBusyCheck())) return; CurrentRevisionLabel.Visible = false; From c1377384bdf5f45aba3ccb6727eaa5019e1c2f58 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 1 Nov 2017 18:39:18 -0400 Subject: [PATCH 7/7] Version bump to 3.1.6.5 [TGSDeploy] --- Version.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Version.cs b/Version.cs index 459e6ec13c..8255119c01 100644 --- a/Version.cs +++ b/Version.cs @@ -12,6 +12,6 @@ using System.Reflection; // [assembly: AssemblyVersion("1.0.*")] //It's impossible to make these a define, don't say I didn't warn you -[assembly: AssemblyVersion("3.1.6.4")] -[assembly: AssemblyFileVersion("3.1.6.4")] -[assembly: AssemblyInformationalVersion("3.1.6.4")] +[assembly: AssemblyVersion("3.1.6.5")] +[assembly: AssemblyFileVersion("3.1.6.5")] +[assembly: AssemblyInformationalVersion("3.1.6.5")]