local system fs htpasswd validation auth
ngmariusz opened this issue · 2 comments
ngmariusz commented
Hi there
my idea is: custom docker container
i have tried dickeyxxx/npm-register and my custom one that i can easily debug
on each i see response from npm-register in the browser however can't get through login
- can you explain where to put htpasswd and is there any way to check if it see the file
for exaple for dickeyxxx/npm-register i should attach volume with file to
- $HOME
- /data
- / (root)
or ??
- maybe you could put example working oneliner with docker run dickeyxxx/npm-register and volumes
thanx!
my results:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'login',
1 verbose cli '--registry',
1 verbose cli 'http://192.168.16.2:3000' ]
2 info using npm@3.10.10
3 info using node@v6.9.5
4 verbose adduser before first PUT { _id: 'org.couchdb.user:im',
4 verbose adduser name: 'im',
4 verbose adduser password: 'XXXXX',
4 verbose adduser email: 'aa@aa.pl',
4 verbose adduser type: 'user',
4 verbose adduser roles: [],
4 verbose adduser date: '2017-02-15T03:38:10.085Z' }
5 verbose request uri http://192.168.16.2:3000/-/user/org.couchdb.user:im
6 verbose request new user, so can't send auth
7 info attempt registry request try #1 at 4:38:10 AM
8 verbose request id a470a9ff8ccfcdde
9 http request PUT http://192.168.16.2:3000/-/user/org.couchdb.user:im
10 http 401 http://192.168.16.2:3000/-/user/org.couchdb.user:im
11 verbose headers { vary: 'Accept-Encoding',
11 verbose headers 'content-type': 'application/json; charset=utf-8',
11 verbose headers 'content-length': '31',
11 verbose headers date: 'Wed, 15 Feb 2017 03:38:10 GMT',
11 verbose headers connection: 'keep-alive' }
12 verbose request invalidating /home/md/.npm/192.168.16.2_3000/-/user/org.couchdb.user_3Aim on PUT
13 verbose adduser back [ { Error: invalid credentials : -/user/org.couchdb.user:im
13 verbose adduser at makeError (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:302:12)
13 verbose adduser at CachingRegistryClient.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:290:14)
13 verbose adduser at Request._callback (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:210:14)
13 verbose adduser at Request.self.callback (/usr/lib/node_modules/npm/node_modules/request/request.js:187:22)
13 verbose adduser at emitTwo (events.js:106:13)
13 verbose adduser at Request.emit (events.js:191:7)
13 verbose adduser at Request.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:1048:10)
13 verbose adduser at emitOne (events.js:96:13)
13 verbose adduser at Request.emit (events.js:188:7)
13 verbose adduser at IncomingMessage.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:969:12) statusCode: 401, code: 'E401' },
13 verbose adduser { error: 'invalid credentials' },
13 verbose adduser '{"error":"invalid credentials"}' ]
14 warn adduser Incorrect username or password
14 warn adduser You can reset your account by visiting:
14 warn adduser
14 warn adduser https://npmjs.org/forgot
15 verbose stack Error: invalid credentials : -/user/org.couchdb.user:im
15 verbose stack at makeError (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:302:12)
15 verbose stack at CachingRegistryClient.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:290:14)
15 verbose stack at Request._callback (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:210:14)
15 verbose stack at Request.self.callback (/usr/lib/node_modules/npm/node_modules/request/request.js:187:22)
15 verbose stack at emitTwo (events.js:106:13)
15 verbose stack at Request.emit (events.js:191:7)
15 verbose stack at Request.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:1048:10)
15 verbose stack at emitOne (events.js:96:13)
15 verbose stack at Request.emit (events.js:188:7)
15 verbose stack at IncomingMessage.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:969:12)
16 verbose statusCode 401
17 verbose cwd /opt/innovativemedia/dockers/npm_register/npm_register
18 error Linux 4.4.0-62-generic
19 error argv "/usr/bin/nodejs" "/usr/bin/npm" "login" "--registry" "http://192.168.16.2:3000"
20 error node v6.9.5
21 error npm v3.10.10
22 error code E401
23 error invalid credentials : -/user/org.couchdb.user:im
24 error If you need help, you may report this error at:
24 error <https://github.com/npm/npm/issues>
25 verbose exit [ 1, true ]
ngmariusz commented
also tried with working dir
docker exec npm_register "ls"
CHANGELOG.md
Dockerfile
LICENSE
README.md
app.json
bin
circle.yml
config.js
htpasswd
lib
logger.js
middleware
node_modules
package.json
public
routes
s3_bucket_policy.json
server.js
start.js
test
Roam-Cooper commented
The htpasswd file must be located at ./tmp/htpasswd
In the directory that you're going to run npm-register from, do
mkdir tmp
htpasswd -nB username >> tmp/htpasswd
npm-register start
The documentation for this project is terrible.