Skip to content

Commit 8aaca2c

Browse files
add env config stuffs
1 parent d121ae0 commit 8aaca2c

File tree

5 files changed

+61
-1
lines changed

5 files changed

+61
-1
lines changed

charts/discourse-vanilla/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.3
18+
version: 0.1.4
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "discourse.fullname" . }}-config
5+
labels:
6+
{{- include "discourse.labels" . | nindent 4 }}
7+
data:
8+
RUBY_GC_HEAP_GROWTH_MAX_SLOTS: "40000"
9+
DISCOURSE_HOSTNAME: "{{ .Values.forum.hostname }}"
10+
LANG: "en_US.UTF-8"
11+
UNICORN_WORKERS: "{{ .Values.forum.workers }}"
12+
DISCOURSE_FORCE_HTTPS: "true"
13+
LETSENCRYPT_ACCOUNT_EMAIL: "{{ .Values.forum.letsencrypt.email }}"
14+
DOCKER_HOST_IP: "172.17.0.1"
15+
RAILS_ENV: "production"
16+
UNICORN_SIDEKIQS: "1"
17+
DISCOURSE_DB_HOST: ""
18+
DISCOURSE_DB_PORT: ""
19+
DISCOURSE_SMTP_ADDRESS: "{{ .Values.forum.mail.host }}"
20+
DISCOURSE_SMTP_PORT: "{{ .Values.forum.mail.port }}"
21+
RUBY_GC_HEAP_INIT_SLOTS: "400000"
22+
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR: "1.5"
23+
DISCOURSE_DB_SOCKET: "/var/run/postgresql"
24+
LETSENCRYPT_DIR: "/shared/letsencrypt"
25+
DISCOURSE_DEVELOPER_EMAILS: "jakub.vysoky@ethereum.org,ligi@ethereum.org"
26+
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
27+
RUBY_VERSION: "3.3.6"
28+
PG_MAJOR: "15"
29+
RUBY_ALLOCATOR: "/usr/lib/libjemalloc.so"
30+
LEFTHOOK: "0"
31+
DEBIAN_RELEASE: "bookworm"
32+
LC_ALL: "en_US.UTF-8"
33+
LANGUAGE: "en_US.UTF-8"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if not .Values.forum.mail.existingSecret }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "discourse.fullname" . }}-smtp
6+
labels:
7+
{{- include "discourse.labels" . | nindent 4 }}
8+
type: Opaque
9+
data:
10+
DISCOURSE_SMTP_USER_NAME: {{ .Values.forum.mail.user | b64enc | quote }}
11+
DISCOURSE_SMTP_PASSWORD: {{ .Values.forum.mail.password | b64enc | quote }}
12+
{{- end }}

charts/discourse-vanilla/templates/statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ spec:
4141
{{- end }}
4242
image: "{{ .Values.image.repository }}/{{ .Values.forum.name }}:{{ .Values.forum.version | default .Values.image.tag | default .Chart.AppVersion }}"
4343
imagePullPolicy: {{ .Values.image.pullPolicy }}
44+
envFrom:
45+
- configMapRef:
46+
name: {{ include "discourse.fullname" . }}-config
47+
- secretRef:
48+
name: {{ .Values.forum.mail.existingSecret | default (printf "%s-smtp" (include "discourse.fullname" .)) }}
4449
ports:
4550
- name: http
4651
containerPort: 80

charts/discourse-vanilla/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ image:
1717
forum:
1818
name: "default"
1919
version: "latest"
20+
hostname: "forum.discource.example"
21+
workers: 4
22+
letsencrypt:
23+
email: john@doe.com
24+
mail:
25+
host: smtp.example.com
26+
port: 587
27+
user: mailuser
28+
password: mailpass
29+
# existingSecret: "" # Name of existing secret containing DISCOURSE_SMTP_USER_NAME and DISCOURSE_SMTP_PASSWORD
2030

2131

2232
# Persistence configuration

0 commit comments

Comments
 (0)