From 308ba8accf2f9908d8231ce5bb7d6c419beaf653 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Mon, 4 Oct 2021 12:31:56 +0200 Subject: [PATCH] (feat) Dynamically set PGID, GID and GROUP_ID (#1091) * base PGID on fsGroup * also remove PGID from questions.yaml * remove mistake * small fix * fix first test * fix linting * always set PUID to 568 * use quotes for env vars (obviously) --- charts/library/common/Chart.yaml | 2 +- .../lib/controller/_autopermissions.yaml | 7 +- .../templates/lib/controller/_container.tpl | 6 ++ charts/stable/airsonic/SCALE/questions.yaml | 7 +- charts/stable/airsonic/values.yaml | 6 +- charts/stable/bazarr/values.yaml | 2 +- charts/stable/booksonic-air/values.yaml | 6 +- .../stable/calibre-web/SCALE/questions.yaml | 7 +- charts/stable/calibre-web/values.yaml | 2 +- charts/stable/calibre/values.yaml | 6 +- charts/stable/custom-app/values.yaml | 2 +- .../stable/deepstack-cpu/SCALE/ix_values.yaml | 2 +- .../stable/deepstack-cpu/SCALE/questions.yaml | 7 +- charts/stable/deepstack-cpu/values.yaml | 6 +- charts/stable/deluge/SCALE/questions.yaml | 7 +- charts/stable/dizquetv/values.yaml | 4 +- charts/stable/duplicati/values.yaml | 4 +- charts/stable/freshrss/SCALE/questions.yaml | 7 +- charts/stable/freshrss/values.yaml | 2 +- charts/stable/grocy/SCALE/questions.yaml | 7 +- charts/stable/grocy/values.yaml | 2 +- charts/stable/handbrake/SCALE/ix_values.yaml | 2 +- charts/stable/handbrake/SCALE/questions.yaml | 7 +- charts/stable/handbrake/values.yaml | 6 +- charts/stable/heimdall/SCALE/questions.yaml | 7 +- charts/stable/heimdall/values.yaml | 2 +- .../home-assistant/SCALE/questions.yaml | 7 +- charts/stable/hyperion-ng/values.yaml | 4 +- charts/stable/jackett/values.yaml | 2 +- .../stable/jdownloader2/SCALE/ix_values.yaml | 2 +- charts/stable/jdownloader2/values.yaml | 6 +- charts/stable/kms/SCALE/questions.yaml | 7 +- .../stable/lazylibrarian/SCALE/questions.yaml | 7 +- charts/stable/lazylibrarian/values.yaml | 2 +- charts/stable/librespeed/values.yaml | 6 +- charts/stable/lidarr/values.yaml | 2 +- charts/stable/lychee/SCALE/questions.yaml | 7 +- charts/stable/lychee/values.yaml | 2 +- charts/stable/mylar/values.yaml | 4 +- charts/stable/nzbhydra/values.yaml | 2 +- charts/stable/ombi/values.yaml | 2 +- charts/stable/organizr/SCALE/questions.yaml | 7 +- charts/stable/organizr/values.yaml | 2 +- charts/stable/oscam/values.yaml | 7 +- charts/stable/pyload/values.yaml | 4 +- charts/stable/qbittorrent/values.yaml | 2 +- charts/stable/radarr/values.yaml | 2 +- charts/stable/readarr/values.yaml | 2 +- charts/stable/resilio-sync/values.yaml | 6 +- charts/stable/sabnzbd/values.yaml | 2 +- charts/stable/sonarr/values.yaml | 2 +- charts/stable/tautulli/values.yaml | 2 +- charts/stable/transmission/values.yaml | 2 +- .../stable/truecommand/SCALE/questions.yaml | 7 +- charts/stable/truecommand/values.yaml | 2 +- charts/stable/tvheadend/SCALE/questions.yaml | 7 +- charts/stable/tvheadend/values.yaml | 1 - charts/stable/unifi/SCALE/ix_values.yaml | 2 +- charts/stable/unifi/SCALE/questions.yaml | 7 +- charts/stable/unifi/values.yaml | 6 +- charts/stable/unpackerr/values.yaml | 2 +- tests/library/common/autoPermissions_spec.rb | 31 --------- tests/library/common/container_spec.rb | 66 +++++++++---------- 63 files changed, 117 insertions(+), 241 deletions(-) diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index a6bc6a6adbb..8de91c8a29a 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 8.1.1 +version: 8.2.0 diff --git a/charts/library/common/templates/lib/controller/_autopermissions.yaml b/charts/library/common/templates/lib/controller/_autopermissions.yaml index fc3fe730d81..d10db4a9494 100644 --- a/charts/library/common/templates/lib/controller/_autopermissions.yaml +++ b/charts/library/common/templates/lib/controller/_autopermissions.yaml @@ -3,12 +3,7 @@ This template serves as the blueprint for the mountPermissions job that is run before chart installation. */}} {{- define "common.controller.autopermissions" -}} - -{{- $group := 568 -}} -{{- if .Values.env -}} - {{- $group = dig "PGID" $group .Values.env -}} -{{- end -}} -{{- $group = dig "fsGroup" $group .Values.podSecurityContext -}} +{{- $group := .Values.podSecurityContext.fsGroup -}} {{- $hostPathMounts := dict -}} {{- range $name, $mount := .Values.persistence -}} {{- if and $mount.enabled $mount.setPermissions -}} diff --git a/charts/library/common/templates/lib/controller/_container.tpl b/charts/library/common/templates/lib/controller/_container.tpl index a6ed529df84..a37f2c9d171 100644 --- a/charts/library/common/templates/lib/controller/_container.tpl +++ b/charts/library/common/templates/lib/controller/_container.tpl @@ -35,6 +35,12 @@ {{- end }} env: + - name: PGID + value: {{ .Values.podSecurityContext.fsGroup | quote }} + - name: GROUP_ID + value: {{ .Values.podSecurityContext.fsGroup | quote }} + - name: GID + value: {{ .Values.podSecurityContext.fsGroup | quote }} {{- if or ( .Values.securityContext.readOnlyRootFilesystem ) ( .Values.securityContext.runAsNonRoot ) }} - name: S6_READ_ONLY_ROOT value: "1" diff --git a/charts/stable/airsonic/SCALE/questions.yaml b/charts/stable/airsonic/SCALE/questions.yaml index 05887f02dd3..d0342c769bb 100644 --- a/charts/stable/airsonic/SCALE/questions.yaml +++ b/charts/stable/airsonic/SCALE/questions.yaml @@ -85,12 +85,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/airsonic/values.yaml b/charts/stable/airsonic/values.yaml index edd326016e3..70dad87237a 100644 --- a/charts/stable/airsonic/values.yaml +++ b/charts/stable/airsonic/values.yaml @@ -27,9 +27,9 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1001" - # -- Specify the group ID the application will run as - PGID: "1001" + PUID: 568 + + # -- Used to set the base path for reverse proxies eg. /booksonic, /books, etc. CONTEXT_PATH: # "url-base" # -- For passing additional java options. For some reverse proxies, you may need to pass `JAVA_OPTS=-Dserver.use-forward-headers=true` for airsonic to generate the proper URL schemes. diff --git a/charts/stable/bazarr/values.yaml b/charts/stable/bazarr/values.yaml index fdfa7c85330..978184d0ac1 100644 --- a/charts/stable/bazarr/values.yaml +++ b/charts/stable/bazarr/values.yaml @@ -14,7 +14,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/booksonic-air/values.yaml b/charts/stable/booksonic-air/values.yaml index 5a191afe1de..e1d0639ba55 100644 --- a/charts/stable/booksonic-air/values.yaml +++ b/charts/stable/booksonic-air/values.yaml @@ -27,9 +27,9 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "568" - # -- Specify the group ID the application will run as - PGID: "568" + PUID: 568 + + # -- Used to set the base path for reverse proxies eg. /booksonic, /books, etc. # CONTEXT_PATH=url-base diff --git a/charts/stable/calibre-web/SCALE/questions.yaml b/charts/stable/calibre-web/SCALE/questions.yaml index 9cd08ad4871..24be2891e50 100644 --- a/charts/stable/calibre-web/SCALE/questions.yaml +++ b/charts/stable/calibre-web/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/calibre-web/values.yaml b/charts/stable/calibre-web/values.yaml index 5748a40707e..4d0c9b61e2e 100644 --- a/charts/stable/calibre-web/values.yaml +++ b/charts/stable/calibre-web/values.yaml @@ -22,7 +22,7 @@ service: env: {} # TZ: # PUID: - # PGID: + # UMASK: # DOCKER_MODS: diff --git a/charts/stable/calibre/values.yaml b/charts/stable/calibre/values.yaml index f073eca9f5a..77a6f4647e2 100644 --- a/charts/stable/calibre/values.yaml +++ b/charts/stable/calibre/values.yaml @@ -29,9 +29,9 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1001" - # -- Specify the group ID the application will run as - PGID: "1001" + PUID: 568 + + # -- Username for the calibre gui GUAC_USER: # -- Password's md5 hash for the calibre gui diff --git a/charts/stable/custom-app/values.yaml b/charts/stable/custom-app/values.yaml index 2340ceb0402..281526dec6b 100644 --- a/charts/stable/custom-app/values.yaml +++ b/charts/stable/custom-app/values.yaml @@ -30,7 +30,7 @@ serviceList: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/deepstack-cpu/SCALE/ix_values.yaml b/charts/stable/deepstack-cpu/SCALE/ix_values.yaml index 5f504dc656b..c4c19271355 100644 --- a/charts/stable/deepstack-cpu/SCALE/ix_values.yaml +++ b/charts/stable/deepstack-cpu/SCALE/ix_values.yaml @@ -12,7 +12,7 @@ image: envTpl: # Permissions Settings USER_ID: "{{ .Values.env.PUID }}" - GROUP_ID: "{{ .Values.env.PGID }}" + ## # Most other defaults are set in questions.yaml # For other options please refer to the wiki, default_values.yaml or the common library chart diff --git a/charts/stable/deepstack-cpu/SCALE/questions.yaml b/charts/stable/deepstack-cpu/SCALE/questions.yaml index 734ad1c7958..45abe3f5a36 100644 --- a/charts/stable/deepstack-cpu/SCALE/questions.yaml +++ b/charts/stable/deepstack-cpu/SCALE/questions.yaml @@ -86,12 +86,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/deepstack-cpu/values.yaml b/charts/stable/deepstack-cpu/values.yaml index c479288abe6..70ad8e50989 100644 --- a/charts/stable/deepstack-cpu/values.yaml +++ b/charts/stable/deepstack-cpu/values.yaml @@ -23,11 +23,11 @@ podSecurityContext: envTpl: # Permissions Settings USER_ID: "{{ .Values.env.PUID }}" - GROUP_ID: "{{ .Values.env.PGID }}" + env: - PUID: "568" - PGID: "568" + PUID: 568 + # TZ: UTC VISION-FACE: "True" VISION-DETECTION: "True" diff --git a/charts/stable/deluge/SCALE/questions.yaml b/charts/stable/deluge/SCALE/questions.yaml index 3e3f9a0f654..a2dbef8e064 100644 --- a/charts/stable/deluge/SCALE/questions.yaml +++ b/charts/stable/deluge/SCALE/questions.yaml @@ -85,12 +85,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/dizquetv/values.yaml b/charts/stable/dizquetv/values.yaml index de234ea822f..40f34bd4ee3 100644 --- a/charts/stable/dizquetv/values.yaml +++ b/charts/stable/dizquetv/values.yaml @@ -19,9 +19,7 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: 1001 - # -- Specify the group ID the application will run as - PGID: 1001 + PUID: 568 # -- Configures service settings for the chart. # @default -- See values.yaml diff --git a/charts/stable/duplicati/values.yaml b/charts/stable/duplicati/values.yaml index 7d3371a6528..537c2d95110 100644 --- a/charts/stable/duplicati/values.yaml +++ b/charts/stable/duplicati/values.yaml @@ -27,9 +27,7 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1000" - # -- Specify the group ID the application will run as - PGID: "1000" + PUID: 568 # -- Configures service settings for the chart. # @default -- See values.yaml diff --git a/charts/stable/freshrss/SCALE/questions.yaml b/charts/stable/freshrss/SCALE/questions.yaml index 56893a34679..c9701aafe93 100644 --- a/charts/stable/freshrss/SCALE/questions.yaml +++ b/charts/stable/freshrss/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/freshrss/values.yaml b/charts/stable/freshrss/values.yaml index 5787ada08a7..70482f141de 100644 --- a/charts/stable/freshrss/values.yaml +++ b/charts/stable/freshrss/values.yaml @@ -22,7 +22,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/grocy/SCALE/questions.yaml b/charts/stable/grocy/SCALE/questions.yaml index bec5cb19348..65e55a1bbdb 100644 --- a/charts/stable/grocy/SCALE/questions.yaml +++ b/charts/stable/grocy/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/grocy/values.yaml b/charts/stable/grocy/values.yaml index 3fae69ac951..39eda46a62c 100644 --- a/charts/stable/grocy/values.yaml +++ b/charts/stable/grocy/values.yaml @@ -22,7 +22,7 @@ service: env: {} # TZ: # PUID: - # PGID: + persistence: config: diff --git a/charts/stable/handbrake/SCALE/ix_values.yaml b/charts/stable/handbrake/SCALE/ix_values.yaml index 498baf6030e..228cfa8b508 100644 --- a/charts/stable/handbrake/SCALE/ix_values.yaml +++ b/charts/stable/handbrake/SCALE/ix_values.yaml @@ -13,7 +13,7 @@ image: envTpl: # Permissions Settings USER_ID: "{{ .Values.env.PUID }}" - GROUP_ID: "{{ .Values.env.PGID }}" + ## # Most other defaults are set in questions.yaml # For other options please refer to the wiki, default_values.yaml or the common library chart diff --git a/charts/stable/handbrake/SCALE/questions.yaml b/charts/stable/handbrake/SCALE/questions.yaml index cffe5a43767..3f7913c43c2 100644 --- a/charts/stable/handbrake/SCALE/questions.yaml +++ b/charts/stable/handbrake/SCALE/questions.yaml @@ -85,12 +85,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/handbrake/values.yaml b/charts/stable/handbrake/values.yaml index bee710aaa37..efa6dcc96ec 100644 --- a/charts/stable/handbrake/values.yaml +++ b/charts/stable/handbrake/values.yaml @@ -29,12 +29,12 @@ service: envTpl: # Permissions Settings USER_ID: "{{ .Values.env.PUID }}" - GROUP_ID: "{{ .Values.env.PGID }}" + env: # Permissions Settings - PUID: "568" - PGID: "568" + PUID: 568 + # General Settings KEEP_APP_RUNNING: "0" CLEAN_TMP_DIR: "1" diff --git a/charts/stable/heimdall/SCALE/questions.yaml b/charts/stable/heimdall/SCALE/questions.yaml index 8a3605b4cc7..7650ec3603c 100644 --- a/charts/stable/heimdall/SCALE/questions.yaml +++ b/charts/stable/heimdall/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/heimdall/values.yaml b/charts/stable/heimdall/values.yaml index f90e2c096f2..95d63b8f937 100644 --- a/charts/stable/heimdall/values.yaml +++ b/charts/stable/heimdall/values.yaml @@ -22,7 +22,7 @@ service: env: {} # TZ: # PUID: - # PGID: + probes: startup: diff --git a/charts/stable/home-assistant/SCALE/questions.yaml b/charts/stable/home-assistant/SCALE/questions.yaml index 9d3afb12707..3017c573bcb 100644 --- a/charts/stable/home-assistant/SCALE/questions.yaml +++ b/charts/stable/home-assistant/SCALE/questions.yaml @@ -100,12 +100,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/hyperion-ng/values.yaml b/charts/stable/hyperion-ng/values.yaml index e2d74568480..b6d7b437f9a 100644 --- a/charts/stable/hyperion-ng/values.yaml +++ b/charts/stable/hyperion-ng/values.yaml @@ -26,9 +26,7 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1001" - # -- Specify the group ID the application will run as - PGID: "1001" + PUID: 568 # -- Configures service settings for the chart. # @default -- See values.yaml diff --git a/charts/stable/jackett/values.yaml b/charts/stable/jackett/values.yaml index 615ae4732bf..122f89f5f01 100644 --- a/charts/stable/jackett/values.yaml +++ b/charts/stable/jackett/values.yaml @@ -28,7 +28,7 @@ probes: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/jdownloader2/SCALE/ix_values.yaml b/charts/stable/jdownloader2/SCALE/ix_values.yaml index 1f51f8ff5ca..befe89e14dc 100644 --- a/charts/stable/jdownloader2/SCALE/ix_values.yaml +++ b/charts/stable/jdownloader2/SCALE/ix_values.yaml @@ -13,7 +13,7 @@ image: envTpl: # Permissions Settings USER_ID: "{{ .Values.env.PUID }}" - GROUP_ID: "{{ .Values.env.PGID }}" + ## # Most other defaults are set in questions.yaml diff --git a/charts/stable/jdownloader2/values.yaml b/charts/stable/jdownloader2/values.yaml index e0a688f50bb..06dd598e50b 100644 --- a/charts/stable/jdownloader2/values.yaml +++ b/charts/stable/jdownloader2/values.yaml @@ -31,12 +31,12 @@ service: envTpl: # Permissions Settings USER_ID: "{{ .Values.env.PUID }}" - GROUP_ID: "{{ .Values.env.PGID }}" + env: # Permissions Settings - PUID: "568" - PGID: "568" + PUID: 568 + # General Settings KEEP_APP_RUNNING: "0" CLEAN_TMP_DIR: "1" diff --git a/charts/stable/kms/SCALE/questions.yaml b/charts/stable/kms/SCALE/questions.yaml index 8c0dca82dab..c900f5bfa10 100644 --- a/charts/stable/kms/SCALE/questions.yaml +++ b/charts/stable/kms/SCALE/questions.yaml @@ -76,12 +76,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/lazylibrarian/SCALE/questions.yaml b/charts/stable/lazylibrarian/SCALE/questions.yaml index 1c13ed00c51..e7f37746a5d 100644 --- a/charts/stable/lazylibrarian/SCALE/questions.yaml +++ b/charts/stable/lazylibrarian/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/lazylibrarian/values.yaml b/charts/stable/lazylibrarian/values.yaml index a8f90f0a5f8..faf6d42f755 100644 --- a/charts/stable/lazylibrarian/values.yaml +++ b/charts/stable/lazylibrarian/values.yaml @@ -21,7 +21,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/librespeed/values.yaml b/charts/stable/librespeed/values.yaml index 77901fba679..7ee5f6b4a1c 100644 --- a/charts/stable/librespeed/values.yaml +++ b/charts/stable/librespeed/values.yaml @@ -27,9 +27,9 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1001" - # -- Specify the group ID the application will run as - PGID: "1001" + PUID: 568 + + # PASSWORD: # CUSTOM_RESULTS: # DB_TYPE: diff --git a/charts/stable/lidarr/values.yaml b/charts/stable/lidarr/values.yaml index f306fe7ec90..71bafde1665 100644 --- a/charts/stable/lidarr/values.yaml +++ b/charts/stable/lidarr/values.yaml @@ -17,7 +17,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + probes: liveness: diff --git a/charts/stable/lychee/SCALE/questions.yaml b/charts/stable/lychee/SCALE/questions.yaml index 0c2233900a9..5920337f19d 100644 --- a/charts/stable/lychee/SCALE/questions.yaml +++ b/charts/stable/lychee/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/lychee/values.yaml b/charts/stable/lychee/values.yaml index 4673c6ba798..92b698f1624 100644 --- a/charts/stable/lychee/values.yaml +++ b/charts/stable/lychee/values.yaml @@ -22,7 +22,7 @@ service: env: {} # PHP_TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/mylar/values.yaml b/charts/stable/mylar/values.yaml index d5fae5ebba6..28cbe54bd2f 100644 --- a/charts/stable/mylar/values.yaml +++ b/charts/stable/mylar/values.yaml @@ -26,9 +26,7 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1000" - # -- Specify the group ID the application will run as - PGID: "1000" + PUID: 568 # -- Configures service settings for the chart. # @default -- See values.yaml diff --git a/charts/stable/nzbhydra/values.yaml b/charts/stable/nzbhydra/values.yaml index d2ef487b7c8..ef1c3edf9a8 100644 --- a/charts/stable/nzbhydra/values.yaml +++ b/charts/stable/nzbhydra/values.yaml @@ -17,7 +17,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + probes: liveness: diff --git a/charts/stable/ombi/values.yaml b/charts/stable/ombi/values.yaml index 71d2371ce43..8029f0eb577 100644 --- a/charts/stable/ombi/values.yaml +++ b/charts/stable/ombi/values.yaml @@ -17,7 +17,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/organizr/SCALE/questions.yaml b/charts/stable/organizr/SCALE/questions.yaml index 5765634b84d..0f5f3b2e503 100644 --- a/charts/stable/organizr/SCALE/questions.yaml +++ b/charts/stable/organizr/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/organizr/values.yaml b/charts/stable/organizr/values.yaml index 33c86d054f8..84f2d29090c 100644 --- a/charts/stable/organizr/values.yaml +++ b/charts/stable/organizr/values.yaml @@ -22,7 +22,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/oscam/values.yaml b/charts/stable/oscam/values.yaml index 5d004ae27b9..6fb70a5cb9f 100644 --- a/charts/stable/oscam/values.yaml +++ b/charts/stable/oscam/values.yaml @@ -10,14 +10,11 @@ securityContext: podSecurityContext: runAsUser: 0 - runAsGroup: 0 + runAsGroup: 20 env: TZ: UTC - PUID: "568" - # currently needed for working with /dev/ttyXYZ devices - # see: https://github.com/linuxserver/docker-oscam/issues/21 - PGID: "20" + PUID: 568 service: main: diff --git a/charts/stable/pyload/values.yaml b/charts/stable/pyload/values.yaml index 97036c55dd2..58ed7b5b7a2 100644 --- a/charts/stable/pyload/values.yaml +++ b/charts/stable/pyload/values.yaml @@ -26,9 +26,7 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1001" - # -- Specify the group ID the application will run as - PGID: "1001" + PUID: 568 # -- Configures service settings for the chart. # @default -- See values.yaml diff --git a/charts/stable/qbittorrent/values.yaml b/charts/stable/qbittorrent/values.yaml index b7bceef88ee..01453f04e12 100644 --- a/charts/stable/qbittorrent/values.yaml +++ b/charts/stable/qbittorrent/values.yaml @@ -11,7 +11,7 @@ securityContext: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + # UMASK: 022 service: diff --git a/charts/stable/radarr/values.yaml b/charts/stable/radarr/values.yaml index ca0dae49092..68c391087dc 100644 --- a/charts/stable/radarr/values.yaml +++ b/charts/stable/radarr/values.yaml @@ -17,7 +17,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + probes: liveness: diff --git a/charts/stable/readarr/values.yaml b/charts/stable/readarr/values.yaml index a6490849bb0..feb72be5840 100644 --- a/charts/stable/readarr/values.yaml +++ b/charts/stable/readarr/values.yaml @@ -17,7 +17,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + probes: liveness: diff --git a/charts/stable/resilio-sync/values.yaml b/charts/stable/resilio-sync/values.yaml index 8b973f541c9..d2fe867b049 100644 --- a/charts/stable/resilio-sync/values.yaml +++ b/charts/stable/resilio-sync/values.yaml @@ -26,9 +26,9 @@ env: # -- Set the container timezone TZ: UTC # -- Specify the user ID the application will run as - PUID: "1001" - # -- Specify the group ID the application will run as - PGID: "1001" + PUID: 568 + + # -- Sets default UMASK UMASK: # 022 diff --git a/charts/stable/sabnzbd/values.yaml b/charts/stable/sabnzbd/values.yaml index edc20ea827d..e00a967c263 100644 --- a/charts/stable/sabnzbd/values.yaml +++ b/charts/stable/sabnzbd/values.yaml @@ -14,7 +14,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/sonarr/values.yaml b/charts/stable/sonarr/values.yaml index 51a38d6ac37..d46a6802c4f 100644 --- a/charts/stable/sonarr/values.yaml +++ b/charts/stable/sonarr/values.yaml @@ -14,7 +14,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + probes: liveness: diff --git a/charts/stable/tautulli/values.yaml b/charts/stable/tautulli/values.yaml index d25058069d7..3fa1ffffdaf 100644 --- a/charts/stable/tautulli/values.yaml +++ b/charts/stable/tautulli/values.yaml @@ -14,7 +14,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: config: diff --git a/charts/stable/transmission/values.yaml b/charts/stable/transmission/values.yaml index 145592ddcf6..ef8120fb5f3 100644 --- a/charts/stable/transmission/values.yaml +++ b/charts/stable/transmission/values.yaml @@ -26,7 +26,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + # TRANSMISSION_ALT_SPEED_DOWN: 50 # TRANSMISSION_ALT_SPEED_ENABLED: false # TRANSMISSION_ALT_SPEED_TIME_BEGIN: 540 diff --git a/charts/stable/truecommand/SCALE/questions.yaml b/charts/stable/truecommand/SCALE/questions.yaml index 3593e454a55..50d039ea494 100644 --- a/charts/stable/truecommand/SCALE/questions.yaml +++ b/charts/stable/truecommand/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/truecommand/values.yaml b/charts/stable/truecommand/values.yaml index 569bede9c3c..a4d2f5d8730 100644 --- a/charts/stable/truecommand/values.yaml +++ b/charts/stable/truecommand/values.yaml @@ -22,7 +22,7 @@ service: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + persistence: data: diff --git a/charts/stable/tvheadend/SCALE/questions.yaml b/charts/stable/tvheadend/SCALE/questions.yaml index e7caec23619..7318ebd3052 100644 --- a/charts/stable/tvheadend/SCALE/questions.yaml +++ b/charts/stable/tvheadend/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/tvheadend/values.yaml b/charts/stable/tvheadend/values.yaml index e7fe39e9020..87ccc406250 100644 --- a/charts/stable/tvheadend/values.yaml +++ b/charts/stable/tvheadend/values.yaml @@ -15,7 +15,6 @@ podSecurityContext: # See https://github.com/linuxserver/docker-tvheadend#parameters env: {} # PUID: 1000 - # PGID: 1000 # TZ: Europe/London # RUN_OPTS: diff --git a/charts/stable/unifi/SCALE/ix_values.yaml b/charts/stable/unifi/SCALE/ix_values.yaml index 7a9a2410c53..76739826178 100644 --- a/charts/stable/unifi/SCALE/ix_values.yaml +++ b/charts/stable/unifi/SCALE/ix_values.yaml @@ -12,7 +12,7 @@ image: envTpl: # Permissions Settings UNIFI_GID: "{{ .Values.env.PUID }}" - UNIFI_UID: "{{ .Values.env.PGID }}" + UNIFI_UID: "{{ .Values.podSecurityContext.fsGroup }}" ## # Most other defaults are set in questions.yaml # For other options please refer to the wiki, default_values.yaml or the common library chart diff --git a/charts/stable/unifi/SCALE/questions.yaml b/charts/stable/unifi/SCALE/questions.yaml index 8c0648c49e6..5cd38c81185 100644 --- a/charts/stable/unifi/SCALE/questions.yaml +++ b/charts/stable/unifi/SCALE/questions.yaml @@ -84,12 +84,7 @@ questions: schema: type: int default: 568 - - variable: PGID - label: "PGID" - description: "Sets the PGID env var for LinuxServer.io (compatible) containers" - schema: - type: int - default: 568 + - variable: UMASK label: "UMASK" description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" diff --git a/charts/stable/unifi/values.yaml b/charts/stable/unifi/values.yaml index ce1e4d2bd77..1645139cabd 100644 --- a/charts/stable/unifi/values.yaml +++ b/charts/stable/unifi/values.yaml @@ -8,7 +8,7 @@ image: envTpl: # Permissions Settings UNIFI_GID: "{{ .Values.env.PUID }}" - UNIFI_UID: "{{ .Values.env.PGID }}" + UNIFI_UID: "{{ .Values.podSecurityContext.fsGroup }}" service: main: @@ -64,8 +64,8 @@ podSecurityContext: env: # TZ: - PUID: "568" - PGID: "568" + PUID: 568 + persistence: config: diff --git a/charts/stable/unpackerr/values.yaml b/charts/stable/unpackerr/values.yaml index 74688a651f5..9826d6035c0 100644 --- a/charts/stable/unpackerr/values.yaml +++ b/charts/stable/unpackerr/values.yaml @@ -18,7 +18,7 @@ portal: env: {} # TZ: UTC # PUID: 1001 - # PGID: 1001 + probes: liveness: diff --git a/tests/library/common/autoPermissions_spec.rb b/tests/library/common/autoPermissions_spec.rb index adcfddac4c4..ed50cd791e1 100644 --- a/tests/library/common/autoPermissions_spec.rb +++ b/tests/library/common/autoPermissions_spec.rb @@ -283,37 +283,6 @@ class Test < ChartTest initContainer = deployment["spec"]["template"]["spec"]["initContainers"][0] assert_equal(results[:command], initContainer["command"]) end - it 'outputs PUID AND PGID permissions for multiple volumes when both are set' do - results= { - command: ["/bin/sh", "-c", "echo 'Automatically correcting permissions...';chown -R :568 '/configlist'; chmod -R g+w '/configlist';chown -R :568 '/data'; chmod -R g+w '/data';"] - } - values = { - env: { - PGID: 666, - PUID: 999 - }, - persistenceList: [ - { - name: "data", - enabled: true, - setPermissions: true, - mountPath: "/data", - hostPath: "/tmp1" - }, - { - name: "configlist", - enabled: true, - setPermissions: true, - mountPath: "/configlist", - hostPath: "/tmp2" - } - ] - } - chart.value values - deployment = chart.resources(kind: "Deployment").first - initContainer = deployment["spec"]["template"]["spec"]["initContainers"][0] - assert_equal(results[:command], initContainer["command"]) - end end end end diff --git a/tests/library/common/container_spec.rb b/tests/library/common/container_spec.rb index 0143008c7a6..9eab6c06554 100644 --- a/tests/library/common/container_spec.rb +++ b/tests/library/common/container_spec.rb @@ -85,7 +85,7 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_nil(mainContainer["env"]) + assert_nil(mainContainer["env"][4]) end it 'set static "k/v pair style" environment variables' do @@ -101,14 +101,14 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal(values[:env].values[0].to_s, mainContainer["env"][1]["value"]) - assert_equal(values[:env].keys[1].to_s, mainContainer["env"][2]["name"]) - assert_equal(values[:env].values[1].to_s, mainContainer["env"][2]["value"]) - assert_equal(values[:env].keys[2].to_s, mainContainer["env"][3]["name"]) - assert_equal(values[:env].values[2].to_s, mainContainer["env"][3]["value"]) - assert_equal(values[:env].keys[3].to_s, mainContainer["env"][4]["name"]) - assert_equal(values[:env].values[3].to_s, mainContainer["env"][4]["value"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal(values[:env].values[0].to_s, mainContainer["env"][4]["value"]) + assert_equal(values[:env].keys[1].to_s, mainContainer["env"][5]["name"]) + assert_equal(values[:env].values[1].to_s, mainContainer["env"][5]["value"]) + assert_equal(values[:env].keys[2].to_s, mainContainer["env"][6]["name"]) + assert_equal(values[:env].values[2].to_s, mainContainer["env"][6]["value"]) + assert_equal(values[:env].keys[3].to_s, mainContainer["env"][7]["name"]) + assert_equal(values[:env].values[3].to_s, mainContainer["env"][7]["value"]) end it 'set list of static "kubernetes style" environment variables' do @@ -124,8 +124,8 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:envList][0][:name].to_s, mainContainer["env"][1]["name"]) - assert_equal(values[:envList][0][:value].to_s, mainContainer["env"][1]["value"]) + assert_equal(values[:envList][0][:name].to_s, mainContainer["env"][4]["name"]) + assert_equal(values[:envList][0][:value].to_s, mainContainer["env"][4]["value"]) end it 'set both static "k/v pair style" and static "k/valueFrom style" environment variables' do @@ -145,10 +145,10 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal(values[:env].values[0].to_s, mainContainer["env"][1]["value"]) - assert_equal(values[:env].keys[1].to_s, mainContainer["env"][2]["name"]) - assert_equal(values[:env].values[1][:valueFrom][:fieldRef][:fieldPath], mainContainer["env"][2]["valueFrom"]["fieldRef"]["fieldPath"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal(values[:env].values[0].to_s, mainContainer["env"][4]["value"]) + assert_equal(values[:env].keys[1].to_s, mainContainer["env"][5]["name"]) + assert_equal(values[:env].values[1][:valueFrom][:fieldRef][:fieldPath], mainContainer["env"][5]["valueFrom"]["fieldRef"]["fieldPath"]) end it 'set static "k/explicitValueFrom pair style" environment variables' do @@ -167,8 +167,8 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal(values[:env].values[0][:valueFrom][:fieldRef][:fieldPath], mainContainer["env"][1]["valueFrom"]["fieldRef"]["fieldPath"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal(values[:env].values[0][:valueFrom][:fieldRef][:fieldPath], mainContainer["env"][4]["valueFrom"]["fieldRef"]["fieldPath"]) end it 'set static "k/implicitValueFrom pair style" environment variables' do @@ -185,8 +185,8 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal(values[:env].values[0][:fieldRef][:fieldPath], mainContainer["env"][1]["valueFrom"]["fieldRef"]["fieldPath"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal(values[:env].values[0][:fieldRef][:fieldPath], mainContainer["env"][4]["valueFrom"]["fieldRef"]["fieldPath"]) end it 'set both static "k/v pair style" and templated "k/v pair style" environment variables' do @@ -200,10 +200,10 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal("common-test-admin", mainContainer["env"][1]["value"]) - assert_equal(values[:env].keys[1].to_s, mainContainer["env"][2]["name"]) - assert_equal(values[:env].values[1].to_s, mainContainer["env"][2]["value"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal("common-test-admin", mainContainer["env"][4]["value"]) + assert_equal(values[:env].keys[1].to_s, mainContainer["env"][5]["name"]) + assert_equal(values[:env].values[1].to_s, mainContainer["env"][5]["value"]) end it 'set templated "k/v pair style" environment variables' do @@ -216,8 +216,8 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal("common-test-admin", mainContainer["env"][1]["value"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal("common-test-admin", mainContainer["env"][4]["value"]) end it 'set static "k/v pair style", templated "k/v pair style", static "k/explicitValueFrom pair style", and static "k/implicitValueFrom pair style" environment variables' do @@ -243,14 +243,14 @@ class Test < ChartTest deployment = chart.resources(kind: "Deployment").first containers = deployment["spec"]["template"]["spec"]["containers"] mainContainer = containers.find{ |c| c["name"] == "common-test" } - assert_equal(values[:env].keys[0].to_s, mainContainer["env"][1]["name"]) - assert_equal("common-test-admin", mainContainer["env"][1]["value"]) - assert_equal(values[:env].keys[1].to_s, mainContainer["env"][2]["name"]) - assert_equal(values[:env].values[1].to_s, mainContainer["env"][2]["value"]) - assert_equal(values[:env].keys[2].to_s, mainContainer["env"][3]["name"]) - assert_equal(values[:env].values[2][:valueFrom][:fieldRef][:fieldPath], mainContainer["env"][3]["valueFrom"]["fieldRef"]["fieldPath"]) - assert_equal(values[:env].keys[3].to_s, mainContainer["env"][4]["name"]) - assert_equal(values[:env].values[3][:fieldRef][:fieldPath], mainContainer["env"][4]["valueFrom"]["fieldRef"]["fieldPath"]) + assert_equal(values[:env].keys[0].to_s, mainContainer["env"][4]["name"]) + assert_equal("common-test-admin", mainContainer["env"][4]["value"]) + assert_equal(values[:env].keys[1].to_s, mainContainer["env"][5]["name"]) + assert_equal(values[:env].values[1].to_s, mainContainer["env"][5]["value"]) + assert_equal(values[:env].keys[2].to_s, mainContainer["env"][6]["name"]) + assert_equal(values[:env].values[2][:valueFrom][:fieldRef][:fieldPath], mainContainer["env"][6]["valueFrom"]["fieldRef"]["fieldPath"]) + assert_equal(values[:env].keys[3].to_s, mainContainer["env"][7]["name"]) + assert_equal(values[:env].values[3][:fieldRef][:fieldPath], mainContainer["env"][7]["valueFrom"]["fieldRef"]["fieldPath"]) end it 'set "static" secret variables' do