Files
wordyne/Chart/templates/configmap.yaml

211 lines
7.6 KiB
YAML

kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "..fullname" . }}-env
labels:
{{- include "..labels" . | nindent 8 }}
data:
{{- if eq (.Values.email.smtpServer | default "smtp2go" ) "smtp2go" }}
SMTP_PORT: '2525'
{{- else }}
SMTP_PORT: '25'
{{- end }}
SMTP_AUTH: 'true'
SMTP_FROM: 'customer-noreply@v3.nu'
{{- if .Values.email }}
{{- if .Values.email.forceFromEmail }}
SMTP_FORCE_FROM: {{ .Values.email.forceFromEmail }}
{{- end }}
{{- if .Values.email.domains }}
SMTP_ALLOWONLY_DOMAINS: {{ .Values.email.domains | join "," }}
{{- end }}
{{- if .Values.email.allowedEmails }}
SMTP_ALLOWONLY_EMAILS: {{ .Values.email.allowedEmails | join "," }}
{{- end }}
{{- else }}
SMTP_FORCE_FROM: "customer-noreply@v3.nu"
SMTP_FROM_NAME: "V3 Customer Mailer"
{{- end }}
WP_ENV: "{{ .Values.site.environment | default "production" }}"
WP_HOME: "https://{{ ( .Values.site.redirectDomain | default ( .Values.site.domain )) | replace "https://" "" | replace "http://" "" }}"
{{- if .Values.site.additionalEnv }}
{{- range $k, $v := .Values.site.additionalEnv }}
{{ $k }}: {{ $v }}
{{- end }}
{{- end }}
---
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "..fullname" . }}-cfg
labels:
{{- include "..labels" . | nindent 8 }}
data:
init.json: |-
{
"exitOnError": true,
"webserverUser": "unit",
"webserverGroup": "unit",
"applicationDir": "/app",
"permissions": "0770",
"updatePermissions": true,
"importDatabase": {{ .Values.database.import | default false }},
"databasePath": "{{ .Values.database.importPath | default "" }}",
"overwriteDatabase": {{ .Values.database.overwrite | default false }},
"generateSalts": true,
"activateTheme": "{{ .Values.site.theme | default .Values.site.name }}",
"convertUploadsToWebp": {{ .Values.site.enableWebpConversion | default false }},
"convertMissingOnly": true
}
unit.json: |-
{
"settings": {
"http": {
"header_read_timeout": 60,
"body_read_timeout": 60,
"idle_timeout": 60,
"max_body_size": 512111110
}
},
"listeners": {
"*:8080": {
"pass": "routes"
}
},
"routes": [
{
"action": {
"return": 200
},
"match": {
"uri": [
"/unit-ping",
"/fpm-ping"
]
}
},
{
"action": {
"return": 302,
"location": "/wp/wp-admin"
},
"match": {
"uri": [
"/wp-admin",
"/wp-admin/*",
]
}
},
{
"action": {
"return": 302,
"location": "/wp/wp-login.php"
},
"match": {
"uri": [
"/wp-login.php",
"/wp-login.php*"
]
}
},
{
"action": {
"return": 404
},
"match": {
"uri": [
"/app/uploads/*.php",
"/app/uploads/*.php/*"
]
}
},
{
"action": {
"pass": "applications/php/direct"
},
"match": {
"uri": [
"*.php",
"*.php/*",
"/wp/wp-admin/"
]
}
},
{{- if eq .Values.site.enableWebpRoute "true" }}
{
"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"
}
}
}
],
"applications": {
"php": {
"type": "php",
"processes": {
"max": 10,
"spare": 1,
"idle_timeout": 20
},
"options": {
"user": {
"display_errors": "{{ .Values.site.displayErrors | default "0" }}",
"log_errors": "{{ .Values.site.logErrors | default "1" }}"
},
"admin": {
"expose_php": "Off",
"short_open_tag": "Off",
"disable_functions": "exec,passthru,shell_exec,system,proc_open,popen,show_source",
"log_errors": "On",
{{- if and .Values.advanced .Values.advanced.php .Values.advanced.php.additionalAdminValues }}
{{- range $k, $v := .Values.advanced.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 }}
"date.timezone": "{{ .Values.customer.timezone | default "Europe/Stockholm" }}"
}
},
"targets": {
"direct": {
"root": "/app/web"
},
"index": {
"root": "/app/web",
"script": "index.php"
}
}
}
}
}