emgarten / Sleet

A static nuget feed generator for Azure Storage, AWS S3, and more.
MIT License
362 stars 43 forks source link

dotnet command line issues http request that are not handled by sleet #73

Closed theladyjaye closed 5 years ago

theladyjaye commented 5 years ago

So I setup my S3 bucket, used sleet to upload my packages and verified that the bucket is populated after the push operation.

I also added a CloudFront distribution and auth handling (which I have temporarily disabled). With it enabled, I can successfully use Basic Auth and hit the index.json and get a response from my CloudFront Address

Now when I run something like:

 dotnet list package | awk '{print $2}' | grep <PackagePrefix> | xargs -n1 dotnet add package -v $(date +'%Y.%-m.%-d')-* -s https://<uniqueid>.cloudfront.net

So I can en masse update my internal packages (calver'd so the date thing works)

I see output like then when it goes to find the package from the provided source:

GET https://<uniqueid>.cloudfront.net/FindPackagesById()?id='My.Package'&semVerLevel=2.0.0

If I try to fetch that same address, I get a 404 so the dotnet add package command fails. or I let the command run and get this for every package:

error: Failed to retrieve information about 'My.Package' from remote source 'https://<uniqueid>.cloudfront.net/FindPackagesById()?id='My.Package'&semVerLevel=2.0.0'.
error: Response status code does not indicate success: 404 (Not Found).

I should also note that attempting to run this from Visual Studio Mac also fails in the same way

Am I missing something in my setup?

My sleet.json is as follows:

{
  "username": "",
  "useremail": "",
  "sources": [
    {
      "name": "feed",
      "type": "s3",
      "baseURI": "https://<uniqueid>.cloudfront.net",
      "bucketName": "<bucket name>",
      "region": "us-west-2",
      "profileName": "<aws profile>"
    }
  ]
}
theladyjaye commented 5 years ago

Ah.. ok I see an issue.. Visual Studio Thinks it's a V2 not a V3 NuGet manifest

theladyjaye commented 5 years ago

YEP! That was it.. I DEFINITELY needed to be adding that /index.json into the source path =) to make it understand it's V3