From 5f21f72b36c9ee2ff5d93e419f35d0bba96b91c5 Mon Sep 17 00:00:00 2001 From: Andy <76787794+AndyW22@users.noreply.github.com> Date: Sat, 22 Jul 2023 13:14:27 +0100 Subject: [PATCH] feat(joplin-server): Migrate to new common (#9564) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Migrate joplin-server to new common based on the changes in https://github.com/truecharts/charts/pull/7913/files ⚒️ Fixes # **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [x] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros kois --- charts/incubator/joplin-server/Chart.yaml | 9 +- .../joplin-server/ci/test-values.yaml | 7 ++ .../joplin-server/templates/NOTES.txt | 1 + .../joplin-server/templates/common.yaml | 2 +- charts/incubator/joplin-server/values.yaml | 98 ++++++++++--------- 5 files changed, 65 insertions(+), 52 deletions(-) create mode 100644 charts/incubator/joplin-server/ci/test-values.yaml create mode 100644 charts/incubator/joplin-server/templates/NOTES.txt diff --git a/charts/incubator/joplin-server/Chart.yaml b/charts/incubator/joplin-server/Chart.yaml index 5ceba75e741..d9728ac4acf 100644 --- a/charts/incubator/joplin-server/Chart.yaml +++ b/charts/incubator/joplin-server/Chart.yaml @@ -3,11 +3,7 @@ appVersion: "2.10.10" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 - - condition: postgresql.enabled - name: postgresql - repository: https://deps.truecharts.org/ - version: 11.0.31 + version: 13.2.0 deprecated: false description: Allows you to sync any Joplin client. home: https://truecharts.org/charts/incubator/joplin-server @@ -26,9 +22,8 @@ sources: - https://github.com/laurent22/joplin/tree/dev/packages/server - https://github.com/laurent22/joplin type: application -version: 12.0.0 +version: 13.0.0 annotations: truecharts.org/catagories: | - media truecharts.org/SCALE-support: "true" - truecharts.org/grade: U diff --git a/charts/incubator/joplin-server/ci/test-values.yaml b/charts/incubator/joplin-server/ci/test-values.yaml new file mode 100644 index 00000000000..dd8528f5366 --- /dev/null +++ b/charts/incubator/joplin-server/ci/test-values.yaml @@ -0,0 +1,7 @@ +workload: + main: + podSpec: + containers: + main: + env: + APP_BASE_URL: "http://localhost:{{ .Values.service.main.ports.main.port }}" diff --git a/charts/incubator/joplin-server/templates/NOTES.txt b/charts/incubator/joplin-server/templates/NOTES.txt new file mode 100644 index 00000000000..72e715a3bc5 --- /dev/null +++ b/charts/incubator/joplin-server/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/joplin-server/templates/common.yaml b/charts/incubator/joplin-server/templates/common.yaml index c1a366e1cf0..9d95f161711 100644 --- a/charts/incubator/joplin-server/templates/common.yaml +++ b/charts/incubator/joplin-server/templates/common.yaml @@ -1 +1 @@ -{{ include "tc.common.loader.all" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/incubator/joplin-server/values.yaml b/charts/incubator/joplin-server/values.yaml index 929e3f77c31..6013e6a36cb 100644 --- a/charts/incubator/joplin-server/values.yaml +++ b/charts/incubator/joplin-server/values.yaml @@ -4,62 +4,72 @@ image: pullPolicy: IfNotPresent securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 + runAsGroup: 0 -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 - -env: - APP_BASE_URL: http://localhost:22300 - APP_PORT: 22300 - DB_CLIENT: "pg" - POSTGRES_DATABASE: "{{ .Values.postgresql.postgresqlDatabase }}" - POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}" - POSTGRES_PORT: "5432" - POSTGRES_PASSWORD: - secretKeyRef: - name: dbcreds - key: postgresql-password - POSTGRES_HOST: - secretKeyRef: - name: dbcreds - key: plainhost - MAILER_ENABLED: 0 - MAILER_HOST: "" - MAILER_PORT: 465 - MAILER_SECURE: true - MAILER_AUTH_USER: "" - MAILER_AUTH_PASSWORD: "" - MAILER_NOREPLY_NAME: "" - MAILER_NOREPLY_EMAIL: "" - -probes: - liveness: - path: "/api/ping" - readiness: - path: "/api/ping" - startup: - path: "/api/ping" +workload: + main: + podSpec: + containers: + main: + probes: + liveness: + path: "/api/ping" + port: "{{ .Values.service.main.ports.main.port }}" + httpHeaders: + Host: '{{ tpl .Values.workload.main.podSpec.containers.main.env.APP_BASE_URL $ | replace "https://" "" | replace "http://" "" }}' + readiness: + path: "/api/ping" + port: "{{ .Values.service.main.ports.main.port }}" + httpHeaders: + Host: '{{ tpl .Values.workload.main.podSpec.containers.main.env.APP_BASE_URL $ | replace "https://" "" | replace "http://" "" }}' + startup: + type: tcp + port: "{{ .Values.service.main.ports.main.port }}" + env: + APP_BASE_URL: "" + APP_PORT: "{{ .Values.service.main.ports.main.port }}" + DB_CLIENT: "pg" + POSTGRES_DATABASE: "{{ .Values.cnpg.main.database }}" + POSTGRES_USER: "{{ .Values.cnpg.main.user }}" + POSTGRES_PORT: "5432" + POSTGRES_PASSWORD: + secretKeyRef: + name: cnpg-main-user + key: password + POSTGRES_HOST: + secretKeyRef: + name: cnpg-main-urls + key: host + MAILER_ENABLED: 0 + MAILER_HOST: "" + MAILER_PORT: 465 + MAILER_SECURE: true + MAILER_AUTH_USER: "" + MAILER_AUTH_PASSWORD: "" + MAILER_NOREPLY_NAME: "" + MAILER_NOREPLY_EMAIL: "" service: main: ports: main: port: 22300 - targetPort: 22300 persistence: config: enabled: true mountPath: "/config" -postgresql: - enabled: true - existingSecret: "dbcreds" - postgresqlUsername: joplin - postgresqlDatabase: joplin +cnpg: + main: + enabled: true + user: joplin + database: joplin portal: - enabled: true + open: + enabled: true