From 3933dc5cc3b8f638ba4f40649031b6fb1018b4a6 Mon Sep 17 00:00:00 2001 From: Maarten Balliauw Date: Mon, 6 Jun 2016 21:05:52 +0200 Subject: [PATCH 1/2] Minor configuration updates to ensure PUT is not hijacked by WebDAV module --- src/NuGet.Server/Core/Helpers.cs | 2 +- src/NuGet.Server/Default.aspx | 6 +++--- src/NuGet.Server/Web.config | 12 ++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/NuGet.Server/Core/Helpers.cs b/src/NuGet.Server/Core/Helpers.cs index cc103db0..0ebe3c60 100644 --- a/src/NuGet.Server/Core/Helpers.cs +++ b/src/NuGet.Server/Core/Helpers.cs @@ -14,7 +14,7 @@ public static string GetRepositoryUrl(Uri currentUrl, string applicationPath) public static string GetPushUrl(Uri currentUrl, string applicationPath) { - return GetBaseUrl(currentUrl, applicationPath) + "nuget"; + return GetBaseUrl(currentUrl, applicationPath) + "api/v2/package"; } public static string GetBaseUrl(Uri currentUrl, string applicationPath) diff --git a/src/NuGet.Server/Default.aspx b/src/NuGet.Server/Default.aspx index 1c4132d5..42185b21 100644 --- a/src/NuGet.Server/Default.aspx +++ b/src/NuGet.Server/Default.aspx @@ -24,12 +24,12 @@ <%= Helpers.GetRepositoryUrl(Request.Url, Request.ApplicationPath) %> <% if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["apiKey"])) { %> - To enable pushing packages to this feed using the nuget command line tool (nuget.exe). Set the api key appSetting in web.config. + To enable pushing packages to this feed using the NuGet command line tool (nuget.exe), set the api key appSetting in web.config. <% } else { %> - Use the command below to push packages to this feed using the nuget command line tool (nuget.exe). + Use the command below to push packages to this feed using the NuGet command line tool (nuget.exe). <% } %>
- nuget push {package file} -s <%= Helpers.GetPushUrl(Request.Url, Request.ApplicationPath) %> {apikey} + nuget.exe push {package file} {apikey} -Source <%= Helpers.GetPushUrl(Request.Url, Request.ApplicationPath) %>
diff --git a/src/NuGet.Server/Web.config b/src/NuGet.Server/Web.config index 51b3c368..b0d722ab 100644 --- a/src/NuGet.Server/Web.config +++ b/src/NuGet.Server/Web.config @@ -69,6 +69,18 @@ + + + + + + + + + + + + \ No newline at end of file From 10bd5d5ed2c5c758f17ad7d38b00413310beec54 Mon Sep 17 00:00:00 2001 From: Maarten Balliauw Date: Mon, 6 Jun 2016 21:10:28 +0200 Subject: [PATCH 2/2] NuGet.Server - Upgrade to .NET 4.6 (compatibility with NuGet 3.3+) - https://github.com/NuGet/NuGetGallery/issues/3063 --- src/CommonAssemblyInfo.cs | 4 +- src/NuGet.Server/NuGet.Server.csproj | 24 +++++---- src/NuGet.Server/Strings.Designer.cs | 2 +- src/NuGet.Server/Web.config | 50 +++++++++---------- src/NuGet.Server/packages.config | 12 ++--- .../NuGet.Server.Tests.csproj | 21 ++++++-- test/NuGet.Server.Tests/packages.config | 21 ++++---- 7 files changed, 75 insertions(+), 59 deletions(-) diff --git a/src/CommonAssemblyInfo.cs b/src/CommonAssemblyInfo.cs index c2cfa8b0..9ca7fad5 100644 --- a/src/CommonAssemblyInfo.cs +++ b/src/CommonAssemblyInfo.cs @@ -13,7 +13,7 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("2.11.1.0")] -[assembly: AssemblyFileVersion("2.11.1.0")] +[assembly: AssemblyVersion("2.11.2.0")] +[assembly: AssemblyFileVersion("2.11.2.0")] [assembly: NeutralResourcesLanguage("en-US")] diff --git a/src/NuGet.Server/NuGet.Server.csproj b/src/NuGet.Server/NuGet.Server.csproj index 72f77535..3452e617 100644 --- a/src/NuGet.Server/NuGet.Server.csproj +++ b/src/NuGet.Server/NuGet.Server.csproj @@ -1,5 +1,5 @@  - + @@ -15,6 +15,8 @@ + v4.6 + {793B20A9-E263-4B54-BB31-305B602087CE} @@ -29,10 +31,12 @@ - True + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + False ..\..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll True @@ -47,21 +51,25 @@ True + False ..\..\packages\RouteMagic.1.3\lib\net40\RouteMagic.dll True + - - 3.5 - + + + + + False ..\..\packages\WebActivatorEx.2.1.0\lib\net40\WebActivatorEx.dll @@ -141,11 +149,7 @@ PreserveNewest - - - - Designer - + diff --git a/src/NuGet.Server/Strings.Designer.cs b/src/NuGet.Server/Strings.Designer.cs index 9dd8a1e5..6d3f9e19 100644 --- a/src/NuGet.Server/Strings.Designer.cs +++ b/src/NuGet.Server/Strings.Designer.cs @@ -70,7 +70,7 @@ internal static string Error_PackageAlreadyExists { } /// - /// Looks up a localized string similar to Package {0} is a symbols package (it contains .pdb fiels and a /src folder). The server is configured to ignore symbols packages.. + /// Looks up a localized string similar to Package {0} is a symbols package (it contains .pdb files and a /src folder). The server is configured to ignore symbols packages.. /// internal static string Error_SymbolsPackagesIgnored { get { diff --git a/src/NuGet.Server/Web.config b/src/NuGet.Server/Web.config index b0d722ab..d1423d43 100644 --- a/src/NuGet.Server/Web.config +++ b/src/NuGet.Server/Web.config @@ -1,4 +1,4 @@ - + - - + - - + - - + - - + - - + - - + - - + + - - + + - + - + - + - - - - + + + - + diff --git a/src/NuGet.Server/packages.config b/src/NuGet.Server/packages.config index 72f4e492..3e048d63 100644 --- a/src/NuGet.Server/packages.config +++ b/src/NuGet.Server/packages.config @@ -1,9 +1,9 @@  - - - - - - + + + + + + \ No newline at end of file diff --git a/test/NuGet.Server.Tests/NuGet.Server.Tests.csproj b/test/NuGet.Server.Tests/NuGet.Server.Tests.csproj index 1eafd7c3..0ee315d8 100644 --- a/test/NuGet.Server.Tests/NuGet.Server.Tests.csproj +++ b/test/NuGet.Server.Tests/NuGet.Server.Tests.csproj @@ -1,5 +1,5 @@  - + {92D18050-3867-4E39-B305-9F9870F66F5E} @@ -8,6 +8,8 @@ NuGet.Server.Tests NuGet.Server.Tests {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + v4.6 + AnyCPU @@ -19,13 +21,18 @@ AnyCPU + + ..\..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + False ..\..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll True - + False - ..\..\packages\Moq.4.5.0\lib\net45\Moq.dll + ..\..\packages\Moq.4.5.8\lib\net45\Moq.dll True @@ -46,18 +53,22 @@ + False ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll True + False ..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll True + False ..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll True + False ..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll True @@ -87,10 +98,10 @@ - + - + \ No newline at end of file diff --git a/test/NuGet.Server.Tests/packages.config b/test/NuGet.Server.Tests/packages.config index 3c1fa71f..82c2bc9e 100644 --- a/test/NuGet.Server.Tests/packages.config +++ b/test/NuGet.Server.Tests/packages.config @@ -1,13 +1,14 @@  - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file