jc21 / docker-registry-ui

😎 A nice web interface for managing your Docker Registry images
MIT License
324 stars 71 forks source link

Error connecting to registry over HTTP #1

Closed msnelling closed 6 years ago

msnelling commented 6 years ago

I'm running this UI in Kubernetes 1.10 connecting to our private registry in the same cluster and getting the below error.

WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
2018-04-17T09:57:13.375Z - info: PID 6 listening on port 80 ...
2018-04-17T09:57:13.379Z - info: Registry Host: image-registry:5000
warn: Error: write EPROTO 139648476564296:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:825:
     at _errnoException (util.js:1031:13)
    at WriteWrap.afterWrite [as oncomplete] (net.js:873:14)
warn: Error: write EPROTO 139648476564296:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:825:
     at _errnoException (util.js:1031:13)
    at WriteWrap.afterWrite [as oncomplete] (net.js:873:14)

Our private registry is running with HTTP and I have successfully used this project to connect as a UI without issue https://github.com/snagles/docker-registry-manager

Below are the environment variables I'm using (excuse the Kubernetes syntax).

            containers:
            - name: image-registry-ui
              image: jc21/registry-ui
              env:
              - name: REGISTRY_HOST
                value: image-registry:5000
              - name: REGISTRY_SSL
                value: "false"
              - name: REGISTRY_STORAGE_DELETE_ENABLED
                value: "true"
              - name: REGISTRY_DOMAIN
                value: registry.example.com
              ports:
              - containerPort: 80
                name: http
                protocol: TCP
msnelling commented 6 years ago

Ok, I solved this myself. The problem is with specifying the REGISTRY_SSL=false environment variable, the code is actually just checking whether the variable is set or not (which I have to say isn't particularly intuitive since the docs say to specify true to use SSL so it's not unreasonable to expect false to not use SSL).

jc21 commented 6 years ago

Yeah I was just mirroring the variable and it's use from the official docker registry. I probably should check the string value..