소스 검색

Escape homeserver variables to prevent rare breakage

Strings containing double-quotes would cause YAML syntax breakage.
Not anymore.

Closes #48 and #49.
pull/54/head
Slavi Pantaleev 7 년 전
부모
커밋
268e9b5b66
1개의 변경된 파일22개의 추가작업 그리고 21개의 파일을 삭제
  1. +22
    -21
      roles/matrix-server/templates/synapse/homeserver.yaml.j2

+ 22
- 21
roles/matrix-server/templates/synapse/homeserver.yaml.j2 파일 보기

@@ -120,7 +120,8 @@ use_presence: {{ matrix_synapse_use_presence|to_json }}
# - nyc.example.com # - nyc.example.com
# - syd.example.com # - syd.example.com
{% if matrix_synapse_federation_domain_whitelist is not none %} {% if matrix_synapse_federation_domain_whitelist is not none %}
federation_domain_whitelist: {{ matrix_synapse_federation_domain_whitelist|to_json }}
federation_domain_whitelist:
{{ matrix_synapse_federation_domain_whitelist|to_nice_yaml }}
{% endif %} {% endif %}


# List of ports that Synapse should listen on, their purpose and their # List of ports that Synapse should listen on, their purpose and their
@@ -215,8 +216,8 @@ database:
# The database engine name # The database engine name
name: "psycopg2" name: "psycopg2"
args: args:
user: "{{ matrix_postgres_connection_username }}"
password: "{{ matrix_postgres_connection_password }}"
user: {{ matrix_postgres_connection_username|to_json }}
password: {{ matrix_postgres_connection_password|to_json }}
database: "{{ matrix_postgres_db_name }}" database: "{{ matrix_postgres_db_name }}"
host: "{{ matrix_postgres_connection_hostname }}" host: "{{ matrix_postgres_connection_hostname }}"
cp_min: 5 cp_min: 5
@@ -411,7 +412,7 @@ recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
turn_uris: ["turn:{{ hostname_matrix }}:3478?transport=udp", "turn:{{ hostname_matrix }}:3478?transport=tcp"] turn_uris: ["turn:{{ hostname_matrix }}:3478?transport=udp", "turn:{{ hostname_matrix }}:3478?transport=tcp"]


# The shared secret used to compute passwords for the TURN server # The shared secret used to compute passwords for the TURN server
turn_shared_secret: "{{ matrix_coturn_turn_static_auth_secret }}"
turn_shared_secret: {{ matrix_coturn_turn_static_auth_secret|to_json }}


# The Username and password if the TURN server needs them and # The Username and password if the TURN server needs them and
# does not use a token # does not use a token
@@ -432,7 +433,7 @@ turn_allow_guests: False
## Registration ## ## Registration ##


# Enable registration for new users. # Enable registration for new users.
enable_registration: {{ matrix_synapse_enable_registration }}
enable_registration: {{ matrix_synapse_enable_registration|to_json }}


# The user must provide all of the below types of 3PID when registering. # The user must provide all of the below types of 3PID when registering.
# #
@@ -453,7 +454,7 @@ enable_registration: {{ matrix_synapse_enable_registration }}


# If set, allows registration by anyone who also has the shared # If set, allows registration by anyone who also has the shared
# secret, even if registration is otherwise disabled. # secret, even if registration is otherwise disabled.
registration_shared_secret: "{{ matrix_synapse_registration_shared_secret }}"
registration_shared_secret: {{ matrix_synapse_registration_shared_secret|to_json }}


# Set the number of bcrypt rounds used to generate password hash. # Set the number of bcrypt rounds used to generate password hash.
# Larger numbers increase the work factor needed to generate the hash. # Larger numbers increase the work factor needed to generate the hash.
@@ -496,7 +497,7 @@ autocreate_auto_join_rooms: {{ matrix_synapse_autocreate_auto_join_rooms }}


# Enable collection and rendering of performance metrics # Enable collection and rendering of performance metrics
enable_metrics: False enable_metrics: False
report_stats: {{ matrix_synapse_report_stats }}
report_stats: {{ matrix_synapse_report_stats|to_json }}




## API Configuration ## ## API Configuration ##
@@ -513,14 +514,14 @@ room_invite_state_types:
app_service_config_files: {{ matrix_synapse_app_service_config_files }} app_service_config_files: {{ matrix_synapse_app_service_config_files }}




macaroon_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"
macaroon_secret_key: {{ matrix_synapse_macaroon_secret_key|to_json }}


# Used to enable access token expiration. # Used to enable access token expiration.
expire_access_token: False expire_access_token: False


# a secret which is used to calculate HMACs for form values, to stop # a secret which is used to calculate HMACs for form values, to stop
# falsification of values # falsification of values
form_secret: "{{ matrix_synapse_form_secret }}"
form_secret: {{ matrix_synapse_form_secret|to_json }}


## Signing Keys ## ## Signing Keys ##


@@ -587,7 +588,7 @@ password_config:
enabled: true enabled: true
# Uncomment and change to a secret random string for extra security. # Uncomment and change to a secret random string for extra security.
# DO NOT CHANGE THIS AFTER INITIAL SETUP! # DO NOT CHANGE THIS AFTER INITIAL SETUP!
pepper: "{{ matrix_synapse_password_config_pepper }}"
pepper: {{ matrix_synapse_password_config_pepper|to_json }}






@@ -633,12 +634,12 @@ password_providers:
{% if matrix_synapse_ext_password_provider_shared_secret_auth_enabled %} {% if matrix_synapse_ext_password_provider_shared_secret_auth_enabled %}
- module: "shared_secret_authenticator.SharedSecretAuthenticator" - module: "shared_secret_authenticator.SharedSecretAuthenticator"
config: config:
sharedSecret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret }}"
sharedSecret: {{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret|to_json }}
{% endif %} {% endif %}
{% if matrix_synapse_ext_password_provider_rest_auth_enabled %} {% if matrix_synapse_ext_password_provider_rest_auth_enabled %}
- module: "rest_auth_provider.RestAuthProvider" - module: "rest_auth_provider.RestAuthProvider"
config: config:
endpoint: "{{ matrix_synapse_ext_password_provider_rest_auth_endpoint }}"
endpoint: {{ matrix_synapse_ext_password_provider_rest_auth_endpoint|to_json }}
policy: policy:
registration: registration:
username: username:
@@ -653,16 +654,16 @@ password_providers:
- module: "ldap_auth_provider.LdapAuthProvider" - module: "ldap_auth_provider.LdapAuthProvider"
config: config:
enabled: true enabled: true
uri: "{{ matrix_synapse_ext_password_provider_ldap_uri }}"
start_tls: "{{ matrix_synapse_ext_password_provider_ldap_start_tls }}"
base: "{{ matrix_synapse_ext_password_provider_ldap_base }}"
uri: {{ matrix_synapse_ext_password_provider_ldap_uri|to_json }}
start_tls: {{ matrix_synapse_ext_password_provider_ldap_start_tls|to_json }}
base: {{ matrix_synapse_ext_password_provider_ldap_base|to_json }}
attributes: attributes:
uid: "{{ matrix_synapse_ext_password_provider_ldap_attributes_uid }}"
mail: "{{ matrix_synapse_ext_password_provider_ldap_attributes_mail }}"
name: "{{ matrix_synapse_ext_password_provider_ldap_attributes_name }}"
bind_dn: "{{ matrix_synapse_ext_password_provider_ldap_bind_dn }}"
bind_password: "{{ matrix_synapse_ext_password_provider_ldap_bind_password }}"
filter: "{{ matrix_synapse_ext_password_provider_ldap_filter }}"
uid: {{ matrix_synapse_ext_password_provider_ldap_attributes_uid|to_json }}
mail: {{ matrix_synapse_ext_password_provider_ldap_attributes_mail|to_json }}
name: {{ matrix_synapse_ext_password_provider_ldap_attributes_name|to_json }}
bind_dn: {{ matrix_synapse_ext_password_provider_ldap_bind_dn|to_json }}
bind_password: {{ matrix_synapse_ext_password_provider_ldap_bind_password|to_json }}
filter: {{ matrix_synapse_ext_password_provider_ldap_filter|to_json }}
{% endif %} {% endif %}
{% endif %} {% endif %}




불러오는 중...
취소
저장