Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push error 401 (Unauthorized) #22

Open
lpyedge opened this issue Sep 19, 2019 · 6 comments
Open

push error 401 (Unauthorized) #22

lpyedge opened this issue Sep 19, 2019 · 6 comments

Comments

@lpyedge
Copy link

lpyedge commented Sep 19, 2019

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
Copy link
Author

lpyedge commented Sep 19, 2019

why it ask me input username & password??

@ljsnogard
Copy link

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).

@jsiedentop
Copy link

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

@rasputino
Copy link

rasputino commented Jun 29, 2020

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

@gluckez
Copy link

gluckez commented Jan 29, 2022

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

@timrabl
Copy link

timrabl commented May 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants