diff --git a/charts/headscale/Chart.yaml b/charts/headscale/Chart.yaml index 0b06bb64e..5bf98fb49 100644 --- a/charts/headscale/Chart.yaml +++ b/charts/headscale/Chart.yaml @@ -4,7 +4,7 @@ description: An open source, self-hosted implementation of the Tailscale control home: https://charts.gabe565.com/charts/headscale icon: https://raw.githubusercontent.com/juanfont/headscale/56a7b1e34952c3e0306a134b2be9b4277f5d8d6e/docs/logo/headscale3-dots.svg type: application -version: 0.9.1 +version: 0.9.2 # renovate datasource=docker depName=ghcr.io/juanfont/headscale appVersion: 0.21.0 kubeVersion: ">=1.22.0-0" @@ -28,3 +28,5 @@ annotations: artifacthub.io/changes: |- - kind: changed description: Don't overwrite config if already exists. Envs are still suggested, but not required anymore. + - kind: changed + description: Set path envs to the value of `.persistence.config.mountPath` instead of hardcoding diff --git a/charts/headscale/README.md b/charts/headscale/README.md index b9eb29498..136aa9025 100644 --- a/charts/headscale/README.md +++ b/charts/headscale/README.md @@ -2,7 +2,7 @@ headscale logo -![Version: 0.9.1](https://img.shields.io/badge/Version-0.9.1-informational?style=flat) +![Version: 0.9.2](https://img.shields.io/badge/Version-0.9.2-informational?style=flat) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat) ![AppVersion: 0.21.0](https://img.shields.io/badge/AppVersion-0.21.0-informational?style=flat) diff --git a/charts/headscale/templates/common.yaml b/charts/headscale/templates/common.yaml index c3fb4bf0f..236a0fc6e 100644 --- a/charts/headscale/templates/common.yaml +++ b/charts/headscale/templates/common.yaml @@ -5,20 +5,23 @@ args: ["headscale", "serve"] initContainers: config: image: alpine + env: + - name: CONFIG_DIR + value: {{ .Values.persistence.config.mountPath }} volumeMounts: {{- if .Values.persistence.config.enabled }} - name: config - mountPath: /etc/headscale + mountPath: {{ .Values.persistence.config.mountPath }} {{- end }} command: - sh - -c - | - if [[ -f '/etc/headscale/config.yaml' ]]; then + if [[ -f "$CONFIG_DIR/config.yaml" ]]; then echo 'Config already exists' >&2 else echo 'Writing empty config' >&2 - cat <<- 'EOF' >/etc/headscale/config.yaml + cat <<- 'EOF' >"$CONFIG_DIR/config.yaml" # It's suggested to use environment variables to configure Headscale. # For config reference, see https://github.com/juanfont/headscale/blob/main/config-example.yaml # To configure any of these as an env: @@ -43,9 +46,9 @@ env: HEADSCALE_METRICS_LISTEN_ADDR: "0.0.0.0:{{ .metrics.port }}" {{- end }} - HEADSCALE_PRIVATE_KEY_PATH: "/etc/headscale/private.key" + HEADSCALE_PRIVATE_KEY_PATH: "{{ .Values.persistence.config.mountPath }}/private.key" HEADSCALE_NOISE: "{}" - HEADSCALE_NOISE_PRIVATE_KEY_PATH: "/etc/headscale/noise_private.key" + HEADSCALE_NOISE_PRIVATE_KEY_PATH: "{{ .Values.persistence.config.mountPath }}/noise_private.key" HEADSCALE_IP_PREFIXES: "fd7a:115c:a1e0::/48 100.64.0.0/10" @@ -72,7 +75,7 @@ env: key: {{ if not .auth.password }}postgres-{{ end }}password {{- else }} HEADSCALE_DB_TYPE: "sqlite3" - HEADSCALE_DB_PATH: "/etc/headscale/db.sqlite" + HEADSCALE_DB_PATH: "{{ $.Values.persistence.config.mountPath }}/db.sqlite" {{- end }} {{- end }} {{- end -}}