mkuchin / docker-registry-web

Web UI for private docker registry v2
https://hub.docker.com/r/hyper/docker-registry-web/
GNU General Public License v2.0
533 stars 133 forks source link

Add htpasswd auth support #71

Open jostyee opened 7 years ago

jostyee commented 7 years ago

Tried to add below in registry-web.yml:

  auth:
    # Enable authentication
    enabled: true
    htpasswd:
      realm: corp-realm
      path: /auth/htpasswd

then run container using:

docker run -v $(pwd)/auth:/auth \
           -v $(pwd)/registry-web.yml:/conf/config.yml:ro \
           -v $(pwd)/db:/data \
           -d -p 8080:8080 --link registry-srv --name registry-web hyper/docker-registry-web 

web app started successfully but couldn't login:

Sorry, we were not able to find a user with that username and password.

docker logs:

2016-12-30 09:11:50,786 [localhost-startStop-1] INFO  web.ConfigService  - [environmentProperties, localProperties]
2016-12-30 09:11:50,796 [localhost-startStop-1] INFO  web.ConfigService  - resolved config:
2016-12-30 09:11:50,798 [localhost-startStop-1] INFO  web.ConfigService  - registry.url: http://registry-srv:5000/v2
2016-12-30 09:11:50,799 [localhost-startStop-1] INFO  web.ConfigService  - registry.auth.key: /config/auth.key
2016-12-30 09:11:50,799 [localhost-startStop-1] INFO  web.ConfigService  - registry.readonly: false
2016-12-30 09:11:50,799 [localhost-startStop-1] INFO  web.ConfigService  - registry.auth.htpasswd.realm: corp-realm
2016-12-30 09:11:50,799 [localhost-startStop-1] INFO  web.ConfigService  - registry.trust_any_ssl: false
2016-12-30 09:11:50,799 [localhost-startStop-1] INFO  web.ConfigService  - registry.basic_auth:
2016-12-30 09:11:50,800 [localhost-startStop-1] INFO  web.ConfigService  - registry.auth.enabled: true
2016-12-30 09:11:50,800 [localhost-startStop-1] INFO  web.ConfigService  - registry.context_path:
2016-12-30 09:11:50,800 [localhost-startStop-1] INFO  web.ConfigService  - registry.auth.issuer: test-issuer
2016-12-30 09:11:50,800 [localhost-startStop-1] INFO  web.ConfigService  - registry.auth.htpasswd.path: /auth/htpasswd
2016-12-30 09:11:50,801 [localhost-startStop-1] INFO  web.ConfigService  - registry.auth.allow_anonymous: true
2016-12-30 09:11:50,801 [localhost-startStop-1] INFO  web.ConfigService  - registry.name: localhost:5000
2016-12-30 09:11:50,803 [localhost-startStop-1] INFO  conf.BootStrap  - auth enabled: true
Dec 30, 2016 9:11:50 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 30, 2016 9:11:50 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 41304 ms
2016-12-30 09:12:57,312 [http-bio-8080-exec-4] WARN  userdetails.GormUserDetailsService  - User not found: dev
PedroMD commented 7 years ago

Can't get it to work with basic auth as well... I didn't even find documentation regarding this, so where did you find information for that registry-web.yml, @jostyee ?

luozhihua commented 5 years ago

Same issues.

2801651942 commented 5 years ago

same issues

osangu commented 3 months ago

Did htpasswd still not supported?