liget icon indicating copy to clipboard operation
liget copied to clipboard

push error 401 (Unauthorized)

Open lpyedge opened this issue 4 years ago • 6 comments

dotnet nuget push CouchbaseNetClient.2.7.4.1.nupkg --source http://192.168.0.11:9011/api/v3/index.json --api-key xxxxxxx info : 正在将 CouchbaseNetClient.2.7.4.1.nupkg 推送到 'http://192.168.0.11:9011/api/v2/package'... info : PUT http://192.168.0.11:9011/api/v2/package/ info : Unauthorized http://192.168.0.11:9011/api/v2/package/ 255 毫秒 error: Response status code does not indicate success: 401 (Unauthorized).

lpyedge avatar Sep 19 '19 05:09 lpyedge

why it ask me input username & password??

lpyedge avatar Sep 19 '19 07:09 lpyedge

Encountered the same error as above.

Steps to reproduce:

  1. Generate API key hash.
$ echo -n 'AB' | sha256sum
38164fbd17603d73f696b8b4d72664d735bb6a7c88577687fd2ae33fd6964153  -
  1. Launch.
$ LIGET_API_KEY_HASH=38164fbd17603d73f696b8b4d72664d735bb6a7c88577687fd2ae33fd6964153 docker run -d -ti -p 9011:9011 tomzo/liget:1.0.3
bf886e9a61ded7c8cb8647d7e28d4c651399474567936c27a71cd91e93afa391
  1. Push package.
$ dotnet nuget push myXxxPackage.nupkg --source http://xxxxx:9011/api/v3/index.json --api-key AB 

info : Pushing myXxxPackage.nupkg  to 'http://xxxxx:9011/api/v2/package'...
info :   PUT http://xxxxx:9011/api/v2/package/
info :   Unauthorized http://xxxxx:9011/api/v2/package/ 737ms
error: Response status code does not indicate success: 401 (Unauthorized).

ljsnogard avatar Nov 05 '19 03:11 ljsnogard

I have the same problem. Didn't get it to work.

jsiedentop avatar May 09 '20 07:05 jsiedentop

The LIGET_API_KEY_HASH should be set in the container. Something like this:

docker run -d --name=liget --mount source=datasimple2,destination=/data/simple2 --mount source=datasqlite,destination=/data/ef.sqlite --mount=source=cachesimple2,destination=/cache/simple2 -ti -p 9011:9011 -e LIGET_API_KEY_HASH='a43d9da1b01b33e1ee917af34006ad529890f13a3a5ad88a0dxxxxxxxxxxxxxx' tomzo/liget

rasputino avatar Jun 29 '20 07:06 rasputino

Is this just not working and no longer maintained? this issue has been open since 2020, and I'm having the exact same problem

gluckez avatar Jan 29 '22 20:01 gluckez

Is this just not working and no longer maintained? this issue has been open since 2020, and I'm having the exact same problem

@gluckez Authorization is working as intended, just generate ur hash with:

echo -n <UR PASSWORD HERE> | sha256sum | awk '{print toupper($1)}'

Afterwards set ur environment variable via the command mentioned by @rasputino or use the following

docker run -d -v data:/data/simple2 -v db:/data/ef.sqlite -v cache:/cache/simple2 -p 9011:9011 -e LIGET_API_KEY_HASH=<UR HASH HERE> tomzo/liget:1.0.3

timrabl avatar May 27 '22 06:05 timrabl