diff --git a/defaults/main.yml b/defaults/main.yml index 588116d..1dd01c8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -113,22 +113,22 @@ matrix_url_preview_enabled: False # anyone in any Matrix room could cause your synapse to issue arbitrary # GET requests to your internal services, causing serious security issues. # matrix_url_preview_blacklist: # defaults to not set -# - '127.0.0.0/8' -# - '10.0.0.0/8' -# - '172.16.0.0/12' -# - '192.168.0.0/16' -# - '100.64.0.0/10' -# - '169.254.0.0/16' -# - '::1/128' -# - 'fe80::/64' -# - 'fc00::/7' +# - "'127.0.0.0/8'" +# - "'10.0.0.0/8'" +# - "'172.16.0.0/12'" +# - "'192.168.0.0/16'" +# - "'100.64.0.0/10'" +# - "'169.254.0.0/16'" +# - "'::1/128'" +# - "'fe80::/64'" +# - "'fc00::/7'" # Optional list of URL matches that the URL preview spider is # denied from accessing. # https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit # matrix_url_preview_url_blacklist: -# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' -# - netloc: '^([A-f0-9:]+:+)+[A-f0-9]+$' +# - netloc: "'^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'" +# - netloc: "'^([A-f0-9:]+:+)+[A-f0-9]+$'" matrix_url_preview_max_spider_size: 10M matrix_tls_enabled: False diff --git a/templates/opt/matrix/config/homeserver.yml.j2 b/templates/opt/matrix/config/homeserver.yml.j2 index 66061e2..a5882b5 100644 --- a/templates/opt/matrix/config/homeserver.yml.j2 +++ b/templates/opt/matrix/config/homeserver.yml.j2 @@ -320,11 +320,11 @@ thumbnail_sizes: # Is the preview URL API enabled? If enabled, you *must* specify # an explicit url_preview_ip_range_blacklist of IPs that the spider is # denied from accessing. -url_preview_enabled: {% 'True' if matrix_url_preview_enabled else 'False' %} +url_preview_enabled: {{ 'True' if matrix_url_preview_enabled else 'False' }} {% if matrix_url_preview_ip_blacklist is defined %} url_preview_ip_range_blacklist: -{{ matrix_url_preview_ip_blacklist | to_nice_yaml(indent=8) }} +{{ matrix_url_preview_ip_blacklist | to_nice_yaml(indent=2) }} {% endif %} # List of IP address CIDR ranges that the URL preview spider is allowed