Parcourir la source

immich - migrate storage sections

Stavros kois il y a 1 an
Parent
commit
1b2fb81080

+ 3 - 3
library/ix-dev/community/immich/Chart.lock

@@ -1,6 +1,6 @@
 dependencies:
 - name: common
   repository: file://../../../common
-  version: 1.2.2
-digest: sha256:fb077cb81f6acecd5c9e6adc22a18e156f780cd78f27198cdb47810f95364b56
-generated: "2023-11-09T09:51:08.676733946+02:00"
+  version: 1.2.3
+digest: sha256:e6ff49b06bf5d4d159e505ae6d153f36cd46170bb519caf90462cd5caebfd0fb
+generated: "2023-11-15T13:21:05.261510633+02:00"

+ 3 - 3
library/ix-dev/community/immich/Chart.yaml

@@ -3,9 +3,9 @@ description: Immich
 annotations:
   title: Immich
 type: application
-version: 1.0.35
+version: 1.1.0
 apiVersion: v2
-appVersion: 1.85.0
+appVersion: 1.86.0
 kubeVersion: '>=1.16.0-0'
 maintainers:
   - name: truenas
@@ -14,7 +14,7 @@ maintainers:
 dependencies:
   - name: common
     repository: file://../../../common
-    version: 1.2.2
+    version: 1.2.3
 home: https://immich.app
 icon: https://media.sys.truenas.net/apps/immich/icons/icon.svg
 sources:

BIN
library/ix-dev/community/immich/charts/common-1.2.2.tgz


BIN
library/ix-dev/community/immich/charts/common-1.2.3.tgz


+ 7 - 14
library/ix-dev/community/immich/ci/basic-values.yaml

@@ -1,22 +1,15 @@
 immichStorage:
   uploads:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/uploads
+    type: pvc
   library:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/library
+    type: pvc
   thumbs:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/thumbs
+    type: pvc
   profile:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/profile
+    type: pvc
   video:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/video
+    type: pvc
   pgData:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgData
+    type: pvc
   pgBackup:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgBackup
+    type: emptyDir

+ 9 - 16
library/ix-dev/community/immich/ci/extra-values.yaml

@@ -1,25 +1,18 @@
 immichStorage:
   uploads:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/uploads
+    type: pvc
   library:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/library
+    type: pvc
   thumbs:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/thumbs
+    type: pvc
   profile:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/profile
+    type: pvc
   video:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/video
+    type: pvc
+  pgData:
+    type: pvc
+  pgBackup:
+    type: emptyDir
   additionalLibraries:
     - hostPath: /mnt/{{ .Release.Name }}/additionalLibrary1
     - hostPath: /mnt/{{ .Release.Name }}/additionalLibrary2
-  pgData:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgData
-  pgBackup:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgBackup

+ 7 - 14
library/ix-dev/community/immich/ci/no-extra-values.yaml

@@ -1,25 +1,18 @@
 immichStorage:
   uploads:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/uploads
+    type: pvc
   library:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/library
+    type: pvc
   thumbs:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/thumbs
+    type: pvc
   profile:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/profile
+    type: pvc
   video:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/video
+    type: pvc
   pgData:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgData
+    type: pvc
   pgBackup:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgBackup
+    type: emptyDir
 
 immichConfig:
   enableML: false

+ 7 - 14
library/ix-dev/community/immich/ci/no-ml-values.yaml

@@ -1,25 +1,18 @@
 immichStorage:
   uploads:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/uploads
+    type: pvc
   library:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/library
+    type: pvc
   thumbs:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/thumbs
+    type: pvc
   profile:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/profile
+    type: pvc
   video:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/video
+    type: pvc
   pgData:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgData
+    type: pvc
   pgBackup:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgBackup
+    type: emptyDir
 
 immichConfig:
   enableML: false

+ 7 - 14
library/ix-dev/community/immich/ci/no-typesenes-values.yaml

@@ -1,25 +1,18 @@
 immichStorage:
   uploads:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/uploads
+    type: pvc
   library:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/library
+    type: pvc
   thumbs:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/thumbs
+    type: pvc
   profile:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/profile
+    type: pvc
   video:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/video
+    type: pvc
   pgData:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgData
+    type: pvc
   pgBackup:
-    type: hostPath
-    hostPath: /mnt/{{ .Release.Name }}/pgBackup
+    type: emptyDir
 
 immichConfig:
   enableTypesense: false

+ 86 - 0
library/ix-dev/community/immich/migrations/migrate

@@ -0,0 +1,86 @@
+#!/usr/bin/python3
+import json
+import os
+import sys
+
+
+# Used to migrate storage format to include ACLs
+def storageMigrate(storage):
+    delKeys = []
+    if storage['type'] == 'hostPath':
+        # Check if the key exists, if not we have already migrated
+        if not storage.get('hostPath'):
+            return storage
+
+        hostPath = storage['hostPath']
+        storage['hostPathConfig'] = { 'hostPath': hostPath }
+        delKeys.append('hostPath')
+
+    if storage['type'] == 'ixVolume':
+        # Check if the key exists, if not we have already migrated
+        if not storage.get('datasetName'):
+            return storage
+
+        datasetName = storage['datasetName']
+        storage['ixVolumeConfig'] = { 'datasetName': datasetName }
+        delKeys.append('datasetName')
+
+
+    for key in delKeys:
+        del storage[key]
+
+    return storage
+
+# Used to migrate libraries to additionalStorages
+def librariesMigrate(libraries):
+    # Additional **Libraries** only had a field for hostPath, because Immich
+    # had a requirement for both hostPath and mountPath to be the same,
+    # now its no longer the case, so we can merge it with additionalStorages
+    for idx, library in enumerate(libraries):
+        if not isinstance(library, dict) or not library:
+            continue
+
+        libraries[idx].update({
+            'type': 'hostPath',
+            'mountPath': library['hostPath'],
+            'hostPathConfig': {
+                'hostPath': library['hostPath'],
+            }
+        })
+
+        del libraries[idx]['hostPath']
+
+    return libraries
+
+
+def migrate(values):
+    storageKey = 'immichStorage'
+    storages = ['uploads', 'library', 'thumbs', 'profile', 'video', 'pgData', 'pgBackup']
+
+    for storage in storages:
+        check_val = values.get(storageKey, {}).get(storage, {})
+        if not isinstance(check_val, dict) or not check_val:
+            continue
+
+        values[storageKey][storage] = storageMigrate(check_val)
+
+    # Migrate additionalLibraries,
+    # if additionalLibraries does not exist, we have already migrated
+    if libraries := values.get(storageKey, {}).get('additionalLibraries'):
+        # If additionalLibraries exists, additionalStorages does not exist yet
+        values[storageKey].update({
+            'additionalStorages': librariesMigrate(libraries)
+        })
+
+        del values[storageKey]['additionalLibraries']
+
+    return values
+
+
+if __name__ == '__main__':
+    if len(sys.argv) != 2:
+        exit(1)
+
+    if os.path.exists(sys.argv[1]):
+        with open(sys.argv[1], 'r') as f:
+            print(json.dumps(migrate(json.loads(f.read()))))

+ 513 - 99
library/ix-dev/community/immich/questions.yaml

@@ -100,27 +100,66 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
+                  type: dict
                   show_if: [["type", "=", "ixVolume"]]
-                  required: true
-                  hidden: true
-                  immutable: true
-                  default: uploads
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "uploads"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
-                  type: hostpath
+                  type: dict
                   show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
         - variable: library
           label: Immich Library Storage
-          description: The path to store Immich library.
+          description: The path to store Immich Library.
           schema:
             type: dict
             attrs:
@@ -139,24 +178,63 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
+                  type: dict
                   show_if: [["type", "=", "ixVolume"]]
-                  required: true
-                  hidden: true
-                  immutable: true
-                  default: library
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "library"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
-                  type: hostpath
+                  type: dict
                   show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
         - variable: thumbs
           label: Immich Thumbs Storage
           description: The path to store Immich Thumbs.
@@ -178,24 +256,63 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
+                  type: dict
                   show_if: [["type", "=", "ixVolume"]]
-                  required: true
-                  hidden: true
-                  immutable: true
-                  default: thumbs
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "thumbs"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
-                  type: hostpath
+                  type: dict
                   show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
         - variable: profile
           label: Immich Profile Storage
           description: The path to store Immich Profile.
@@ -217,24 +334,63 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
+                  type: dict
                   show_if: [["type", "=", "ixVolume"]]
-                  required: true
-                  hidden: true
-                  immutable: true
-                  default: profile
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "profile"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
-                  type: hostpath
+                  type: dict
                   show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
         - variable: video
           label: Immich Video Storage
           description: The path to store Immich Video.
@@ -256,45 +412,64 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
+                  type: dict
                   show_if: [["type", "=", "ixVolume"]]
-                  required: true
-                  hidden: true
-                  immutable: true
-                  default: video
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
-                schema:
-                  type: hostpath
-                  show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
-        - variable: additionalLibraries
-          label: Additional Libraries
-          description: |
-            Additional libraries for Immich.</br>
-            Internal mountPath will be the same as your hostPath</br>
-            https://immich.app/docs/features/read-only-gallery
-          schema:
-            type: list
-            default: []
-            items:
-              - variable: storageEntry
-                label: Storage Entry
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "video"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
                   type: dict
+                  show_if: [["type", "=", "hostPath"]]
                   attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
                     - variable: hostPath
                       label: Host Path
                       description: The host path to use for storage.
                       schema:
                         type: hostpath
+                        show_if: [["aclEnable", "=", false]]
                         required: true
+
         - variable: pgData
           label: Immich Postgres Data Storage
           description: The path to store Immich Postgres Data.
@@ -316,24 +491,72 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
-                  show_if: [["type", "=", "ixVolume"]]
-                  required: true
+                  type: dict
+                  # Nothing to show for the user
                   hidden: true
-                  immutable: true
-                  default: pgData
+                  show_if: [["type", "=", "ixVolume"]]
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        # Postgres does a CHMOD at startup
+                        # Which fails with ACL
+                        hidden: true
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "pgData"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
-                  type: hostpath
+                  type: dict
                   show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        # Postgres does a CHMOD at startup
+                        # Which fails with ACL
+                        hidden: true
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
+
         - variable: pgBackup
           label: Immich Postgres Backup Storage
           description: The path to store Immich Postgres Backup.
@@ -355,24 +578,215 @@ questions:
                       description: Host Path (Path that already exists on the system)
                     - value: ixVolume
                       description: ixVolume (Dataset created automatically by the system)
-              - variable: datasetName
-                label: Dataset Name
+              - variable: ixVolumeConfig
+                label: ixVolume Configuration
+                description: The configuration for the ixVolume dataset.
                 schema:
-                  type: string
-                  show_if: [["type", "=", "ixVolume"]]
-                  required: true
+                  type: dict
+                  # Nothing to show for the user
                   hidden: true
-                  immutable: true
-                  default: pgBackup
+                  show_if: [["type", "=", "ixVolume"]]
                   $ref:
                     - "normalize/ixVolume"
-              - variable: hostPath
-                label: Host Path
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        # Postgres does a CHMOD at startup
+                        # Which fails with ACL
+                        hidden: true
+                        default: false
+                    - variable: datasetName
+                      label: Dataset Name
+                      description: The name of the dataset to use for storage.
+                      schema:
+                        type: string
+                        required: true
+                        immutable: true
+                        hidden: true
+                        default: "pgBackup"
+                    - variable: aclEntries
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+              - variable: hostPathConfig
+                label: hostPathConfig
                 schema:
-                  type: hostpath
+                  type: dict
                   show_if: [["type", "=", "hostPath"]]
-                  immutable: true
-                  required: true
+                  attrs:
+                    - variable: aclEnable
+                      label: Enable ACL
+                      description: Enable ACL for the dataset.
+                      schema:
+                        type: boolean
+                        # Postgres does a CHMOD at startup
+                        # Which fails with ACL
+                        hidden: true
+                        default: false
+                    - variable: acl
+                      label: ACL Configuration
+                      schema:
+                        type: dict
+                        show_if: [["aclEnable", "=", true]]
+                        attrs: []
+                        $ref:
+                          - "normalize/acl"
+                    - variable: hostPath
+                      label: Host Path
+                      description: The host path to use for storage.
+                      schema:
+                        type: hostpath
+                        show_if: [["aclEnable", "=", false]]
+                        required: true
+
+        - variable: additionalStorages
+          label: Additional Storage
+          description: Additional storage for Immich.
+          schema:
+            type: list
+            default: []
+            items:
+              - variable: storageEntry
+                label: Storage Entry
+                schema:
+                  type: dict
+                  attrs:
+                    - variable: type
+                      label: Type
+                      description: |
+                        ixVolume: Is dataset created automatically by the system.</br>
+                        Host Path: Is a path that already exists on the system.</br>
+                        SMB Share: Is a SMB share that is mounted to a persistent volume claim.
+                      schema:
+                        type: string
+                        required: true
+                        default: "ixVolume"
+                        immutable: true
+                        enum:
+                          - value: "hostPath"
+                            description: Host Path (Path that already exists on the system)
+                          - value: "ixVolume"
+                            description: ixVolume (Dataset created automatically by the system)
+                          - value: "smb-pv-pvc"
+                            description: SMB Share (Mounts a persistent volume claim to a SMB share)
+                    - variable: readOnly
+                      label: Read Only
+                      description: Mount the volume as read only.
+                      schema:
+                        type: boolean
+                        default: false
+                    - variable: mountPath
+                      label: Mount Path
+                      description: The path inside the container to mount the storage.
+                      schema:
+                        type: path
+                        required: true
+                    - variable: hostPathConfig
+                      label: hostPathConfig
+                      schema:
+                        type: dict
+                        show_if: [["type", "=", "hostPath"]]
+                        attrs:
+                          - variable: aclEnable
+                            label: Enable ACL
+                            description: Enable ACL for the dataset.
+                            schema:
+                              type: boolean
+                              default: false
+                          - variable: acl
+                            label: ACL Configuration
+                            schema:
+                              type: dict
+                              show_if: [["aclEnable", "=", true]]
+                              attrs: []
+                              $ref:
+                                - "normalize/acl"
+                          - variable: hostPath
+                            label: Host Path
+                            description: The host path to use for storage.
+                            schema:
+                              type: hostpath
+                              show_if: [["aclEnable", "=", false]]
+                              required: true
+                    - variable: ixVolumeConfig
+                      label: ixVolume Configuration
+                      description: The configuration for the ixVolume dataset.
+                      schema:
+                        type: dict
+                        show_if: [["type", "=", "ixVolume"]]
+                        $ref:
+                          - "normalize/ixVolume"
+                        attrs:
+                          - variable: aclEnable
+                            label: Enable ACL
+                            description: Enable ACL for the dataset.
+                            schema:
+                              type: boolean
+                              default: false
+                          - variable: datasetName
+                            label: Dataset Name
+                            description: The name of the dataset to use for storage.
+                            schema:
+                              type: string
+                              required: true
+                              immutable: true
+                              default: "storage_entry"
+                          - variable: aclEntries
+                            label: ACL Configuration
+                            schema:
+                              type: dict
+                              show_if: [["aclEnable", "=", true]]
+                              attrs: []
+                    - variable: smbConfig
+                      label: SMB Share Configuration
+                      description: The configuration for the SMB Share.
+                      schema:
+                        type: dict
+                        show_if: [["type", "=", "smb-pv-pvc"]]
+                        attrs:
+                          - variable: server
+                            label: Server
+                            description: The server for the SMB share.
+                            schema:
+                              type: string
+                              required: true
+                          - variable: share
+                            label: Share
+                            description: The share name for the SMB share.
+                            schema:
+                              type: string
+                              required: true
+                          - variable: domain
+                            label: Domain (Optional)
+                            description: The domain for the SMB share.
+                            schema:
+                              type: string
+                          - variable: username
+                            label: Username
+                            description: The username for the SMB share.
+                            schema:
+                              type: string
+                              required: true
+                          - variable: password
+                            label: Password
+                            description: The password for the SMB share.
+                            schema:
+                              type: string
+                              required: true
+                              private: true
+                          - variable: size
+                            label: Size (in Gi)
+                            description: The size of the volume quota.
+                            schema:
+                              type: int
+                              required: true
+                              min: 1
+                              default: 1
 
   - variable: resources
     label: ""

+ 30 - 22
library/ix-dev/community/immich/templates/_persistence.tpl

@@ -1,11 +1,17 @@
 {{- define "immich.persistence" -}}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.pgData) }}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.pgBackup) }}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.library) }}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.uploads) }}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.thumbs) }}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.profile) }}
+  {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.video) }}
+
 persistence:
   {{/* Data */}}
   library:
     enabled: true
-    type: {{ .Values.immichStorage.library.type }}
-    datasetName: {{ .Values.immichStorage.library.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.library.hostPath | default "" }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.library) | nindent 4 }}
     targetSelector:
       server:
         server:
@@ -15,9 +21,7 @@ persistence:
           mountPath: /usr/src/app/upload/library
   uploads:
     enabled: true
-    type: {{ .Values.immichStorage.uploads.type }}
-    datasetName: {{ .Values.immichStorage.uploads.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.uploads.hostPath | default "" }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.uploads) | nindent 4 }}
     targetSelector:
       server:
         server:
@@ -27,9 +31,7 @@ persistence:
           mountPath: /usr/src/app/upload/upload
   thumbs:
     enabled: true
-    type: {{ .Values.immichStorage.thumbs.type }}
-    datasetName: {{ .Values.immichStorage.thumbs.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.thumbs.hostPath | default "" }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.thumbs) | nindent 4 }}
     targetSelector:
       server:
         server:
@@ -39,9 +41,7 @@ persistence:
           mountPath: /usr/src/app/upload/thumbs
   profile:
     enabled: true
-    type: {{ .Values.immichStorage.profile.type }}
-    datasetName: {{ .Values.immichStorage.profile.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.profile.hostPath | default "" }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.profile) | nindent 4 }}
     targetSelector:
       server:
         server:
@@ -51,9 +51,7 @@ persistence:
           mountPath: /usr/src/app/upload/profile
   video:
     enabled: true
-    type: {{ .Values.immichStorage.video.type }}
-    datasetName: {{ .Values.immichStorage.video.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.video.hostPath | default "" }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.video) | nindent 4 }}
     targetSelector:
       server:
         server:
@@ -61,19 +59,18 @@ persistence:
       microservices:
         microservices:
           mountPath: /usr/src/app/upload/encoded-video
-  {{- range $idx, $storage := .Values.immichStorage.additionalLibraries }}
-  {{ printf "immich-%v" (int $idx) }}:
+  {{- range $idx, $storage := .Values.immichStorage.additionalStorages }}
+  {{ printf "immich-%v:" (int $idx) }}
     enabled: true
-    type: hostPath
-    hostPath: {{ $storage.hostPath | default "" }}
-    # Host path and mount path MUST be the same
+    {{- include "immich.storage.ci.migration" (dict "storage" $storage) }}
+    {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
     targetSelector:
       server:
         server:
-          mountPath: {{ $storage.hostPath }}
+          mountPath: {{ $storage.mountPath }}
       microservices:
         microservices:
-          mountPath: {{ $storage.hostPath }}
+          mountPath: {{ $storage.mountPath }}
   {{- end }}
   {{/* Caches */}}
   microcache:
@@ -116,9 +113,20 @@ persistence:
         redis:
           mountPath: /tmp
 
+
   {{/* Database */}}
   {{- include "ix.v1.common.app.postgresPersistence"
       (dict "pgData" .Values.immichStorage.pgData
             "pgBackup" .Values.immichStorage.pgBackup
       ) | nindent 2 }}
 {{- end -}}
+
+{{/* Can be removed on the next bump (1.1.0+), only used for CI values */}}
+{{- define "immich.storage.ci.migration" -}}
+  {{- $storage := .storage -}}
+
+  {{- if $storage.hostPath -}}
+    {{- $_ := set $storage "hostPathConfig" dict -}}
+    {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
+  {{- end -}}
+{{- end -}}

+ 18 - 11
library/ix-dev/community/immich/values.yaml

@@ -1,22 +1,22 @@
 image:
   repository: altran1502/immich-server
   pullPolicy: IfNotPresent
-  tag: v1.85.0
+  tag: v1.86.0
 
 webImage:
   repository: altran1502/immich-web
   pullPolicy: IfNotPresent
-  tag: v1.85.0
+  tag: v1.86.0
 
 proxyImage:
   repository: altran1502/immich-proxy
   pullPolicy: IfNotPresent
-  tag: v1.85.0
+  tag: v1.86.0
 
 mlImage:
   repository: altran1502/immich-machine-learning
   pullPolicy: IfNotPresent
-  tag: v1.85.0
+  tag: v1.86.0
 
 typesenseImage:
   repository: typesense/typesense
@@ -49,26 +49,33 @@ immichNetwork:
 immichStorage:
   uploads:
     type: ixVolume
-    datasetName: uploads
+    ixVolumeConfig:
+      datasetName: uploads
   library:
     type: ixVolume
-    datasetName: library
+    ixVolumeConfig:
+      datasetName: library
   thumbs:
     type: ixVolume
-    datasetName: thumbs
+    ixVolumeConfig:
+      datasetName: thumbs
   profile:
     type: ixVolume
-    datasetName: profile
+    ixVolumeConfig:
+      datasetName: profile
   video:
     type: ixVolume
-    datasetName: video
+    ixVolumeConfig:
+      datasetName: video
   additionalLibraries: []
   pgData:
     type: ixVolume
-    datasetName: pgData
+    ixVolumeConfig:
+      datasetName: pgData
   pgBackup:
     type: ixVolume
-    datasetName: pgBackup
+    ixVolumeConfig:
+      datasetName: pgBackup
 
 notes:
   custom: |