Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Remove code generating comments in configuration file #12941

Merged
merged 54 commits into from
Jun 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b788ea8
add info about config documentation to file header
H-Shay May 18, 2022
370a36b
remove comments from api.py
H-Shay May 18, 2022
74e171b
remove comments from appservice.py
H-Shay May 18, 2022
9fce9af
remove comments from auth.py
H-Shay May 18, 2022
c8ebd3e
remove comments from background_updates.py
H-Shay May 18, 2022
e17b3e5
remove comments from cache.py
H-Shay May 18, 2022
bf7c543
remove comments from captcha.py
H-Shay May 18, 2022
6d30891
remove comments from cas.py
H-Shay May 18, 2022
ad320d3
remove comments from consent.py
H-Shay May 18, 2022
d67d26b
remove comments from database.py
H-Shay May 18, 2022
91bd93d
remove comments from emailconfig.py
H-Shay May 18, 2022
7957222
remove comments from federation.py
H-Shay May 18, 2022
f6e29de
remove comments from federation.py
H-Shay May 18, 2022
004e2ae
remove comments from groups.py
H-Shay May 18, 2022
650332c
remove comments from jwt.py
H-Shay May 18, 2022
b246258
remove comments from modules.py
H-Shay May 19, 2022
11d9f22
remove comments from oembed.py
H-Shay May 19, 2022
9e47700
remove comments from oidc.py
H-Shay May 19, 2022
ee3c658
remove comments from push.py
H-Shay May 19, 2022
6b1cfc3
remove comments from ratelimiting.py
H-Shay May 19, 2022
6babef8
remove comments from redis.py
H-Shay May 19, 2022
22cd3d8
remove comments from retention.py
H-Shay May 19, 2022
29a9e2f
remove comments from room.py
H-Shay May 19, 2022
b449597
remove comments in room_directory.py
H-Shay May 19, 2022
9647714
remove comments from saml2.py
H-Shay May 19, 2022
e090c1e
remove comments from server_notices.py
H-Shay May 19, 2022
b8f32fa
remvoe comments from sso.py
H-Shay May 19, 2022
b6393d4
remove comments from stats.py
H-Shay May 19, 2022
bbce92b
remove comments from tracer.py
H-Shay May 19, 2022
099f79f
remove comments from user_directory.py
H-Shay May 19, 2022
01b88e0
remove comments from voip.py
H-Shay May 19, 2022
b2d0418
remove comments from workers.py
H-Shay May 19, 2022
bb88cc1
remove comments from repository.py
H-Shay May 19, 2022
e797906
remove comments from registration.py
H-Shay May 19, 2022
a925e0e
remove comments from tls.py
H-Shay May 19, 2022
bb52e28
remove comments from server.py
H-Shay May 19, 2022
b97a3e7
remove comments from metrics.py
H-Shay May 19, 2022
e01e1d4
update sample_config_header
H-Shay May 19, 2022
65ff8a0
slight refactor to generate whole config from parts
H-Shay May 31, 2022
60bbdbd
sample config
H-Shay May 31, 2022
2c1211f
remove comments from logger.py
H-Shay May 31, 2022
c66db44
remove comments from key.py
H-Shay May 31, 2022
0925fd3
merge in develop
H-Shay May 31, 2022
573b399
changelog
H-Shay Jun 1, 2022
210e8b1
lint + proper changelog number
H-Shay Jun 1, 2022
408c45e
regenerate sample config
H-Shay Jun 1, 2022
10d2613
remove printed shared secret from tests where unnecessary
H-Shay Jun 1, 2022
04881af
fix issue with registration shared secret not being string
H-Shay Jun 1, 2022
f5b16c1
requested changes
H-Shay Jun 7, 2022
18d7a87
regenerate config
H-Shay Jun 7, 2022
40cbc96
requested changes
H-Shay Jun 9, 2022
bb1b2bb
actually requested change
H-Shay Jun 9, 2022
ffb8f2b
regenerate sample config
H-Shay Jun 9, 2022
2348e47
Merge branch 'develop' into shay/bye_bye_comments
H-Shay Jun 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 1 addition & 163 deletions synapse/config/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,166 +226,4 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
def generate_config_section(self, data_dir_path: str, **kwargs: Any) -> str:
assert data_dir_path is not None
media_store = os.path.join(data_dir_path, "media_store")

formatted_thumbnail_sizes = "".join(
THUMBNAIL_SIZE_YAML % s for s in DEFAULT_THUMBNAIL_SIZES
)
# strip final NL
formatted_thumbnail_sizes = formatted_thumbnail_sizes[:-1]

ip_range_blacklist = "\n".join(
" # - '%s'" % ip for ip in DEFAULT_IP_RANGE_BLACKLIST
)

return (
r"""
## Media Store ##

# Enable the media store service in the Synapse master. Uncomment the
# following if you are using a separate media store worker.
#
#enable_media_repo: false

# Directory where uploaded images and attachments are stored.
#
media_store_path: "%(media_store)s"

# Media storage providers allow media to be stored in different
# locations.
#
#media_storage_providers:
# - module: file_system
# # Whether to store newly uploaded local files
# store_local: false
# # Whether to store newly downloaded remote files
# store_remote: false
# # Whether to wait for successful storage for local uploads
# store_synchronous: false
# config:
# directory: /mnt/some/other/directory

# The largest allowed upload size in bytes
#
# If you are using a reverse proxy you may also need to set this value in
# your reverse proxy's config. Notably Nginx has a small max body size by default.
# See https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
#
#max_upload_size: 50M

# Maximum number of pixels that will be thumbnailed
#
#max_image_pixels: 32M

# Whether to generate new thumbnails on the fly to precisely match
# the resolution requested by the client. If true then whenever
# a new resolution is requested by the client the server will
# generate a new thumbnail. If false the server will pick a thumbnail
# from a precalculated list.
#
#dynamic_thumbnails: false

# List of thumbnails to precalculate when an image is uploaded.
#
#thumbnail_sizes:
%(formatted_thumbnail_sizes)s

# Is the preview URL API enabled?
#
# 'false' by default: uncomment the following to enable it (and specify a
# url_preview_ip_range_blacklist blacklist).
#
#url_preview_enabled: true

# List of IP address CIDR ranges that the URL preview spider is denied
# from accessing. There are no defaults: you must explicitly
# specify a list for URL previewing to work. You should specify any
# internal services in your network that you do not want synapse to try
# to connect to, otherwise anyone in any Matrix room could cause your
# synapse to issue arbitrary GET requests to your internal services,
# causing serious security issues.
#
# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
# listed here, since they correspond to unroutable addresses.)
#
# This must be specified if url_preview_enabled is set. It is recommended that
# you uncomment the following list as a starting point.
#
# Note: The value is ignored when an HTTP proxy is in use
#
#url_preview_ip_range_blacklist:
%(ip_range_blacklist)s

# List of IP address CIDR ranges that the URL preview spider is allowed
# to access even if they are specified in url_preview_ip_range_blacklist.
# This is useful for specifying exceptions to wide-ranging blacklisted
# target IP ranges - e.g. for enabling URL previews for a specific private
# website only visible in your network.
#
#url_preview_ip_range_whitelist:
# - '192.168.1.1'

# Optional list of URL matches that the URL preview spider is
# denied from accessing. You should use url_preview_ip_range_blacklist
# in preference to this, otherwise someone could define a public DNS
# entry that points to a private IP address and circumvent the blacklist.
# This is more useful if you know there is an entire shape of URL that
# you know that will never want synapse to try to spider.
#
# Each list entry is a dictionary of url component attributes as returned
# by urlparse.urlsplit as applied to the absolute form of the URL. See
# https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
# The values of the dictionary are treated as an filename match pattern
# applied to that component of URLs, unless they start with a ^ in which
# case they are treated as a regular expression match. If all the
# specified component matches for a given list item succeed, the URL is
# blacklisted.
#
#url_preview_url_blacklist:
# # blacklist any URL with a username in its URI
# - username: '*'
#
# # blacklist all *.google.com URLs
# - netloc: 'google.com'
# - netloc: '*.google.com'
#
# # blacklist all plain HTTP URLs
# - scheme: 'http'
#
# # blacklist http(s)://www.acme.com/foo
# - netloc: 'www.acme.com'
# path: '/foo'
#
# # blacklist any URL with a literal IPv4 address
# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'

# The largest allowed URL preview spidering size in bytes
#
#max_spider_size: 10M

# A list of values for the Accept-Language HTTP header used when
# downloading webpages during URL preview generation. This allows
# Synapse to specify the preferred languages that URL previews should
# be in when communicating with remote servers.
#
# Each value is a IETF language tag; a 2-3 letter identifier for a
# language, optionally followed by subtags separated by '-', specifying
# a country or region variant.
#
# Multiple values can be provided, and a weight can be added to each by
# using quality value syntax (;q=). '*' translates to any language.
#
# Defaults to "en".
#
# Example:
#
# url_preview_accept_language:
# - en-UK
# - en-US;q=0.9
# - fr;q=0.8
# - *;q=0.7
#
url_preview_accept_language:
# - en
"""
% locals()
)
return "media_store_path: %(media_store)s" % locals()
H-Shay marked this conversation as resolved.
Show resolved Hide resolved