Files
wordyne/Chart/templates/configmap.yaml

256 lines
9.3 KiB
YAML
Raw Normal View History

2023-03-18 23:16:04 +00:00
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "..fullname" . }}-env
labels:
{{- include "..labels" . | nindent 8 }}
data:
2023-09-12 15:45:08 +02:00
{{- if .Values.email.smtpHost }}
SMTP_HOST: {{ .Values.email.smtpHost }}
{{- end }}
{{- if .Values.email.smtpPort }}
SMTP_PORT: {{ .Values.email.smtpPort | quote }}
{{- end }}
{{- if .Values.email.smtpAuth }}
SMTP_AUTH: 'True'
{{- if .Values.email.smtpUser }}
SMTP_USER: {{ .Values.email.smtpUser }}
{{- end }}
{{- if .Values.email.smtpPassword }}
SMTP_PASSWORD: {{ .Values.email.smtpPassword }}
{{- end }}
{{- end }}
{{- if .Values.email.smtpStarttls }}
2023-07-19 00:29:37 +02:00
SMTP_STARTTLS: 'True'
2023-09-12 15:45:08 +02:00
{{- end }}
{{- if .Values.email.defaultSender }}
SMTP_FROM: {{ .Values.email.defaultSender }}
{{- end }}
{{- if .Values.email.defaultSenderName }}
SMTP_FROM_NAME: {{ .Values.email.defaultSenderName }}
{{- end }}
{{- if .Values.email.forceSender }}
SMTP_FORCE_FROM: {{ .Values.email.forceSender }}
{{- end }}
{{- if .Values.email.domains }}
2023-06-04 07:53:33 +00:00
SMTP_ALLOWONLY_DOMAINS: {{ .Values.email.domains | join "," }}
2023-09-12 15:45:08 +02:00
{{- end }}
{{- if .Values.email.allowedEmails }}
2023-03-28 19:59:53 +00:00
SMTP_ALLOWONLY_EMAILS: {{ .Values.email.allowedEmails | join "," }}
2023-09-12 15:45:08 +02:00
{{- end }}
WP_HOME: "https://{{ .Values.site.domain | replace "http://" "" | replace "https://" "" }}"
2023-09-13 10:41:57 +02:00
{{- if .Values.site.env }}
{{- range $k, $v := .Values.site.env }}
2023-03-27 21:12:31 +00:00
{{ $k }}: {{ $v }}
2023-09-12 15:45:08 +02:00
{{- end }}
{{- end }}
2023-03-18 23:16:04 +00:00
---
kind: ConfigMap
apiVersion: v1
metadata:
2023-03-19 10:07:25 +00:00
name: {{ include "..fullname" . }}-cfg
2023-03-18 23:16:04 +00:00
labels:
{{- include "..labels" . | nindent 8 }}
data:
2023-06-03 22:01:56 +00:00
init.json: |-
{
"exitOnError": true,
"webserverUser": "unit",
"webserverGroup": "unit",
"applicationDir": "/app",
"permissions": "0770",
2023-09-12 15:45:08 +02:00
"updatePermissions": {{ .Values.init.wp.updatePermissions | default false }},
"importDatabase": {{ .Values.init.db.active | default false }},
"databasePath": "{{ .Values.init.db.path | default "" }}",
"databaseUrl": "{{ .Values.init.db.url | default "" }}",
"importContent": {{ .Values.init.content.active | default false }},
"contentPath": "{{ .Values.init.content.path | default "" }}",
"contentUrl": "{{ .Values.init.content.url | default "" }}",
"overwriteDatabase": {{ .Values.init.db.overwrite | default false }},
2023-06-03 22:01:56 +00:00
"generateSalts": true,
2023-09-12 15:45:08 +02:00
"activateTheme": "{{ .Values.init.wp.theme | default .Values.site.name }}",
{{- if .Values.init.asJob }}
2023-10-30 23:44:39 +01:00
"convertUploadsToWebp": {{ .Values.init.content.webpConverter | default true }},
{{- else }}
2023-09-12 15:45:08 +02:00
"convertUploadsToWebp": {{ .Values.init.content.webpConverter | default false }},
{{- end }}
{{- if and .Values.storage.cloud.active .Values.storage.local.active }}
"backupToCloud": true,
{{- else }}
"backupToCloud": false,
{{- end }}
2023-06-07 17:41:03 +02:00
"convertMissingOnly": true
2023-03-18 23:16:04 +00:00
}
2023-06-03 22:01:56 +00:00
unit.json: |-
{
"settings": {
"http": {
"header_read_timeout": 60,
"body_read_timeout": 60,
"idle_timeout": 60,
"max_body_size": 512111110
2023-03-18 23:16:04 +00:00
}
2023-06-03 22:01:56 +00:00
},
"listeners": {
"*:8080": {
"pass": "routes"
2023-03-18 23:16:04 +00:00
}
2023-06-03 22:01:56 +00:00
},
"routes": [
{
"action": {
"return": 200
},
"match": {
"uri": [
"/unit-ping",
"/fpm-ping"
]
}
},
{
"action": {
"return": 302,
"location": "/wp/wp-admin"
2023-06-03 22:01:56 +00:00
},
"match": {
"uri": [
"/wp-admin",
2023-09-13 14:05:07 +02:00
"/wp-admin/*"
2023-06-03 22:01:56 +00:00
]
}
},
{
"action": {
"return": 302,
"location": "/wp/wp-login.php"
2023-06-03 22:01:56 +00:00
},
"match": {
"uri": [
"/wp-login.php",
"/wp-login.php*"
2023-06-03 22:01:56 +00:00
]
}
},
{
"action": {
"return": 404
2023-06-03 22:01:56 +00:00
},
"match": {
"uri": [
"/app/uploads/*.php",
"/app/uploads/*.php/*"
2023-07-18 23:27:15 +02:00
]
}
},
{
"action": {
"pass": "applications/php/direct"
2023-07-18 23:27:15 +02:00
},
"match": {
"uri": [
"*.php",
"*.php/*",
"/wp/wp-admin/"
2023-06-03 22:01:56 +00:00
]
}
},
2023-09-12 15:45:08 +02:00
{{- if (.Values.site.webpRoute | default "true") }}
2023-06-03 22:01:56 +00:00
{
"match": {
"uri": [
"*.jpg",
"*.jpeg",
"*.gif",
"*.png"
]
},
"action": {
"share": [
"/app/web$uri.webp",
"/app/web$uri"
],
"fallback": {
"pass": "applications/php/index"
}
}
},
{{- end }}
{
"action": {
"share": "/app/web$uri",
"fallback": {
"pass": "applications/php/index"
}
}
2023-03-18 23:16:04 +00:00
}
2023-06-03 22:01:56 +00:00
],
"applications": {
"php": {
"type": "php",
2023-07-18 23:39:38 +02:00
"processes": {
2023-09-13 14:05:07 +02:00
"max": {{ .Values.php.maxProc | default 5 }},
"spare": {{ .Values.php.spareProc | default 1 }},
"idle_timeout": {{ .Values.php.procIdleTimeout | default 65 }}
2023-07-18 23:39:38 +02:00
},
2023-06-03 22:01:56 +00:00
"options": {
"user": {
2023-09-12 15:45:08 +02:00
{{- if and .Values.php .Values.php.additionalValues }}
{{- range $k, $v := .Values.php.additionalValues }}
"{{ $k }}": "{{ $v }}",
{{- end }}
{{- end }}
"display_errors": "{{ .Values.php.displayErrors | default "Off" }}",
"log_errors": "{{ .Values.php.logErrors | default "On" }}"
2023-06-03 22:01:56 +00:00
},
"admin": {
"expose_php": "Off",
"short_open_tag": "Off",
"disable_functions": "exec,passthru,shell_exec,system,proc_open,popen,show_source",
2023-09-12 15:45:08 +02:00
"log_errors": "{{ .Values.php.logErrors | default "On" }}",
{{- if and .Values.php .Values.php.additionalAdminValues }}
{{- range $k, $v := .Values.php.additionalAdminValues }}
"{{ $k }}": "{{ $v }}",
{{- end }}
{{- else }}
"memory_limit": "{{ .Values.site.resources.php.memory | default "512M" }}",
"upload_max_filesize": "{{ .Values.site.resources.php.upload | default "512M" }}",
"post_max_size": "{{ .Values.site.resources.php.post | default "512M" }}",
"max_execution_time": "{{ .Values.site.resources.php.executionTime | default "300" }}",
"max_input_time": "{{ .Values.site.resources.php.inputTime | default "300" }}",
{{- end }}
2023-06-04 09:58:43 +00:00
"date.timezone": "{{ .Values.customer.timezone | default "Europe/Stockholm" }}"
2023-06-03 22:01:56 +00:00
}
},
"targets": {
"direct": {
"root": "/app/web"
},
"index": {
"root": "/app/web",
"script": "index.php"
}
}
2023-03-18 23:16:04 +00:00
}
}
2023-03-22 22:59:03 +01:00
}
2023-09-12 15:45:08 +02:00
{{- if .Values.storage.configMap }}
{{- range .Values.storage.configMap }}
{{- if eq .type "configmap" }}
---
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "..fullname" $ }}-cm-{{ .name }}
labels:
{{- include "..labels" $ | nindent 8 }}
data:
{{- range $k, $v := .files }}
{{ $v.name }}: {{ $v.content | toYaml | indent 4}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}