matrix-synapse: Redo well-known server
Now allows custom .well-known/matrix/{server,client} data to be provided
This commit is contained in:
parent
8ae1000472
commit
6cbb8bf9fd
4 changed files with 32 additions and 10 deletions
|
@ -109,17 +109,21 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if has . $wkHosts }}
|
{{- if has . $wkHosts }}
|
||||||
|
{{- if $.Values.wellknown.enabled }}
|
||||||
- path: /.well-known/matrix/client
|
- path: /.well-known/matrix/client
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $wkName }}
|
||||||
servicePort: 8008
|
servicePort: 80
|
||||||
|
|
||||||
{{- if $.Values.wellknown.enabled }}
|
|
||||||
- path: /.well-known/matrix/server
|
- path: /.well-known/matrix/server
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $wkName }}
|
serviceName: {{ $wkName }}
|
||||||
servicePort: 80
|
servicePort: 80
|
||||||
{{- end }}
|
{{- else }}
|
||||||
|
- path: /.well-known/matrix/client
|
||||||
|
backend:
|
||||||
|
serviceName: {{ $fullName }}
|
||||||
|
servicePort: 8008
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -23,12 +23,11 @@ data:
|
||||||
server.groupname = "lighttpd"
|
server.groupname = "lighttpd"
|
||||||
server.document-root = {{ .Values.wellknown.htdocsPath | quote }}
|
server.document-root = {{ .Values.wellknown.htdocsPath | quote }}
|
||||||
server.pid-file = "/run/lighttpd.pid"
|
server.pid-file = "/run/lighttpd.pid"
|
||||||
server.errorlog = "/dev/stderr"
|
|
||||||
url.rewrite-once = (
|
url.rewrite-once = (
|
||||||
|
"^/\.well-known/matrix/client" => "/client.json",
|
||||||
"^/\.well-known/matrix/server" => "/server.json"
|
"^/\.well-known/matrix/server" => "/server.json"
|
||||||
)
|
)
|
||||||
status.status-url = "/server-status"
|
status.status-url = "/server-status"
|
||||||
accesslog.filename = "/dev/stderr"
|
|
||||||
extforward.forwarder = ( "all" => "trust")
|
extforward.forwarder = ( "all" => "trust")
|
||||||
setenv.add-response-header = (
|
setenv.add-response-header = (
|
||||||
"access-control-allow-headers" => "Origin, X-Requested-With, Content-Type, Accept, Authorization",
|
"access-control-allow-headers" => "Origin, X-Requested-With, Content-Type, Accept, Authorization",
|
||||||
|
@ -39,5 +38,15 @@ data:
|
||||||
"content-type" => "application/json"
|
"content-type" => "application/json"
|
||||||
)
|
)
|
||||||
server.json: |-
|
server.json: |-
|
||||||
|
{{- if .Values.wellknown.server }}
|
||||||
|
{{ toJson .Values.wellknown.server | nindent 4 }}
|
||||||
|
{{- else }}
|
||||||
{{ dict "m.server" (printf "%s:%d" (.Values.wellknown.host | default (.Values.publicServerName | default .Values.serverName)) (.Values.wellknown.port | default 443)) | toJson | indent 4 }}
|
{{ dict "m.server" (printf "%s:%d" (.Values.wellknown.host | default (.Values.publicServerName | default .Values.serverName)) (.Values.wellknown.port | default 443)) | toJson | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
client.json: |-
|
||||||
|
{{- if .Values.wellknown.client }}
|
||||||
|
{{ toJson .Values.wellknown.client | nindent 4 }}
|
||||||
|
{{- else }}
|
||||||
|
{{ dict "m.homeserver" (dict "base_url" (printf "https://%s/" (.Values.publicServerName | default .Values.serverName))) | toJson | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
|
@ -64,6 +64,9 @@ spec:
|
||||||
- mountPath: /etc/lighttpd/lighttpd.conf
|
- mountPath: /etc/lighttpd/lighttpd.conf
|
||||||
name: files
|
name: files
|
||||||
subPath: lighttpd.conf
|
subPath: lighttpd.conf
|
||||||
|
- mountPath: {{ .Values.wellknown.htdocsPath }}/client.json
|
||||||
|
name: files
|
||||||
|
subPath: client.json
|
||||||
- mountPath: {{ .Values.wellknown.htdocsPath }}/server.json
|
- mountPath: {{ .Values.wellknown.htdocsPath }}/server.json
|
||||||
name: files
|
name: files
|
||||||
subPath: server.json
|
subPath: server.json
|
||||||
|
|
|
@ -456,8 +456,14 @@ wellknown:
|
||||||
|
|
||||||
## The host and port combo to serve on .well-known/matrix/server.
|
## The host and port combo to serve on .well-known/matrix/server.
|
||||||
##
|
##
|
||||||
# host: matrix.example.com
|
server: {}
|
||||||
# port: 443
|
# m.server: matrix.example.com:443
|
||||||
|
|
||||||
|
## Data to serve on .well-known/matrix/client.
|
||||||
|
##
|
||||||
|
client: {}
|
||||||
|
# m.homeserver:
|
||||||
|
# base_url: https://matrix.example.com
|
||||||
|
|
||||||
## A custom htdocs path, useful when running another image.
|
## A custom htdocs path, useful when running another image.
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in a new issue