helm / chartmuseum

helm chart repository server
https://chartmuseum.com
Apache License 2.0
3.61k stars 402 forks source link

Helm ChartMuseum Login | /v2/ | 404 Not Found #793

Open IfrKonv opened 1 day ago

IfrKonv commented 1 day ago

Hello, I've installed ChartMuseum version 0.16.2 via Docker, with these configurations:

version: '3.8'
services:
  chartmuseum:
    image: ghcr.io/helm/chartmuseum:v0.16.2
    ports:
      - "8080:8080"
    environment:
      - DEBUG=1
      - STORAGE=local
      - STORAGE_LOCAL_ROOTDIR=/charts
      - BASIC_AUTH_USER=myuser
      - BASIC_AUTH_PASS=mypass
    volumes:
      - /opt/docker-volumes/charts:/charts

I've exposed the service via HTTP with Nginx, and when I try to add the repo to Helm, I get:

$ helm registry login https://my.agency.com
Username: myuser
Password: 
Error: login attempt to https://my.agency.com/v2/ failed with status: 404 Not Found
$ 

the logs:

2024-11-30T15:59:15.942Z        DEBUG   [22] Incoming request: /v2/     {"reqID": "b26a1927-a97e-401c-904f-dd6b4f245443"}
2024-11-30T15:59:15.943Z        WARN    [22] Request served     {"path": "/v2/", "comment": "", "clientIP": "10.0.0.2", "method": "GET", "statusCode": 404, "latency": "274.368µs", "reqID": "b26a1927-a97e-401c-904f-dd6b4f245443"}
2024-11-30T15:59:16.359Z        DEBUG   [23] Incoming request: /v2/     {"reqID": "787fd8ae-d19d-488f-8684-b46665bea17e"}
2024-11-30T15:59:16.359Z        WARN    [23] Request served     {"path": "/v2/", "comment": "", "clientIP": "10.0.0.2", "method": "GET", "statusCode": 404, "latency": "41.738µs", "reqID": "787fd8ae-d19d-488f-8684-b46665bea17e"}

Could someone tell me what I'm doing wrong? I really can't figure out where the error is, it seems all correct. I've also tried a direct curl and it works:

$ curl --user "myuser:mypass" https://my.agency.com/index.yaml
apiVersion: v1
entries: {}
generated: "2024-11-30T15:29:27Z"
serverInfo: {}

I've also tried to install the cm-push plugin, but obviously it asks me to log in first. I thank in advance anyone who can provide some information to help me. Regards

IfrKonv commented 1 day ago

Update

I have simply added a rule in Nginx that rewrites /v2/ to the base path, and everything is working fine.

    location / {
        proxy_pass http://192.168.x.y:8080/;
    }

    location /v2/ {
        proxy_pass http://192.168.x.y:8080/;
    }

At this moment, I don’t know if everything works perfectly, but my question is: how is this procedure documented?

I hope this can help someone.