From 8a27e5ef22c6c58adc550884f57f5a47b9a6dd12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 25 Jun 2020 11:16:20 +0200 Subject: [PATCH 01/23] Import __matrix_synapse type from ungleich's dot-cdist --- type/__matrix_synapse/files/environment.sh | 6 + .../__matrix_synapse/files/homeserver.yaml.sh | 1785 +++++++++++++++++ type/__matrix_synapse/files/log.config.sh | 60 + type/__matrix_synapse/man.rst | 180 ++ type/__matrix_synapse/manifest | 287 +++ type/__matrix_synapse/parameter/boolean | 14 + .../parameter/default/database_host | 0 .../parameter/default/database_password | 0 .../parameter/default/database_user | 0 .../parameter/default/event_cache_size | 1 + .../parameter/default/global_cache_factor | 1 + .../parameter/default/ldap_base_dn | 0 .../parameter/default/ldap_bind_dn | 0 .../parameter/default/ldap_bind_password | 0 .../parameter/default/ldap_filter | 1 + .../parameter/default/ldap_mail_attribute | 1 + .../parameter/default/ldap_name_attribute | 1 + .../parameter/default/ldap_uid_attribute | 1 + .../parameter/default/ldap_uri | 0 .../parameter/default/max_upload_size | 1 + .../parameter/default/rc_login_burst | 1 + .../parameter/default/rc_login_per_second | 1 + .../parameter/default/rc_message_burst | 1 + .../parameter/default/rc_message_per_second | 1 + .../parameter/default/smtp_host | 1 + .../parameter/default/smtp_pass | 0 .../parameter/default/smtp_port | 1 + .../parameter/default/smtp_user | 0 .../parameter/default/turn_user_lifetime | 1 + type/__matrix_synapse/parameter/optional | 25 + .../parameter/optional_multiple | 5 + type/__matrix_synapse/parameter/required | 4 + type/__matrix_synapse/singleton | 0 33 files changed, 2380 insertions(+) create mode 100644 type/__matrix_synapse/files/environment.sh create mode 100755 type/__matrix_synapse/files/homeserver.yaml.sh create mode 100755 type/__matrix_synapse/files/log.config.sh create mode 100644 type/__matrix_synapse/man.rst create mode 100755 type/__matrix_synapse/manifest create mode 100644 type/__matrix_synapse/parameter/boolean create mode 100644 type/__matrix_synapse/parameter/default/database_host create mode 100644 type/__matrix_synapse/parameter/default/database_password create mode 100644 type/__matrix_synapse/parameter/default/database_user create mode 100644 type/__matrix_synapse/parameter/default/event_cache_size create mode 100644 type/__matrix_synapse/parameter/default/global_cache_factor create mode 100644 type/__matrix_synapse/parameter/default/ldap_base_dn create mode 100644 type/__matrix_synapse/parameter/default/ldap_bind_dn create mode 100644 type/__matrix_synapse/parameter/default/ldap_bind_password create mode 100644 type/__matrix_synapse/parameter/default/ldap_filter create mode 100644 type/__matrix_synapse/parameter/default/ldap_mail_attribute create mode 100644 type/__matrix_synapse/parameter/default/ldap_name_attribute create mode 100644 type/__matrix_synapse/parameter/default/ldap_uid_attribute create mode 100644 type/__matrix_synapse/parameter/default/ldap_uri create mode 100644 type/__matrix_synapse/parameter/default/max_upload_size create mode 100644 type/__matrix_synapse/parameter/default/rc_login_burst create mode 100644 type/__matrix_synapse/parameter/default/rc_login_per_second create mode 100644 type/__matrix_synapse/parameter/default/rc_message_burst create mode 100644 type/__matrix_synapse/parameter/default/rc_message_per_second create mode 100644 type/__matrix_synapse/parameter/default/smtp_host create mode 100644 type/__matrix_synapse/parameter/default/smtp_pass create mode 100644 type/__matrix_synapse/parameter/default/smtp_port create mode 100644 type/__matrix_synapse/parameter/default/smtp_user create mode 100644 type/__matrix_synapse/parameter/default/turn_user_lifetime create mode 100644 type/__matrix_synapse/parameter/optional create mode 100644 type/__matrix_synapse/parameter/optional_multiple create mode 100644 type/__matrix_synapse/parameter/required create mode 100644 type/__matrix_synapse/singleton diff --git a/type/__matrix_synapse/files/environment.sh b/type/__matrix_synapse/files/environment.sh new file mode 100644 index 0000000..99179be --- /dev/null +++ b/type/__matrix_synapse/files/environment.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +cat << EOF +# Specify environment variables used when running Synapse +SYNAPSE_CACHE_FACTOR=$CACHE_FACTOR +EOF diff --git a/type/__matrix_synapse/files/homeserver.yaml.sh b/type/__matrix_synapse/files/homeserver.yaml.sh new file mode 100755 index 0000000..77be438 --- /dev/null +++ b/type/__matrix_synapse/files/homeserver.yaml.sh @@ -0,0 +1,1785 @@ +#!/bin/sh + +# NOTE: this template has been generated using the +# matrix-synapse-1.5.1-1.fc31.noarch Fedora package for use with CDIST. + +generate_extra_settings () { + for line in $EXTRA_SETTINGS; do + echo "$line" + done +} + +generate_database () { + if [ "$DATABASE_ENGINE" = "sqlite3" ]; then + cat << EOF +database: + # The database engine name + name: "$DATABASE_ENGINE" + # Arguments to pass to the engine + args: + # Path to the database + database: "$DATABASE_NAME" +EOF + else +cat << EOF +database: + # The database engine name + name: "$DATABASE_ENGINE" + # Arguments to pass to the engine + args: + database: "$DATABASE_NAME" + host: "$DATABASE_HOST" + user: "$DATABASE_USER" + password: "$DATABASE_PASSWORD" +EOF + fi +} + +generate_password_providers () { + if [ "$ENABLE_LDAP_AUTH" = "true" ]; then + cat <