From c32a1836aa0e2eb203392b9d4c3598a4da43eb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 24 Jan 2022 11:23:38 +0100 Subject: [PATCH] __matrix_synapse: add --sso-template-dir parameter --- type/__matrix_synapse/files/homeserver.yaml.sh | 2 +- type/__matrix_synapse/man.rst | 3 +++ type/__matrix_synapse/manifest | 3 +++ type/__matrix_synapse/parameter/default/sso-template-dir | 1 + type/__matrix_synapse/parameter/optional | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 type/__matrix_synapse/parameter/default/sso-template-dir diff --git a/type/__matrix_synapse/files/homeserver.yaml.sh b/type/__matrix_synapse/files/homeserver.yaml.sh index bc8cff0..d719d3f 100755 --- a/type/__matrix_synapse/files/homeserver.yaml.sh +++ b/type/__matrix_synapse/files/homeserver.yaml.sh @@ -2191,7 +2191,7 @@ sso: # You can see the default templates at: # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates # - #template_dir: "res/templates" + template_dir: "${SSO_TEMPLATE_DIR:?}" # JSON web token integration. The following settings can be used to make diff --git a/type/__matrix_synapse/man.rst b/type/__matrix_synapse/man.rst index 7da9282..0589a5e 100644 --- a/type/__matrix_synapse/man.rst +++ b/type/__matrix_synapse/man.rst @@ -205,6 +205,9 @@ saml2-mapping-provider-extra-settings Extra YAML-formatted key/pair values provided as configuration to the SAML2 mapping provider module (e.g. 'key: value'). Can be specified multiple times. +sso-template-dir + Directory used to source SSO-related HTML templates. + extra-setting Arbitrary string to be added to the configuration file. Can be specified multiple times. diff --git a/type/__matrix_synapse/manifest b/type/__matrix_synapse/manifest index 9e1a07c..6a89de6 100755 --- a/type/__matrix_synapse/manifest +++ b/type/__matrix_synapse/manifest @@ -220,6 +220,9 @@ if [ -f "$__object/parameter/saml2-mapping-provider-extra-config" ]; then export SAML2_MAPPING_PROVIDER_EXTRA_CONFIG fi +SSO_TEMPLATE_DIR=$(cat "$__object/parameter/sso-template-dir") +export SSO_TEMPLATE_DIR + if [ -n "$SAML2_SP_KEY" ] && [ -z "$SAML2_SP_CERT" ]; then echo "--saml2-sp-cert must be set if --saml2-sp-key is provided." >&2 exit 1 diff --git a/type/__matrix_synapse/parameter/default/sso-template-dir b/type/__matrix_synapse/parameter/default/sso-template-dir new file mode 100644 index 0000000..b51bcdc --- /dev/null +++ b/type/__matrix_synapse/parameter/default/sso-template-dir @@ -0,0 +1 @@ +res/template diff --git a/type/__matrix_synapse/parameter/optional b/type/__matrix_synapse/parameter/optional index 2e265e9..1786dd1 100644 --- a/type/__matrix_synapse/parameter/optional +++ b/type/__matrix_synapse/parameter/optional @@ -41,3 +41,4 @@ saml2-sp-key saml2-sp-cert default-identity-server saml2-mapping-provider-module +sso-template-dir