Preserve scheme when redirecting to blob \ cdn #598

Closed
wants to merge 221 commits into
from

Conversation

Projects
None yet
6 participants
Member

pranavkm commented Sep 20, 2012

Fixes bug #576

Member

jeffhandley commented Sep 20, 2012

:shipit:

drakomeep and others added some commits Oct 4, 2012

@drakomeep @TimLovellSmith drakomeep Add package contents page. ecd381f
@TimLovellSmith dotnetjunky Add controller action to return file content. 5f3b20d
@TimLovellSmith dotnetjunky Add file download. e1e7998
@TimLovellSmith dotnetjunky Change url to query string instead of url path to load forbidden paths. 849e025
@TimLovellSmith dotnetjunky Show image for image files. 74ebb6d
@TimLovellSmith dotnetjunky Fix downloading images. b7c554b
@TimLovellSmith dotnetjunky Reject requests for big packages. 36afc8b
@TimLovellSmith dotnetjunky Add Azure Cache service and use it when running on Azure. 8e9ab37
@TimLovellSmith dotnetjunky adjust cache to cache the binary files uninstall of the IPackage inst…
…ance.
dbc3aaf
@TimLovellSmith dotnetjunky MOdify build script to add stuff to web.config 719426c
@TimLovellSmith dotnetjunky Add compress and cache service. 1d7ab66
@anurse @TimLovellSmith anurse Added Facebook Like button via JavaScript SDK 37c74c9
@anurse @TimLovellSmith anurse Fixed tests and added packaging logic for Facebook App ID af910cf
@anurse @TimLovellSmith anurse Added nugetgallery Open Graph data 7d46768
@anurse @TimLovellSmith anurse Use default package icon as og:image when package has no icon 59476f2
@anurse @TimLovellSmith anurse Stripped QueryString from "CanonicalCurrent Helper" 5cd8847
@drakomeep @TimLovellSmith drakomeep package explorer to the cloud c3a2eb6
@TimLovellSmith dotnetjunky roll back change to avoid breaking unit tests. 2e89c5d
@anurse @TimLovellSmith anurse Added Tweet button to package display page a5b71b3
@anurse @TimLovellSmith anurse Added support for storing ELMAH logs in Azure Table Storage 69bb99c
@anurse @TimLovellSmith anurse Cleaned up some testing code added in elmahazure branch 4d81b97
@anurse @TimLovellSmith anurse Fixed web.config merge issues 6575f27
@anurse @TimLovellSmith anurse Fixed error in packaging script which prevented account key being set…
… for

ELMAH logging
fd5e859
@anurse @TimLovellSmith anurse Fixed double-url problem in Tweet button db4f220
@drakomeep @TimLovellSmith drakomeep Package explorer to the cloud. b4446dd
@TimLovellSmith dotnetjunky Undo inadvertent changes to web.config fbefe97
@TimLovellSmith dotnetjunky Fix a bad merge in Routes.cs 50e311f
@anurse @TimLovellSmith anurse Fixed Share buttons to use Package-specific URL instead of
Version-specific URLs.
7149573
@TimLovellSmith TimLovellSmith ContainerBindings - make it successfully fall back and create a cache
even when Azure SDK is not installed.
(fixes: unhandled TypeInitializationException during startup)
84a3ab4
@TimLovellSmith TimLovellSmith Fixups to build and unit tests after rebasing Preview from master. 98c01c8
@TimLovellSmith TimLovellSmith Second half of fixing up build and unit tests after git rebase. f717ad2
@TimLovellSmith TimLovellSmith Restore the default Error logger to non-Azure dependent logger. Resto…
…re the formatting of web.config to VS autoformatted default.
c68a380
@drakomeep dotnetjunky Update the solution to using .NET 4.5 6df32e0
Luan Nguyen Merge pull request #641 from NuGet/net45preview
Update the solution to using .NET 4.5
5ad6c74
@anurse anurse Removed "via @nuget" from Tweet button 019cd36
dotnetjunky Update readme to require VS 2012 and Windows Azure SDK 1.8 3d3e227
Member

TimLovellSmith commented on 3d3e227 Nov 14, 2012

Do we really have a build dependency on Windows Azure SDK right now? I just checked out Preview and I seem to be able to build OK without Windows Azure SDK installed, thanks to the packages we are pulling in, I guess.

Member

TimLovellSmith replied Dec 6, 2012

OK, but that is only useful and required if you wish to deploy to Azure. Could add 'to enable building packages deployable to Azure' as clarification.

TimLovellSmith and others added some commits Nov 9, 2012

@TimLovellSmith TimLovellSmith Update gallery Website to depend on asp.net MVC 4. baa099e
@TimLovellSmith TimLovellSmith Remove old aspnet NuGet packages obsoleted by MVC4. 6438119
@TimLovellSmith TimLovellSmith Use new package version MvcHaacked.Ajax.MVC4. f69c87f
@TimLovellSmith TimLovellSmith Introduce a variable to workaround an issue with the RAZR code genera…
…tion which was generating an invalid lambda statement found while updating to MVC4.
278947a
@TimLovellSmith TimLovellSmith Adding app.config binding redirects for Facts project so that tests c…
…an pass after update to MVC4 while dependencies still reference MVC3.
e05fd86
@TimLovellSmith TimLovellSmith Fixup issues introduced by rebasing MVC4 branch. 8452be7
Luan Nguyen Merge pull request #642 from NuGet/MVC4
Update gallery Website to depend on asp.net MVC 4.
e17e819
dotnetjunky Update project to using Windows Azure Storage 2.0 library 2322971
dotnetjunky Sort using statements and rename ISimpleCloudBlob.cs ff60096
dotnetjunky Update the Microsoft.Odata.Data.Contrib package. 4c26f64
dotnetjunky Revert a commented code. efa8e9a
Luan Nguyen Merge pull request #649 from NuGet/MakeAsync
Update the project to using the latest WindowsAzure.Storage and Microsoft.Data.Odata packages.
dd3f4f3
dotnetjunky Fix the UploadPages deadlock issue. 755ce02
dotnetjunky Restore missing assembly references. 176c28a
Luan Nguyen Merge pull request #654 from NuGet/RestoreAssemblyRefPreview
Restore missing assembly references.
8b5af65
dotnetjunky Fix bug when a blog storage file doesn't exist. 79eff68
@johnataylor johnataylor Add NuGet Operation into PackageStatistics 9a06ac1
@johnataylor johnataylor fix units tests following add of NuGet-Operation 4ff81f2
dotnetjunky Update service implementations to using async APIs. a2f02bf
dotnetjunky Replace the cache service with local resource storage. 2193017
dotnetjunky Fix bug on Upload Package page which is caused by incorrect usage of …
…the GetBlobReferenceFromServer.
3ab4fea
@TimLovellSmith TimLovellSmith Search enhancement - make 'Indexing and Search' unit testable.
The first unit test is FAILing to find the word 'awesome' in the package description.
3973750
@TimLovellSmith TimLovellSmith Added a second search unit test, and converted LuceneIndexingService and
LuceneSearchService to use in-memory indexes during unit test runs.
4c4621c
@TimLovellSmith TimLovellSmith Some more unit tests of Search. 34a6a11
@TimLovellSmith TimLovellSmith Some fixups - namespaces and missing IPackageSource service for actua…
…lly running website.
d901593
@TimLovellSmith TimLovellSmith Introduced per field analyzer for purpose of better Title field token…
…ization. Motive - trying to get all my new tests to pass.
6eae8fd
@TimLovellSmith TimLovellSmith At last - all search tests passing! Time for initial review. 29d3a01
@TimLovellSmith TimLovellSmith Fix an unfortunate merge conflict in .csproj file. Either git or diff…
…merge is screwing me.
bbfe897
@TimLovellSmith TimLovellSmith Custom Query Parser done now just need to plug it in. 8a46b6f
@TimLovellSmith TimLovellSmith Finished integrating custom query parser and tests still pass.
But search such as 'id:NuGet assembly' results seem pretty random still.
3ebc0c4
@TimLovellSmith TimLovellSmith Search is ready for testing! Field specific searches should now work …
…great!
32e41a1
@TimLovellSmith TimLovellSmith Improve indexing and search algorithms to make searching for partial …
…Ids work better and for Id phrase searches to work.
7f58f3e
@TimLovellSmith TimLovellSmith Fix that we can't find NanoTube with title:nano. 9b4fd2a
@TimLovellSmith TimLovellSmith Deemphasize author field and fix null reference exception caused by u…
…sing stop words in the Query.
230edf5
@TimLovellSmith TimLovellSmith Refine the website UI so that clicking a tag or an author actually se…
…arches with Tags: and Author: search. Also refine the way search strings are presented so that quote marks used in searches are less confusing. And revert some temporary debugging changes.
b00732f
dotnetjunky Rename all 'Svc' to 'Service'. 8772440
dotnetjunky Rename all 'Repo' to 'Repository'. cba79f8
@TimLovellSmith TimLovellSmith Merge branch 'Preview' of https://github.com/NuGet/NuGetGallery into …
…Preview
146e3b5

@anurse anurse commented on the diff Dec 10, 2012

Website/Services/CloudBlobFileStorageService.cs
+ var container = GetContainer(folderName);
+ var blob = container.GetBlobReference(fileName);
+
+ var redirectUri = GetRedirectUri(httpContext, blob.Uri);
+ return new RedirectResult(redirectUri.OriginalString, false);
+ }
+
+ internal Uri GetRedirectUri(HttpContextBase httpContext, Uri blobUri)
+ {
+ var requestUrl = httpContext.Request.Url;
+ string host = String.IsNullOrEmpty(configuration.AzureCdnHost) ? blobUri.Host : configuration.AzureCdnHost;
+ var urlBuilder = new UriBuilder(requestUrl.Scheme, host)
+ {
+ Path = blobUri.LocalPath,
+ Query = blobUri.Query
+ };
@anurse

anurse Dec 10, 2012

Member

The indentation of the "{}" block seems odd...

Oh snap. I just Pranav'd Pranav!

Member

anurse commented Dec 10, 2012

:shipit:

jeffhandley and others added some commits Oct 3, 2012

@jeffhandley jeffhandley Fixes #602. Don't auto-curate packages with excluded dependencies. b052e4c
dotnetjunky Remove usage of TransactionScope and refactor the services to rely on…
… EntityFramework transaction from the SaveChanges() method.
ec7979d
@TimLovellSmith TimLovellSmith Update the searchid branch with changes suggested during code review …
…and offline by Pranav. Search no longer hits SQL!
b6b78f8
@TimLovellSmith TimLovellSmith Merge branch 'Preview' of https://github.com/NuGet/NuGetGallery into …
…Preview
1280a17
@TimLovellSmith TimLovellSmith One more CR fixup 7e537cc
dotnetjunky Fix bug with the Stream being closed before it is used. db93ba8
@TimLovellSmith TimLovellSmith Merge branch 'Preview' of https://github.com/NuGet/NuGetGallery into …
…Preview
af9ce66
@drakomeep @TimLovellSmith drakomeep Add package contents page. e8c72d6
@TimLovellSmith dotnetjunky [broken commit] Add controller action to return file content. 9a45ad0
@TimLovellSmith dotnetjunky Add file download. 3c93122
@TimLovellSmith dotnetjunky Change url to query string instead of url path to load forbidden paths. 0407bcf
@TimLovellSmith dotnetjunky Show image for image files. d242ba1
@TimLovellSmith dotnetjunky Fix downloading images. d258c7c
@TimLovellSmith dotnetjunky Reject requests for big packages. 60cca34
@TimLovellSmith dotnetjunky Add Azure Cache service and use it when running on Azure. 6937745
@TimLovellSmith dotnetjunky adjust cache to cache the binary files uninstall of the IPackage inst…
…ance.
37c8c64
@TimLovellSmith dotnetjunky MOdify build script to add stuff to web.config 0e39d7b
@TimLovellSmith dotnetjunky Add compress and cache service. f272c5b
@drakomeep @TimLovellSmith drakomeep [broken commit] package explorer to the cloud e6e9cb7
@TimLovellSmith dotnetjunky roll back change to avoid breaking unit tests. 590a511
@drakomeep @TimLovellSmith drakomeep [broken commit] Package explorer to the cloud. d670cbd
@TimLovellSmith dotnetjunky Fix a bad merge in Routes.cs 4760a10

Luan Nguyen and others added some commits Dec 15, 2012

Luan Nguyen Merge pull request #694 from NuGet/FixIndexBug
Fix bug where newly uploaded package is not indexed and hence does not a...
4469f17
@TimLovellSmith TimLovellSmith Fix #675 - Packages with .CS in the name are unreachable. ed46df9
@TimLovellSmith TimLovellSmith Verify clean 'git status' and remove App_Data folder before Package.p…
…s1 will actually do packaging.
b270056
@TimLovellSmith TimLovellSmith Fix package download count sorting to work by total download count fo…
…r package registration (which was accidentally regressed as part of search changes). Re-fix the null reference exception resulting from degenerate search queries and add unit test for the scenario. Also add unit tests for AnalysisHelperFacts since assumptions about its behavior were the indirect root cause of the bug.
8215dac
@TimLovellSmith TimLovellSmith Merge branch '690' into Preview b39c57d
@TimLovellSmith TimLovellSmith Merge branch '657' into Preview ef8a305
dotnetjunky Rename ICacheService to IPackageCacheService. 27ff20d
@TimLovellSmith TimLovellSmith Add a server side workaround for #674 to support NuGet 2.1 client. beb3154
@TimLovellSmith TimLovellSmith Fix the gallery not to spam people with 'your email address changed' …
…messages by sending to users with unconfirmed email addresses or by email in response to requests that include an invalid challenge token.
b7462e6
@TimLovellSmith TimLovellSmith Merge branch 'confirmationemail' into Preview e11e455
@TimLovellSmith TimLovellSmith Fix newly introduced null reference exception caught by unit tests. 5989e97
@TimLovellSmith TimLovellSmith Merge branch 'Fix674' into Preview d689346
dotnetjunky Fix CSS layout issue on the Package Contents page. 4eeb3fe
dotnetjunky Don't show upshell message in Chrome. Don't refresh content if clicki…
…ng on the same file.
fb5982b
dotnetjunky Add drop down option to select syntax scheme. fddf7dc
dotnetjunky Add unit tests for PackageFilesController. 79a5204
dotnetjunky Make changes per review. Also disable syntax highlighting for minifie…
…d JS files.
4e8fe1b
dotnetjunky Fix class name due to bad merge. 54c3c98
dotnetjunky Implement async file upload. 0dc8783
dotnetjunky Add cache service back. dca7a5d
dotnetjunky use cache service for async upload progress 26a0736
dotnetjunky clean up and fix bugs. f8fd672
dotnetjunky add unit test ef285c2
dotnetjunky Accept .ico file as image. c5348bf
Luan Nguyen Merge pull request #708 from NuGet/fixico
Package explorer: Accept .ico file as image.
1aac218
Luan Nguyen Merge pull request #706 from NuGet/UploadWithProgress
Show progress during package uploads
8ba4efa
dotnetjunky Fix FxCop warnings and treat FxCop warnings as errors. 5d4ff72
dotnetjunky Set FxCop rules as errors. f08369d
dotnetjunky Add unit tests for the Stats() method. Fix #707 220e692
dotnetjunky Add HttpContext to the code analysis dictionary. 2c84efc
dotnetjunky Uninstall Newtonsoft.Json package. d75d915
dotnetjunky Suppress an Fxcop issue which only happens in release build. 3968a48
dotnetjunky add robots.txt file to keep search engine at bay from Contens page. 3cbfb15
Luan Nguyen Merge pull request #712 from NuGet/noindex
add robots.txt file to keep search engine at bay from Contents page.
4eca611
@TimLovellSmith TimLovellSmith Fix the OData feed on preview which was a) throwing null refs b) miss…
…ing a whole lot of data in fields (now that they are coming from Lucene instead of the DB) causing a blank UI to show once the throwing thing was fixed. Removed PackageIndexEntity class as it wasn't pulling much weight.

Add unit test for driving the V2 feed using the Lucene Index!
Ensured unit tests passed.
336ac48
@TimLovellSmith TimLovellSmith Clean up redundant lines in Packageservice.cs 82c6765
dotnetjunky Fix bug whereby some legacy package has the package binary hosted ext…
…ernally. Fix some layout issue. #628
9c6477a
Luan Nguyen Merge pull request #732 from NuGet/kinhln-fix_explorer_bug
Fix small bugs with package explorer page
6ba75cb
@drakomeep drakomeep Delete unused method. 6d117ed
@anurse anurse Moved SQL Connection String to IConfiguration and enabled Azure confi…
…guration as a config source.
16423ae
@anurse anurse Added settings to cscfg and switched to using Azure Storage Connection
Strings
b2b0bb2
@anurse anurse Moved Azure Cache Configuration to Code a6bedaa
@anurse anurse Added DbContextFactory to allow Migrations to construct Data Context. e5e9fb0
@anurse anurse Added ELMAH-Azure configuration stuff 8d85935
@anurse anurse Added some more descriptive comments c02a46b
@anurse anurse Made data cache factory readonly in CloudCacheService 2b118b6
@anurse anurse Refactored SecureString construction 58fa27e
@anurse anurse Changed EntitiesContext..ctor to take connection string instead of the
whole configuration object
250fd6e
@anurse anurse Enable debug by default and use Package script to disable it. a750430
@anurse anurse Changed configuration to ensure it will load settings live, allowing for
in-flight changes
aa8b0c3
@anurse anurse Fixed bug in HttpContextCache service that caused it to throw on Async
package upload.
29f622e
@anurse anurse Added prefix to appsettings used for Sql Connection Strings. 2795f14
@anurse anurse Luan was right! No /usectppackageformat for us :( b2a0ad3
@anurse anurse Modified emulator launch script to allow using arbitrary config file 4634e7d
@anurse anurse Removed accidentally-checked-in log file 2a1b846
@anurse anurse Set script to build Small VM service by default (for devs) 5088eac
@anurse anurse Added upload script to push package to blob storage
Added New-Configuration script to construct an Azure Configuration file
for a particular environment.
14ffc5c
@anurse anurse Changed Package scripts to inject RDP/SSL support if needed 5d0df15
@anurse anurse Updated upload script 47cc77d

anurse was assigned Jan 22, 2013

pranavkm and others added some commits Dec 18, 2012

@pranavkm @anurse pranavkm Removing RazorGenerator from gallery 20566e7
@TimLovellSmith TimLovellSmith Add a ReadOnlyMode to EntitiesContext - todo: wire this up to our ser…
…vice config somehow so that we can easily make config changes.
6b2ac2f
@johnataylor johnataylor added statistics pages 075679e
@johnataylor johnataylor include generated code 00233e4
@johnataylor johnataylor remove trailing whitespace d5efe36
@johnataylor johnataylor added statistics service for dependency injection e570c57
@johnataylor johnataylor fixed fxcop errors in statistics branch 29a2c80
@johnataylor johnataylor added blank connection string entry to web.config 8070701
@johnataylor johnataylor added xunit tests and txet on stats page ddba379
@johnataylor johnataylor clean up using statements 9a5489a
@johnataylor johnataylor code review and added async cc0d1d5
@johnataylor johnataylor remove local debug code 01fbef2
@johnataylor johnataylor refactor between controller and viewmodel cd23c90
@johnataylor johnataylor fix unit test break caused by refactoring 989e6c6
@johnataylor johnataylor fix unit tests 544d8a3
@johnataylor johnataylor changed routes and cleaned up usings 2e1b477
@johnataylor johnataylor moved aggregate stats from pages to stats 4183672
@TimLovellSmith TimLovellSmith Wire up ReadOnlyMode to web.config - but also hardcode it in certain …
…places where configuration doesn't really matter.
8550628
@TimLovellSmith TimLovellSmith Show a custom error page when an action requiring database writes fai…
…ls because we are in read-only.
b1b0c9a
@johnataylor johnataylor Fix up merge issues d3c1c1d
@TimLovellSmith TimLovellSmith Make App_Start robust to the database connection not working. With th…
…ese changes the nuget.org home page can load even though the database is offline. :)
7eeeb62
@TimLovellSmith TimLovellSmith Remove WorkItems and WorkItemCleanupJob now they are no longer needed. fc69ffb
@TimLovellSmith TimLovellSmith Add an error bar for nuget.org home page statistics just in case the …
…site is degraded due to SQL being down.
5132fcb

you can add a ctor overload that only takes the IStatisticsService

This should be renamed to TheTotalsAction

Member

jeffhandley commented on 4183672 Jan 22, 2013

Looking good

Member

johnataylor replied Jan 22, 2013

done

This culture detection/usage seems like something we would want to permeate all our controllers, can we do that concisely?

Member

johnataylor replied Jan 24, 2013

Sounds reasonable. Is there a specific case you have in mind?

@TimLovellSmith TimLovellSmith commented on the diff Jan 30, 2013

Website/Services/CloudBlobFileStorageService.cs
- return builder.Uri;
- }
- return blobUri;
+ internal ActionResult CreateDownloadFileActionResult(
+ HttpContextBase httpContext,
+ string folderName,
+ string fileName)
+ {
+ var container = GetContainer(folderName);
+ var blob = container.GetBlobReference(fileName);
+
+ var redirectUri = GetRedirectUri(httpContext, blob.Uri);
+ return new RedirectResult(redirectUri.OriginalString, false);
+ }
+
+ internal Uri GetRedirectUri(HttpContextBase httpContext, Uri blobUri)
@TimLovellSmith

TimLovellSmith Jan 30, 2013

Member

I don't really like that it introduces a dependency of CloudBlobFileStorageService on HttpContext. Could we just pass in the desired URI Scheme as the parameter instead?

@anurse

anurse Jan 30, 2013

Member

Yeah, that does sound better. I'm going to be merging this in (unless you have space on your plate :P) so I'll take a look at that.

Member

anurse commented Feb 5, 2013

Closing this and opening a new PR against dev.

anurse closed this Feb 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment