diff --git a/charts/4allportal/Chart.yaml b/charts/4allportal/Chart.yaml index 6fb3da99..746d99f2 100644 --- a/charts/4allportal/Chart.yaml +++ b/charts/4allportal/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "3.10.38" description: A Helm chart for 4ALLPORTAL version 3.10.0 and up name: 4allportal -version: 20.1.1 +version: 20.2.0 icon: https://4allportal.com/wp-content/uploads/2022/07/cropped-4ap_logo.png keywords: - 4ALLPORTAL diff --git a/charts/4allportal/README.md b/charts/4allportal/README.md index 22c052bb..c0117af7 100644 --- a/charts/4allportal/README.md +++ b/charts/4allportal/README.md @@ -1,6 +1,6 @@ # 4allportal -![Version: 20.1.1](https://img.shields.io/badge/Version-20.1.1-informational?style=flat-square) ![AppVersion: 3.10.38](https://img.shields.io/badge/AppVersion-3.10.38-informational?style=flat-square) +![Version: 20.2.0](https://img.shields.io/badge/Version-20.2.0-informational?style=flat-square) ![AppVersion: 3.10.38](https://img.shields.io/badge/AppVersion-3.10.38-informational?style=flat-square) A Helm chart for 4ALLPORTAL version 3.10.0 and up @@ -246,6 +246,7 @@ A Helm chart for 4ALLPORTAL version 3.10.0 and up | samba.image.repository | string | `"samba.org/samba-server"` | | | samba.image.tag | string | `"v0.6"` | | | samba.livenessProbe.enabled | bool | `false` | | +| samba.mounts | list | `[]` | | | samba.nodeSelector | object | `{}` | | | samba.podDisruptionBudget | bool | `true` | | | samba.readinessProbe.enabled | bool | `false` | | @@ -254,6 +255,7 @@ A Helm chart for 4ALLPORTAL version 3.10.0 and up | samba.resources.requests.cpu | string | `"10m"` | | | samba.resources.requests.memory | string | `"32Mi"` | | | samba.tolerations | list | `[]` | | +| samba.users | list | `[]` | | | users | list | `[]` | | | webdav.affinity | object | `{}` | | | webdav.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | | diff --git a/charts/4allportal/templates/samba/configmap.yaml b/charts/4allportal/templates/samba/configmap.yaml index b041da71..30c0dac8 100644 --- a/charts/4allportal/templates/samba/configmap.yaml +++ b/charts/4allportal/templates/samba/configmap.yaml @@ -7,58 +7,75 @@ metadata: data: config.json: |- { - "samba-container-config": "v0", - "configs": { - "mountconf": { - "shares": [ - "assets", "data" - ], - "globals": [ - "globals" - ], - "instance_name": "assets", - "permissions": { - "method": "initialize-share-perms", - "status_xattr": "user.share-perms-status", - "mode": "0777" - } - } - }, - "shares": { - "assets": { - "options": { - "force user": "4allportal", - "browseable": "yes", - "path": "/mnt/assets", - "read only": "no" - } - }, - "data": { - "options": { - "force user": "4allportal", - "browseable": "yes", - "path": "/mnt/data", - "read only": "no" - } - } - }, - "globals": { - "globals": { - "options": { - "server min protocol": "SMB3", - "server smb encrypt": "required", - "client smb encrypt": "required", - "client min protocol": "SMB3", - "disable spoolss": "yes", - "dos charset": "ascii", - "fileid:algorithm": "fsid", - "load printers": "no", - "printcap name": "/dev/null", - "printing": "bsd", - "smb ports": "445", - "vfs objects": "fileid" - } - } - } + "samba-container-config": "v0", + "configs": { + "mountconf": { + "shares": [ + "assets", "data" + {{- range $mount, $i := .Values.samba.mounts -}}, + {{- regexReplaceAll "\\W+" (regexReplaceAll "^/(.*)" $mount "$1") "_" | quote }} + {{- end }} + ], + "globals": [ + "globals" + ], + "instance_name": "assets", + "permissions": { + "method": "initialize-share-perms", + "status_xattr": "user.share-perms-status", + "mode": "0777" + } + } + }, + "shares": { + {{- range $mount, $perms := .Values.samba.mounts -}} + {{- regexReplaceAll "\\W+" (regexReplaceAll "^/(.*)" $mount "$1") "_" | quote | nindent 8 }}: { + "options": { + "force user": "4allportal", + "browseable": "yes", + "path": "/mnt{{- $mount }}", + "read only": "no" + {{- if $perms.users -}} + , + "valid users": {{ $perms.users | join "," | quote }} + {{- end }} + } + }, + {{- end }} + "assets": { + "options": { + "force user": "4allportal", + "browseable": "yes", + "path": "/mnt/assets", + "read only": "no" + } + }, + "data": { + "options": { + "force user": "4allportal", + "browseable": "yes", + "path": "/mnt/data", + "read only": "no" + } + } + }, + "globals": { + "globals": { + "options": { + "server min protocol": "SMB3", + "server smb encrypt": "required", + "client smb encrypt": "required", + "client min protocol": "SMB3", + "disable spoolss": "yes", + "dos charset": "ascii", + "fileid:algorithm": "fsid", + "load printers": "no", + "printcap name": "/dev/null", + "printing": "bsd", + "smb ports": "445", + "vfs objects": "fileid" + } + } + } } -{{- end }} +{{- end -}} diff --git a/charts/4allportal/templates/samba/secret.yaml b/charts/4allportal/templates/samba/secret.yaml index 30b9df19..1c7a4af2 100644 --- a/charts/4allportal/templates/samba/secret.yaml +++ b/charts/4allportal/templates/samba/secret.yaml @@ -11,6 +11,14 @@ stringData: "samba-container-config": "v0", "users": { "all_entries": [ + {{- with .Values.samba.users }} + {{- range $k, $v := . }} + { + "name": {{ $k | quote }}, + "password": {{ $v | quote }} + }, + {{- end }} + {{- end }} { "name": "admin", "password": {{ .Values.samba.adminPassword | quote }} diff --git a/charts/4allportal/values.yaml b/charts/4allportal/values.yaml index 08c98637..dbd73432 100644 --- a/charts/4allportal/values.yaml +++ b/charts/4allportal/values.yaml @@ -251,6 +251,8 @@ samba: registry: quay.io repository: samba.org/samba-server tag: v0.6 + users: [] + mounts: [] livenessProbe: enabled: false