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

Read-only error on htpasswd file when addUser #148

Open
andreapigatto opened this issue May 1, 2024 · 0 comments
Open

Read-only error on htpasswd file when addUser #148

andreapigatto opened this issue May 1, 2024 · 0 comments

Comments

@andreapigatto
Copy link

andreapigatto commented May 1, 2024

Hi,
I installed successfully verdaccio via the helm chart provided but I'm facing a E500 when I try to run addUser command via terminal.
Checking the pod logs I see:
Error: EROFS: read-only file system, open '/verdaccio/storage/htpasswd'

I'm installing verdaccio as a subchart with these values:

verdaccio:
  configMap: |
    storage: /verdaccio/storage/data

    web:
      title: Verdaccio

    auth:
      htpasswd:
        file: /verdaccio/storage/htpasswd
        algorithm: bcrypt
        rounds: 10

    uplinks:
      npmjs:
        url: https://registry.npmjs.org/
        agent_options:
          keepAlive: true
          maxSockets: 40
          maxFreeSockets: 10

    packages:
      '@company/*':
        access: $authenticated
        publish: $authenticated
        unpublish: $authenticated
      '@*/*':
        access: $authenticated
        publish: $authenticated
        proxy: npmjs
      '**':
        access: $authenticated
        publish: $authenticated
        proxy: npmjs

    log: {type: stdout, format: pretty, level: http}
  secrets:
    htpasswd:
    - username: "verdaccio"
      password: "verdaccio"
  ingress:
    enabled: true
    className: "nginx"
    paths:
      - /
    extraPaths: [ ]
    hosts:
      - verdaccio.my-monorepo.com
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
    tls:
      - hosts:
          - verdaccio.my-monorepo.com
        secretName: verdaccio-tls

Verdaccio is running correctly at https://verdaccio.my-monorepo.com using certificate from cert-manager.
I'm able to login on the UI with the verdaccio user defined in values above.

When I try to run addUser to add a user I get the error I mentioned above.

Checking the deployment.yaml template file of the chart I saw this:

...
      - mountPath: /verdaccio/storage/htpasswd
        name: htpasswd
        subPath: htpasswd
        readOnly: true
...

I'm guessing if that readOnly:true can be the issue preventing to update the file and add new users.
That property seems not possible to overwrite via values but hardcoded on the code of the template.

Am I missing something?
I'm not that experienced with npm registry and htpasswd. Is there a way to retrieve from the verdaccio user used for the UI the token for the .npmrc file? So that I can use the same user for UI and on .npmrc for publishing packages?

In any case add multiple users to be used in verdaccio seems a must have feature. Any ideas how to solve?

Thanks!

@andreapigatto andreapigatto changed the title Read-only error when addUser Read-only error on htpasswd file when addUser May 1, 2024
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

1 participant