TrueChartsClone/charts/stable/wordpress/templates/_env.tpl

95 lines
3.9 KiB
Smarty
Raw Normal View History

Replace all CRLFs with LFs (#9593) **Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> When looking at the catalog files on scale, I noticed that there is a mix of CRLFs and LFs. I assume this was not intentional given the yaml linter has a check to ensure chart yaml files use LFs. This change converts all CRLFs to LFs. **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] 🔃 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:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 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._
2023-06-13 07:55:52 +00:00
{{/* Wordpress environment variables */}}
{{- define "wordpress.env" -}}
configmap:
env-config:
enabled: true
data:
APACHE_HTTP_PORT_NUMBER: {{ .Values.service.main.ports.main.port | quote }}
{{/* Database */}}
WORDPRESS_DATABASE_PORT_NUMBER: "3306"
WORDPRESS_DATABASE_USER: {{ .Values.mariadb.mariadbUsername | quote }}
WORDPRESS_DATABASE_NAME: {{ .Values.mariadb.mariadbDatabase | quote }}
{{/* Wordpress */}}
WORDPRESS_USERNAME: {{ .Values.wordpress.user | quote }}
WORDPRESS_EMAIL: {{ .Values.wordpress.email | quote }}
WORDPRESS_FIRST_NAME: {{ .Values.wordpress.first_name | quote }}
WORDPRESS_LAST_NAME: {{ .Values.wordpress.last_name | quote }}
WORDPRESS_BLOG_NAME: {{ .Values.wordpress.blog_name | quote }}
WORDPRESS_ENABLE_REVERSE_PROXY: {{ ternary "yes" "no" .Values.wordpress.enable_reverse_proxy_headers | quote }}
feat(wordpress): switch to https (#15818) **Description** Switch wordpress to HTTPS ⚒️ Fixes #11500 **⚙️ Type of change** - [X] ⚙️ 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?** **📃 Notes:** **✔️ 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 - [X] ⬆️ 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: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
2023-12-07 12:44:21 +00:00
WORDPRESS_ENABLE_HTTPS: "true"
Replace all CRLFs with LFs (#9593) **Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> When looking at the catalog files on scale, I noticed that there is a mix of CRLFs and LFs. I assume this was not intentional given the yaml linter has a check to ensure chart yaml files use LFs. This change converts all CRLFs to LFs. **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] 🔃 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:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 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._
2023-06-13 07:55:52 +00:00
{{- if .Values.smtp.enabled }}
WORDPRESS_SMTP_HOST: {{ .Values.smtp.host | quote }}
WORDPRESS_SMTP_PORT: {{ .Values.smtp.port | quote }}
{{- end }}
{{- $php := get .Values "php-config" }}
{{/* PHP */}}
{{- with $php.PHP_ENABLE_OPCACHE }}
PHP_ENABLE_OPCACHE: {{ . | quote }}
{{- end }}
{{- with $php.PHP_EXPOSE_PHP }}
PHP_EXPOSE_PHP: {{ . | quote }}
{{- end }}
{{- with $php.PHP_MAX_EXECUTION_TIME }}
PHP_MAX_EXECUTION_TIME: {{ . | quote }}
{{- end }}
{{- with $php.PHP_MAX_INPUT_TIME }}
PHP_MAX_INPUT_TIME: {{ . | quote }}
{{- end }}
{{- with $php.PHP_MAX_INPUT_VARS }}
PHP_MAX_INPUT_VARS: {{ . | quote }}
{{- end }}
{{- with $php.PHP_MEMORY_LIMIT }}
PHP_MEMORY_LIMIT: {{ . | quote }}
{{- end }}
{{- with $php.PHP_POST_MAX_SIZE }}
PHP_POST_MAX_SIZE: {{ . | quote }}
{{- end }}
{{- with $php.PHP_UPLOAD_MAX_FILESIZE }}
PHP_UPLOAD_MAX_FILESIZE: {{ . | quote }}
{{- end }}
{{- $secretName := printf "%s-env-secret" (include "tc.v1.common.lib.chart.names.fullname" .) }}
secret:
env-secret:
enabled: true
data:
WORDPRESS_DATABASE_HOST: {{ .Values.mariadb.creds.plainhost }}
WORDPRESS_DATABASE_PASSWORD: {{ .Values.mariadb.creds.mariadbPassword | trimAll "\"" }}
WORDPRESS_PASSWORD: {{ .Values.wordpress.pass }}
{{- if .Values.smtp.enabled }}
WORDPRESS_SMTP_USER: {{ .Values.smtp.user }}
WORDPRESS_SMTP_PASSWORD: {{ .Values.smtp.pass }}
{{- end }}
{{/* Salts */}}
WORDPRESS_AUTH_KEY: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_AUTH_KEY" "secret" $secretName) }}
WORDPRESS_SECURE_AUTH_KEY: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_SECURE_AUTH_KEY" "secret" $secretName) }}
WORDPRESS_LOGGED_IN_KEY: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_LOGGED_IN_KEY" "secret" $secretName) }}
WORDPRESS_NONCE_KEY: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_NONCE_KEY" "secret" $secretName) }}
WORDPRESS_AUTH_SALT: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_AUTH_SALT" "secret" $secretName) }}
WORDPRESS_SECURE_AUTH_SALT: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_SECURE_AUTH_SALT" "secret" $secretName) }}
WORDPRESS_LOGGED_IN_SALT: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_LOGGED_IN_SALT" "secret" $secretName) }}
WORDPRESS_NONCE_SALT: {{ include "wordpress.fetch" (dict "ns" .Release.Namespace "var" "WORDPRESS_NONCE_SALT" "secret" $secretName) }}
{{- end }}
{{- define "wordpress.fetch" -}}
{{- $var := .var -}}
{{- $secret := .secret -}}
{{- $ns := .ns -}}
{{- $ret := randAlphaNum 32 -}}
{{- with (lookup "v1" "Secret" $ns $secret) -}}
{{- $ret = index .data $var | b64dec -}}
{{- end -}}
{{- $ret -}}
{{- end -}}