diff --git a/charts/stable/lychee/Chart.yaml b/charts/stable/lychee/Chart.yaml index 7299c88a740..1d7bd29a36f 100644 --- a/charts/stable/lychee/Chart.yaml +++ b/charts/stable/lychee/Chart.yaml @@ -4,6 +4,14 @@ dependencies: - name: common repository: https://truecharts.org version: 8.16.0 +- condition: postgresql.enabled + name: postgresql + repository: https://truecharts.org/ + version: 6.0.68 +- condition: redis.enabled + name: redis + repository: https://truecharts.org + version: 1.0.74 deprecated: false description: Lychee is a free photo-management tool, which runs on your server or web-space @@ -23,7 +31,7 @@ sources: - https://github.com/LycheeOrg/Lychee - https://hub.docker.com/r/lycheeorg/lychee type: application -version: 9.0.43 +version: 10.0.0 annotations: truecharts.org/catagories: | - media diff --git a/charts/stable/lychee/questions.yaml b/charts/stable/lychee/questions.yaml index b475ab27807..7387018f003 100644 --- a/charts/stable/lychee/questions.yaml +++ b/charts/stable/lychee/questions.yaml @@ -88,7 +88,133 @@ questions: schema: type: int default: 568 + - variable: APP_URL + label: "APP_URL" + description: "Application URL eg. https://lychee.mydomain.com" + schema: + type: string + default: "http://localhost" + - variable: APP_DEBUG + label: "APP_DEBUG" + description: "Enables the debug info" + schema: + type: boolean + default: false + - variable: SECURITY_HEADER_HSTS_ENABLE + label: "SECURITY_HEADER_HSTS_ENABLE" + description: "Enables HSTS Headers" + schema: + type: boolean + default: false + - variable: secret + group: "Container Configuration" + label: "Secret Image Environment" + schema: + additional_attrs: true + type: dict + attrs: + - variable: MAIL_FROM_ADDRESS + label: "MAIL_FROM_ADDRESS" + description: "Mail from Address" + schema: + type: string + default: "" + - variable: MAIL_FROM_NAME + label: "MAIL_FROM_NAME" + description: "Mail from Name" + schema: + type: string + default: "" + - variable: MAIL_DRIVER + label: "MAIL_DRIVER" + description: "Mail Driver" + schema: + type: string + default: "smtp" + enum: + - value: "smtp" + description: "smtp" + - value: "mailgun" + description: "mailgun" + - value: "sendmail" + description: "sendmail" + - value: "ses" + description: "ses" + - value: "postmark" + description: "postmark" + - value: "log" + description: "log" + - value: "array" + description: "array" + - variable: MAIL_HOST + label: "MAIL_HOST" + description: "Mail Host" + schema: + type: string + default: "" + - variable: MAIL_PORT + label: "MAIL_PORT" + description: "Mail Port" + schema: + type: int + - variable: MAIL_USERNAME + label: "MAIL_USERNAME" + description: "Mail Username" + schema: + type: string + default: "" + - variable: MAIL_PASSWORD + label: "MAIL_PASSWORD" + description: "Mail Password" + schema: + type: string + private: true + default: "" + - variable: MAIL_ENCRYPTION + label: "MAIL_ENCRYPTION" + description: "Mail Encryption" + schema: + type: string + default: "tls" + - variable: PUSHER_APP_ID + label: "PUSHER_APP_ID" + description: "Pusher App ID" + schema: + type: string + default: "" + - variable: PUSHER_APP_KEY + label: "PUSHER_APP_KEY" + description: "Pusher App Key" + schema: + type: string + private: true + default: "" + - variable: PUSHER_APP_SECRET + label: "PUSHER_APP_SECRET" + description: "Pusher App Secret" + schema: + type: string + private: true + default: "" + - variable: PUSHER_APP_CLUSTER + label: "PUSHER_APP_CLUSTER" + description: "Pusher App Cluster" + schema: + type: string + default: "mt1" + - variable: PUSHER_APP_CLUSTER + label: "PUSHER_APP_CLUSTER" + description: "Pusher App Cluster" + schema: + type: string + default: "mt1" + - variable: PUSHER_APP_CLUSTER + label: "PUSHER_APP_CLUSTER" + description: "Pusher App Cluster" + schema: + type: string + default: "mt1" # Include{containerConfig} @@ -182,7 +308,7 @@ questions: additional_attrs: true type: dict attrs: - - variable: config + - variable: conf label: "App Config Storage" description: "Stores the Application Configuration." schema: @@ -225,6 +351,92 @@ questions: - value: "Memory" description: "Memory" # Include{persistenceAdvanced} + - variable: sym + label: "App sym Storage" + description: "Stores the Application sym." + schema: + additional_attrs: true + type: dict + attrs: + - variable: type + label: "Type of Storage" + description: "Sets the persistence type, Anything other than PVC could break rollback!" + schema: + type: string + default: "simplePVC" + enum: + - value: "simplePVC" + description: "PVC (simple)" + - value: "simpleHP" + description: "HostPath (simple)" + - value: "emptyDir" + description: "emptyDir" + - value: "pvc" + description: "pvc" + - value: "hostPath" + description: "hostPath" +# Include{persistenceBasic} + - variable: hostPath + label: "hostPath" + description: "Path inside the container the storage is mounted" + schema: + show_if: [["type", "=", "hostPath"]] + type: hostpath + - variable: medium + label: "EmptyDir Medium" + schema: + show_if: [["type", "=", "emptyDir"]] + type: string + default: "" + enum: + - value: "" + description: "Default" + - value: "Memory" + description: "Memory" +# Include{persistenceAdvanced} + - variable: uploads + label: "App Uploads Storage" + description: "Stores the Application Uploads." + schema: + additional_attrs: true + type: dict + attrs: + - variable: type + label: "Type of Storage" + description: "Sets the persistence type, Anything other than PVC could break rollback!" + schema: + type: string + default: "simplePVC" + enum: + - value: "simplePVC" + description: "PVC (simple)" + - value: "simpleHP" + description: "HostPath (simple)" + - value: "emptyDir" + description: "emptyDir" + - value: "pvc" + description: "pvc" + - value: "hostPath" + description: "hostPath" +# Include{persistenceBasic} + - variable: hostPath + label: "hostPath" + description: "Path inside the container the storage is mounted" + schema: + show_if: [["type", "=", "hostPath"]] + type: hostpath + - variable: medium + label: "EmptyDir Medium" + schema: + show_if: [["type", "=", "emptyDir"]] + type: string + default: "" + enum: + - value: "" + description: "Default" + - value: "Memory" + description: "Memory" +# Include{persistenceAdvanced} # Include{persistenceList} diff --git a/charts/stable/lychee/templates/_secrets.tpl b/charts/stable/lychee/templates/_secrets.tpl new file mode 100644 index 00000000000..768a00eb026 --- /dev/null +++ b/charts/stable/lychee/templates/_secrets.tpl @@ -0,0 +1,20 @@ +{{/* Define the secrets */}} +{{- define "lychee.secrets" -}} +--- + +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: lychee-secrets +{{- $lycheeprevious := lookup "v1" "Secret" .Release.Namespace "lychee-secrets" }} +{{- $app_key := "" }} +data: + {{- if $lycheeprevious}} + APP_KEY: {{ index $lycheeprevious.data "APP_KEY" }} + {{- else }} + {{- $app_key := randAlphaNum 32 }} + APP_KEY: {{ $app_key | b64enc }} + {{- end }} + +{{- end -}} diff --git a/charts/stable/lychee/templates/common.yaml b/charts/stable/lychee/templates/common.yaml index a6613c2ce21..d9b58791f5f 100644 --- a/charts/stable/lychee/templates/common.yaml +++ b/charts/stable/lychee/templates/common.yaml @@ -1 +1,7 @@ -{{ include "common.all" . }} +{{/* Make sure all variables are set properly */}} +{{ include "common.setup" . }} + +{{ include "lychee.secrets" . }} + +{{/* Render the templates */}} +{{ include "common.postSetup" . }} diff --git a/charts/stable/lychee/values.yaml b/charts/stable/lychee/values.yaml index 0981a1158ee..dd72bff7eaf 100644 --- a/charts/stable/lychee/values.yaml +++ b/charts/stable/lychee/values.yaml @@ -18,10 +18,69 @@ service: port: 10017 targetPort: 80 -env: {} - # PHP_TZ: UTC - # PUID: 1001 +env: + # Internal Envs + TIMEZONE: "{{ .Values.env.TZ }}" + PHP_TZ: "{{ .Values.env.TZ }}" + DB_CONNECTION: "pgsql" + DB_PORT: "5432" + DB_DATABASE: "{{ .Values.postgresql.postgresqlDatabase }}" + DB_USERNAME: "{{ .Values.postgresql.postgresqlUsername }}" + REDIS_PORT: "6379" + CACHE_DRIVER: "redis" + SESSION_DRIVER: "redis" + APP_ENV: "production" + APP_NAME: "Lychee" + MIX_PUSHER_APP_KEY: "{{ .Values.env.PUSHER_APP_KEY }}" + MIX_PUSHER_APP_CLUSTER: "{{ .Values.env.PUSHER_APP_CLUSTER }}" + # User Envs + PUID: 568 + TZ: UTC + SECURITY_HEADER_HSTS_ENABLE: false + APP_DEBUG: false + PUSHER_APP_KEY: "" + PUSHER_APP_CLUSTER: "" + APP_URL: http://localhost + +envValueFrom: + DB_PASSWORD: + secretKeyRef: + name: dbcreds + key: postgresql-password + DB_HOST: + secretKeyRef: + name: dbcreds + key: plainhost + REDIS_HOST: + secretKeyRef: + name: rediscreds + key: plainhost + REDIS_PASSWORD: + secretKeyRef: + name: rediscreds + key: redis-password + APP_KEY: + secretKeyRef: + name: lychee-secrets + key: APP_KEY + persistence: - config: + conf: enabled: true - mountPath: "/config" + mountPath: "/conf" + sym: + enabled: true + mountPath: "/sym" + uploads: + enabled: true + mountPath: "/uploads" + +postgresql: + enabled: true + existingSecret: "dbcreds" + postgresqlUsername: lychee + postgresqlDatabase: lychee + +redis: + enabled: true + existingSecret: "rediscreds"