Skip to content

element web: support multiple additional subproperties #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions charts/matrix-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,16 @@ also configured so that location sharing shows maps; please reconfigure as appro
Additional Element Web configuration can be provided as a JSON String with
```yaml
elementWeb:
additional: |
{
"default_theme": "dark",
"default_server_config": {
"m.identity_server": {
"base_url": "https://vector.im"
additional:
extra-config.json: |
{
"default_theme": "dark",
"default_server_config": {
"m.identity_server": {
"base_url": "https://vector.im"
}
}
}
}
```
Full details on available configuration options can be found at
https://github.com/element-hq/element-web/blob/develop/docs/config.md.
Expand Down
33 changes: 17 additions & 16 deletions charts/matrix-stack/ci/fragments/element-web-pytest-extras.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ elementWeb:
podSecurityContext:
runAsGroup: 0

additional: |
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://synapse.{{ $.Values.serverName }}"
additional:
user-config.json: |
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://synapse.{{ $.Values.serverName }}"
}
},
"element_call": {
"url": "https://call.{{ $.Values.serverName }}",
"use_exclusively": true
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_new_room_decoration_ui": true,
"feature_element_call_video_rooms": true
}
},
"element_call": {
"url": "https://call.{{ $.Values.serverName }}",
"use_exclusively": true
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_new_room_decoration_ui": true,
"feature_element_call_video_rooms": true
}
}
33 changes: 17 additions & 16 deletions charts/matrix-stack/ci/pytest-element-web-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@

# initSecrets, postgres don't have any required properties to be set and defaults to enabled
elementWeb:
additional: |
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://synapse.{{ $.Values.serverName }}"
additional:
user-config.json: |
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://synapse.{{ $.Values.serverName }}"
}
},
"element_call": {
"url": "https://call.{{ $.Values.serverName }}",
"use_exclusively": true
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_new_room_decoration_ui": true,
"feature_element_call_video_rooms": true
}
},
"element_call": {
"url": "https://call.{{ $.Values.serverName }}",
"use_exclusively": true
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_new_room_decoration_ui": true,
"feature_element_call_video_rooms": true
}
}
annotations:
has-no-service-monitor: "true"
ingress:
Expand Down
5 changes: 4 additions & 1 deletion charts/matrix-stack/source/element-web.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"type": "boolean"
},
"additional": {
"type": "string"
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"replicas": {
"minimum": 1,
Expand Down
5 changes: 3 additions & 2 deletions charts/matrix-stack/source/element-web.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial

enabled: true

## Arbitrary extra config to inject into Element Web's config.json a JSON string
## Arbitrary extra config to inject into Element Web's config.json.
## Each key under additional is an additional config to merge into Element Web's config.json.
##
## Full details on available configuration options can be found at https://github.com/element-hq/element-web/blob/develop/docs/config.md
## Most settings are configurable but some settings are owned by the chart and can't be overwritten
additional: "{}"
additional: {}

# Number of Element Web replicas to start up
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion charts/matrix-stack/source/synapse.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ media:
{{- sub_schema_values.credential("Secret used to sign Synapse issued tokens", "macaroon", initIfAbsent=True) }}

## Additional configuration to provide to all Synapse processes.
## Each key under additional is an additioanal config to merge into synapse homeserver.yaml
## Each key under additional is an additional config to merge into synapse homeserver.yaml
## Full details on available configuration options can be found at https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html
{{- sub_schema_values.additionalConfig() }}

Expand Down
8 changes: 7 additions & 1 deletion charts/matrix-stack/templates/element-web/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ app.kubernetes.io/version: {{ .image.tag }}
{{- $_ := set $config "default_server_config" $defaultServerConfig -}}
{{- $_ := set $config "bug_report_endpoint_url" "https://element.io/bugreports/submit" -}}
{{- $_ := set $config "map_style_url" "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx" -}}
{{- tpl (toPrettyJson (merge $config (.additional | fromJson))) $root -}}
{{- with .additional }}
{{- range $key := (. | keys | uniq | sortAlpha) }}
{{- $prop := index $root.Values.elementWeb.additional $key }}
{{- $_ := (merge $config ($prop | fromJson)) -}}
{{- end }}
{{- end }}
{{- tpl (toPrettyJson $config) $root -}}
{{- end }}
{{- end }}

Expand Down
5 changes: 4 additions & 1 deletion charts/matrix-stack/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@
"type": "boolean"
},
"additional": {
"type": "string"
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"replicas": {
"minimum": 1,
Expand Down
7 changes: 4 additions & 3 deletions charts/matrix-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,12 @@ initSecrets:
elementWeb:
enabled: true

## Arbitrary extra config to inject into Element Web's config.json a JSON string
## Arbitrary extra config to inject into Element Web's config.json.
## Each key under additional is an additional config to merge into Element Web's config.json.
##
## Full details on available configuration options can be found at https://github.com/element-hq/element-web/blob/develop/docs/config.md
## Most settings are configurable but some settings are owned by the chart and can't be overwritten
additional: "{}"
additional: {}

# Number of Element Web replicas to start up
replicas: 1
Expand Down Expand Up @@ -1273,7 +1274,7 @@ synapse:
macaroon: {}

## Additional configuration to provide to all Synapse processes.
## Each key under additional is an additioanal config to merge into synapse homeserver.yaml
## Each key under additional is an additional config to merge into synapse homeserver.yaml
## Full details on available configuration options can be found at https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html
## This can be provided in-line in the Helm Chart and/or via an existing Secret
## e.g.
Expand Down
1 change: 1 addition & 0 deletions newsfragments/254.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ElementWeb additional config now expect multiple subproperties.
Loading