Skip to content

Commit

Permalink
Fix jmap config
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Sep 23, 2024
1 parent 0e45e7a commit 94e5cf1
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 38 deletions.
6 changes: 3 additions & 3 deletions apis/installer/v1alpha1/inbox_agent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ type InboxAgentApiserver struct {
}

type InboxServerInfo struct {
JMAPEndpoint string `json:"jmapEndpoint"`
WebadminEndpoint string `json:"webadminEndpoint"`
Token string `json:"token"`
JMAPSessionEndpoint string `json:"jmapSessionEndpoint"`
WebadminEndpoint string `json:"webadminEndpoint"`
Token string `json:"token"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 1 addition & 1 deletion charts/inbox-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The following table lists the configurable parameters of the `inbox-agent` chart
| apiserver.servingCerts.serverKey | Private key for the serving certificate used by webhook server. | <code>""</code> |
| monitoring.agent | Name of monitoring agent (either "prometheus.io/operator" or "prometheus.io/builtin") | <code>"none"</code> |
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |
| inboxServer.jmapEndpoint | | <code>""</code> |
| inboxServer.jmapSessionEndpoint | | <code>""</code> |
| inboxServer.webadminEndpoint | | <code>""</code> |
| inboxServer.token | | <code>""</code> |

Expand Down
2 changes: 1 addition & 1 deletion charts/inbox-agent/templates/operator/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ metadata:
{{- include "inbox-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
jmapEndpoint: {{ .Values.inboxServer.jmapEndpoint }}
jmapSessionEndpoint: {{ .Values.inboxServer.jmapSessionEndpoint }}
webadminEndpoint: {{ .Values.inboxServer.webadminEndpoint }}
token: {{.Values.inboxServer.token}}
14 changes: 2 additions & 12 deletions charts/inbox-agent/templates/operator/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ spec:
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
{{- if .Values.inboxServer.jmapEndpoint }}
- --jmapEndpoint={{ .Values.inboxServer.jmapEndpoint }}
{{- if .Values.inboxServer.jmapSessionEndpoint }}
- --jmapSessionEndpoint={{ .Values.inboxServer.jmapSessionEndpoint }}
{{- end }}
{{- if .Values.inboxServer.webadminEndpoint }}
- --webadminEndpoint={{ .Values.inboxServer.webadminEndpoint }}
Expand All @@ -80,16 +80,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: INBOX_SERVER_JMAP_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: jmapEndpoint
- name: INBOX_SERVER_WEBADMIN_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: webadminEndpoint
- name: INBOX_SERVER_TOKEN
valueFrom:
secretKeyRef:
Expand Down
14 changes: 2 additions & 12 deletions charts/inbox-agent/templates/webhook/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ spec:
args:
- webhook
- --webhook-name={{ include "inbox-agent.fullname" . }}
{{- if .Values.inboxServer.jmapEndpoint }}
- --jmapEndpoint={{ .Values.inboxServer.jmapEndpoint }}
{{- if .Values.inboxServer.jmapSessionEndpoint }}
- --jmapSessionEndpoint={{ .Values.inboxServer.jmapSessionEndpoint }}
{{- end }}
{{- if .Values.inboxServer.webadminEndpoint }}
- --webadminEndpoint={{ .Values.inboxServer.webadminEndpoint }}
Expand All @@ -75,16 +75,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: INBOX_SERVER_WEBADMIN_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: webadminEndpoint
- name: INBOX_SERVER_JMAP_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: jmapEndpoint
- name: INBOX_SERVER_TOKEN
valueFrom:
secretKeyRef:
Expand Down
4 changes: 2 additions & 2 deletions charts/inbox-agent/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -945,14 +945,14 @@ properties:
type: array
inboxServer:
properties:
jmapEndpoint:
jmapSessionEndpoint:
type: string
token:
type: string
webadminEndpoint:
type: string
required:
- jmapEndpoint
- jmapSessionEndpoint
- token
- webadminEndpoint
type: object
Expand Down
2 changes: 1 addition & 1 deletion charts/inbox-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ monitoring:
labels: {}

inboxServer:
jmapEndpoint: ""
jmapSessionEndpoint: ""
webadminEndpoint: ""
token: ""
2 changes: 1 addition & 1 deletion charts/inbox-server/configs/domainlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
<domainlist>
<autodetect>false</autodetect>
<autodetectIP>false</autodetectIP>
<defaultDomain>${env:JAMES_DEFAULT_DOMAIN}</defaultDomain>
<defaultDomain>${env:JAMES_EMAIL_DOMAIN}</defaultDomain>
</domainlist>
3 changes: 2 additions & 1 deletion charts/inbox-server/configs/jmap.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ tls.secret=${env:JAMES_KEYSTORE_PASSWORD}
#
jwt.publickeypem.url=file://conf/jwt_publickey
jwt.privatekeypem.url=file://conf/jwt_privatekey
jmap.port=80
url.prefix=https://${env:JAMES_SERVER_DOMAIN}
jmap.port=8080

view.email.query.enabled=true
email.send.max.size=${env:JAMES_MESSAGE_SIZE}
Expand Down
20 changes: 17 additions & 3 deletions charts/inbox-server/templates/james/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ spec:
name: {{ include "inbox-server.fullname" . }}-openssearch-auth
key: password
{{- end }}
- name: JAMES_DEFAULT_DOMAIN
{{ if .Values.dns.domain }}
- name: JAMES_SERVER_DOMAIN
value: {{ .Values.dns.domain }}
{{ else }}
- name: JAMES_SERVER_DOMAIN
value: {{ first .Values.dns.targetIPs }}
{{ end }}
- name: JAMES_EMAIL_DOMAIN
value: {{ .Values.dns.emailDomain }}
- name: JAMES_SMTP_HOSTNAME
value: "smtp.{{ .Values.dns.emailDomain }}"
Expand Down Expand Up @@ -162,7 +169,7 @@ spec:
- name: JAVA_TOOL_OPTIONS
value: "{{ $jamesOpts }}"
ports:
- containerPort: 80
- containerPort: 8080
- containerPort: 8000
- containerPort: 4000
resources:
Expand Down Expand Up @@ -326,7 +333,14 @@ spec:
name: {{ include "inbox-server.fullname" . }}-openssearch-auth
key: password
{{- end }}
- name: JAMES_DEFAULT_DOMAIN
{{ if .Values.dns.domain }}
- name: JAMES_SERVER_DOMAIN
value: {{ .Values.dns.domain }}
{{ else }}
- name: JAMES_SERVER_DOMAIN
value: {{ first .Values.dns.targetIPs }}
{{ end }}
- name: JAMES_EMAIL_DOMAIN
value: {{ .Values.dns.emailDomain }}
- name: JAMES_SMTP_HOSTNAME
value: "smtp.{{ .Values.dns.emailDomain }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/inbox-server/templates/james/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
targetPort: 8080
name: "web"
---
kind: Service
Expand Down

0 comments on commit 94e5cf1

Please sign in to comment.