From 651f2a2aec283cab5b2420fda91fd6ac98a64fb0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 10 Jan 2015 21:12:43 -0500 Subject: [PATCH] add https port to config object --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 7 +++++++ MediaBrowser.Server.Mono/Native/BaseMonoApp.cs | 2 +- MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 1 + MediaBrowser.Server.Startup.Common/INativeApp.cs | 3 ++- MediaBrowser.ServerApplication/Native/RegisterServer.bat | 6 ++++++ .../Native/ServerAuthorization.cs | 5 +++-- MediaBrowser.ServerApplication/Native/WindowsApp.cs | 4 ++-- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 681442ff54..f9c5c65674 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -26,6 +26,12 @@ namespace MediaBrowser.Model.Configuration /// The HTTP server port number. public int HttpServerPortNumber { get; set; } + /// + /// Gets or sets the HTTPS server port number. + /// + /// The HTTPS server port number. + public int HttpsPortNumber { get; set; } + /// /// Gets or sets a value indicating whether [enable internet providers]. /// @@ -187,6 +193,7 @@ namespace MediaBrowser.Model.Configuration ImageSavingConvention = ImageSavingConvention.Compatible; PublicPort = 8096; HttpServerPortNumber = 8096; + HttpsPortNumber = 8920; EnableDashboardResponseCaching = true; EnableAutomaticRestart = true; diff --git a/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs b/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs index 7f61570a4d..1ec0109ad8 100644 --- a/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs +++ b/MediaBrowser.Server.Mono/Native/BaseMonoApp.cs @@ -83,7 +83,7 @@ namespace MediaBrowser.Server.Mono.Native return list; } - public void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory) + public void AuthorizeServer(int udpPort, int httpServerPort, int httpsPort, string tempDirectory) { } diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index bbdb89ac39..fa068a7de8 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -1098,6 +1098,7 @@ namespace MediaBrowser.Server.Startup.Common NativeApp.AuthorizeServer( UdpServerEntryPoint.PortNumber, ServerConfigurationManager.Configuration.HttpServerPortNumber, + ServerConfigurationManager.Configuration.HttpsPortNumber, ConfigurationManager.CommonApplicationPaths.TempDirectory); } catch (Exception ex) diff --git a/MediaBrowser.Server.Startup.Common/INativeApp.cs b/MediaBrowser.Server.Startup.Common/INativeApp.cs index 4abea57fb1..2dbd844baa 100644 --- a/MediaBrowser.Server.Startup.Common/INativeApp.cs +++ b/MediaBrowser.Server.Startup.Common/INativeApp.cs @@ -18,8 +18,9 @@ namespace MediaBrowser.Server.Startup.Common /// /// The UDP port. /// The HTTP server port. + /// The HTTPS server port. /// The temporary directory. - void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory); + void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string tempDirectory); /// /// Gets the environment. diff --git a/MediaBrowser.ServerApplication/Native/RegisterServer.bat b/MediaBrowser.ServerApplication/Native/RegisterServer.bat index 3346ecb317..57e93683e0 100644 --- a/MediaBrowser.ServerApplication/Native/RegisterServer.bat +++ b/MediaBrowser.ServerApplication/Native/RegisterServer.bat @@ -1,5 +1,6 @@ rem %1 = udp server port rem %2 = http server port +rem %3 = https server port if [%1]==[] GOTO DONE @@ -11,6 +12,11 @@ if [%2]==[] GOTO DONE netsh advfirewall firewall delete rule name="Port %2" protocol=TCP localport=%2 netsh advfirewall firewall add rule name="Port %2" dir=in action=allow protocol=TCP localport=%2 +if [%3]==[] GOTO DONE + +netsh advfirewall firewall delete rule name="Port %3" protocol=TCP localport=%3 +netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=TCP localport=%3 + :DONE Exit \ No newline at end of file diff --git a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs index d9063aa580..995c44e318 100644 --- a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs +++ b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs @@ -15,8 +15,9 @@ namespace MediaBrowser.ServerApplication.Native /// /// The UDP port. /// The HTTP server port. + /// The HTTPS server port. /// The temp directory. - public static void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory) + public static void AuthorizeServer(int udpPort, int httpServerPort, int httpsServerPort, string tempDirectory) { Directory.CreateDirectory(tempDirectory); @@ -36,7 +37,7 @@ namespace MediaBrowser.ServerApplication.Native { FileName = tmpFile, - Arguments = string.Format("{0} {1}", udpPort, httpServerPort), + Arguments = string.Format("{0} {1} {2}", udpPort, httpServerPort, httpsServerPort), CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs index 0970d6537a..45070e6ece 100644 --- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs +++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs @@ -21,9 +21,9 @@ namespace MediaBrowser.ServerApplication.Native return list; } - public void AuthorizeServer(int httpServerPort, int udpPort, string tempDirectory) + public void AuthorizeServer(int udpPort, int httpServerPort, int httpsPort, string tempDirectory) { - ServerAuthorization.AuthorizeServer(udpPort, httpServerPort, tempDirectory); + ServerAuthorization.AuthorizeServer(udpPort, httpServerPort, httpsPort, tempDirectory); } public NativeEnvironment Environment