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
+2 -1
View File
@@ -51,7 +51,7 @@ jobs:
if [[ $(echo ${OUTPUT_JSON} | jq --compact-output '. | length') -gt 0 ]]; then if [[ $(echo ${OUTPUT_JSON} | jq --compact-output '. | length') -gt 0 ]]; then
echo "detected=true" >> "$GITHUB_OUTPUT" echo "detected=true" >> "$GITHUB_OUTPUT"
fi fi
- name: Test and Fix Pre-Commit Issues - name: Test and Fix Pre-Commit Issues
shell: bash shell: bash
if: inputs.chartChangesDetected == 'true' if: inputs.chartChangesDetected == 'true'
@@ -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
+78 -85
View File
@@ -13,79 +13,73 @@ questions:
# Include{containerBasic} # Include{containerBasic}
# Include{containerAdvanced} # Include{containerAdvanced}
- variable: env - variable: env
group: "App Configuration" group: "App Configuration"
label: "Image Environment" label: "Image Environment"
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: ALLOWED_HOSTS - variable: ALLOWED_HOSTS
label: "ALLOWED_HOSTS" label: "ALLOWED_HOSTS"
description: "Must be a valid domain or * (* is not recommended for production)" description: "Must be a valid domain or * (* is not recommended for production)"
schema: schema:
type: string type: string
default: "localhost" default: "localhost"
required: true required: true
- variable: AUTO_SIGNUP - variable: AUTO_SIGNUP
label: "AUTO_SIGNUP" label: "AUTO_SIGNUP"
description: "Enable automatic signup" description: "Enable automatic signup"
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: LANGUAGE_CODE - variable: LANGUAGE_CODE
label: "LANGUAGE_CODE" label: "LANGUAGE_CODE"
description: "Django language code" description: "Django language code"
schema: schema:
type: string type: string
default: "en-us" default: "en-us"
required: true required: true
- variable: DEBUG - variable: DEBUG
label: "DEBUG" label: "DEBUG"
description: "Output additional messages from `/entrypoint.sh`. It doesn't change the output of the Etebase server." description: "Output additional messages from `/entrypoint.sh`. It doesn't change the output of the Etebase server."
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: SHELL_DEBUG - variable: SHELL_DEBUG
label: "SHELL_DEBUG" label: "SHELL_DEBUG"
description: "Run `/entrypoint.sh` with `set -x`" description: "Run `/entrypoint.sh` with `set -x`"
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: DEBUG_DJANGO - variable: DEBUG_DJANGO
label: "DEBUG_DJANGO" label: "DEBUG_DJANGO"
description: "Enable Django debug mode (not recommended for production)" description: "Enable Django debug mode (not recommended for production)"
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: secretEnv - variable: SUPER_USER
group: "App Configuration" label: "SUPER_USER"
label: "Image Secrets" description: "Username of the Django superuser (First Install Only)"
schema: schema:
additional_attrs: true type: string
type: dict default: "admin"
attrs: required: true
- variable: SUPER_USER - variable: SUPER_PASS
label: "SUPER_USER" label: "SUPER_PASS"
description: "Username of the Django superuser (First Install Only)" description: "Password of the Django superuser (First Install Only). Will be generated if left unset."
schema: schema:
type: string type: string
default: "admin" default: ""
required: true private: true
- variable: SUPER_PASS - variable: SUPER_EMAIL
label: "SUPER_PASS" label: "SUPER_EMAIL"
description: "Password of the Django superuser (First Install Only). Will be generated if left unset." description: "Email of the Django superuser (First Install Only)"
schema: schema:
type: string type: string
default: "" default: ""
private: true
- variable: SUPER_EMAIL
label: "SUPER_EMAIL"
description: "Email of the Django superuser (First Install Only)"
schema:
type: string
default: ""
# Include{containerConfig} # Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot} # Include{serviceRoot}
- variable: main - variable: main
label: "Main Service" label: "Main Service"
@@ -134,28 +128,27 @@ 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"
schema: schema:
type: int type: int
default: 373 default: 373
- variable: runAsGroup - variable: runAsGroup
label: "runAsGroup" label: "runAsGroup"
description: "The groupID this App of the user running the application" description: "The groupID this App of the user running the application"
schema: schema:
type: int type: int
default: 373 default: 373
# Include{securityContextContainer} # Include{securityContextContainer}
# Include{securityContextAdvanced} # Include{securityContextAdvanced}
# Include{securityContextPod} # Include{securityContextPod}
- variable: fsGroup - variable: fsGroup
label: "fsGroup" label: "fsGroup"
description: "The group that should own ALL storage." description: "The group that should own ALL storage."
schema: schema:
type: int type: int
default: 373 default: 373
# Include{resources} # Include{resources}
# Include{advanced} # Include{advanced}
+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" . }}
+65 -53
View File
@@ -3,10 +3,13 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 0.11.0@sha256:47478da0d1b3ab18d5bfbcd4537fa80305ace94746b01c32e609c7e9e663d860 tag: 0.11.0@sha256:47478da0d1b3ab18d5bfbcd4537fa80305ace94746b01c32e609c7e9e663d860
podSecurityContext: securityContext:
runAsUser: 373 container:
runAsGroup: 373 runAsUser: 373
fsGroup: 373 runAsGroup: 373
readOnlyRootFilesystem: false
pod:
fsGroup: 373
# Docker image configuration docs: # Docker image configuration docs:
# https://github.com/victor-rds/docker-etebase#settings-and-customization # https://github.com/victor-rds/docker-etebase#settings-and-customization
@@ -14,50 +17,60 @@ podSecurityContext:
# EteSync configuration docs: # EteSync configuration docs:
# https://github.com/etesync/server#configuration # https://github.com/etesync/server#configuration
env: workload:
# App main:
SERVER: http podSpec:
AUTO_UPDATE: true containers:
ALLOWED_HOSTS: "localhost" main:
AUTO_SIGNUP: false probes:
LANGUAGE_CODE: "en-us" liveness:
TIME_ZONE: "{{ .Values.TZ }}" type: tcp
readiness:
type: tcp
startup:
type: tcp
env:
PORT: "{{ .Values.service.main.ports.main.port }}"
# App
SERVER: http
AUTO_UPDATE: true
ALLOWED_HOSTS: "localhost"
AUTO_SIGNUP: false
LANGUAGE_CODE: "en-us"
TIME_ZONE: "{{ .Values.TZ }}"
# Debugging # Debugging
DEBUG: false DEBUG: false
SHELL_DEBUG: false SHELL_DEBUG: false
DEBUG_DJANGO: false DEBUG_DJANGO: false
# Postgres
DB_ENGINE: postgres
DATABASE_NAME: "{{ .Values.postgresql.postgresqlDatabase }}"
DATABASE_USER: "{{ .Values.postgresql.postgresqlUsername }}"
DATABASE_PASSWORD:
secretKeyRef:
name: dbcreds
key: postgresql-password
DATABASE_HOST:
secretKeyRef:
name: dbcreds
key: plainhost
DATABASE_PORT: 5432
REDIS_URI:
secretKeyRef:
name: rediscreds
key: url
secretEnv:
# Superuser
SUPER_USER: "admin"
SUPER_PASS: ""
SUPER_EMAIL: ""
# Postgres
DB_ENGINE: postgres
DATABASE_NAME: "{{ .Values.cnpg.main.database }}"
DATABASE_USER: "{{ .Values.cnpg.main.user }}"
DATABASE_PASSWORD:
secretKeyRef:
name: cnpg-main-user
key: password
DATABASE_HOST:
secretKeyRef:
name: cnpg-main-urls
key: host
DATABASE_PORT: 5432
REDIS_URI:
secretKeyRef:
expandObjectName: false
name: '{{ printf "%s-%s" .Release.Name "rediscreds" }}'
key: url
# Superuser
SUPER_USER: "admin"
SUPER_PASS: ""
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
enabled: true cnpg:
existingSecret: "dbcreds" main:
postgresqlUsername: etesync enabled: true
postgresqlDatabase: etesync user: etesync
database: etesync
redis: redis:
enabled: true enabled: true
existingSecret: rediscreds
portal: portal:
enabled: true open:
enabled: true