christianhuth / helm-charts

Helm Charts for various Applications: https://charts.christianhuth.de
MIT License
32 stars 17 forks source link

umami - 403 error on password change + 401 on team creation #1097

Open mrvnklm opened 2 months ago

mrvnklm commented 2 months ago

I installed the chart without any customizations and I am getting an 403 error if I want to change the default users password and 401 error if I want to create a team. I also tried CLOUD_MODE: 0 and use DISABLE_LOGIN: 0.

christianhuth commented 2 weeks ago

Thanks for reporting this bug. Can you provide the version of the Helm Chart and the used values.yaml please.

ERPedersen commented 3 days ago

TL;DR: If you want to disable an environment variable, you can set it to an empty string.


I ran into the same error, and spent some time debugging this.


If we look at the function canCreateWebsite, it checks for the following:

if (cloudMode) { 
  return !!grant?.find(a => a === PERMISSIONS.websiteCreate);
}

Meaning that if you set cloudMode to "0", this will happen:

if ("0") { // true 
  return !!grant?.find(a => a === PERMISSIONS.websiteCreate);
}

But if you set cloudMode to "", this will happen:

if ("") { // false 
  return !!grant?.find(a => a === PERMISSIONS.websiteCreate);
}

So to fix this issue, you can set the variables to "" if you want to make them effectively falsey in the code.

To me it doesn't seem like these boolean environment variables should be quoted, and it gives the opposite behaviour:

{{- if .Values.umami.cloudMode }}
 - name: CLOUD_MODE
   value: {{ .Values.umami.cloudMode | quote }}
{{- end }}