Browse files

Remove cloud service project from gallery (#3112)

* remove cloud service project

* Removed mentions of cloud project from readme

* New build script
  • Loading branch information...
1 parent 2cf6524 commit 18943852bb10f3c5c7adcf135794ec92a69e2ff6 @scottbommarito scottbommarito committed with xavierdecoster Aug 23, 2016
Showing with 768 additions and 1,468 deletions.
  1. +1 −0 .gitignore
  2. +3 −1 .nuget/packages.config
  3. +0 −239 Changelog.md
  4. +0 −42 NuGet.Cloud.targets
  5. +2 −2 NuGet.config
  6. +0 −7 NuGetGallery.sln
  7. +2 −3 README.md
  8. +0 −7 Repository.props
  9. +2 −3 appveyor.yml
  10. +1 −15 build.cmd
  11. +0 −94 build.msbuild
  12. +124 −0 build.ps1
  13. +0 −28 build/DeployFrontend.ps1
  14. +0 −16 build/NuGetGallery.xunit.targets
  15. +0 −3 build/README.md
  16. +401 −0 build/common.ps1
  17. +0 −177 src/NuGetGallery.Cloud/DeployToAzure.ps1
  18. +0 −89 src/NuGetGallery.Cloud/NuGetGallery.Cloud.ccproj
  19. +0 −22 src/NuGetGallery.Cloud/NuGetGallery.Cloud.nuspec
  20. +0 −13 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/InstallDotNet452.cmd
  21. BIN src/NuGetGallery.Cloud/NuGetGalleryContent/bin/NDP452-KB2901954-Web.exe
  22. +0 −2 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/SslConfig.cmd
  23. +0 −83 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/SslConfig.ps1
  24. +0 −2 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/Startup.cmd
  25. +0 −92 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/Startup.ps1
  26. +0 −49 src/NuGetGallery.Cloud/NuGetGalleryContent/diagnostics.wadcfgx
  27. +0 −82 src/NuGetGallery.Cloud/ServiceConfiguration.Cloud.cscfg
  28. +0 −82 src/NuGetGallery.Cloud/ServiceConfiguration.Local.cscfg
  29. +0 −92 src/NuGetGallery.Cloud/ServiceDefinition.csdef
  30. +0 −9 src/NuGetGallery.Core/NuGetGallery.Core.csproj
  31. +29 −1 src/NuGetGallery.Core/Properties/AssemblyInfo.cs
  32. +0 −1 src/NuGetGallery.Core/packages.config
  33. +0 −4 src/NuGetGallery.Operations/NuGetGallery.Operations.csproj
  34. +0 −1 src/NuGetGallery.Operations/packages.config
  35. +3 −9 src/NuGetGallery/NuGetGallery.csproj
  36. +29 −1 src/NuGetGallery/Properties/AssemblyInfo.cs
  37. +8 −9 src/NuGetGallery/Web.config
  38. +102 −103 src/NuGetGallery/packages.config
  39. +0 −9 src/galops/galops.csproj
  40. +0 −1 src/galops/packages.config
  41. +0 −6 tests/NuGetGallery.Core.Facts/NuGetGallery.Core.Facts.csproj
  42. +0 −1 tests/NuGetGallery.Core.Facts/packages.config
  43. +0 −6 tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj
  44. +61 −62 tests/NuGetGallery.Facts/packages.config
View
1 .gitignore
@@ -175,3 +175,4 @@ src/NuGetGallery.Cloud/ecf/
# Vs2015
.vs/config/applicationhost.config
src/NuGetGallery/App_Data/Files/auditing/
+artifacts/
View
4 .nuget/packages.config
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="xunit.runner.visualstudio" version="2.0.1" />
+ <package id="Microsoft.CodeAnalysis.BinSkim" version="1.3.4-beta" />
+ <package id="xunit.runner.console" version="2.1.0" />
+ <package id="xunit.runner.visualstudio" version="2.1.0" />
</packages>
View
239 Changelog.md
@@ -1,239 +0,0 @@
-#March 7, 2014
-
-Fixed a bug that caused a limited number of users to see an error page when attempting to view the Manage My Packages page, as well as a couple other UI glitches. This release was coordinated with a new worker whose new jobs support our disaster recovery and failover plan. See [3.0.1](https://github.com/NuGet/NuGetGallery/issues?milestone=45&page=1&state=closed) for details.
-
-
-#February 21, 2014
-
-Changed the frequency of stats updates on the home page. See [#1795](hhttps://github.com/NuGet/NuGetGallery/pull/1795) for details on the code change.
-
-
-#February 6, 2014
-
-Restored aggregate statistics to the home page, added an error message when package edits fail repeatedly, fixed a spurious error when uploading packages with dependencies that have no targetFramework assigned, and made a number of other fixes. See [I7 - QA 1/6](https://github.com/NuGet/NuGetGallery/issues?milestone=39&page=1&state=closed) for details.
-
-#January 2, 2014
-
-Improved our detection algorithm for packages in the WebMatrix custom feed, included additional validation for package upload using the Gallery website, and made the experience for validation errors in the contact pages more consistent. This iteration also included a number of other small user interface changes; see [I6 -12/06 QA - 01/02 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=38&page=1&state=closed) for details.
-
-#Dec 6, 2013
-
-Added support for Microsoft account login. Also fixes a number of UI issues. See [I5 -11/14 QA - 12/06 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=37&page=1&state=closed) for details.
-
-
-#Nov 14, 2013
-
-Bug fixes in a number of UI components, removing offensive terms, and removing the FriendlyLicenseNames configuration setting. Also fixes endless cycle of re-prompting for credentials in the client. [I4 -11/1 QA - 11/14 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=36&page=1&state=closed)
-
-#Nov 1,2013
-
-Bug fixes in new user registration, stats, search indexing and "Manage my packages" page. Complete list can be found here: [I3 -10/18 QA - 11/1 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=35&page=1&state=closed)
-
-#Oct 19,2013
-
-### OAuth Phase 1
-
-The back end changes to support OAuth in NuGet Gallery.
-
-### Other bug fixes
-
-Complete list can be found here: [10/04 - QA (10/18 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=34&page=1&state=closed)
-
-#Oct 9,2013
-
-### Friendly License Names
-
-NuGet Gallery will now display the list of license names for a package in addition to simply providing a link to the license text. The big idea behind this feature is that it will aid in the decision making process over whether or not to use a package.
-More details [here.](http://blog.nuget.org/20131011/friendly-license-names.html)
-
-### Simplified user registration
-
-New user registration workflow has been simplified with this deployment. Going forward, users don't have to confirm email for signing in. Email comfirmation can be done anytime before uploading a package.
-
-### Normalized package versions
-
-The package versions will be normalized in the package display page. For example, for a package with version "1.0", the version will be displayed as "1.0.0".
-The normalized version will be displayed in the "Verify package details" page while uploading a new package. This avoids the issue where packages with version "1.1" and "1.1.0" co-exists in the Gallery.
-
-### Other bug fixes
-
-Other bug fixes in Glimpse integration and OData feed.Complete list can be found here: [09/20 - QA (10/09 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=33&state=closed)
-
-
-#Sep 19, 2013
-
-### Edit package and other bug fixes
-
-A bunch of fixes around Edit package and expandable search box. Complete list can be found here: [09/6 - QA (09/19 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=32&page=1&state=closed)
-
-#Sep 3, 2013
-
-### Edit Package
-
-You can now edit the metadata related to your NuGet package from the NuGet Gallery before and after uploading the package.
-More details can be found [here](http://blog.nuget.org/20130823/Introducing-Edit-Package.html) in our team blog.
-
-### Expandable Search box
-The search box now gets auto-expanded whenever user tries to search for packages, making it easier to type in large search queries.
-
-### Other bug fixes
-
-Other changes include minor fixes in stats page, GetUpdates() API and updating NuGet.Core to 2.7-alpha.Complete list can be found here: [08/14 - QA (09/03 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=29)
-
-#Aug 1, 2013
-
-### Dependency update
-
-The dependencies of nuget.org website like OData, NuGet.Core and Azure Storage have been updated to point to their latest versions respectively.
-
-### Other bug fixes
-
-Other changes include minor fixes in stats page, GetUpdates() API and email validation for new user registration. Complete list can be found here: [07/19 - QA (08/02 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=27)
-
-#July 19, 2013
-
-### Nuget.org deployed on Azure Websites
-
-The nuget.org website is now deployed on Azure web sites instead of Azure cloud services. Expect a detailed blog post from the NuGet team on the steps involed in migration and key take aways.
-A couple of bug fixes were made to enable this migration( to be compatible with Azure web sites).
-
-- Canonical domain name for nuget.org : nuget.org will now re-direct to www.nuget.org.
-
-- Lucence search index stored in Temp folder instead of AppData folder.
-
-### Improved statistics
-
-The [stats page](https://www.nuget.org/stats) now shows graphs for client usage and monthly download trends.
-Also the stats for the individual packages now shows graphs for [downloads based on version](https://www.nuget.org/stats/packages/Newtonsoft.Json?groupby=Version) and "Install-Dependency" as an operation - which would help in indicating whether it is a direct install or install due to dependency.
-
-### Other bug fixes
-
-Other changes include [updated terms of use and privacy policy](https://www.nuget.org/policies/Privacy) and fixes to "Contact support" form. Complete list can be found here: [07/05 - QA (07/19 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=25&state=closed)
-
-#July 8, 2013
-
-### Accessiblity bug fixes
-
-A bunch of accessiblity issue like sorting, highlighting and WCAG level A HTML 5 errors in the website are fixed.
-
-### Other bug fixes
-
-Other changes include code refactoring of the controllers for better testability, client side input validation for user registration and proper retrieval of tags from package file irrespective of the delimiter used. Complete list can be found here: [06/21 - QA (07/05 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=24&state=closed)
-
-# June 21, 2013
-
-### Filtering in GetUpdates() API based on target framework
-
-The GetUpdates() in nuget.org API (V2) feed now allows filtering based on a specific target framework.
-
-### Admin page bug fixes
-
-A bunch of bug fixes related to the nuget.org Admin page (which shows up only for Administrator account) to modify and update database.
-
-### Other bug fixes
-
-Other bug fixes related to new user registration form and database schemna changes. Complete list can be found here: [06/10 - QA (06/20 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=23&state=closed)
-
-# June 7, 2013
-
-### Bug fixes in Search
-
-Minor bug fixes in search to not show the version number of packages in search results and to support special characters in seeach queries. Now the search terms like "C++" ,"C#" should return precise results.
-
-### Other bug fixes
-
-Other bug fixes related to "Contact Support" form and unlisting packages. Complete list can be found here: [05/27 - QA (06/07 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=22&state=closed)
-
-# May 23, 2013
-
-### Remove unlisted packages from search index
-
-When a package gets unlisted, it will be removed from the Lucene search index immediately. This is one of the frequent ask from users as they don't want their unlisted packages to show up in search.
-
-### Admin Page bug fixes
-
-Bunch of fixes around the Admin page (which will be visible only for administrative login).
-
-### Other minor bug fixes
-
-Other minor fixes like client side validation for user name/email. Complete list can be found here: [05/13 - QA (05/24 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=21)
-
-# May 13, 2013
-
-### Front page enhancements
-
-The contents for [nuget.org](nuget.org) home page is dynamically pulled from blob storage. This will help us to make announcements about new releases,
-warnings or alerts about outages in an easy and quick way.
-
-### Admin Page improvements
-
-A new admin page is added to the nuget.org website which lets the administrators (core NuGet team members) to view error logs, rebuilding Lucenece index and similar admin actions.
-
-### User created date
-
-The user created date will be now be stored along with the user data in the dastabase. This enables getting statistics around users like registrations per week.
-
-### Other minor bug fixes
-
-Other minor fixes around statistics and curated feed.Complete list can be found here: [04/29 - QA (05/10 - Production)](https://github.com/NuGet/NuGetGallery/issues?milestone=20)
-
-
-# April 25, 2013
-
-### Group by Client Name,Version and Operation for download stats
-The [package download statistics page] (//nuget.org/stats/) now allows you to group the download details based on package version, client version, client name and operation.
-
-### WebMatrix curated feed performance improvements
-The indexing of curated packages is optimized for performance so that search on a curated feed is on par with the search on regular feed.
-
-### Other minor bug fixes
-
-Complete list can be found here: [Production Deployment 4/25](https://github.com/NuGet/NuGetGallery/issues?milestone=19)
-
-# April 11, 2013
-
-### Top 500 packages exposed in the feed
-
-The nuget.org API (V2) feed now exposes the top downloaded packages (over the last 6 weeks). This can accessed be via url [nuget.org/api/v2/stats/downloads](//nuget.org/api/v2/stats/downloads). At this time, the top 500 packages are shown by default and that is also the maximum number returned.
-
-You can limit the numbers of results using ?count in the query string. For example, [nuget.org/api/v2/stats/downloads?count=10](//nuget.org/api/v2/stats/downloads?count=10) would return the top 10 downloaded packages in last 6 weeks - with information like download count, gallery url and feed url for that package.
-
-The default and maximum count of 500 might change over time, so we recommend always specifying a count parameter if you are programmatically consuming this data.
-
-### Numeric rank for packages stats
-
-The [Statistics page](http://nuget.org/stats) now shows the numeric rank of the package (based on the download count).
-
-### Links to gravatar in profile page
-
-The profile editing page now includes help text and a link to gravatar making it easy for users to update their profile picture.
-
-### UserName optimization in DB (backend)
-
-The "Users" table is optimized to have "UserName" as index for performance enhancements.
-
-### Other minor bug fixes
-
-Complete list can be found here: [Production Deployment 4/12](https://github.com/NuGet/NuGetGallery/issues?milestone=18&state=closed)
-
-# March 28, 2013
-
-### Support for MinClientVersion
-
-You can now upload packages with "[minclientVersion](http://nuget.codeplex.com/wikipage?title=NuGet%202.5%20list%20of%20features%20for%20Testing%20days%203%2f27%20to%203%2f29%20%2c%202013 )" to the NuGetGallery.
-
-The minclientVersion of the package will shown in the package home page right next to the package description.
-
-### Contacting support
-
-The "Report Abuse" page has been revamped to enable users to chose the specific issue with the package they are reporting. It also guides the user to differentiate between "Contact Owners" and "Report Abuse".
-
-### Improved package statistics
-
-The package statistics now shows the break down of downloads based on the NuGet client (like NuGet CommandLine 2.1, NuGet Package Manager console 2.2 and so on. It also shows the split of the type of download operation (like Install, Restore, Update).
-
-### Other minor bug fixes
-
-Complete list can be found here: [Production Deployment 3/28](https://github.com/NuGet/NuGetGallery/issues?milestone=17&state=closed)
-
-
View
42 NuGet.Cloud.targets
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!--
- Why is this in the template and not in the NuGet.Services.Build package? Because we can't install
- NuGet packages in to ccprojes :(
- -->
- <PropertyGroup>
- <CollectRoleFilesDependsOn>
- $(CollectRoleFilesDependsOn);
- CollectWorkerAppConfig
- </CollectRoleFilesDependsOn>
- </PropertyGroup>
- <Target Name="CollectWorkerAppConfig">
- <!-- Add the app config file from SourceFilesOutputGroup -->
- <ItemGroup>
- <WorkerFiles Include="%(CopyLocalDependencies.Identity).config" Condition="Exists('%(CopyLocalDependencies.Identity).config')">
- <TargetPath>%(Filename)%(Extension).config</TargetPath>
- <RoleOwner>$(_WorkerRoleProject)</RoleOwner>
- <RoleOwnerName>$(_WorkerRoleProjectName)</RoleOwnerName>
- </WorkerFiles>
- <WorkerFiles Include="@(SourceFilesOutputGroup)" Condition=" '%(SourceFilesOutputGroup.TargetPath)' == '$(WorkerEntryPoint).config' " >
- <TargetPath>%(TargetPath)</TargetPath>
- <RoleOwner>$(_WorkerRoleProject)</RoleOwner>
- <RoleOwnerName>$(_WorkerRoleProjectName)</RoleOwnerName>
- </WorkerFiles>
- </ItemGroup>
- </Target>
- <PropertyGroup>
- <PublishDependsOn>
- $(PublishDependsOn);
- OctopusPackage
- </PublishDependsOn>
- </PropertyGroup>
- <Target Name="OctopusPackage" Condition="'$(NuGetExePath)' != ''">
- <PropertyGroup>
- <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(MSBuildProjectDirectory)\$(PublishDir.Trim('\\'))</PackageOutputDir>
- <PackCommand>"$(NuGetExePath)" pack "$(MSBuildProjectDirectory)\$(MSBuildProjectName).nuspec" -Properties "Configuration=$(Configuration);Platform=$(Platform);SemanticVersion=$(SemanticVersion);SimpleVersion=$(SimpleVersion);BuildMachine=$(BuildMachine);BuildUser=$(BuildUser);Branch=$(Branch);Commit=$(Commit);BuildDateUtc=$(BuildDateUtc)" -Version $(SemanticVersion) -NonInteractive -OutputDirectory "$(PackageOutputDir)"</PackCommand>
- </PropertyGroup>
- <Message Text="Building Octopus Package..." Importance="high" />
- <Exec Command="$(PackCommand)" />
- </Target>
-</Project>
View
4 NuGet.config
@@ -8,8 +8,8 @@
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
- <add key="v2.nuget.org" value="https://nuget.org/api/v2" />
- <add key="nugetbuild" value="https://dotnet.myget.org/F/nuget-build/api/v2/" />
+ <add key="nuget" value="https://api.nuget.org/v3/index.json" />
+ <add key="nugetbuild" value="https://dotnet.myget.org/F/nuget-build/api/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
View
7 NuGetGallery.sln
@@ -24,8 +24,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetGallery.Core", "src\Nu
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetGallery.Core.Facts", "tests\NuGetGallery.Core.Facts\NuGetGallery.Core.Facts.csproj", "{8AC9E39E-366C-47E5-80AE-38E71CD31386}"
EndProject
-Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "NuGetGallery.Cloud", "src\NuGetGallery.Cloud\NuGetGallery.Cloud.ccproj", "{0041ACA0-30EC-4554-8C7C-0AF810F3086F}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3. Tests", "3. Tests", "{39E54EC3-CBAA-453A-BE64-748FE1559A58}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0. Shared", "0. Shared", "{155100FF-524B-4CAF-93C6-A57478B3DBAD}"
@@ -62,10 +60,6 @@ Global
{8AC9E39E-366C-47E5-80AE-38E71CD31386}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AC9E39E-366C-47E5-80AE-38E71CD31386}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AC9E39E-366C-47E5-80AE-38E71CD31386}.Release|Any CPU.Build.0 = Release|Any CPU
- {0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Release|Any CPU.Build.0 = Release|Any CPU
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -81,7 +75,6 @@ Global
{F240D1BC-BBFB-4F22-9DF8-3FDE36BFD665} = {2ECA1159-9B9D-4D65-95AF-F14337FD3DA6}
{097B2CDD-9623-4C34-93C2-D373D51F5B4E} = {155100FF-524B-4CAF-93C6-A57478B3DBAD}
{8AC9E39E-366C-47E5-80AE-38E71CD31386} = {39E54EC3-CBAA-453A-BE64-748FE1559A58}
- {0041ACA0-30EC-4554-8C7C-0AF810F3086F} = {05998089-58F5-4A84-8C11-C5C6244A6F89}
{6931C2EE-E081-4518-9798-D34D83B35BF6} = {05998089-58F5-4A84-8C11-C5C6244A6F89}
EndGlobalSection
EndGlobal
View
5 README.md
@@ -14,7 +14,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
1. Visual Studio 2015 - Custom install so that you may also install Microsoft SQL Server Data Tools. This will provide the LocalDB that Windows Azure SDK requires.
2. PowerShell 2.0 (comes with Windows 7+)
3. [NuGet](http://docs.nuget.org/docs/start-here/installing-nuget)
- 4. [Windows Azure SDK](http://www.microsoft.com/windowsazure/sdk/) - Note that you may have to manually upgrade the ".Cloud" projects in the solution if a different SDK version is used.
+ 4. [Windows Azure SDK](http://www.microsoft.com/windowsazure/sdk/)
2. Clone it!
```git clone git@github.com:NuGet/NuGetGallery.git```
@@ -28,8 +28,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
1. We highly recommend using IIS Express. Use the [Web Platform Installer](http://microsoft.com/web) to install it if you don't have it already (it comes with recent versions of VS and WebMatrix though). Make sure to at least once run IIS Express as an administrator.
2. In an ADMIN powershell prompt, run the `.\tools\Enable-LocalTestMe.ps1` file. It allows non-admins to host websites at: `http(s)://nuget.localtest.me`, it configures an IIS Express site at that URL and creates a self-signed SSL certificate. For more information on `localtest.me`, check out [readme.localtest.me](http://readme.localtest.me). However, because [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication) is not supported in the Network Shell on versions of Windows before 8, you must have at least Windows 8 to run this script successfully.
3. If you're having trouble, go to the _Project Properties_ for the Website project, click on the _Web_ tab and change the URL to `localhost:port` where _port_ is some port number above 1024.
- 4. When running the application using the Azure Compute emulator, you may have to edit the `.\src\NuGetGallery.Cloud\ServiceConfiguration.Local.cscfg` file and set the certificate thumbprint for the setting `SSLCertificate` to the certificate thumbprint of the generated `nuget.localtest.me` certificate from step 2. You can get a list of certificates and their thumbprints using PowerShell, running `Get-ChildItem -path cert:\LocalMachine\My`.
-
+
5. Create the Database!
There are two ways you can create the databases. From Visual Studio 2015 or from the command line.
View
7 Repository.props
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- This file should always be at the root of the repository -->
- <ItemGroup>
- <SolutionFile Include="$(MSBuildThisFileDirectory)\*.sln" />
- </ItemGroup>
-</Project>
View
5 appveyor.yml
@@ -1,9 +1,8 @@
-version: 3.0.{build}
+version: 3.1.{build}
configuration: Release
nuget:
disable_publish_on_pr: true
build_script:
- cmd: build.cmd
artifacts:
-- path: '**\app.publish\*.cspkg'
-- path: '**\app.publish\*.nupkg'
+- path: 'artifacts\*.nupkg'
View
16 build.cmd
@@ -1,15 +1 @@
-@SETLOCAL
-@SET SCRIPT_PATH=%~dp0
-:CheckOS
-IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)
-
-:64BIT
-"%programfiles(x86)%\MSBuild\14.0\Bin\msbuild.exe" %SCRIPT_PATH%build.msbuild /tv:14.0 /p:VisualStudioVersion=14.0 /p:ToolsVersion=14.0 %*
-GOTO END
-
-:32BIT
-"%programfiles%\MSBuild\14.0\Bin\msbuild.exe" %SCRIPT_PATH%build.msbuild /tv:14.0 /p:VisualStudioVersion=14.0 /p:ToolsVersion=14.0 %*
-GOTO END
-
-:END
-@SETLOCAL
+PowerShell.exe -NoProfile -ExecutionPolicy ByPass ".\build.ps1 -Configuration 'Release' -Verbose"
View
94 build.msbuild
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <MsBuildTasksAssembly Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll')">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll</MsBuildTasksAssembly>
- <MsBuildTasksAssembly Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll')">$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</MsBuildTasksAssembly>
- </PropertyGroup>
-
- <PropertyGroup>
- <MvcBuildViews>true</MvcBuildViews>
- </PropertyGroup>
-
- <UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MsBuildTasksAssembly)">
- <ParameterGroup>
- <OutputFilename ParameterType="System.String" Required="true" />
- </ParameterGroup>
- <Task>
- <Reference Include="System.Core" />
- <Using Namespace="System" />
- <Using Namespace="System.IO" />
- <Using Namespace="System.Net" />
- <Using Namespace="Microsoft.Build.Framework" />
- <Using Namespace="Microsoft.Build.Utilities" />
- <Code Type="Fragment" Language="cs">
- <![CDATA[
- try {
- OutputFilename = Path.GetFullPath(OutputFilename);
-
- Log.LogMessage("Downloading latest version of NuGet.exe...");
- WebClient webClient = new WebClient();
- webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
-
- return true;
- }
- catch (Exception ex) {
- Log.LogErrorFromException(ex);
- return false;
- }
- ]]>
- </Code>
- </Task>
- </UsingTask>
-
- <Target Name="RestorePackages">
- <ItemGroup>
- <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
- <PackageSource Include="https://www.nuget.org/api/v2" />
- <PackageSource Include="https://www.myget.org/F/nugetbuild/" />
- </ItemGroup>
- <PropertyGroup>
- <NuGetExeDir>$(MSBuildThisFileDirectory)\.nuget</NuGetExeDir>
- <NuGetExePath>$(NuGetExeDir)\nuget.exe</NuGetExePath>
- <RestoreCommand>"$(NuGetExePath)" restore -Source "@(PackageSource)" "@(SolutionFile)" -NonInteractive</RestoreCommand>
- </PropertyGroup>
- <MakeDir Directories="$(NuGetExeDir)" Condition="!Exists('$(NuGetExeDir)')" />
- <Message Text="Restoring packages ... " Importance="high" />
- <DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" !Exists('$(NuGetExePath)')" />
- <Exec Command="$(RestoreCommand)" LogStandardErrorAsError="true" />
- </Target>
-
- <Target Name="CheckForMultipleSolutions">
- <Error Text="Multiple solutions exist in $(RepositoryRoot)!" Condition="'@(SolutionFile->Count())' &gt; 1" />
- </Target>
-
- <Target Name="CoreBuild">
- <!-- Find the version we're looking for -->
- <Exec Command="dir packages\NuGet.Services.Build* /O:-N /B" StandardOutputImportance="low" ConsoleToMSBuild="true" EchoOff="true">
- <Output TaskParameter="ConsoleOutput" PropertyName="Versions" />
- </Exec>
- <PropertyGroup>
- <_NuGetServicesBuildVersion>$(Versions.Split(";")[0])</_NuGetServicesBuildVersion>
- </PropertyGroup>
- <MSBuild Projects="$(MSBuildThisFileDirectory)packages\$(_NuGetServicesBuildVersion)\tools\NuGet.Services.FullBuild.msbuild" />
- </Target>
-
- <Target Name="RunBinSkim" DependsOnTargets="RestorePackages">
- <PropertyGroup Condition="'$(Configuration)' == ''">
- <Configuration>Debug</Configuration>
- </PropertyGroup>
-
- <PropertyGroup>
- <NuGetExeDir>$(MSBuildThisFileDirectory)\.nuget</NuGetExeDir>
- <NuGetExePath>$(NuGetExeDir)\nuget.exe</NuGetExePath>
- <InstallBinSkimCommand>"$(NuGetExePath)" install Microsoft.CodeAnalysis.BinSkim -Version 1.3.4-beta -NonInteractive -ExcludeVersion</InstallBinSkimCommand>
- <RunBinSkimCommand>.\packages\Microsoft.CodeAnalysis.BinSkim\tools\x64\BinSkim.exe analyze --config default --verbose</RunBinSkimCommand>
- </PropertyGroup>
- <Message Text="Downloading and running BinSkim ... " Importance="high" />
- <Exec Command="$(InstallBinSkimCommand)" LogStandardErrorAsError="true" />
- <Exec Command="$(RunBinSkimCommand) src\NuGetGallery\bin\NuGetGallery.dll" LogStandardErrorAsError="true" />
- <Exec Command="$(RunBinSkimCommand) src\NuGet.Services.Search.Client\bin\$(Configuration)\NuGet.Services.Search.Client.dll" LogStandardErrorAsError="true" />
- <Exec Command="$(RunBinSkimCommand) src\NuGetGallery.Core\bin\$(Configuration)\NuGetGallery.Core.dll" LogStandardErrorAsError="true" />
- </Target>
-
- <Target Name="Build" DependsOnTargets="CheckForMultipleSolutions;RestorePackages;CoreBuild;RunBinSkim" />
-</Project>
View
124 build.ps1
@@ -0,0 +1,124 @@
+[CmdletBinding(DefaultParameterSetName='RegularBuild')]
+param (
+ [ValidateSet("debug", "release")]
+ [string]$Configuration = 'debug',
+ [ValidateSet("Release","rtm", "rc", "beta", "beta2", "final", "xprivate", "zlocal")]
+ [string]$ReleaseLabel = 'zlocal',
+ [int]$BuildNumber,
+ [switch]$SkipRestore,
+ [switch]$CleanCache,
+ [string]$SimpleVersion = '1.0.0',
+ [string]$SemanticVersion = '1.0.0-zlocal',
+ [string]$Branch,
+ [string]$CommitSHA
+)
+
+# For TeamCity - If any issue occurs, this script fail the build. - By default, TeamCity returns an exit code of 0 for all powershell scripts, even if they fail
+trap {
+ Write-Host "BUILD FAILED: $_" -ForegroundColor Red
+ Write-Host "ERROR DETAILS:" -ForegroundColor Red
+ Write-Host $_.Exception -ForegroundColor Red
+ Write-Host ("`r`n" * 3)
+ exit 1
+}
+
+. "$PSScriptRoot\build\common.ps1"
+
+Function Run-BinSkim {
+ [CmdletBinding()]
+ param()
+
+ Trace-Log 'Running BinSkim'
+
+ $BinSkimExe = (Join-Path $PSScriptRoot "packages\Microsoft.CodeAnalysis.BinSkim\tools\x64\BinSkim.exe")
+
+ & $BinSkimExe analyze --config default --verbose (Join-Path $PSScriptRoot "src\NuGetGallery\bin\NuGetGallery.dll")
+ & $BinSkimExe analyze --config default --verbose (Join-Path $PSScriptRoot "src\NuGet.Services.Search.Client\bin\$Configuration\NuGet.Services.Search.Client.dll")
+ & $BinSkimExe analyze --config default --verbose (Join-Path $PSScriptRoot "src\NuGetGallery.Core\bin\$Configuration\NuGetGallery.Core.dll")
+}
+
+Function Run-Tests {
+ [CmdletBinding()]
+ param()
+
+ Trace-Log 'Running tests'
+
+ $xUnitExe = (Join-Path $PSScriptRoot "packages\xunit.runner.console\tools\xunit.console.exe")
+
+ & $xUnitExe (Join-Path $PSScriptRoot "tests\NuGetGallery.Core.Facts\bin\$Configuration\NuGetGallery.Core.Facts.dll")
+ & $xUnitExe (Join-Path $PSScriptRoot "tests\NuGetGallery.Facts\bin\$Configuration\NuGetGallery.Facts.dll")
+}
+
+Write-Host ("`r`n" * 3)
+Trace-Log ('=' * 60)
+
+$startTime = [DateTime]::UtcNow
+if (-not $BuildNumber) {
+ $BuildNumber = Get-BuildNumber
+}
+Trace-Log "Build #$BuildNumber started at $startTime"
+
+$BuildErrors = @()
+
+Invoke-BuildStep 'Installing NuGet.exe' { Install-NuGet } `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Clearing package cache' { Clear-PackageCache } `
+ -skip:(-not $CleanCache) `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Clearing artifacts' { Clear-Artifacts } `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Restoring solution packages' { `
+ Install-SolutionPackages -path (Join-Path $PSScriptRoot ".nuget\packages.config") -output (Join-Path $PSScriptRoot "packages") -excludeversion } `
+ -skip:$SkipRestore `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Set version metadata in AssemblyInfo.cs' { `
+ param($Path, $Version, $Branch, $Commit)
+ Set-VersionInfo -Path $Path -Version $Version -Branch $Branch -Commit $Commit `
+ } `
+ -args (Join-Path $PSScriptRoot "src\NuGetGallery\Properties\AssemblyInfo.cs"), $SimpleVersion, $Branch, $CommitSHA `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Set version metadata in AssemblyInfo.cs' { `
+ param($Path, $Version, $Branch, $Commit)
+ Set-VersionInfo -Path $Path -Version $Version -Branch $Branch -Commit $Commit `
+ } `
+ -args (Join-Path $PSScriptRoot "src\NuGetGallery.Core\Properties\AssemblyInfo.cs"), $SimpleVersion, $Branch, $CommitSHA `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Building solution' {
+ param($Configuration, $BuildNumber, $SolutionPath, $SkipRestore)
+ Build-Solution $Configuration $BuildNumber -MSBuildVersion "14" $SolutionPath -SkipRestore:$SkipRestore -MSBuildProperties "/p:MvcBuildViews=true" `
+ } `
+ -args $Configuration, $BuildNumber, (Join-Path $PSScriptRoot "NuGetGallery.sln"), $SkipRestore `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Running BinSkim' { Run-BinSkim } `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Running tests' { Run-Tests } `
+ -ev +BuildErrors
+
+Invoke-BuildStep 'Creating artifacts' {
+ New-Package (Join-Path $PSScriptRoot "src\NuGetGallery.Core\NuGetGallery.Core.csproj") -Configuration $Configuration -BuildNumber $BuildNumber -ReleaseLabel $ReleaseLabel -Version $SemanticVersion `
+ -ev +BuildErrors
+ }
+
+Trace-Log ('-' * 60)
+
+## Calculating Build time
+$endTime = [DateTime]::UtcNow
+Trace-Log "Build #$BuildNumber ended at $endTime"
+Trace-Log "Time elapsed $(Format-ElapsedTime ($endTime - $startTime))"
+
+Trace-Log ('=' * 60)
+
+if ($BuildErrors) {
+ $ErrorLines = $BuildErrors | %{ ">>> $($_.Exception.Message)" }
+ Error-Log "Build's completed with $($BuildErrors.Count) error(s):`r`n$($ErrorLines -join "`r`n")" -Fatal
+}
+
+Write-Host ("`r`n" * 3)
View
28 build/DeployFrontend.ps1
@@ -1,28 +0,0 @@
-function Set-AppSetting($x, [string]$name, [string]$value) {
- $setting = $x.configuration.appSettings.add | where { $_.key -eq $name }
- if($setting) {
- $setting.value = $value
- "Set $name = $value."
- } else {
- "Unknown App Setting: $name."
- }
-}
-
-# Gather deployment info
-pushd $env:DEPLOYMENT_SOURCE
-"In Deployment Source: $(Get-Location)"
-$Commit = git rev-parse --short HEAD
-$Branch = $env:branch
-$Date = [TimeZoneInfo]::ConvertTimeBySystemTimeZoneId([DateTimeOffset]::UtcNow, "Pacific Standard Time")
-popd
-
-# Load web.config
-$webConfigPath = Join-Path $env:DEPLOYMENT_TEMP "web.config"
-if(!(Test-Path $webConfigPath)) {
- throw "Web.config not found at $webConfigPath!"
-}
-$webConfig = [xml](cat $webConfigPath)
-Set-AppSetting $webConfig "Gallery.ReleaseBranch" $Branch
-Set-AppSetting $webConfig "Gallery.ReleaseSha" $Commit
-Set-AppSetting $webConfig "Gallery.ReleaseTime" ($Date.ToString("yyyy-MM-dd hh:mm:ss tt") + " Pacific")
-$webConfig.Save($webConfigPath)
View
16 build/NuGetGallery.xunit.targets
@@ -1,16 +0,0 @@
-<Project DefaultTargets="RunFacts" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <XunitMsBuildRunner Include="$(MSBuildThisFileDirectory)..\packages\NuGet.Services.Build.*\tools\xunit.runner.msbuild.dll" />
- </ItemGroup>
- <PropertyGroup>
- <BuildDependsOn>
- $(BuildDependsOn);
- RunFacts
- </BuildDependsOn>
- </PropertyGroup>
- <UsingTask TaskName="Xunit.Runner.MSBuild.xunit" AssemblyFile="@(XunitMsBuildRunner)" Condition="Exists('@(XunitMsBuildRunner)')" />
-
- <Target Name="RunFacts" Condition="'$(RunFacts)' == 'true' And Exists('@(XunitMsBuildRunner)')" Inputs="$(TargetPath)" Outputs="$(OutputPath)$(MSBuildProjectName).results.xml">
- <xunit Assemblies="$(TargetPath)" Xml="$(OutputPath)$(MSBuildProjectName).results.xml" />
- </Target>
-</Project>
View
3 build/README.md
@@ -1,3 +0,0 @@
-# Build Scripts
-
-Scripts used during the compilation of the NuGet Gallery frontend and backend.
View
401 build/common.ps1
@@ -0,0 +1,401 @@
+### Constants ###
+$DefaultMSBuildVersion = '15'
+$DefaultConfiguration = 'debug'
+$NuGetClientRoot = Split-Path -Path $PSScriptRoot -Parent
+$NuGetExe = Join-Path $NuGetClientRoot '.nuget\nuget.exe'
+$Artifacts = Join-Path $NuGetClientRoot artifacts
+$MSBuildRoot = Join-Path ${env:ProgramFiles(x86)} 'MSBuild\'
+$MSBuildExeRelPath = 'bin\msbuild.exe'
+$VisualStudioVersion=14.0
+
+Set-Alias nuget $NuGetExe
+
+$OrigBgColor = $host.ui.rawui.BackgroundColor
+$OrigFgColor = $host.ui.rawui.ForegroundColor
+
+### Functions ###
+Function Trace-Log($TraceMessage = '') {
+ Write-Host "[$(Trace-Time)]`t$TraceMessage" -ForegroundColor Cyan
+}
+
+Function Verbose-Log($VerboseMessage) {
+ Write-Verbose "[$(Trace-Time)]`t$VerboseMessage"
+}
+
+Function Error-Log {
+ param(
+ [string]$ErrorMessage,
+ [switch]$Fatal)
+ if (-not $Fatal) {
+ Write-Error "[$(Trace-Time)]`t$ErrorMessage"
+ }
+ else {
+ Write-Error "[$(Trace-Time)]`t$ErrorMessage" -ErrorAction Stop
+ }
+}
+
+Function Warning-Log($WarningMessage) {
+ Write-Warning "[$(Trace-Time)]`t$WarningMessage"
+}
+
+Function Trace-Time() {
+ $currentTime = Get-Date
+ $lastTime = $Global:LastTraceTime
+ $Global:LastTraceTime = $currentTime
+ "{0:HH:mm:ss} +{1:F0}" -f $currentTime, ($currentTime - $lastTime).TotalSeconds
+}
+
+$Global:LastTraceTime = Get-Date
+
+Function Format-ElapsedTime($ElapsedTime) {
+ '{0:F0}:{1:D2}' -f $ElapsedTime.TotalMinutes, $ElapsedTime.Seconds
+}
+
+# MSBUILD has a nasty habit of leaving the foreground color red
+Function Reset-Colors {
+ $host.ui.rawui.BackgroundColor = $OrigBgColor
+ $host.ui.rawui.ForegroundColor = $OrigFgColor
+}
+
+Function Clear-Artifacts {
+ [CmdletBinding()]
+ param()
+ if (Test-Path $Artifacts) {
+ Trace-Log 'Clearing the Artifacts folder'
+ Remove-Item $Artifacts\* -Recurse -Force
+ }
+ else {
+ New-Item $Artifacts -Type Directory
+ }
+}
+
+Function Get-MSBuildExe {
+ param(
+ [string]$MSBuildVersion
+ )
+
+ $MSBuildExe = Join-Path $MSBuildRoot ($MSBuildVersion + ".0")
+ Join-Path $MSBuildExe $MSBuildExeRelPath
+}
+
+Function Invoke-BuildStep {
+ [CmdletBinding()]
+ param(
+ [Parameter(Mandatory=$True)]
+ [string]$BuildStep,
+ [Parameter(Mandatory=$True)]
+ [ScriptBlock]$Expression,
+ [Parameter(Mandatory=$False)]
+ [Alias('args')]
+ [Object[]]$Arguments,
+ [Alias('skip')]
+ [switch]$SkipExecution
+ )
+ if (-not $SkipExecution) {
+ if ($env:TEAMCITY_VERSION) {
+ Write-Output "##teamcity[blockOpened name='$BuildStep']"
+ }
+
+ Trace-Log "[BEGIN] $BuildStep"
+ $sw = [Diagnostics.Stopwatch]::StartNew()
+ $completed = $false
+
+ try {
+ Invoke-Command $Expression -ArgumentList $Arguments -ErrorVariable err
+ $completed = $true
+ }
+ finally {
+ $sw.Stop()
+ Reset-Colors
+ if ($completed) {
+ Trace-Log "[DONE +$(Format-ElapsedTime $sw.Elapsed)] $BuildStep"
+ }
+ else {
+ if (-not $err) {
+ Trace-Log "[STOPPED +$(Format-ElapsedTime $sw.Elapsed)] $BuildStep"
+ }
+ else {
+ Error-Log "[FAILED +$(Format-ElapsedTime $sw.Elapsed)] $BuildStep"
+ }
+ }
+
+ if ($env:TEAMCITY_VERSION) {
+ Write-Output "##teamcity[blockClosed name='$BuildStep']"
+ }
+ }
+ }
+ else {
+ Warning-Log "[SKIP] $BuildStep"
+ }
+}
+
+Function Build-Solution {
+ [CmdletBinding()]
+ param(
+ [string]$Configuration = $DefaultConfiguration,
+ [int]$BuildNumber = (Get-BuildNumber),
+ [string]$MSBuildVersion = $DefaultMSBuildVersion,
+ [string]$SolutionPath,
+ [string]$TargetProfile,
+ [string]$Target,
+ [string]$MSBuildProperties,
+ [switch]$SkipRestore
+ )
+
+ if (-not $SkipRestore) {
+ # Restore packages for NuGet.Tooling solution
+ Restore-SolutionPackages -path $SolutionPath -MSBuildVersion $MSBuildVersion
+ }
+
+ # Build the solution
+ $opts = , $SolutionPath
+ $opts += "/p:Configuration=$Configuration;BuildNumber=$(Format-BuildNumber $BuildNumber)"
+
+ if ($TargetProfile) {
+ $opts += "/p:TargetProfile=$TargetProfile"
+ }
+
+ if ($Target) {
+ $opts += "/t:$Target"
+ }
+
+ if (-not $VerbosePreference) {
+ $opts += '/verbosity:minimal'
+ }
+
+ if ($MSBuildProperties) {
+ $opts += $MSBuildProperties
+ }
+
+ $MSBuildExe = Get-MSBuildExe $MSBuildVersion
+
+ Trace-Log "$MSBuildExe $opts"
+ & $MSBuildExe $opts
+ if (-not $?) {
+ Error-Log "Build of ${SolutionPath} failed. Code: $LASTEXITCODE"
+ }
+}
+
+# Downloads NuGet.exe and VSTS Credential provider if missing
+Function Install-NuGet {
+ [CmdletBinding()]
+ param()
+ $NuGetFolderPath = Split-Path -Path $NuGetExe -Parent
+ if (-not (Test-Path $NuGetFolderPath )) {
+ Trace-Log 'Creating folder "$($NuGetFolderPath)"'
+ New-Item $NuGetFolderPath -Type Directory | Out-Null
+ }
+ else {
+ Trace-Log 'Target folder "$($NuGetFolderPath)" already exists.'
+ }
+
+ Trace-Log 'Downloading latest prerelease of nuget.exe'
+ wget https://dist.nuget.org/win-x86-commandline/latest-prerelease/nuget.exe -OutFile $NuGetExe
+}
+
+Function Get-BuildNumber() {
+ $SemanticVersionDate = '2016-06-22'
+ [int](((Get-Date) - (Get-Date $SemanticVersionDate)).TotalMinutes / 5)
+}
+
+Function Format-BuildNumber([int]$BuildNumber) {
+ '{0:D4}' -f $BuildNumber
+}
+
+Function Clear-PackageCache {
+ [CmdletBinding()]
+ param()
+ Trace-Log 'Clearing package cache (except the web cache)'
+
+ & $NuGetExe locals packages-cache -clear -verbosity detailed
+ #& nuget locals global-packages -clear -verbosity detailed
+ & $NuGetExe locals temp -clear -verbosity detailed
+}
+
+Function Install-SolutionPackages {
+ [CmdletBinding()]
+ param(
+ [Alias('path')]
+ [string]$SolutionPath,
+ [Alias('output')]
+ [string]$OutputPath,
+ [switch]$NonInteractive = $true,
+ [switch]$ExcludeVersion = $false
+ )
+ $opts = , 'install'
+ $InstallLocation = $NuGetClientRoot
+ if (-not $SolutionPath) {
+ $opts += "${NuGetClientRoot}\.nuget\packages.config", '-SolutionDirectory', $NuGetClientRoot
+ }
+ else {
+ $opts += $SolutionPath
+ $InstallLocation = Split-Path -Path $SolutionPath -Parent
+ }
+
+ if (-not $VerbosePreference) {
+ $opts += '-verbosity', 'quiet'
+ }
+
+ if ($NonInteractive) {
+ $opts += '-NonInteractive'
+ }
+
+ if ($ExcludeVersion) {
+ $opts += '-ExcludeVersion'
+ }
+
+ if ($OutputPath) {
+ $opts += '-OutputDirectory', "${OutputPath}"
+ }
+
+ Trace-Log "Installing packages @""$InstallLocation"""
+ Trace-Log "$NuGetExe $opts"
+ & $NuGetExe $opts
+ if (-not $?) {
+ Error-Log "Install failed @""$InstallLocation"". Code: ${LASTEXITCODE}"
+ }
+}
+
+Function Restore-SolutionPackages {
+ [CmdletBinding()]
+ param(
+ [Alias('path')]
+ [string]$SolutionPath,
+ [ValidateSet(4, 12, 14, 15)]
+ [int]$MSBuildVersion,
+ [string]$BuildNumber
+ )
+ $InstallLocation = $NuGetClientRoot
+ $opts = , 'restore'
+ if (-not $SolutionPath) {
+ $opts += "${NuGetClientRoot}\.nuget\packages.config", '-SolutionDirectory', $NuGetClientRoot
+ }
+ else {
+ $opts += $SolutionPath
+ $InstallLocation = Split-Path -Path $SolutionPath -Parent
+ }
+ if ($MSBuildVersion) {
+ $opts += '-MSBuildVersion', $MSBuildVersion
+ }
+
+ if (-not $VerbosePreference) {
+ $opts += '-verbosity', 'quiet'
+ }
+
+ Trace-Log "Restoring packages @""$InstallLocation"""
+ Trace-Log "$NuGetExe $opts"
+ & $NuGetExe $opts
+ if (-not $?) {
+ Error-Log "Restore failed @""$InstallLocation"". Code: ${LASTEXITCODE}"
+ }
+}
+
+Function Get-PackageVersion() {
+ [CmdletBinding()]
+ param(
+ [string]$ReleaseLabel = "zlocal",
+ [string]$BuildNumber
+ )
+
+ if (-not $BuildNumber) {
+ $BuildNumber = Get-BuildNumber
+ }
+
+ [string]"$SemanticVersion-$ReleaseLabel$BuildNumber"
+}
+
+Function New-Package {
+ [CmdletBinding()]
+ param(
+ [Alias('target')]
+ [string]$TargetFilePath,
+ [string]$Configuration,
+ [string]$ReleaseLabel = "zlocal",
+ [string]$BuildNumber,
+ [switch]$NoPackageAnalysis,
+ [string]$Version
+ )
+ Trace-Log "Creating package from @""$TargetFilePath"""
+ $opts = , 'pack'
+ $opts += $TargetFilePath
+
+ if (-not (Test-Path $Artifacts)) {
+ New-Item $Artifacts -Type Directory
+ }
+
+ $opts += '-OutputDirectory', $Artifacts
+ $opts += '-Properties', "Configuration=$Configuration"
+
+ if (-not $BuildNumber) {
+ $BuildNumber = Get-BuildNumber
+ }
+
+ if ($Version){
+ $PackageVersion = $Version
+ }
+ else {
+ $PackageVersion = Get-PackageVersion $ReleaseLabel $BuildNumber
+ }
+
+ $opts += '-Version', "$PackageVersion"
+
+ if ($NoPackageAnalysis) {
+ $opts += '-NoPackageAnalysis'
+ }
+
+ Trace-Log "$NuGetExe $opts"
+ & $NuGetExe $opts
+ if (-not $?) {
+ Error-Log "Pack failed for @""$TargetFilePath"". Code: ${LASTEXITCODE}"
+ }
+}
+
+Function Set-VersionInfo {
+ [CmdletBinding()]
+ param(
+ [string]$Path,
+ [string]$Version,
+ [string]$Branch,
+ [string]$Commit
+ )
+
+ if (-not $Version) {
+ throw "No version info provided."
+ }
+
+ if(!(Test-Path $Path)) {
+ throw "AssemblyInfo.cs not found at $Path!"
+ }
+
+ Trace-Log "Getting version info in @""$Path"""
+
+ if (-not $Commit) {
+ $Commit = git rev-parse --short HEAD
+ }
+ else {
+ if ($Commit.Length -gt 7) {
+ $Commit = $Commit.SubString(0, 7)
+ }
+ }
+
+ if (-not $Branch) {
+ $Branch = git rev-parse --abbrev-ref HEAD
+ }
+
+ $BuildDateUtc = [DateTimeOffset]::UtcNow
+ $SemanticVersion = $Version + "-" + $Branch
+
+ Trace-Log ("[assembly: AssemblyVersion(""" + $Version + """)]")
+ Trace-Log ("[assembly: AssemblyInformationalVersion(""" + $SemanticVersion + """)]")
+ Trace-Log ("[assembly: AssemblyMetadata(""Branch"", """ + $Branch + """)]")
+ Trace-Log ("[assembly: AssemblyMetadata(""CommitId"", """ + $Commit + """)]")
+ Trace-Log ("[assembly: AssemblyMetadata(""BuildDateUtc"", """ + $BuildDateUtc + """)]")
+
+ Add-Content $Path ("`r`n[assembly: AssemblyVersion(""" + $Version + """)]")
+ Add-Content $Path ("[assembly: AssemblyInformationalVersion(""" + $SemanticVersion + """)]")
+ Add-Content $Path "#if !PORTABLE"
+ Add-Content $Path ("[assembly: AssemblyMetadata(""Branch"", """ + $Branch + """)]")
+ Add-Content $Path ("[assembly: AssemblyMetadata(""CommitId"", """ + $Commit + """)]")
+ Add-Content $Path ("[assembly: AssemblyMetadata(""BuildDateUtc"", """ + $BuildDateUtc + """)]")
+ Add-Content $Path "#endif"
+}
View
177 src/NuGetGallery.Cloud/DeployToAzure.ps1
@@ -1,177 +0,0 @@
-## Octopus Azure deployment script, version 1.0
-## --------------------------------------------------------------------------------------
-##
-## This script is used to control how we deploy packages to Windows Azure.
-##
-## When the script is run, the correct Azure subscription will ALREADY be selected,
-## and we'll have loaded the neccessary management certificates. The Azure PowerShell module
-## will also be loaded.
-##
-## If you want to customize the Azure deployment process, simply copy this script into
-## your NuGet package as DeployToAzure.ps1. Octopus will invoke it instead of the default
-## script.
-##
-## The script will be passed the following parameters in addition to the normal Octopus
-## variables passed to any PowerShell script.
-##
-## $OctopusAzureSubscriptionId // The subscription ID GUID
-## $OctopusAzureSubscriptionName // The random name of the temporary Azure subscription record
-## $OctopusAzureServiceName // The name of your cloud service
-## $OctopusAzureStorageAccountName // The name of your storage account
-## $OctopusAzureSlot // The name of the slot to deploy to (Staging or Production)
-## $OctopusAzurePackageUri // URI to the .cspkg file in Azure Blob Storage to deploy
-## $OctopusAzureConfigurationFile // The name of the Azure cloud service configuration file to use
-## $OctopusAzureDeploymentLabel // The label to use for deployment
-## $OctopusAzureSwapIfPossible // "True" if we should attempt to "swap" deployments rather than a new deployment
-
-function CreateOrUpdate()
-{
- $releaseNumber = $OctopusParameters["Octopus.Release.Number"]
- $OctopusAzureDeploymentLabel = $releaseNumber + " (" + ([DateTime]::Now.ToString("dd MMM yyyy @ HHmm")) + ")"
- Write-Host "Deploying `"$OctopusAzureDeploymentLabel`""
-
- # Parse out the environment name
- if($OctopusAzureServiceName -notmatch "nuget-(?<env>[A-Za-z]+)-\d+-[A-Z0-9a-z]+")
- {
- throw "Azure Service Name is invalid: $OctopusAzureServiceName"
- }
- $environment = $matches["env"]
-
- # Locate the config file
- $config = Join-Path $env:NuDeployCode "Deployment\Config\$environment\$OctopusAzureServiceName.cscfg"
- if(!(Test-Path $config))
- {
- throw "Missing Deployment Config File! Expected it at: $config. Check the NuDeployCodeRoot environment variable on your Tentacle!"
- }
-
- # Copy it over the current one
- Write-Host "Copying $config to $OctopusAzureConfigurationFile"
- Copy-Item $config $OctopusAzureConfigurationFile -Force
-
- # Get the Current Deployment
- $deployment = Get-AzureDeployment -ServiceName $OctopusAzureServiceName -Slot $OctopusAzureSlot -ErrorVariable a -ErrorAction silentlycontinue
-
- if (($a[0] -ne $null) -or ($deployment.Name -eq $null))
- {
- CreateNewDeployment
- return
- }
-
- if (($OctopusAzureSwapIfPossible -eq $true) -and ($OctopusAzureSlot -eq "Production"))
- {
- Write-Host "Checking whether a swap is possible"
- $staging = Get-AzureDeployment -ServiceName $OctopusAzureServiceName -Slot "Staging" -ErrorVariable a -ErrorAction silentlycontinue
- if (($a[0] -ne $null) -or ($staging.Name -eq $null))
- {
- Write-Host "Nothing is deployed in staging"
- }
- else
- {
- Write-Host ("Current staging deployment: " + $staging.Label)
-
- # Parse the release number out
- $splat = $staging.Label.Split();
- if(($splat.Length -gt 0) -and ($staging.Label.Split()[0] -eq $releaseNumber))
- {
- # We can swap! The existing deployment label matches this release!
- SwapDeployment
- return
- }
- }
- }
-
- # Get the current number of instances and poke it in to the config if we're updating an existing deployment
- # (Octopus can do this automatically but we are already messing with CSCFG :))
- Write-Host "Reading existing Instance Count for $($deployment.ServiceName)"
- $xml = [xml](cat $OctopusAzureConfigurationFile);
- $deployment.RolesConfiguration.Keys | ForEach {
- # Find the role node affected
- $roleName = $_
- $roleXml = $xml.ServiceConfiguration.Role | where {$_.name -eq $roleName} | select -first 1
-
- # Put the current value in the xml
- $instanceCount = $deployment.RolesConfiguration[$roleName].InstanceCount;
- Write-Host " Setting $roleName instance count to $instanceCount"
- $roleXml.Instances.count = $instanceCount.ToString()
- }
- Write-Host "Saving config file..."
- $xml.Save($OctopusAzureConfigurationFile)
- UpdateDeployment
-}
-
-function SwapDeployment()
-{
- Write-Host "Swapping the staging environment to production"
- Move-AzureDeployment -ServiceName $OctopusAzureServiceName
-}
-
-function UpdateDeployment($deployment)
-{
- Write-Host "A deployment already exists in $OctopusAzureServiceName for slot $OctopusAzureSlot. Upgrading deployment..."
- Set-AzureDeployment -Upgrade -ServiceName $OctopusAzureServiceName -Package $OctopusAzurePackageUri -Configuration $OctopusAzureConfigurationFile -Slot $OctopusAzureSlot -Mode Simultaneous -label $OctopusAzureDeploymentLabel -Force
-}
-
-function CreateNewDeployment()
-{
- Write-Host "Creating a new deployment..."
- New-AzureDeployment -Slot $OctopusAzureSlot -Package $OctopusAzurePackageUri -Configuration $OctopusAzureConfigurationFile -label $OctopusAzureDeploymentLabel -ServiceName $OctopusAzureServiceName
-}
-
-function WaitForComplete()
-{
- $dep = Get-AzureDeployment -ServiceName $OctopusAzureServiceName -Slot $OctopusAzureSlot
-
- $ready = $false
- while(!$ready) {
- Write-Host "Checking if deployment is ready yet"
- $ready = $true
- $dep.RoleInstanceList | ForEach-Object {
- Write-Host " $($_.InstanceName) = $($_.InstanceStatus)"
- if($_.InstanceStatus -ne "ReadyRole") {
- $ready = $false
- }
- }
- if(!$ready) {
- Write-Host "Sleeping for 10 seconds..."
- Start-Sleep -Seconds 10
- $dep = Get-AzureDeployment -ServiceName $OctopusAzureServiceName -Slot $OctopusAzureSlot
- }
- }
-
- $completeDeploymentID = $dep.DeploymentId
- Write-Host "Deployment complete; Deployment ID: $completeDeploymentID"
-}
-
-function ConfigureDiagnostics([string]$roleName)
-{
- # Locate the diagnostics config file
- $config = Join-Path (Split-Path $OctopusAzureConfigurationFile) "Extensions\PaasDiagnostics.$roleName.PubConfig.xml"
- if(!(Test-Path $config))
- {
- throw "Missing Diagnostics Config File! Expected it at: $config. Is it missing from the OctopusDeploy NuGet package?"
- }
-
- $xml = [xml](cat $OctopusAzureConfigurationFile)
- $roleXml = $xml.ServiceConfiguration.Role | where {$_.name -eq $roleName} | select -First 1
- $diagnosticsConfigurationSetting = $roleXml.ConfigurationSettings.Setting | where {$_.name -eq "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"} | select -First 1
-
- $storageContext = New-AzureStorageContext -ConnectionString $diagnosticsConfigurationSetting.value
-
- Write-Host "Configuring diagnostics for '$OctopusAzureServiceName' (role: $roleName, slot: $OctopusAzureSlot)..."
-
- $extension = Get-AzureServiceExtension -ServiceName $OctopusAzureServiceName -Slot $OctopusAzureSlot -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics' -ErrorAction SilentlyContinue -ErrorVariable errorVariable
- if (!($?)) {
- Write-Host "Error occurred getting extension. Details: $errorVariable"
- } elseif ($extension -ne $null) {
- Write-Host "Diagnostics already configured. Skipping."
- } else {
- Remove-AzureServiceDiagnosticsExtension -ServiceName $OctopusAzureServiceName -Slot $OctopusAzureSlot -ErrorAction SilentlyContinue -ErrorVariable errorVariable
- Set-AzureServiceDiagnosticsExtension -ServiceName $OctopusAzureServiceName -Slot $OctopusAzureSlot -DiagnosticsConfigurationPath $config -StorageContext $storageContext -Role $roleName -Verbose
- }
-
- Write-Host "Configured diagnostics for role $roleName."
-}
-
-CreateOrUpdate
-WaitForComplete
-ConfigureDiagnostics -RoleName "NuGetGallery"
View
89 src/NuGetGallery.Cloud/NuGetGallery.Cloud.ccproj
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Repository.props'))\Repository.props" />
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>2.9</ProductVersion>
- <ProjectGuid>0041aca0-30ec-4554-8c7c-0af810f3086f</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>NuGetGallery.Cloud</RootNamespace>
- <AssemblyName>NuGetGallery.Cloud</AssemblyName>
- <StartDevelopmentStorage>True</StartDevelopmentStorage>
- <Name>NuGetGallery.Cloud</Name>
- <PackageEnableRemoteDebugger>False</PackageEnableRemoteDebugger>
- <TargetProfile>Local</TargetProfile>
- <UseEmulatorExpressByDefault>False</UseEmulatorExpressByDefault>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <!-- Items for the project -->
- <ItemGroup>
- <None Include="DeployToAzure.ps1" />
- <None Include="NuGetGallery.Cloud.nuspec" />
- <ServiceConfiguration Include="ServiceConfiguration.Cloud.cscfg" />
- <ServiceDefinition Include="ServiceDefinition.csdef" />
- <ServiceConfiguration Include="ServiceConfiguration.Local.cscfg" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\NuGetGallery\NuGetGallery.csproj">
- <Name>NuGetGallery</Name>
- <Project>{1dacf781-5cd0-4123-8bac-cd385d864be5}</Project>
- <Private>True</Private>
- <RoleType>Web</RoleType>
- <RoleName>NuGetGallery</RoleName>
- <UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="NuGetGalleryContent\" />
- <Folder Include="NuGetGalleryContent\bin" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="NuGetGalleryContent\bin\InstallDotNet452.cmd">
- <SubType>Content</SubType>
- </Content>
- <Content Include="NuGetGalleryContent\bin\NDP452-KB2901954-Web.exe">
- <SubType>Content</SubType>
- </Content>
- <Content Include="NuGetGalleryContent\bin\Startup.cmd">
- <SubType>Content</SubType>
- </Content>
- <Content Include="NuGetGalleryContent\bin\Startup.ps1">
- <SubType>Content</SubType>
- </Content>
- <Content Include="NuGetGalleryContent\bin\SslConfig.cmd">
- <SubType>Content</SubType>
- </Content>
- <Content Include="NuGetGalleryContent\bin\SslConfig.ps1">
- <SubType>Content</SubType>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <DiagnosticsConfiguration Include="NuGetGalleryContent\diagnostics.wadcfgx" />
- </ItemGroup>
- <!-- Import the target files for this project template -->
- <PropertyGroup>
- <VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
- <CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.9\</CloudExtensionsDir>
- </PropertyGroup>
- <Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
- <Import Project="$(MSBuildProjectDirectory)\..\..\NuGet.Cloud.targets" />
-</Project>
View
22 src/NuGetGallery.Cloud/NuGetGallery.Cloud.nuspec
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<package >
- <metadata>
- <id>NuGetGallery.Cloud</id>
- <version>0.0.0</version>
- <authors>.NET Foundation</authors>
- <owners>.NET Foundation</owners>
- <licenseUrl>https://github.com/NuGet/NuGetGallery/blob/master/LICENSE</licenseUrl>
- <projectUrl>https://github.com/NuGet/NuGetGallery</projectUrl>
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
- <description>Deployment package for the NuGet V2 Gallery Service.</description>
- <releaseNotes>
- Built by $BuildUser$ on $BuildMachine$ at $BuildDateUtc$ from $Commit$ on branch '$Branch$'.
- </releaseNotes>
- </metadata>
- <files>
- <file src="DeployToAzure.ps1" />
- <file src="bin\$configuration$\app.publish\NuGetGallery.Cloud.cspkg" />
- <file src="bin\$configuration$\app.publish\ServiceConfiguration.Cloud.cscfg" />
- <file src="bin\$configuration$\app.publish\Extensions\PaaSDiagnostics.NuGetGallery.PubConfig.xml" target="Extensions"/>
- </files>
-</package>
View
13 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/InstallDotNet452.cmd
@@ -1,13 +0,0 @@
-REM Install .NET Framework
-set timehour=%time:~0,2%
-set timestamp=%date:~-4,4%%date:~-10,2%%date:~-7,2%-%timehour: =0%%time:~3,2%
-set startuptasklog=startuptasklog-%timestamp%.txt
-set netfxinstallerlog = NetFXInstallerLog-%timestamp%
-echo Logfile generated at: %startuptasklog% >> %startuptasklog%
-echo Checking if .NET 4.5.2 is installed >> %startuptasklog%
-reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release | Find "0x5cbf5"
-if %ERRORLEVEL%== 0 goto end
-echo Installing .NET 4.5.2. Log: %netfxinstallerlog% >> %startuptasklog%
-start /wait %~dp0NDP452-KB2901954-Web.exe /q /serialdownload /log %netfxinstallerlog%
-:end
-echo Completed: %date:~-4,4%%date:~-10,2%%date:~-7,2%-%timehour: =0%%time:~3,2% >> %startuptasklog%
View
BIN src/NuGetGallery.Cloud/NuGetGalleryContent/bin/NDP452-KB2901954-Web.exe
Binary file not shown.
View
2 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/SslConfig.cmd
@@ -1,2 +0,0 @@
-powershell -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0SslConfig.ps1" >> startup.log 2>> startup.err
-exit /b 0
View
83 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/SslConfig.ps1
@@ -1,83 +0,0 @@
-# Copyright (c) Andre N. Klingsheim. See https://nwebsec.codeplex.com/license for license information.
-
-param([bool]$allowReboot = $false)
-
-Function UpdateRegistryPath($path){
-
- if(test-path $path){
- return $false
- }
- write-Host "Creating registry path: $path"
- md $path
- return $true
-}
-
-Function UpdateRegistryKey($path, $propertyName, $value, $propertyType){
- $property = Get-ItemProperty -Path $path -Name $propertyName -ErrorAction SilentlyContinue
-
- if($property){
- if($property.$propertyName -eq $value){
- return $false
- }
- Write-Host "Updating registry key $path $propertyName $value"
- Set-ItemProperty -path $path -name $propertyName -value $value
- return $true
- }
- Write-Host "Creating registry key $path $propertyName $value"
- New-ItemProperty -path $path -name $propertyName -value $value -PropertyType $propertyType
- return $true
-}
-
-$date = Get-Date
-write-output "---- NWebsec.AzureStartupTasks - TLS hardening - $date ----"
-write-output "Checking for registry keys, updating as necessary"
-write-output ""
-
-
-$preferredCipherSuites = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA"
-$rebootRequired = $false
-
-# Disable SSL 2.0
-write-output "**** Making sure SSL 2.0 is disabled ****"
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryKey "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server" "Enabled" 0 "DWord") -Or $rebootRequired
-
-# Disable SSL 3.0
-write-output "**** Making sure SSL 3.0 is disabled ****"
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryKey "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server" "Enabled" 0 "DWord") -Or $rebootRequired
-
-# Enable TLS 1.1
-write-output "**** Making sure TLS 1.1 is enabled ****"
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryKey "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" "DisabledByDefault" 0 "DWord") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryKey "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" "DisabledByDefault" 0 "DWord") -Or $rebootRequired
-
-
-# Enable TSL 1.2
-write-output "**** Making sure TLS 1.2 is enabled ****"
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryKey "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" "DisabledByDefault" 0 "DWord") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client") -Or $rebootRequired
-$rebootRequired = (UpdateRegistryKey "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" "DisabledByDefault" 0 "DWord") -Or $rebootRequired
-
-# Protocol versions done, set preferred cipher suites
-write-output "**** Making sure preferred cipher suites are set ****"
-$rebootRequired = (UpdateRegistryKey "HKLM:\SOFTWARE\Policies\Microsoft\Cryptography\Configuration\SSL\00010002" "Functions" $preferredCipherSuites "String") -Or $rebootRequired
-
-if($rebootRequired){
- if($allowReboot){
- write-output "Registry was updated, rebooting..."
- write-output "---- NWebsec.AzureStartupTasks - TLS hardening Completed - $date ----"
- shutdown /r /t 0
- }else{
- write-output "Registry was updated, reboot is required for changes to take effect."
- }
-}else{
-write-output "Registry keys were ok, exiting."
-}
-write-output "---- NWebsec.AzureStartupTasks - TLS hardening Completed - $date ----"
View
2 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/Startup.cmd
@@ -1,2 +0,0 @@
-powershell -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0Startup.ps1" >> startup.log 2>> startup.err
-exit /b 0
View
92 src/NuGetGallery.Cloud/NuGetGalleryContent/bin/Startup.ps1
@@ -1,92 +0,0 @@
-# Find IIS
-$iisRoot = Join-Path $env:windir "system32\inetsrv"
-if(Test-Path "HKLM:\Software\Microsoft\IISExpress") {
- $iisRoot = (Get-ItemProperty ((dir HKLM:\Software\Microsoft\IISExpress | sort -desc | select -first 1).PSPath)).InstallPath;
-}
-
-$appcmd = Join-Path $iisRoot "appcmd.exe"
-if(!(Test-Path $appcmd)) {
- throw "Could not find AppCmd!"
-}
-
-# Enable Dynamic Compression of OData feed
-&$appcmd set config /section:urlCompression /doDynamicCompression:True /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/json; charset=utf-8',enabled='True']" /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/xml; charset=utf-8',enabled='True']" /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/xml',enabled='True']" /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/atom%u002bxml; charset=utf-8',enabled='True']" /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/atom%u002bxml',enabled='True']" /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/atom%u002bxml; type=feed; charset=utf-8',enabled='True']" /commit:apphost
-&$appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/atom%u002bxml; type=feed',enabled='True']" /commit:apphost
-
-
-# Customize Logging
-&$appcmd set config -section:system.applicationHost/sites /siteDefaults.logFile.enabled:"True" /commit:apphost
-&$appcmd set config -section:system.applicationHost/sites /siteDefaults.logFile.logFormat:"W3C" /commit:apphost
-&$appcmd set config -section:system.applicationHost/sites /siteDefaults.logFile.period:"Hourly" /commit:apphost
-&$appcmd set config -section:system.applicationHost/sites /siteDefaults.logFile.logExtFileFlags:"Date,Time,TimeTaken,BytesRecv,BytesSent,ComputerName,HttpStatus,HttpSubStatus,Win32Status,ProtocolVersion,ServerIP,ServerPort,Method,Host,UriStem,UriQuery,UserAgent"
-
-
-# Increase the number of available IIS threads for high performance applications
-# Uses the recommended values from http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8
-# Assumes running on two cores (medium instance on Azure)
-&$appcmd set config /commit:MACHINE -section:processModel -maxWorkerThreads:100
-&$appcmd set config /commit:MACHINE -section:processModel -minWorkerThreads:50
-&$appcmd set config /commit:MACHINE -section:processModel -minIoThreads:50
-&$appcmd set config /commit:MACHINE -section:processModel -maxIoThreads:100
-
-# Adjust the maximum number of connections per core for all IP addresses
-&$appcmd set config /commit:MACHINE -section:connectionManagement /+["address='*',maxconnection='240'"]
-
-
-# Configure IP Restrictions
-
-# Install the feature
-Import-Module ServerManager
-Add-WindowsFeature Web-IP-Security
-
-# Clear them
-do {
- $str = &$appcmd set config -section:system.webServer/security/ipSecurity /-"[@start]" /commit:apphost
- $str
-} while(!$str.Contains("ERROR"))
-
-# Read the new list
-[Reflection.Assembly]::LoadWithPartialName("Microsoft.WindowsAzure.ServiceRuntime");
-$setting = [Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment]::GetConfigurationSettingValue("Startup.BlockedIPs");
-$ips = $setting.Split(",");
-
-# Save the new lists
-$ips | where { ![String]::IsNullOrEmpty($_) } | foreach {
- $parts = $_.Split(":")
- $ip = $parts[0]
- if($parts.Length -gt 1) {
- $subnet = $parts[1]
- &$appcmd set config -section:system.webServer/security/ipSecurity /+"[ipAddress='$ip',subnetMask='$subnet',allowed='False']" /commit:apphost
- }
- else {
- &$appcmd set config -section:system.webServer/security/ipSecurity /+"[ipAddress='$ip',allowed='False']" /commit:apphost
- }
-}
-
-# Configure secondary SSL bindings
-$setting = [Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment]::GetConfigurationSettingValue("Startup.AdditionalSSL");
-$additionalSSL = $setting.Split(","); # e.g. foo.bar:443:thumbprint,bar.baz:443:FEDCBA
-
-# Register additional SSL bindings
-$sites = [xml](&$appcmd list sites /xml)
-$defaultSite = $sites.appcmd.SITE[0].Attributes[0].Value.ToString()
-$additionalSSL | where { ![String]::IsNullOrEmpty($_) } | foreach {
- $parts = $_.Split(":")`
-
- $hostname = $parts[0]
- $port = $parts[1]
- $thumbprint = $parts[2]
-
- echo Adding binding to site $defaultSite for URL https://$hostname`:$port with SNI certificate $thumbprint
- &$appcmd set site /site.name:"$defaultSite" /+"bindings.[protocol='https',bindingInformation='*:$port`:$hostname',sslFlags='1']" /commit:apphost
- netsh http add sslcert hostnameport=$hostname`:$port certhash=$thumbprint appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}' certstorename=MY
-}
-
-# Install Microsoft internal corporate root cert required for KeyVault access to LocalMachine\AuthRoot (it's not supported by azure, hence we install to cert to CA store, and then need to move it)
-Move-Item -Path Cert:\LocalMachine\CA\D17697CC206ED26E1A51F5BB96E9356D6D610B74 -Destination Cert:\LocalMachine\Root
View
49 src/NuGetGallery.Cloud/NuGetGalleryContent/diagnostics.wadcfgx
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<DiagnosticsConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
- <PublicConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
- <WadCfg>
- <DiagnosticMonitorConfiguration overallQuotaInMB="4096">
- <DiagnosticInfrastructureLogs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
- <Directories scheduledTransferPeriod="PT1M">
- <IISLogs containerName="wad-iis-logfiles" />
- <FailedRequestLogs containerName="wad-failedrequestlogs" />
- <DataSources>
- <DirectoryConfiguration containerName="ng-v2gallery-logs">
- <LocalResource relativePath="." name="Logs"/>
- </DirectoryConfiguration>
- </DataSources>
- </Directories>
- <PerformanceCounters scheduledTransferPeriod="PT1M">
- <PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\ISAPI Extension Requests/sec" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Bytes Total/Sec" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Requests/Sec" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\ASP.NET Applications(__Total__)\Errors Total/Sec" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT3M" />
- <PerformanceCounterConfiguration counterSpecifier="\.NET CLR Jit(_Global_)\% Time in Jit" sampleRate="PT0S" />
- <PerformanceCounterConfiguration counterSpecifier="\.NET CLR Loading(_Global_)\% Time Loading" sampleRate="PT0S" />
- <PerformanceCounterConfiguration counterSpecifier="\.NET CLR LocksAndThreads(_Global_)\Contention Rate / sec" sampleRate="PT0S" />
- <PerformanceCounterConfiguration counterSpecifier="\.NET CLR Memory(_Global_)\# Bytes in all Heaps" sampleRate="PT0S" />
- <PerformanceCounterConfiguration counterSpecifier="\.NET CLR Memory(_Global_)\% Time in GC" sampleRate="PT0S" />
- <PerformanceCounterConfiguration counterSpecifier="\.NET CLR Networking(_Global_)\Connections Established" sampleRate="PT0S" />
- </PerformanceCounters>
- <WindowsEventLog scheduledTransferPeriod="PT1M">
- <DataSource name="System!*" />
- </WindowsEventLog>
- <CrashDumps directoryQuotaPercentage="6" containerName="wad-crash-dumps">
- <CrashDumpConfiguration processName="WaIISHost.exe" />
- <CrashDumpConfiguration processName="WaWorkerHost.exe" />
- <CrashDumpConfiguration processName="w3wp.exe" />
- </CrashDumps>
- <Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose" />
- </DiagnosticMonitorConfiguration>
- </WadCfg>
- <StorageAccount />
- </PublicConfig>
- <PrivateConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
- <StorageAccount endpoint="" />
- </PrivateConfig>
- <IsEnabled>true</IsEnabled>
-</DiagnosticsConfiguration>
View
82 src/NuGetGallery.Cloud/ServiceConfiguration.Cloud.cscfg
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ServiceConfiguration serviceName="NuGetGallery.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
- <Role name="NuGetGallery">
- <Instances count="1" />
- <ConfigurationSettings>
- <!-- ******************* -->
- <!-- DEPLOYMENT SPECIFIC -->
- <!-- ******************* -->
- <!-- These should change on every deployment (to rotate credentials, etc.) -->
- <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
- <Setting name="Gallery.AzureStorageConnectionString" value="UseDevelopmentStorage=true" />
- <Setting name="Gallery.AzureStorageReadAccessGeoRedundant" value="false" />
- <Setting name="Gallery.SqlServer" value="Data Source=(LocalDB)\v11.0;Initial Catalog=NuGetGallery;Integrated Security=SSPI" />
- <Setting name="Gallery.SupportRequestSqlServer" value="Data Source=(LocalDB)\v11.0;Initial Catalog=SupportRequest;Integrated Security=SSPI" />
- <!-- WARNING: This is an insecure default password. Change it before enabling remote desktop -->
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBnQYJKoZIhvcNAQcDoIIBjjCCAYoCAQAxggFOMIIBSgIBADAyMB4xHDAaBgNVBAMME1dpbmRvd3MgQXp1cmUgVG9vbHMCEG870pHsz0GPRZ18ZHEVMyMwDQYJKoZIhvcNAQEBBQAEggEABCvdlx/fjNaMh+I4tdArjlmC/KhsVISFYKP+Tppd4LJM4J67FUcgSnnZLp/fII7gvd0X7XHRjV9a9gTj15b3lexRXp36oDLiRpw9Ld0EbxNMB1CBPNDqYRlV8iZBLeER3KOq7b+6iUywx1TWRf3UtaIZYI1BU6XJXWlKKartrKFl7g1MV6T506xN5a2m+r9Wi9dTApOYx3mBl1ZICDPTQX5dMWP6aRslapdOcyp+cMAgNjdE0TW0jw5eVEY0m3PqxuSSI99xtXLcVYrz6H7K3C8lNoxR9BlL89XOBh2VGsrsNeDF80cwuZkLYkqL3koehilh6b+iIC74yjcNboPRajAzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECCGRjuJpsHCYgBDKJqr9G6xa5kT1yQHFHx5Y" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2014-10-12T23:59:59.0000000-07:00" />
- <!-- ******************** -->
- <!-- ENVIRONMENT SPECIFIC -->
- <!-- ******************** -->
- <!-- These only need to change when defining a new environment -->
- <Setting name="Gallery.Environment" value="LocalEmulator" />
- <Setting name="Gallery.WarningBanner" value="" />
- <Setting name="Gallery.FacebookAppId" value="" />
- <Setting name="Gallery.AppInsightsInstrumentationKey" value="" />
- <Setting name="Gallery.AppInsightsSamplingPercentage" value="50" />
- <Setting name="Gallery.GoogleAnalyticsPropertyId" value="" />
- <Setting name="Gallery.AzureCdnHost" value="" />
- <Setting name="Gallery.SiteRoot" value="nuget.localtest.me" />
- <Setting name="Gallery.ServiceDiscoveryUri" value="https://api.nuget.org/v3/index.json" />
- <Setting name="Gallery.SearchServiceResourceType" value="SearchGalleryQueryService/3.0.0-rc" />
- <Setting name="Auth.MicrosoftAccount.Enabled" value="false" />
- <Setting name="Auth.MicrosoftAccount.ClientId" value="" />
- <Setting name="Auth.MicrosoftAccount.ClientSecret" value="" />
- <Setting name="Auth.AzureActiveDirectory.Enabled" value="false" />
- <Setting name="Auth.AzureActiveDirectory.ClientId" value="" />
- <Setting name="Auth.AzureActiveDirectory.Authority" value="" />
- <Setting name="Auth.AzureActiveDirectory.Issuer" value="" />
- <Setting name="Auth.AzureActiveDirectory.ShowOnLoginPage" value="false" />
- <Setting name="Gallery.PagerDutyAccountName" value="" />
- <Setting name="Gallery.PagerDutyAPIKey" value="" />
- <Setting name="Gallery.PagerDutyServiceKey" value="" />
- <Setting name="Gallery.EnforcedAuthProviderForAdmin" value="" />
- <!-- *************** -->
- <!-- STABLE SETTINGS -->
- <!-- *************** -->
- <!-- Depending on your policy, these likely do not need to vary -->
- <!-- SmtpUri is expected to be of the format: smtps://username:password@host:port. Note that if username contains an "@", you need to URI Encode it! -->
- <Setting name="Gallery.Brand" value="NuGet Gallery" />
- <Setting name="Gallery.SmtpUri" value="" />
- <Setting name="Gallery.RequireSSL" value="true" />
- <Setting name="Gallery.StorageType" value="AzureStorage" />
- <Setting name="Gallery.LuceneIndexLocation" value="Temp" />
- <Setting name="Gallery.ConfirmEmailAddress" value="true" />
- <Setting name="Gallery.AutoUpdateSearchIndex" value="true" />
- <Setting name="Gallery.CollectPerfLogs" value="true" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="nuget" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
- <!-- **************** -->
- <!-- RUNTIME SETTINGS -->
- <!-- **************** -->
- <!-- These are only changed at runtime -->
- <Setting name="Gallery.ReadOnlyMode" value="false" />
- <Setting name="Gallery.FeedOnlyMode" value="false" />
- <Setting name="Startup.BlockedIPs" value="" />
- <!-- ***************** -->
- <!-- KeyVault settings. -->
- <!-- ***************** -->
- <Setting name="KeyVault.VaultName" value="" />
- <Setting name="KeyVault.ClientId" value="" />
- <Setting name="KeyVault.CertificateThumbprint" value="" />
- </ConfigurationSettings>
- <Certificates>
- <!-- Totally bogus set of Hex digits that get replaced by the actual thumbprints when generating a CSCFG -->
- <Certificate name="SSLCertificate" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
- <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
- <Certificate name="KeyVaultAccess" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
- <Certificate name="KeyVaultAccessCA" thumbprint="D17697CC206ED26E1A51F5BB96E9356D6D610B74" thumbprintAlgorithm="sha1" />
- </Certificates>
- </Role>
-</ServiceConfiguration>
View
82 src/NuGetGallery.Cloud/ServiceConfiguration.Local.cscfg
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ServiceConfiguration serviceName="NuGetGallery.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
- <Role name="NuGetGallery">
- <Instances count="1" />
- <ConfigurationSettings>
- <!-- ******************* -->
- <!-- DEPLOYMENT SPECIFIC -->
- <!-- ******************* -->
- <!-- These should change on every deployment (to rotate credentials, etc.) -->
- <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
- <Setting name="Gallery.AzureStorageConnectionString" value="UseDevelopmentStorage=true" />
- <Setting name="Gallery.AzureStorageReadAccessGeoRedundant" value="false" />
- <Setting name="Gallery.SqlServer" value="Data Source=(LocalDB)\v11.0;Initial Catalog=NuGetGallery;Integrated Security=SSPI" />
- <Setting name="Gallery.SupportRequestSqlServer" value="Data Source=(LocalDB)\v11.0;Initial Catalog=SupportRequest;Integrated Security=SSPI" />
- <!-- WARNING: This is an insecure default password. Change it before enabling remote desktop -->
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBnQYJKoZIhvcNAQcDoIIBjjCCAYoCAQAxggFOMIIBSgIBADAyMB4xHDAaBgNVBAMME1dpbmRvd3MgQXp1cmUgVG9vbHMCEG870pHsz0GPRZ18ZHEVMyMwDQYJKoZIhvcNAQEBBQAEggEABCvdlx/fjNaMh+I4tdArjlmC/KhsVISFYKP+Tppd4LJM4J67FUcgSnnZLp/fII7gvd0X7XHRjV9a9gTj15b3lexRXp36oDLiRpw9Ld0EbxNMB1CBPNDqYRlV8iZBLeER3KOq7b+6iUywx1TWRf3UtaIZYI1BU6XJXWlKKartrKFl7g1MV6T506xN5a2m+r9Wi9dTApOYx3mBl1ZICDPTQX5dMWP6aRslapdOcyp+cMAgNjdE0TW0jw5eVEY0m3PqxuSSI99xtXLcVYrz6H7K3C8lNoxR9BlL89XOBh2VGsrsNeDF80cwuZkLYkqL3koehilh6b+iIC74yjcNboPRajAzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECCGRjuJpsHCYgBDKJqr9G6xa5kT1yQHFHx5Y" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2014-10-12T23:59:59.0000000-07:00" />
- <!-- ******************** -->
- <!-- ENVIRONMENT SPECIFIC -->
- <!-- ******************** -->
- <!-- These only need to change when defining a new environment -->
- <Setting name="Gallery.Environment" value="LocalEmulator" />
- <Setting name="Gallery.WarningBanner" value="This is a development environment. No data will be preserved." />
- <Setting name="Gallery.FacebookAppId" value="" />
- <Setting name="Gallery.AppInsightsInstrumentationKey" value="" />
- <Setting name="Gallery.AppInsightsSamplingPercentage" value="100" />
- <Setting name="Gallery.GoogleAnalyticsPropertyId" value="" />
- <Setting name="Gallery.AzureCdnHost" value="" />
- <Setting name="Gallery.SiteRoot" value="nuget.localtest.me" />
- <Setting name="Gallery.ServiceDiscoveryUri" value="https://api.nuget.org/v3/index.json" />
- <Setting name="Gallery.SearchServiceResourceType" value="SearchGalleryQueryService/3.0.0-rc" />
- <Setting name="Auth.MicrosoftAccount.Enabled" value="false" />
- <Setting name="Auth.MicrosoftAccount.ClientId" value="" />
- <Setting name="Auth.MicrosoftAccount.ClientSecret" value="" />
- <Setting name="Auth.AzureActiveDirectory.Enabled" value="false" />
- <Setting name="Auth.AzureActiveDirectory.ClientId" value="" />
- <Setting name="Auth.AzureActiveDirectory.Authority" value="" />
- <Setting name="Auth.AzureActiveDirectory.Issuer" value="" />
- <Setting name="Auth.AzureActiveDirectory.ShowOnLoginPage" value="false" />
- <Setting name="Gallery.PagerDutyAccountName" value="" />
- <Setting name="Gallery.PagerDutyAPIKey" value="" />
- <Setting name="Gallery.PagerDutyServiceKey" value="" />
- <Setting name="Gallery.EnforcedAuthProviderForAdmin" value="" />
- <!-- *************** -->
- <!-- STABLE SETTINGS -->
- <!-- *************** -->
- <!-- Depending on your policy, these likely do not need to vary -->
- <!-- SmtpUri is expected to be of the format: smtps://username:password@host:port. Note that if username contains an "@", you need to URI Encode it! -->
- <Setting name="Gallery.Brand" value="NuGet Gallery" />
- <Setting name="Gallery.SmtpUri" value="" />
- <Setting name="Gallery.RequireSSL" value="true" />
- <Setting name="Gallery.StorageType" value="AzureStorage" />
- <Setting name="Gallery.LuceneIndexLocation" value="Temp" />
- <Setting name="Gallery.ConfirmEmailAddress" value="true" />
- <Setting name="Gallery.AutoUpdateSearchIndex" value="true" />
- <Setting name="Gallery.CollectPerfLogs" value="true" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="nuget" />
- <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
- <!-- **************** -->
- <!-- RUNTIME SETTINGS -->
- <!-- **************** -->
- <!-- These are only changed at runtime -->
- <Setting name="Gallery.ReadOnlyMode" value="false" />
- <Setting name="Gallery.FeedOnlyMode" value="false" />
- <Setting name="Startup.BlockedIPs" value="" />
- <!-- ***************** -->
- <!-- KeyVault settings. -->
- <!-- ***************** -->
- <Setting name="KeyVault.VaultName" value="" />
- <Setting name="KeyVault.ClientId" value="" />
- <Setting name="KeyVault.CertificateThumbprint" value="" />
- </ConfigurationSettings>
- <Certificates>
- <!-- Totally bogus set of Hex digits that get replaced by the actual thumbprints when generating a CSCFG -->
- <Certificate name="SSLCertificate" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
- <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
- <Certificate name="KeyVaultAccess" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
- <Certificate name="KeyVaultAccessCA" thumbprint="D17697CC206ED26E1A51F5BB96E9356D6D610B74" thumbprintAlgorithm="sha1" />
- </Certificates>
- </Role>
-</ServiceConfiguration>
View
92 src/NuGetGallery.Cloud/ServiceDefinition.csdef
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ServiceDefinition name="NuGetGallery.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
- <LoadBalancerProbes>
- <LoadBalancerProbe name="HTTP" path="/" protocol="http" port="80" />
- </LoadBalancerProbes>
- <!-- Size of the instances -->
- <WebRole name="NuGetGallery" vmsize="ExtraLarge">
- <ConfigurationSettings>
- <Setting name="Gallery.Brand" />
- <Setting name="Gallery.Environment" />
- <Setting name="Gallery.RequireSSL" />
- <Setting name="Gallery.AzureStorageConnectionString" />
- <Setting name="Gallery.AzureStorageReadAccessGeoRedundant" />
- <Setting name="Gallery.SqlServer" />
- <Setting name="Gallery.SupportRequestSqlServer" />
- <Setting name="Gallery.ConfirmEmailAddress" />
- <Setting name="Gallery.ReadOnlyMode" />
- <Setting name="Gallery.FeedOnlyMode" />
- <Setting name="Gallery.StorageType" />
- <Setting name="Gallery.SmtpUri" />
- <Setting name="Gallery.FacebookAppId" />
- <Setting name="Gallery.AppInsightsInstrumentationKey" />
- <Setting name="Gallery.AppInsightsSamplingPercentage" />
- <Setting name="Gallery.SiteRoot" />
- <Setting name="Gallery.AzureCdnHost" />
- <Setting name="Gallery.LuceneIndexLocation" />
- <Setting name="Gallery.GoogleAnalyticsPropertyId" />
- <Setting name="Gallery.ServiceDiscoveryUri" />
- <Setting name="Gallery.SearchServiceResourceType" />
- <Setting name="Gallery.AutoUpdateSearchIndex" />
- <Setting name="Gallery.CollectPerfLogs" />
- <Setting name="Gallery.PagerDutyAccountName" />
- <Setting name="Gallery.PagerDutyAPIKey" />
- <Setting name="Gallery.PagerDutyServiceKey" />
- <Setting name="Gallery.WarningBanner" />
- <Setting name="Gallery.EnforcedAuthProviderForAdmin" />
- <Setting name="Auth.MicrosoftAccount.Enabled" />
- <Setting name="Auth.MicrosoftAccount.ClientId" />
- <Setting name="Auth.MicrosoftAccount.ClientSecret" />
- <Setting name="Auth.AzureActiveDirectory.Enabled" />
- <Setting name="Auth.AzureActiveDirectory.ClientId" />
- <Setting name="Auth.AzureActiveDirectory.Authority" />
- <Setting name="Auth.AzureActiveDirectory.Issuer" />
- <Setting name="Auth.AzureActiveDirectory.ShowOnLoginPage" />
- <Setting name="Startup.BlockedIPs" />
- <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
- <Setting name="KeyVault.VaultName" />
- <Setting name="KeyVault.ClientId" />
- <Setting name="KeyVault.CertificateThumbprint" />
- </ConfigurationSettings>
- <Sites>
- <Site name="Web">
- <Bindings>
- <Binding name="HttpBinding" endpointName="HttpEndpoint" />
- <Binding name="HttpsBinding" endpointName="HttpsEndpoint" />
- </Bindings>
- </Site>
- </Sites>
- <Startup>
- <Task commandLine="InstallDotNet452.cmd" executionContext="elevated" taskType="simple" />
- <Task commandLine="SslConfig.cmd" executionContext="elevated" taskType="simple" />
- <Task commandLine="Startup.cmd" executionContext="elevated" taskType="simple" />
- </Startup>
- <Endpoints>
- <InputEndpoint name="HttpEndpoint" protocol="http" port="80" loadBalancerProbe="HTTP" />
- <InputEndpoint name="HttpsEndpoint" protocol="https" port="443" loadBalancerProbe="HTTP" certificate="SSLCertificate" />
- <InstanceInputEndpoint name="HttpInstanceEndpoint" protocol="tcp" localPort="80">
- <AllocatePublicPortFrom>
- <FixedPortRange max="8089" min="8081" />
- </AllocatePublicPortFrom>
- </InstanceInputEndpoint>
- <InstanceInputEndpoint name="HttpsInstanceEndpoint" protocol="tcp" localPort="443">
- <AllocatePublicPortFrom>
- <FixedPortRange max="44309" min="44301" />
- </AllocatePublicPortFrom>
- </InstanceInputEndpoint>
- </Endpoints>
- <Imports>
- <Import moduleName="RemoteAccess" />
- <Import moduleName="RemoteForwarder" />
- <Import moduleName="Diagnostics" />
- </Imports>
- <Certificates>
- <Certificate name="SSLCertificate" storeLocation="LocalMachine" storeName="My" />
- <Certificate name="KeyVaultAccess" storeLocation="LocalMachine" storeName="My" />
- <Certificate name="KeyVaultAccessCA" storeLocation="LocalMachine" storeName="CA" />
- </Certificates>
- <LocalResources>
- <LocalStorage name="Logs" cleanOnRoleRecycle="false" sizeInMB="2048" />
- </LocalResources>
- </WebRole>
-</ServiceDefinition>
View
9 src/NuGetGallery.Core/NuGetGallery.Core.csproj
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props" Condition="Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -220,12 +219,4 @@
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
- <PropertyGroup>
- <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
- </PropertyGroup>
- <Error Condition="!Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props'))" />
- <Error Condition="!Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets'))" />
- </Target>
- <Import Project="..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets" Condition="Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets')" />
</Project>
View
30 src/NuGetGallery.Core/Properties/AssemblyInfo.cs
@@ -1,9 +1,37 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using System;
using System.Reflection;
+using System.Resources;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
[assembly: AssemblyTitle("NuGetGallery.Core")]
+[assembly: AssemblyCompany(".NET Foundation")]
+[assembly: AssemblyProduct("NuGet Services")]
+[assembly: AssemblyCopyright("\x00a9 .NET Foundation. All rights reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+#if !PORTABLE
+[assembly: ComVisible(false)]
+#endif
+
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#else
+[assembly: AssemblyConfiguration("Release")]
+#endif
+
+[assembly: CLSCompliant(false)]
+[assembly: NeutralResourcesLanguage("en-us")]
+
[assembly: AssemblyDescription("Core support library for NuGet Gallery Frontend and Backend")]
-[assembly: InternalsVisibleTo("NuGetGallery.Core.Facts")]
+[assembly: InternalsVisibleTo("NuGetGallery.Core.Facts")]
+
+// The build will automatically inject the following attributes:
+// AssemblyVersion, AssemblyFileVersion, AssemblyInformationalVersion, AssemblyMetadata (for Branch, CommitId, and BuildDateUtc)
+
+[assembly: AssemblyMetadata("RepositoryUrl", "https://www.github.com/NuGet/NuGetGallery")]
+
View
1 src/NuGetGallery.Core/packages.config
@@ -13,7 +13,6 @@
<package id="NuGet.Packaging" version="3.5.0-beta-final" targetFramework="net452" />
<package id="NuGet.Packaging.Core" version="3.5.0-beta-final" targetFramework="net452" />
<package id="NuGet.Packaging.Core.Types" version="3.5.0-beta-final" targetFramework="net452" />
- <package id="NuGet.Services.Build" version="3.0.13" targetFramework="net452" developmentDependency="true" />
<package id="NuGet.Versioning" version="3.5.0-beta-final" targetFramework="net452" />
<package id="System.Spatial" version="5.6.5-beta" targetFramework="net452" />
<package id="WindowsAzure.Storage" version="4.3.0" targetFramework="net452" />
View
4 src/NuGetGallery.Operations/NuGetGallery.Operations.csproj
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props" Condition="Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -457,8 +456,5 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
- <Error Condition="!Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props'))" />
- <Error Condition="!Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets'))" />
</Target>
- <Import Project="..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets" Condition="Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.targets')" />
</Project>
View
1 src/NuGetGallery.Operations/packages.config
@@ -26,7 +26,6 @@
<package id="NuGet.Packaging" version="3.5.0-beta-final" targetFramework="net452" />
<package id="NuGet.Packaging.Core" version="3.5.0-beta-final" targetFramework="net452" />
<package id="NuGet.Packaging.Core.Types" version="3.5.0-beta-final" targetFramework="net452" />
- <package id="NuGet.Services.Build" version="3.0.13" targetFramework="net452" developmentDependency="true" />
<package id="NuGet.Versioning" version="3.5.0-beta-final" targetFramework="net452" />
<package id="System.Net.Http" version="2.0.20126.16343" targetFramework="net452" />
<package id="System.Spatial" version="5.6.5-beta" targetFramework="net452" />
View
12 src/NuGetGallery/NuGetGallery.csproj
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props" Condition="Exists('..\..\packages\NuGet.Services.Build.3.0.13\build\NuGet.Services.Build.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -25,18 +24,15 @@
<OldToolsVersion>12.0</OldToolsVersion>
<TargetFrameworkProfile />
<IISExpressSSLPort>443</IISExpressSSLPort>
- <DownloadNuGetExe>true</DownloadNuGetExe>
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
<IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
<CodeContractsAssemblyMode>0</CodeContractsAssemblyMode>
- <NuGetPackageImportStamp>001c21d7</NuGetPackageImportStamp>
- <NuGetPackageImportStamp>061576ae</NuGetPackageImportStamp>
- <NuGetPackageImportStamp>
- </NuGetPackageImportStamp>
<MvcProjectUpgradeChecked>true</MvcProjectUpgradeChecked>
<UseGlobalApplicationHostFile />
<MvcBuildViews Condition=" '$(MvcBuildViews)' == '' ">false</MvcBuildViews>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -1749,6 +1745,7 @@
<SubType>Designer</SubType>
</Content>
<None Include="Properties\PublishProfiles\nuget-staging-frontend.pubxml" />
+ <Content Include="packages.config" />
<Content Include="Scripts\perpackagestatsgraphs.js" />
<Content Include="Scripts\stat