From 71c7c74b7bbeda00a8cfda289dcdac603da84f33 Mon Sep 17 00:00:00 2001 From: Lee Verberne Date: Sat, 16 Mar 2019 07:16:20 +0100 Subject: [PATCH 1/2] Allow configuring push content for matrix-synapse This allows overriding the default value for `include_content`. Setting this to false allows homeserver admins to ensure that message content isn't sent in the clear through third party servers. --- roles/matrix-synapse/defaults/main.yml | 5 +++++ roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index a2b9b24dc..7cbdc6693 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -140,6 +140,11 @@ matrix_synapse_app_service_config_files: [] # any password providers have been enabled or not. matrix_synapse_password_providers_enabled: false +# Whether clients can request to include message content in push notifications +# sent through third party servers. Setting this to false requires mobile clients +# to load message content directly from the homeserver. +matrix_synapse_push_include_content: true + # Enable exposure of metrics to Prometheus # See https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.rst matrix_synapse_metrics_enabled: false diff --git a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 index 363337889..57e093dfc 100644 --- a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -847,9 +847,8 @@ password_providers: # For modern android devices the notification content will still appear # because it is loaded by the app. iPhone, however will send a # notification saying only that a message arrived and who it came from. -# -#push: -# include_content: true +push: + include_content: {{ matrix_synapse_push_include_content }} # spam_checker: From 2f1662626e9a86f8451179c3a4a8c18c87b5ab7f Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 17 Mar 2019 20:51:12 +0200 Subject: [PATCH 2/2] Use |to_json for matrix_synapse_push_include_content Doing this for consistency. Related to #117 (Github Pull Request). --- roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 index 57e093dfc..55dfe316e 100644 --- a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -848,7 +848,7 @@ password_providers: # because it is loaded by the app. iPhone, however will send a # notification saying only that a message arrived and who it came from. push: - include_content: {{ matrix_synapse_push_include_content }} + include_content: {{ matrix_synapse_push_include_content|to_json }} # spam_checker: