feat(etesync): Move to new common (#9095)

**Description**

Attempting to move a complicated app, let's see how it goes

⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ 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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ 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
- [ ] ⚠️ 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: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Signed-off-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Stavros kois <s.kois@outlook.com>
This commit is contained in:
StevenMcElligott
2023-05-25 20:46:40 +03:00
committed by GitHub
co-authored by Stavros Kois Stavros kois
parent d8abbbaeb3
commit eeb7a6acca
6 changed files with 160 additions and 163 deletions
+1
View File
@@ -92,6 +92,7 @@ jobs:
filePath: /tmp/lint_result.txt filePath: /tmp/lint_result.txt
comment_tag: lint_results comment_tag: lint_results
mode: recreate mode: recreate
GITHUB_TOKEN: ${{ github.token }}
- name: Lint Result - name: Lint Result
if: steps.list-changed.outputs.detected == 'true' if: steps.list-changed.outputs.detected == 'true'
+3 -7
View File
@@ -3,15 +3,11 @@ appVersion: "0.11.0"
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
version: 11.1.2 version: 12.9.2
- condition: postgresql.enabled
name: postgresql
repository: https://deps.truecharts.org/
version: 11.0.31
- condition: redis.enabled - condition: redis.enabled
name: redis name: redis
repository: https://deps.truecharts.org repository: https://deps.truecharts.org
version: 5.0.33 version: 6.0.43
deprecated: false deprecated: false
description: Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars, tasks and notes. description: Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars, tasks and notes.
home: https://truecharts.org/charts/incubator/etesync home: https://truecharts.org/charts/incubator/etesync
@@ -35,7 +31,7 @@ sources:
- https://github.com/etesync - https://github.com/etesync
- https://github.com/victor-rds/docker-etebase - https://github.com/victor-rds/docker-etebase
type: application type: application
version: 3.0.25 version: 4.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- productivity - productivity
+1 -8
View File
@@ -58,13 +58,6 @@ questions:
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: secretEnv
group: "App Configuration"
label: "Image Secrets"
schema:
additional_attrs: true
type: dict
attrs:
- variable: SUPER_USER - variable: SUPER_USER
label: "SUPER_USER" label: "SUPER_USER"
description: "Username of the Django superuser (First Install Only)" description: "Username of the Django superuser (First Install Only)"
@@ -86,6 +79,7 @@ questions:
type: string type: string
default: "" default: ""
# Include{containerConfig} # Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot} # Include{serviceRoot}
- variable: main - variable: main
label: "Main Service" label: "Main Service"
@@ -134,7 +128,6 @@ questions:
# Include{ingressTraefik} # Include{ingressTraefik}
# Include{ingressList} # Include{ingressList}
# Include{securityContextRoot} # Include{securityContextRoot}
- variable: runAsUser - variable: runAsUser
label: "runAsUser" label: "runAsUser"
description: "The UserID of the user running the application" description: "The UserID of the user running the application"
+5 -13
View File
@@ -1,18 +1,10 @@
{{/* EteSync superuser credentials and Django SECRET_KEY */}} {{/* EteSync superuser credentials and Django SECRET_KEY */}}
{{- define "etesync.secret" -}} {{- define "etesync.secret" -}}
--- enabled: true
{{- $secretName := "etesync-secret" }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data: data:
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) }} {{- with (lookup "v1" "Secret" .Release.Namespace "etesync-secret") }}
secret.txt: {{ index .data "secret.txt" }} secret.txt: {{ index .data "secret.txt" | b64dec }}
{{- else }} {{- else }}
secret.txt: {{ randAlphaNum 32 | b64enc }} secret.txt: {{ randAlphaNum 32 }}
{{- end }} {{- end }}
{{- end -}}
{{- end }}
@@ -1,8 +1,11 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }} {{- include "tc.v1.common.loader.init" . }}
{{/* Render secret for etesync */}} {{/* Render secrets for etesync */}}
{{- include "etesync.secret" . }} {{- $secret := include "etesync.secret" . | fromYaml -}}
{{- if $secret -}}
{{- $_ := set .Values.secret "etesync-secret" $secret -}}
{{- end -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }} {{ include "tc.v1.common.loader.apply" . }}
+35 -23
View File
@@ -3,9 +3,12 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 0.11.0@sha256:47478da0d1b3ab18d5bfbcd4537fa80305ace94746b01c32e609c7e9e663d860 tag: 0.11.0@sha256:47478da0d1b3ab18d5bfbcd4537fa80305ace94746b01c32e609c7e9e663d860
podSecurityContext: securityContext:
container:
runAsUser: 373 runAsUser: 373
runAsGroup: 373 runAsGroup: 373
readOnlyRootFilesystem: false
pod:
fsGroup: 373 fsGroup: 373
# Docker image configuration docs: # Docker image configuration docs:
@@ -14,7 +17,20 @@ podSecurityContext:
# EteSync configuration docs: # EteSync configuration docs:
# https://github.com/etesync/server#configuration # https://github.com/etesync/server#configuration
env: workload:
main:
podSpec:
containers:
main:
probes:
liveness:
type: tcp
readiness:
type: tcp
startup:
type: tcp
env:
PORT: "{{ .Values.service.main.ports.main.port }}"
# App # App
SERVER: http SERVER: http
AUTO_UPDATE: true AUTO_UPDATE: true
@@ -30,34 +46,31 @@ env:
# Postgres # Postgres
DB_ENGINE: postgres DB_ENGINE: postgres
DATABASE_NAME: "{{ .Values.postgresql.postgresqlDatabase }}" DATABASE_NAME: "{{ .Values.cnpg.main.database }}"
DATABASE_USER: "{{ .Values.postgresql.postgresqlUsername }}" DATABASE_USER: "{{ .Values.cnpg.main.user }}"
DATABASE_PASSWORD: DATABASE_PASSWORD:
secretKeyRef: secretKeyRef:
name: dbcreds name: cnpg-main-user
key: postgresql-password key: password
DATABASE_HOST: DATABASE_HOST:
secretKeyRef: secretKeyRef:
name: dbcreds name: cnpg-main-urls
key: plainhost key: host
DATABASE_PORT: 5432 DATABASE_PORT: 5432
REDIS_URI: REDIS_URI:
secretKeyRef: secretKeyRef:
name: rediscreds expandObjectName: false
name: '{{ printf "%s-%s" .Release.Name "rediscreds" }}'
key: url key: url
secretEnv:
# Superuser # Superuser
SUPER_USER: "admin" SUPER_USER: "admin"
SUPER_PASS: "" SUPER_PASS: ""
SUPER_EMAIL: "" SUPER_EMAIL: ""
service: service:
main: main:
ports: ports:
main: main:
protocol: HTTP protocol: http
targetPort: 3735
port: 10254 port: 10254
persistence: persistence:
@@ -66,23 +79,22 @@ persistence:
mountPath: "/data" mountPath: "/data"
secret: secret:
enabled: true enabled: true
type: "custom" type: secret
readOnly: true readOnly: true
mountPath: "/data/secret.txt" mountPath: "/data/secret.txt"
subPath: "secret.txt" subPath: "secret.txt"
volumeSpec: objectName: "etesync-secret"
secret:
secretName: "etesync-secret"
postgresql: # Enabled postgres
cnpg:
main:
enabled: true enabled: true
existingSecret: "dbcreds" user: etesync
postgresqlUsername: etesync database: etesync
postgresqlDatabase: etesync
redis: redis:
enabled: true enabled: true
existingSecret: rediscreds
portal: portal:
open:
enabled: true enabled: true