Victor Van Doom
Victor Van Doom

Reputation: 103

Verdaccio User Registration Disabled

I am trying to deploy Verdaccio to my kubernetes cluster to use as shared registry for my other components. My Problem is, that I cannot seem to get it to properly let my authenticate. I use the most recent Helm-Chart for deployment. The configuration allows no registrations and expects authentication.

    # This is the config file used for the docker images.
    # It allows all users to do anything, so don't use it on production systems.
    #
    # Do not configure host and port under `listen` in this file
    # as it will be ignored when using docker.
    # see https://github.com/verdaccio/verdaccio/blob/master/docs/docker.md#docker-and-custom-port-configuration
    #
    # Look here for more config file examples:
    # https://github.com/verdaccio/verdaccio/tree/master/conf
    #

    # path to a directory with all packages
    storage: /verdaccio/storage/data

    web:
      # WebUI is enabled as default, if you want disable it, just uncomment this line
      #enable: false
      title: DiPlom NPM Registry - Verdaccio

    auth:
      htpasswd:
        file: /verdaccio/storage/htpasswd
        # Maximum amount of users allowed to register, defaults to +infinity.
        # You can set this to -1 to disable registration.
        max_users: -1

    # a list of other known repositories we can talk to
    uplinks:
      npmjs:
        url: https://registry.npmjs.org/

    packages:
      '@*/*':
        # scoped packages
        access: $authenticated
        publish: $authenticated
        # proxy: npmjs

      '**':
        # allow all users (including non-authenticated users) to read and
        # publish all packages
        #
        # you can specify usernames/groupnames (depending on your auth plugin)
        # and three keywords: $all, $anonymous, $authenticated
        access: $authenticated

        # allow all known users to publish packages
        # (anyone can register by default, remember?)
        publish: $authenticated

        # if package is not available locally, proxy requests to 'npmjs' registry
        # proxy: npmjs

    # To use `npm audit` uncomment the following section
    middlewares:
      audit:
        enabled: true

    # log settings
    logs:
      - {type: stdout, format: pretty, level: http}
      #- {type: file, path: verdaccio.log, level: info}

I need to get user-credentials to obtain the corresponding Token so I can push and pull from the registry. However, so far nothing I entered into the HTPasswd file worked. I've looked through the issues on GitHub and a few tips how to generate the HTPasswd entry, but so far no success. When I try to login via npm login, I get the following response:

npm ERR! code E409
npm ERR! 409 Conflict - PUT http://<IngressURL>/-/user/org.couchdb.user:admin - user registration disabled

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/<USR>/.npm/_logs/2021-08-13T10_23_30_382Z-debug.log

I then tried to configure the server to allow registrations by changing max_users to 1. When running npm adduser I get the very same response. How am I supposed to use Verdaccio if there is no way to authenticate with the service? Or am I missing something? Thanks.

Update:

I've played around with various deployments (docker, compose, Minikube) and figured out, that the ingress, that is created by the helm chart, seems to be the problem here. Not sure what exactly is not working, but as soon as I manually expose the pod via node-port I can properly create a user.

Upvotes: 1

Views: 2956

Answers (0)

Related Questions