diff --git a/library/ix-dev/community/passbolt/Chart.lock b/library/ix-dev/community/passbolt/Chart.lock new file mode 100644 index 0000000000..c1b3102799 --- /dev/null +++ b/library/ix-dev/community/passbolt/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.1.1 +digest: sha256:a7dbe3e4d42dbcd4325776e5e01a1d630c7f185f79e7ebf22b1b9cc80f56eed7 +generated: "2023-10-18T15:31:40.718484458+03:00" diff --git a/library/ix-dev/community/passbolt/Chart.yaml b/library/ix-dev/community/passbolt/Chart.yaml new file mode 100644 index 0000000000..983529855a --- /dev/null +++ b/library/ix-dev/community/passbolt/Chart.yaml @@ -0,0 +1,26 @@ +name: passbolt +description: Passbolt is a security-first, open source password manager +annotations: + title: Passbolt +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: 4.3.0 +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ + email: dev@ixsystems.com +dependencies: + - name: common + repository: file://../../../common + version: 1.1.1 +home: https://www.passbolt.com +icon: https://media.sys.truenas.net/apps/passbolt/icons/icon.svg +sources: + - https://hub.docker.com/r/passbolt/passbolt + - https://github.com/truenas/charts/tree/master/community/passbolt + - https://www.passbolt.com +keywords: + - password + - manager diff --git a/library/ix-dev/community/passbolt/README.md b/library/ix-dev/community/passbolt/README.md new file mode 100644 index 0000000000..bb46687f66 --- /dev/null +++ b/library/ix-dev/community/passbolt/README.md @@ -0,0 +1,22 @@ +# Passbolt + +[Passbolt](https://www.passbolt.com) is a security-first, open source password manager + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Passbolt` directories. +> Afterward, the `Passbolt` container will run as a **non**-root user (`33`). +> Same applies to the `mariadb` container. This will run afterwards as a **non**-root user (`999`). +> On each upgrade, a container will be launched with **root** privileges in order to apply the correct +> permissions to the `mariadb` **backups** directory. Container that performs the backup will run as a **non**-root user (`999`) afterwards. +> Keep in mind the permissions on the backup directory will be changed to `999:999` on **every** update. +> But will only be changed once for the `Passbolt` and `mariadb` data directories. + +## Register admin user + +Connect to the container's shell and run the following command replacing the +values (`user@example.com`, `first_name`, `last_name`) with your own values. + +```shell +/usr/share/php/passbolt/bin/cake passbolt register_user -r admin \ + -u user@example.com -f first_name -l last_name +``` diff --git a/library/ix-dev/community/passbolt/app-readme.md b/library/ix-dev/community/passbolt/app-readme.md new file mode 100644 index 0000000000..bb46687f66 --- /dev/null +++ b/library/ix-dev/community/passbolt/app-readme.md @@ -0,0 +1,22 @@ +# Passbolt + +[Passbolt](https://www.passbolt.com) is a security-first, open source password manager + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Passbolt` directories. +> Afterward, the `Passbolt` container will run as a **non**-root user (`33`). +> Same applies to the `mariadb` container. This will run afterwards as a **non**-root user (`999`). +> On each upgrade, a container will be launched with **root** privileges in order to apply the correct +> permissions to the `mariadb` **backups** directory. Container that performs the backup will run as a **non**-root user (`999`) afterwards. +> Keep in mind the permissions on the backup directory will be changed to `999:999` on **every** update. +> But will only be changed once for the `Passbolt` and `mariadb` data directories. + +## Register admin user + +Connect to the container's shell and run the following command replacing the +values (`user@example.com`, `first_name`, `last_name`) with your own values. + +```shell +/usr/share/php/passbolt/bin/cake passbolt register_user -r admin \ + -u user@example.com -f first_name -l last_name +``` diff --git a/library/ix-dev/community/passbolt/charts/common-1.1.1.tgz b/library/ix-dev/community/passbolt/charts/common-1.1.1.tgz new file mode 100644 index 0000000000..183621438d Binary files /dev/null and b/library/ix-dev/community/passbolt/charts/common-1.1.1.tgz differ diff --git a/library/ix-dev/community/passbolt/ci/basic-values.yaml b/library/ix-dev/community/passbolt/ci/basic-values.yaml new file mode 100644 index 0000000000..f8f7b08579 --- /dev/null +++ b/library/ix-dev/community/passbolt/ci/basic-values.yaml @@ -0,0 +1,15 @@ +passboltNetwork: + webPort: 31000 + +passboltConfig: + appUrl: http://localhost:31000 + +passboltStorage: + gpg: + type: pvc + jwt: + type: pvc + mariadbData: + type: pvc + mariadbBackup: + type: emptyDir diff --git a/library/ix-dev/community/passbolt/ci/host-values.yaml b/library/ix-dev/community/passbolt/ci/host-values.yaml new file mode 100644 index 0000000000..c9d16eb57a --- /dev/null +++ b/library/ix-dev/community/passbolt/ci/host-values.yaml @@ -0,0 +1,15 @@ +passboltNetwork: + hostNetwork: true + +passboltConfig: + appUrl: http://localhost:8080 + +passboltStorage: + gpg: + type: pvc + jwt: + type: pvc + mariadbData: + type: pvc + mariadbBackup: + type: emptyDir diff --git a/library/ix-dev/community/passbolt/ci/https-values.yaml b/library/ix-dev/community/passbolt/ci/https-values.yaml new file mode 100644 index 0000000000..1a52c4eef4 --- /dev/null +++ b/library/ix-dev/community/passbolt/ci/https-values.yaml @@ -0,0 +1,102 @@ +passboltConfig: + appUrl: https://localhost:31000 + +passboltNetwork: + webPort: 31000 + certificateID: 1 + +passboltStorage: + gpg: + type: pvc + jwt: + type: pvc + mariadbData: + type: pvc + mariadbBackup: + type: emptyDir + +ixCertificates: + "1": + certificate: | + -----BEGIN CERTIFICATE----- + MIIEdjCCA16gAwIBAgIDYFMYMA0GCSqGSIb3DQEBCwUAMGwxDDAKBgNVBAMMA2Fz + ZDELMAkGA1UEBhMCVVMxDTALBgNVBAgMBGFzZGYxCzAJBgNVBAcMAmFmMQ0wCwYD + VQQKDARhc2RmMQwwCgYDVQQLDANhc2QxFjAUBgkqhkiG9w0BCQEWB2FAYS5jb20w + HhcNMjEwODMwMjMyMzU0WhcNMjMxMjAzMjMyMzU0WjBuMQswCQYDVQQDDAJhZDEL + MAkGA1UEBhMCVVMxDTALBgNVBAgMBGFzZGYxDTALBgNVBAcMBGFzZGYxDTALBgNV + BAoMBGFkc2YxDTALBgNVBAsMBGFzZGYxFjAUBgkqhkiG9w0BCQEWB2FAYS5jb20w + ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7+1xOHRQyOnQTHFcrdasX + Zl0gzutVlA890a1wiQpdD5dOtCLo7+eqVYjqVKo9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kZjEL + MAkGA1UEBwwCYWYxDTALBgNVBAoMBGFzZGYxDDAKBgNVBAsMA2FzZDEWMBQGCSqG + SIb3DQEJARYHYUBhLmNvbYIDYFMXMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF + BQcDAjAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggEBAKEocOmVuWlr + zegtKYMe8NhHIkFY9oVn5ym6RHNOJpPH4QF8XYC3Z5+iC5yGh4P/jVe/4I4SF6Ql + PtofU0jNq5vzapt/y+m008eXqPQFmoUOvu+JavoRVcRx2LIP5AgBA1mF56CSREsX + TkuJAA9IUQ8EjnmAoAeKINuPaKxGDuU8BGCMqr/qd564MKNf9XYL+Fb2rlkA0O2d + 2No34DQLgqSmST/LAvPM7Cbp6knYgnKmGr1nETCXasg1cueHLnWWTvps2HiPp2D/ + +Fq0uqcZLu4Mdo0CPs4e5sHRyldEnRSKh0DVLprq9zr/GMipmPLJUsT5Jed3sj0w + M7Y3vwxshpo= + -----END CERTIFICATE----- + privatekey: | + -----BEGIN PRIVATE KEY----- + MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC7+1xOHRQyOnQT + HFcrdasXZl0gzutVlA890a1wiQpdD5dOtCLo7+eqVYjqVKo9W8RUIArXWmBu/Abk + H7oVFWC1P973W1+ArF5sA70f7BZgqRKJTIisuIFIlRETgfnP2pfQmHRZtGaIJRZI + 4vQCdYgW2g0KOvvNcZJCVq1OrhKiNiY1bWCp66DGg0ic6OEkZFHTm745zUNQaf2d + NgsxKU0HPGjVLJI//yrRFAOSBUqgD4c50krnMF7fU/Fqh+UyOu8t6Y/HsySh3urB + +Zie331tAzV6QV39KKxRflNx/yuWrtIEslGTm+xHKoCYJEk/nZ3mX8Y5hG6wWAb7 + A/FuDVg3AgMBAAECggEAapt30rj9DitGTtxAt13pJMEhyYxvvD3WkvmJwguF/Bbu + eW0Ba1c668fMeRCA54FWi1sMqusPS4HUqqUvk+t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Y + qQ+66XnfsA9G/bu4MDS9AX83iahD9IdLXQAy8I19prAbpVumKegPbMnNYNB/TYEc + 3G15AKCXo7jjOUtHY01DCQ== + -----END PRIVATE KEY----- diff --git a/library/ix-dev/community/passbolt/item.yaml b/library/ix-dev/community/passbolt/item.yaml new file mode 100644 index 0000000000..878fcc8e6d --- /dev/null +++ b/library/ix-dev/community/passbolt/item.yaml @@ -0,0 +1,11 @@ +icon_url: https://media.sys.truenas.net/apps/passbolt/icon/icon.svg +categories: + - security +screenshots: + - https://media.sys.truenas.net/apps/passbolt/screenshots/screenshot1.png + - https://media.sys.truenas.net/apps/passbolt/screenshots/screenshot2.png + - https://media.sys.truenas.net/apps/passbolt/screenshots/screenshot3.png + - https://media.sys.truenas.net/apps/passbolt/screenshots/screenshot4.png +tags: + - password + - manager diff --git a/library/ix-dev/community/passbolt/metadata.yaml b/library/ix-dev/community/passbolt/metadata.yaml new file mode 100644 index 0000000000..47027d8847 --- /dev/null +++ b/library/ix-dev/community/passbolt/metadata.yaml @@ -0,0 +1,8 @@ +runAsContext: + - userName: www-data + groupName: www-data + gid: 33 + uid: 33 + description: Passbolt run as a non-root user +capabilities: [] +hostMounts: [] diff --git a/library/ix-dev/community/passbolt/questions.yaml b/library/ix-dev/community/passbolt/questions.yaml new file mode 100644 index 0000000000..3fda46aa55 --- /dev/null +++ b/library/ix-dev/community/passbolt/questions.yaml @@ -0,0 +1,340 @@ +groups: + - name: Passbolt Configuration + description: Configure Passbolt + - name: Network Configuration + description: Configure Network for Passbolt + - name: Storage Configuration + description: Configure Storage for Passbolt + - name: Resources Configuration + description: Configure Resources for Passbolt + +portals: + web_portal: + protocols: + - "$kubernetes-resource_configmap_portal_protocol" + host: + - "$kubernetes-resource_configmap_portal_host" + ports: + - "$kubernetes-resource_configmap_portal_port" + path: "$kubernetes-resource_configmap_portal_path" + +questions: + - variable: passboltConfig + label: "" + group: Passbolt Configuration + schema: + type: dict + attrs: + - variable: appUrl + label: App URL + description: | + The URL for the Passbolt WebUI.
+ Format is: https://sub.domain.tld:port + schema: + type: uri + default: '' + required: true + - variable: additionalEnvs + label: Additional Environment Variables + description: Configure additional environment variables for Passbolt. + schema: + type: list + default: [] + items: + - variable: env + label: Environment Variable + schema: + type: dict + attrs: + - variable: name + label: Name + schema: + type: string + required: true + - variable: value + label: Value + schema: + type: string + required: true + + - variable: passboltNetwork + label: "" + group: Network Configuration + schema: + type: dict + attrs: + - variable: hostNetwork + label: Host Network + description: | + Bind to the host network. It's recommended to keep this disabled.
+ schema: + type: boolean + default: false + - variable: webPort + label: Web Port + description: The port for the Passbolt WebUI. + schema: + type: int + default: 30097 + show_if: [["hostNetwork", "=", false]] + min: 9000 + max: 65535 + required: true + - variable: certificateID + label: Certificate + description: The certificate to use for Passbolt. + schema: + type: int + "null": true + $ref: + - "definitions/certificate" + + - variable: passboltStorage + label: "" + group: Storage Configuration + schema: + type: dict + attrs: + - variable: gpg + label: Passbolt GPG Storage + description: The path to store Passbolt GPG. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + 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 + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: gpg + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: jwt + label: Passbolt JWT Storage + description: The path to store Passbolt JWT. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + 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 + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: jwt + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: mariadbData + label: Passbolt MariaDB Data Storage + description: The path to store Passbolt MariaDB Data. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + 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 + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: mariadbData + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: mariadbBackup + label: Passbolt MariaDB Backup Storage + description: The path to store Passbolt MariaDB Backup. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + 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 + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: mariadbBackup + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: additionalStorages + label: Additional Storage + description: Additional storage for Passbolt. + 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.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: "ixVolume" + enum: + - value: "hostPath" + description: Host Path (Path that already exists on the system) + - value: "ixVolume" + description: ixVolume (Dataset created automatically by the system) + - variable: mountPath + label: Mount Path + description: The path inside the container to mount the storage. + schema: + type: path + required: true + - variable: hostPath + label: Host Path + description: The host path to use for storage. + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + required: true + - variable: datasetName + label: Dataset Name + description: The name of the dataset to use for storage. + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + immutable: true + default: "storage_entry" + $ref: + - "normalize/ixVolume" + + - variable: resources + label: "" + group: Resources Configuration + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpu + label: CPU + description: CPU limit for Passbolt. + schema: + type: string + max_length: 6 + valid_chars: '^(0\.[1-9]|[1-9][0-9]*)(\.[0-9]|m?)$' + valid_chars_error: | + Valid CPU limit formats are
+ - Plain Integer - eg. 1
+ - Float - eg. 0.5
+ - Milicpu - eg. 500m + default: "4000m" + required: true + - variable: memory + label: Memory + description: Memory limit for Passbolt. + schema: + type: string + max_length: 12 + valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$' + valid_chars_error: | + Valid Memory limit formats are
+ - Suffixed with E/P/T/G/M/K - eg. 1G
+ - Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi
+ - Plain Integer in bytes - eg. 1024
+ - Exponent - eg. 134e6 + default: "8Gi" + required: true diff --git a/library/ix-dev/community/passbolt/templates/NOTES.txt b/library/ix-dev/community/passbolt/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/library/ix-dev/community/passbolt/templates/_configuration.tpl b/library/ix-dev/community/passbolt/templates/_configuration.tpl new file mode 100644 index 0000000000..f889d01596 --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/_configuration.tpl @@ -0,0 +1,43 @@ +{{- define "passbolt.configuration" -}} + + {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} + + {{- $dbHost := (printf "%s-mariadb" $fullname) -}} + {{- $dbUser := "passbolt" -}} + {{- $dbName := "passbolt" -}} + + {{- $dbPass := (randAlphaNum 32) -}} + {{- $dbRootPass := (randAlphaNum 32) -}} + {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-mariadb-creds" $fullname)) -}} + {{- $dbPass = ((index .data "MARIADB_PASSWORD") | b64dec) -}} + {{- $dbRootPass = ((index .data "MARIADB_ROOT_PASSWORD") | b64dec) -}} + {{- end }} + +secret: + mariadb-creds: + enabled: true + data: + MARIADB_USER: {{ $dbUser }} + MARIADB_DATABASE: {{ $dbName }} + MARIADB_PASSWORD: {{ $dbPass }} + MARIADB_ROOT_PASSWORD: {{ $dbRootPass }} + MARIADB_HOST: {{ $dbHost }} + + passbolt-creds: + enabled: true + data: + DATASOURCES_DEFAULT_HOST: {{ $dbHost }} + DATASOURCES_DEFAULT_DATABASE: {{ $dbName }} + DATASOURCES_DEFAULT_USERNAME: {{ $dbUser }} + DATASOURCES_DEFAULT_PASSWORD: {{ $dbPass }} + DATASOURCES_DEFAULT_PORT: "3306" + +configmap: + passbolt-config: + enabled: true + data: + APP_FULL_BASE_URL: {{ .Values.passboltConfig.appUrl }} + GNUPGHOME: /var/lib/passbolt/.gnupg + PASSBOLT_GPG_SERVER_KEY_PUBLIC: /etc/passbolt/gpg/serverkey.asc + PASSBOLT_GPG_SERVER_KEY_PRIVATE: /etc/passbolt/gpg/serverkey_private.asc +{{- end -}} diff --git a/library/ix-dev/community/passbolt/templates/_mariadb.tpl b/library/ix-dev/community/passbolt/templates/_mariadb.tpl new file mode 100644 index 0000000000..08e10b2367 --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/_mariadb.tpl @@ -0,0 +1,6 @@ +{{- define "passbolt.mariadb.workload" -}} +workload: +{{- include "ix.v1.common.app.mariadb" (dict "secretName" "mariadb-creds" + "resources" .Values.resources + "ixChartContext" .Values.ixChartContext) | nindent 2 }} +{{- end -}} diff --git a/library/ix-dev/community/passbolt/templates/_passbolt.tpl b/library/ix-dev/community/passbolt/templates/_passbolt.tpl new file mode 100644 index 0000000000..27cba5e3eb --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/_passbolt.tpl @@ -0,0 +1,59 @@ +{{- define "passbolt.workload" -}} +workload: + passbolt: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: {{ .Values.passboltNetwork.hostNetwork }} + containers: + passbolt: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: 33 + runAsGroup: 33 + readOnlyRootFilesystem: false + envFrom: + - secretRef: + name: passbolt-creds + - configMapRef: + name: passbolt-config + {{ with .Values.passboltConfig.additionalEnvs }} + envList: + {{ range $env := . }} + - name: {{ $env.name }} + value: {{ $env.value }} + {{ end }} + {{ end }} + probes: + {{- $port := 8080 -}} + {{- $protocol := "http" -}} + {{- if .Values.passboltNetwork.certificateID -}} + {{- $port = 4433 -}} + {{- $protocol = "https" -}} + {{- end }} + liveness: + enabled: true + type: {{ $protocol }} + port: {{ $port }} + path: /healthcheck/status + readiness: + enabled: true + type: {{ $protocol }} + port: {{ $port }} + path: /healthcheck/status + startup: + enabled: true + type: {{ $protocol }} + port: {{ $port }} + path: /healthcheck/status + initContainers: + {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions" + "UID" 33 + "GID" 33 + "type" "install") | nindent 8 }} + {{- include "ix.v1.common.app.mariadbWait" (dict "name" "02-mariadb-wait" + "secretName" "mariadb-creds") | nindent 8 }} +{{- end -}} diff --git a/library/ix-dev/community/passbolt/templates/_persistence.tpl b/library/ix-dev/community/passbolt/templates/_persistence.tpl new file mode 100644 index 0000000000..e892690d98 --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/_persistence.tpl @@ -0,0 +1,104 @@ +{{- define "passbolt.persistence" -}} +persistence: + gpg: + enabled: true + type: {{ .Values.passboltStorage.gpg.type }} + datasetName: {{ .Values.passboltStorage.gpg.datasetName | default "" }} + hostPath: {{ .Values.passboltStorage.gpg.hostPath | default "" }} + targetSelector: + passbolt: + passbolt: + mountPath: /etc/passbolt/gpg + 01-permissions: + mountPath: /mnt/directories/gpg + jwt: + enabled: true + type: {{ .Values.passboltStorage.jwt.type }} + datasetName: {{ .Values.passboltStorage.jwt.datasetName | default "" }} + hostPath: {{ .Values.passboltStorage.jwt.hostPath | default "" }} + targetSelector: + passbolt: + passbolt: + mountPath: /etc/passbolt/jwt + 01-permissions: + mountPath: /mnt/directories/jwt + tmp: + enabled: true + type: emptyDir + targetSelector: + passbolt: + passbolt: + mountPath: /tmp + varrun: + enabled: true + type: emptyDir + targetSelector: + passbolt: + passbolt: + mountPath: /var/run + {{- range $idx, $storage := .Values.passboltStorage.additionalStorages }} + {{ printf "passbolt-%v" (int $idx) }}: + enabled: true + type: {{ $storage.type }} + datasetName: {{ $storage.datasetName | default "" }} + hostPath: {{ $storage.hostPath | default "" }} + targetSelector: + passbolt: + passbolt: + mountPath: {{ $storage.mountPath }} + 01-permissions: + mountPath: /mnt/directories{{ $storage.mountPath }} + {{- end }} + + mariadbdata: + enabled: true + type: {{ .Values.passboltStorage.mariadbData.type }} + datasetName: {{ .Values.passboltStorage.mariadbData.datasetName | default "" }} + hostPath: {{ .Values.passboltStorage.mariadbData.hostPath | default "" }} + targetSelector: + # MariaDB pod + mariadb: + # MariaDB container + mariadb: + mountPath: /var/lib/mysql + # MariaDB - Permissions container + permissions: + mountPath: /mnt/directories/mariadb_data + mariadbbackup: + enabled: true + type: {{ .Values.passboltStorage.mariadbBackup.type }} + datasetName: {{ .Values.passboltStorage.mariadbBackup.datasetName | default "" }} + hostPath: {{ .Values.passboltStorage.mariadbBackup.hostPath | default "" }} + targetSelector: + # MariaDB backup pod + mariadbbackup: + # MariaDB backup container + mariadbbackup: + mountPath: /mariadb_backup + # MariaDB - Permissions container + permissions: + mountPath: /mnt/directories/mariadb_backup + + {{- if .Values.passboltNetwork.certificateID }} + cert: + enabled: true + type: secret + objectName: passbolt-cert + defaultMode: "0600" + items: + - key: tls.key + path: certificate.key + - key: tls.crt + path: certificate.crt + targetSelector: + passbolt: + passbolt: + mountPath: /etc/passbolt/certs + readOnly: true + +scaleCertificate: + passbolt-cert: + enabled: true + id: {{ .Values.passboltNetwork.certificateID }} + {{- end -}} +{{- end -}} diff --git a/library/ix-dev/community/passbolt/templates/_portal.tpl b/library/ix-dev/community/passbolt/templates/_portal.tpl new file mode 100644 index 0000000000..9198772fd3 --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/_portal.tpl @@ -0,0 +1,29 @@ +{{- define "passbolt.portal" -}} + {{- $url := urlParse .Values.passboltConfig.appUrl -}} + + {{- $protocol := "http" -}} + {{- if $url.scheme -}} + {{- $protocol = $url.scheme -}} + {{- end -}} + + {{- $host := "$node_ip" -}} + {{- $port := ternary "443" "80" (eq $protocol "https") -}} + {{- if $url.host -}} + {{- if contains ":" $url.host -}} + {{- $port = (split ":" $url.host)._1 -}} + {{- $host = (split ":" $url.host)._0 -}} + {{- else -}} + {{- $host = $url.host -}} + {{- end -}} + {{- end }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal +data: + path: / + port: {{ $port | quote }} + protocol: {{ $protocol | quote }} + host: {{ $host | quote }} +{{- end -}} diff --git a/library/ix-dev/community/passbolt/templates/_service.tpl b/library/ix-dev/community/passbolt/templates/_service.tpl new file mode 100644 index 0000000000..22f051f5b2 --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/_service.tpl @@ -0,0 +1,31 @@ +{{- define "passbolt.service" -}} +{{- $port := 8080 -}} +{{- if .Values.passboltNetwork.certificateID -}} + {{- $port = 4433 -}} +{{- end }} +service: + passbolt: + enabled: true + primary: true + type: NodePort + targetSelector: passbolt + ports: + webui: + enabled: true + primary: true + port: {{ .Values.passboltNetwork.webPort }} + nodePort: {{ .Values.passboltNetwork.webPort }} + targetPort: {{ $port }} + targetSelector: passbolt + mariadb: + enabled: true + type: ClusterIP + targetSelector: mariadb + ports: + mariadb: + enabled: true + primary: true + port: 3306 + targetPort: 3306 + targetSelector: mariadb +{{- end -}} diff --git a/library/ix-dev/community/passbolt/templates/common.yaml b/library/ix-dev/community/passbolt/templates/common.yaml new file mode 100644 index 0000000000..f7f3cf1822 --- /dev/null +++ b/library/ix-dev/community/passbolt/templates/common.yaml @@ -0,0 +1,13 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "passbolt.configuration" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "passbolt.persistence" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "passbolt.service" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "passbolt.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "passbolt.mariadb.workload" $ | fromYaml) -}} + +{{/* Create the configmap for portal manually*/}} +{{- include "passbolt.portal" $ -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/library/ix-dev/community/passbolt/upgrade_info.json b/library/ix-dev/community/passbolt/upgrade_info.json new file mode 100644 index 0000000000..767388094a --- /dev/null +++ b/library/ix-dev/community/passbolt/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "values.yaml", "keys": ["image"]} diff --git a/library/ix-dev/community/passbolt/upgrade_strategy b/library/ix-dev/community/passbolt/upgrade_strategy new file mode 100755 index 0000000000..ee19ae1569 --- /dev/null +++ b/library/ix-dev/community/passbolt/upgrade_strategy @@ -0,0 +1,31 @@ +#!/usr/bin/python3 +import json +import re +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +RE_STABLE_VERSION = re.compile(r'\d+\.\d+\.\d+-\d+-ce-non-root') + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = {t.strip('-ce-non-root').replace('-', '.'): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} + version = semantic_versioning(list(tags)) + if not version: + return {} + + return { + 'tags': {key: tags[version]}, + 'app_version': version, + } + + +if __name__ == '__main__': + try: + versions_json = json.loads(sys.stdin.read()) + except ValueError: + raise ValueError('Invalid json specified') + + print(json.dumps(newer_mapping(versions_json))) diff --git a/library/ix-dev/community/passbolt/values.yaml b/library/ix-dev/community/passbolt/values.yaml new file mode 100644 index 0000000000..4083489eb9 --- /dev/null +++ b/library/ix-dev/community/passbolt/values.yaml @@ -0,0 +1,45 @@ +image: + repository: passbolt/passbolt + pullPolicy: IfNotPresent + tag: 4.3.0-1-ce-non-root + +resources: + limits: + cpu: 4000m + memory: 8Gi + +passboltConfig: + appUrl: '' + additionalEnvs: [] + +passboltNetwork: + webPort: 30097 + certificateID: + hostNetwork: false + +passboltStorage: + gpg: + type: ixVolume + datasetName: gpg + jwt: + type: ixVolume + datasetName: jwt + mariadbData: + type: ixVolume + datasetName: mariadbData + mariadbBackup: + type: ixVolume + datasetName: mariadbBackup + additionalStorages: [] + +notes: + custom: | + ## Register admin user + + Connect to the container's shell and run the following command replacing the + values (`user@example.com`, `first_name`, `last_name`) with your own values. + + ```shell + /usr/share/php/passbolt/bin/cake passbolt register_user -r admin \ + -u user@example.com -f first_name -l last_name + ```