View | Details | Raw Unified | Return to bug 236260 | Differences between
and this patch

Collapse All | Expand All

(-)py-matrix-synapse/Makefile (-11 / +11 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	matrix-synapse
4
PORTNAME=	matrix-synapse
5
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
6
DISTVERSION=	0.34.1.1
6
DISTVERSION=	0.99.2
7
CATEGORIES=	net-im python
7
CATEGORIES=	net-im python
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
9
9
Lines 21-27 Link Here
21
		${PYTHON_PKGNAMEPREFIX}signedjson>=1.0.0:security/py-signedjson@${PY_FLAVOR} \
21
		${PYTHON_PKGNAMEPREFIX}signedjson>=1.0.0:security/py-signedjson@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}pynacl>=1.2.1:security/py-pynacl@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}pynacl>=1.2.1:security/py-pynacl@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}twisted>=17.1.0:devel/py-twisted@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}twisted>=18.7.0:devel/py-twisted@${PY_FLAVOR} \
25
		${PYTHON_PKGNAMEPREFIX}treq>=15.1:www/py-treq@${PY_FLAVOR} \
25
		${PYTHON_PKGNAMEPREFIX}treq>=15.1:www/py-treq@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}openssl>=16.0.0:security/py-openssl@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}openssl>=16.0.0:security/py-openssl@${PY_FLAVOR} \
27
		${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} \
27
		${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} \
Lines 33-44 Link Here
33
		${PYTHON_PKGNAMEPREFIX}sortedcontainers>=1.4.4:devel/py-sortedcontainers@${PY_FLAVOR} \
33
		${PYTHON_PKGNAMEPREFIX}sortedcontainers>=1.4.4:devel/py-sortedcontainers@${PY_FLAVOR} \
34
		${PYTHON_PKGNAMEPREFIX}psutil>=2.0.0:sysutils/py-psutil@${PY_FLAVOR} \
34
		${PYTHON_PKGNAMEPREFIX}psutil>=2.0.0:sysutils/py-psutil@${PY_FLAVOR} \
35
		${PYTHON_PKGNAMEPREFIX}pysaml2>=4.0.2:security/py-pysaml2@${PY_FLAVOR} \
35
		${PYTHON_PKGNAMEPREFIX}pysaml2>=4.0.2:security/py-pysaml2@${PY_FLAVOR} \
36
		${PYTHON_PKGNAMEPREFIX}pymacaroons-pynacl>=0.9.3:security/py-pymacaroons-pynacl@${PY_FLAVOR} \
36
		${PYTHON_PKGNAMEPREFIX}pymacaroons-pynacl>=0.13.0:security/py-pymacaroons-pynacl@${PY_FLAVOR} \
37
		${PYTHON_PKGNAMEPREFIX}msgpack>=0.4.2:devel/py-msgpack@${PY_FLAVOR} \
37
		${PYTHON_PKGNAMEPREFIX}msgpack>=0.5.0:devel/py-msgpack@${PY_FLAVOR} \
38
		${PYTHON_PKGNAMEPREFIX}phonenumbers>=8.2.0:devel/py-phonenumbers@${PY_FLAVOR} \
38
		${PYTHON_PKGNAMEPREFIX}phonenumbers>=8.2.0:devel/py-phonenumbers@${PY_FLAVOR} \
39
		${PYTHON_PKGNAMEPREFIX}six>=1.10:devel/py-six@${PY_FLAVOR} \
39
		${PYTHON_PKGNAMEPREFIX}six>=1.10:devel/py-six@${PY_FLAVOR} \
40
		${PYTHON_PKGNAMEPREFIX}prometheus-client>=0.2.0:net-mgmt/py-prometheus-client@${PY_FLAVOR} \
40
		${PYTHON_PKGNAMEPREFIX}prometheus-client>=0.2.0:net-mgmt/py-prometheus-client@${PY_FLAVOR} \
41
		${PYTHON_PKGNAMEPREFIX}attrs>16.0.0:devel/py-attrs@${PY_FLAVOR} \
41
		${PYTHON_PKGNAMEPREFIX}attrs>17.4.0:devel/py-attrs@${PY_FLAVOR} \
42
		${PYTHON_PKGNAMEPREFIX}netaddr>=0.7.18:net/py-netaddr@${PY_FLAVOR}
42
		${PYTHON_PKGNAMEPREFIX}netaddr>=0.7.18:net/py-netaddr@${PY_FLAVOR}
43
43
44
# Dependencies that aren't declared in python_dependencies.py which I have discovered
44
# Dependencies that aren't declared in python_dependencies.py which I have discovered
Lines 47-53 Link Here
47
47
48
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}virtualenv>=15.0:devel/py-virtualenv@${PY_FLAVOR} \
48
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}virtualenv>=15.0:devel/py-virtualenv@${PY_FLAVOR} \
49
		${PYTHON_PKGNAMEPREFIX}tox>=2.3.1:devel/py-tox@${PY_FLAVOR} \
49
		${PYTHON_PKGNAMEPREFIX}tox>=2.3.1:devel/py-tox@${PY_FLAVOR} \
50
		${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml@${PY_FLAVOR}
50
		${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml@${PY_FLAVOR} \
51
		${PYTHON_PKGNAMEPREFIX}mock>=2.0:devel/py-mock@${PY_FLAVOR}
51
52
52
USES=		python
53
USES=		python
53
USE_GITHUB=	yes
54
USE_GITHUB=	yes
Lines 65-74 Link Here
65
LOGDIR?=	/var/log/${PORTNAME}
66
LOGDIR?=	/var/log/${PORTNAME}
66
PIDDIR?=	/var/run/${PORTNAME}
67
PIDDIR?=	/var/run/${PORTNAME}
67
68
68
SUB_FILES=	pkg-message homeserver.yaml log.config
69
SUB_FILES=	pkg-message log.config
69
SUB_LIST+=	PYTHON_CMD=${PYTHON_CMD} DBDIR=${DBDIR} LOGDIR=${LOGDIR} PIDDIR=${PIDDIR} USERS=${USERS}
70
SUB_LIST+=	PYTHON_CMD=${PYTHON_CMD} DBDIR=${DBDIR} LOGDIR=${LOGDIR} PIDDIR=${PIDDIR} USERS=${USERS}
70
71
71
PLIST_FILES+=	"@sample %%ETCDIR%%/homeserver.yaml.sample"
72
PLIST_FILES+=	"@sample %%ETCDIR%%/log.config.sample"
72
PLIST_FILES+=	"@sample %%ETCDIR%%/log.config.sample"
73
73
74
NO_ARCH=	yes
74
NO_ARCH=	yes
Lines 77-86 Link Here
77
OPTIONS_DEFAULT=	SQLITE
77
OPTIONS_DEFAULT=	SQLITE
78
EMAIL_DESC=		Email notifications for missed messages
78
EMAIL_DESC=		Email notifications for missed messages
79
URL_PREVIEW_DESC=	Add dependencies necessary for URL previews
79
URL_PREVIEW_DESC=	Add dependencies necessary for URL previews
80
EMAIL_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}Jinja2>=2.8:devel/py-Jinja2@${PY_FLAVOR} \
80
URL_RUN_DEPENDS+=       ${PYTHON_PKGNAMEPREFIX}lxml>=3.5.0:devel/py-lxml@${PY_FLAVOR}
81
EMAIL_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}Jinja2>=2.9:devel/py-Jinja2@${PY_FLAVOR} \
81
			${PYTHON_PKGNAMEPREFIX}bleach>=1.4.2:www/py-bleach@${PY_FLAVOR}
82
			${PYTHON_PKGNAMEPREFIX}bleach>=1.4.2:www/py-bleach@${PY_FLAVOR}
82
LDAP_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}matrix-synapse-ldap3>=0.1:net/py-matrix-synapse-ldap3@${PY_FLAVOR}
83
LDAP_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}matrix-synapse-ldap3>=0.1:net/py-matrix-synapse-ldap3@${PY_FLAVOR}
83
PGSQL_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}psycopg2>0:databases/py-psycopg2@${PY_FLAVOR}
84
PGSQL_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}psycopg2>2.6:databases/py-psycopg2@${PY_FLAVOR}
84
SQLITE_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}
85
SQLITE_RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}
85
86
86
post-patch:
87
post-patch:
Lines 91-97 Link Here
91
92
92
post-install:
93
post-install:
93
	${MKDIR} ${STAGEDIR}${ETCDIR}
94
	${MKDIR} ${STAGEDIR}${ETCDIR}
94
	${INSTALL_DATA} ${WRKDIR}/homeserver.yaml ${STAGEDIR}${ETCDIR}/homeserver.yaml.sample
95
	${INSTALL_DATA} ${WRKDIR}/log.config ${STAGEDIR}${ETCDIR}/log.config.sample
95
	${INSTALL_DATA} ${WRKDIR}/log.config ${STAGEDIR}${ETCDIR}/log.config.sample
96
96
97
.include <bsd.port.mk>
97
.include <bsd.port.mk>
(-)py-matrix-synapse/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1547138548
1
TIMESTAMP = 1553288664
2
SHA256 (matrix-org-synapse-v0.34.1.1_GH0.tar.gz) = bfc1997c3a8dc48eb9eb02956df6a24ad8337e4eac0faa13cb581d3a694825f7
2
SHA256 (matrix-org-synapse-v0.99.2_GH0.tar.gz) = d61636bbfa14e4b7ade633723cf63903b350c888d837de760eac8902b7d69329
3
SIZE (matrix-org-synapse-v0.34.1.1_GH0.tar.gz) = 1131071
3
SIZE (matrix-org-synapse-v0.99.2_GH0.tar.gz) = 1186956
(-)py-matrix-synapse/files/homeserver.yaml.in (-751 lines)
Lines 1-751 Link Here
1
# vim:ft=yaml
2
# PEM encoded X509 certificate for TLS.
3
# You can replace the self-signed certificate that synapse
4
# autogenerates on launch with your own SSL certificate + key pair
5
# if you like.  Any required intermediary certificates can be
6
# appended after the primary certificate in hierarchical order.
7
tls_certificate_path: "%%ETCDIR%%/example.com.tls.crt"
8
9
# PEM encoded private key for TLS
10
tls_private_key_path: "%%ETCDIR%%/example.com.tls.key"
11
12
# PEM dh parameters for ephemeral keys
13
tls_dh_params_path: "%%ETCDIR%%/example.com.tls.dh"
14
15
# Don't bind to the https port
16
no_tls: False
17
18
# List of allowed TLS fingerprints for this server to publish along
19
# with the signing keys for this server. Other matrix servers that
20
# make HTTPS requests to this server will check that the TLS
21
# certificates returned by this server match one of the fingerprints.
22
#
23
# Synapse automatically adds the fingerprint of its own certificate
24
# to the list. So if federation traffic is handled directly by synapse
25
# then no modification to the list is required.
26
#
27
# If synapse is run behind a load balancer that handles the TLS then it
28
# will be necessary to add the fingerprints of the certificates used by
29
# the loadbalancers to this list if they are different to the one
30
# synapse is using.
31
#
32
# Homeservers are permitted to cache the list of TLS fingerprints
33
# returned in the key responses up to the "valid_until_ts" returned in
34
# key. It may be necessary to publish the fingerprints of a new
35
# certificate and wait until the "valid_until_ts" of the previous key
36
# responses have passed before deploying it.
37
#
38
# You can calculate a fingerprint from a given TLS listener via:
39
# openssl s_client -connect $host:$port < /dev/null 2> /dev/null |
40
#   openssl x509 -outform DER | openssl sha256 -binary | base64 | tr -d '='
41
# or by checking matrix.org/federationtester/api/report?server_name=$host
42
#
43
tls_fingerprints: []
44
# tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
45
46
47
## Server ##
48
49
# The domain name of the server, with optional explicit port.
50
# This is used by remote servers to connect to this server,
51
# e.g. matrix.org, localhost:8080, etc.
52
# This is also the last part of your UserID.
53
server_name: "example.com"
54
55
# When running as a daemon, the file to store the pid in
56
pid_file: %%PIDDIR%%/homeserver.pid
57
58
# CPU affinity mask. Setting this restricts the CPUs on which the
59
# process will be scheduled. It is represented as a bitmask, with the
60
# lowest order bit corresponding to the first logical CPU and the
61
# highest order bit corresponding to the last logical CPU. Not all CPUs
62
# may exist on a given system but a mask may specify more CPUs than are
63
# present.
64
#
65
# For example:
66
#    0x00000001  is processor #0,
67
#    0x00000003  is processors #0 and #1,
68
#    0xFFFFFFFF  is all processors (#0 through #31).
69
#
70
# Pinning a Python process to a single CPU is desirable, because Python
71
# is inherently single-threaded due to the GIL, and can suffer a
72
# 30-40% slowdown due to cache blow-out and thread context switching
73
# if the scheduler happens to schedule the underlying threads across
74
# different cores. See
75
# https://www.mirantis.com/blog/improve-performance-python-programs-restricting-single-cpu/.
76
#
77
# This setting requires the affinity package to be installed!
78
#
79
# cpu_affinity: 0xFFFFFFFF
80
81
# The path to the web client which will be served at /_matrix/client/
82
# if 'webclient' is configured under the 'listeners' configuration.
83
#
84
# web_client_location: "/path/to/web/root"
85
86
# The public-facing base URL for the client API (not including _matrix/...)
87
# public_baseurl: https://example.com:8448/
88
89
# Set the soft limit on the number of file descriptors synapse can use
90
# Zero is used to indicate synapse should set the soft limit to the
91
# hard limit.
92
soft_file_limit: 0
93
94
# Set to false to disable presence tracking on this homeserver.
95
use_presence: true
96
97
# The GC threshold parameters to pass to `gc.set_threshold`, if defined
98
# gc_thresholds: [700, 10, 10]
99
100
# Set the limit on the returned events in the timeline in the get
101
# and sync operations. The default value is -1, means no upper limit.
102
# filter_timeline_limit: 5000
103
104
# Whether room invites to users on this server should be blocked
105
# (except those sent by local server admins). The default is False.
106
# block_non_admin_invites: True
107
108
# Restrict federation to the following whitelist of domains.
109
# N.B. we recommend also firewalling your federation listener to limit
110
# inbound federation traffic as early as possible, rather than relying
111
# purely on this application-layer restriction.  If not specified, the
112
# default is to whitelist everything.
113
#
114
# federation_domain_whitelist:
115
#  - lon.example.com
116
#  - nyc.example.com
117
#  - syd.example.com
118
119
# List of ports that Synapse should listen on, their purpose and their
120
# configuration.
121
listeners:
122
  # Main HTTPS listener
123
  # For when matrix traffic is sent directly to synapse.
124
  -
125
    # The port to listen for HTTPS requests on.
126
    port: 8448
127
128
    # Local addresses to listen on.
129
    # On Linux and Mac OS, `::` will listen on all IPv4 and IPv6
130
    # addresses by default. For most other OSes, this will only listen
131
    # on IPv6.
132
    bind_addresses:
133
      - '::'
134
      - '0.0.0.0'
135
136
    # This is a 'http' listener, allows us to specify 'resources'.
137
    type: http
138
139
    tls: true
140
141
    # Use the X-Forwarded-For (XFF) header as the client IP and not the
142
    # actual client IP.
143
    x_forwarded: false
144
145
    # List of HTTP resources to serve on this listener.
146
    resources:
147
      -
148
        # List of resources to host on this listener.
149
        names:
150
          - client     # The client-server APIs, both v1 and v2
151
          # - webclient  # The bundled webclient. (no longer available)
152
153
        # Should synapse compress HTTP responses to clients that support it?
154
        # This should be disabled if running synapse behind a load balancer
155
        # that can do automatic compression.
156
        compress: true
157
158
      - names: [federation]  # Federation APIs
159
        compress: false
160
161
    # optional list of additional endpoints which can be loaded via
162
    # dynamic modules
163
    # additional_resources:
164
    #   "/_matrix/my/custom/endpoint":
165
    #     module: my_module.CustomRequestHandler
166
    #     config: {}
167
168
  # Unsecure HTTP listener,
169
  # For when matrix traffic passes through loadbalancer that unwraps TLS.
170
  - port: 8008
171
    tls: false
172
    bind_addresses: ['::', '0.0.0.0']
173
    type: http
174
175
    x_forwarded: false
176
177
    resources:
178
      - names: [client] # change to "client, webclient" to activate web client
179
                        # also set web_client_location to a correct location
180
        compress: true
181
      - names: [federation]
182
        compress: false
183
184
  # Turn on the twisted ssh manhole service on localhost on the given
185
  # port.
186
  # - port: 9000
187
  #   bind_addresses: ['::1', '127.0.0.1']
188
  #   type: manhole
189
190
191
  # Homeserver blocking
192
  #
193
  # How to reach the server admin, used in ResourceLimitError
194
  # admin_contact: 'mailto:admin@server.com'
195
  #
196
  # Global block config
197
  #
198
  # hs_disabled: False
199
  # hs_disabled_message: 'Human readable reason for why the HS is blocked'
200
  # hs_disabled_limit_type: 'error code(str), to help clients decode reason'
201
  #
202
  # Monthly Active User Blocking
203
  #
204
  # Enables monthly active user checking
205
  # limit_usage_by_mau: False
206
  # max_mau_value: 50
207
  # mau_trial_days: 2
208
  #
209
  # Sometimes the server admin will want to ensure certain accounts are
210
  # never blocked by mau checking. These accounts are specified here.
211
  #
212
  # mau_limit_reserved_threepids:
213
  # - medium: 'email'
214
  #   address: 'reserved_user@example.com'
215
216
217
218
# Database configuration
219
database:
220
  # The database engine name
221
  name: "sqlite3"
222
  # Arguments to pass to the engine
223
  args:
224
    # Path to the database
225
    database: "%%DBDIR%%/homeserver.db"
226
227
# Number of events to cache in memory.
228
event_cache_size: "10K"
229
230
231
232
# A yaml python logging config file
233
log_config: "%%ETCDIR%%/log.config"
234
235
236
## Ratelimiting ##
237
238
# Number of messages a client can send per second
239
rc_messages_per_second: 0.2
240
241
# Number of message a client can send before being throttled
242
rc_message_burst_count: 10.0
243
244
# The federation window size in milliseconds
245
federation_rc_window_size: 1000
246
247
# The number of federation requests from a single server in a window
248
# before the server will delay processing the request.
249
federation_rc_sleep_limit: 10
250
251
# The duration in milliseconds to delay processing events from
252
# remote servers by if they go over the sleep limit.
253
federation_rc_sleep_delay: 500
254
255
# The maximum number of concurrent federation requests allowed
256
# from a single server
257
federation_rc_reject_limit: 50
258
259
# The number of federation requests to concurrently process from a
260
# single server
261
federation_rc_concurrent: 3
262
263
264
265
# Directory where uploaded images and attachments are stored.
266
media_store_path: "%%DBDIR%%/media_store"
267
268
# Media storage providers allow media to be stored in different
269
# locations.
270
# media_storage_providers:
271
# - module: file_system
272
#   # Whether to write new local files.
273
#   store_local: false
274
#   # Whether to write new remote media
275
#   store_remote: false
276
#   # Whether to block upload requests waiting for write to this
277
#   # provider to complete
278
#   store_synchronous: false
279
#   config:
280
#     directory: /mnt/some/other/directory
281
282
# Directory where in-progress uploads are stored.
283
uploads_path: "%%DBDIR%%/uploads"
284
285
# The largest allowed upload size in bytes
286
max_upload_size: "10M"
287
288
# Maximum number of pixels that will be thumbnailed
289
max_image_pixels: "32M"
290
291
# Whether to generate new thumbnails on the fly to precisely match
292
# the resolution requested by the client. If true then whenever
293
# a new resolution is requested by the client the server will
294
# generate a new thumbnail. If false the server will pick a thumbnail
295
# from a precalculated list.
296
dynamic_thumbnails: false
297
298
# List of thumbnail to precalculate when an image is uploaded.
299
thumbnail_sizes:
300
- width: 32
301
  height: 32
302
  method: crop
303
- width: 96
304
  height: 96
305
  method: crop
306
- width: 320
307
  height: 240
308
  method: scale
309
- width: 640
310
  height: 480
311
  method: scale
312
- width: 800
313
  height: 600
314
  method: scale
315
316
# Is the preview URL API enabled?  If enabled, you *must* specify
317
# an explicit url_preview_ip_range_blacklist of IPs that the spider is
318
# denied from accessing.
319
url_preview_enabled: False
320
321
# List of IP address CIDR ranges that the URL preview spider is denied
322
# from accessing.  There are no defaults: you must explicitly
323
# specify a list for URL previewing to work.  You should specify any
324
# internal services in your network that you do not want synapse to try
325
# to connect to, otherwise anyone in any Matrix room could cause your
326
# synapse to issue arbitrary GET requests to your internal services,
327
# causing serious security issues.
328
#
329
# url_preview_ip_range_blacklist:
330
# - '127.0.0.0/8'
331
# - '10.0.0.0/8'
332
# - '172.16.0.0/12'
333
# - '192.168.0.0/16'
334
# - '100.64.0.0/10'
335
# - '169.254.0.0/16'
336
# - '::1/128'
337
# - 'fe80::/64'
338
# - 'fc00::/7'
339
#
340
# List of IP address CIDR ranges that the URL preview spider is allowed
341
# to access even if they are specified in url_preview_ip_range_blacklist.
342
# This is useful for specifying exceptions to wide-ranging blacklisted
343
# target IP ranges - e.g. for enabling URL previews for a specific private
344
# website only visible in your network.
345
#
346
# url_preview_ip_range_whitelist:
347
# - '192.168.1.1'
348
349
# Optional list of URL matches that the URL preview spider is
350
# denied from accessing.  You should use url_preview_ip_range_blacklist
351
# in preference to this, otherwise someone could define a public DNS
352
# entry that points to a private IP address and circumvent the blacklist.
353
# This is more useful if you know there is an entire shape of URL that
354
# you know that will never want synapse to try to spider.
355
#
356
# Each list entry is a dictionary of url component attributes as returned
357
# by urlparse.urlsplit as applied to the absolute form of the URL.  See
358
# https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit
359
# The values of the dictionary are treated as an filename match pattern
360
# applied to that component of URLs, unless they start with a ^ in which
361
# case they are treated as a regular expression match.  If all the
362
# specified component matches for a given list item succeed, the URL is
363
# blacklisted.
364
#
365
# url_preview_url_blacklist:
366
# # blacklist any URL with a username in its URI
367
# - username: '*'
368
#
369
# # blacklist all *.google.com URLs
370
# - netloc: 'google.com'
371
# - netloc: '*.google.com'
372
#
373
# # blacklist all plain HTTP URLs
374
# - scheme: 'http'
375
#
376
# # blacklist http(s)://www.acme.com/foo
377
# - netloc: 'www.acme.com'
378
#   path: '/foo'
379
#
380
# # blacklist any URL with a literal IPv4 address
381
# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
382
383
# The largest allowed URL preview spidering size in bytes
384
max_spider_size: "10M"
385
386
387
388
389
## Captcha ##
390
# See docs/CAPTCHA_SETUP for full details of configuring this.
391
392
# This Home Server's ReCAPTCHA public key.
393
recaptcha_public_key: "YOUR_PUBLIC_KEY"
394
395
# This Home Server's ReCAPTCHA private key.
396
recaptcha_private_key: "YOUR_PRIVATE_KEY"
397
398
# Enables ReCaptcha checks when registering, preventing signup
399
# unless a captcha is answered. Requires a valid ReCaptcha
400
# public/private key.
401
enable_registration_captcha: False
402
403
# A secret key used to bypass the captcha test entirely.
404
#captcha_bypass_secret: "YOUR_SECRET_HERE"
405
406
# The API endpoint to use for verifying m.login.recaptcha responses.
407
recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify"
408
409
410
## Turn ##
411
412
# The public URIs of the TURN server to give to clients
413
#turn_uris: []
414
415
# The shared secret used to compute passwords for the TURN server
416
#turn_shared_secret: "YOUR_SHARED_SECRET"
417
418
# The Username and password if the TURN server needs them and
419
# does not use a token
420
#turn_username: "TURNSERVER_USERNAME"
421
#turn_password: "TURNSERVER_PASSWORD"
422
423
# How long generated TURN credentials last
424
turn_user_lifetime: "1h"
425
426
# Whether guests should be allowed to use the TURN server.
427
# This defaults to True, otherwise VoIP will be unreliable for guests.
428
# However, it does introduce a slight security risk as it allows users to
429
# connect to arbitrary endpoints without having first signed up for a
430
# valid account (e.g. by passing a CAPTCHA).
431
turn_allow_guests: True
432
433
434
## Registration ##
435
436
# Enable registration for new users.
437
enable_registration: False
438
439
# The user must provide all of the below types of 3PID when registering.
440
#
441
# registrations_require_3pid:
442
#     - email
443
#     - msisdn
444
445
# Mandate that users are only allowed to associate certain formats of
446
# 3PIDs with accounts on this server.
447
#
448
# allowed_local_3pids:
449
#     - medium: email
450
#       pattern: ".*@matrix\.org"
451
#     - medium: email
452
#       pattern: ".*@vector\.im"
453
#     - medium: msisdn
454
#       pattern: "\+44"
455
456
# If set, allows registration by anyone who also has the shared
457
# secret, even if registration is otherwise disabled.
458
registration_shared_secret: "CHANGEME_50CHAR_RANDOM"
459
460
# Set the number of bcrypt rounds used to generate password hash.
461
# Larger numbers increase the work factor needed to generate the hash.
462
# The default number is 12 (which equates to 2^12 rounds).
463
# N.B. that increasing this will exponentially increase the time required
464
# to register or login - e.g. 24 => 2^24 rounds which will take >20 mins.
465
bcrypt_rounds: 12
466
467
# Allows users to register as guests without a password/email/etc, and
468
# participate in rooms hosted on this server which have been made
469
# accessible to anonymous users.
470
allow_guest_access: False
471
472
# The list of identity servers trusted to verify third party
473
# identifiers by this server.
474
trusted_third_party_id_servers:
475
    - matrix.org
476
    - vector.im
477
    - riot.im
478
479
# Users who register on this homeserver will automatically be joined
480
# to these rooms
481
#auto_join_rooms:
482
#    - "#example:example.com"
483
484
# Where auto_join_rooms are specified, setting this flag ensures that the
485
# the rooms exist by creating them when the first user on the
486
# homeserver registers.
487
# Setting to false means that if the rooms are not manually created,
488
# users cannot be auto-joined since they do not exist.
489
autocreate_auto_join_rooms: true
490
491
492
## Metrics ###
493
494
# Enable collection and rendering of performance metrics
495
enable_metrics: False
496
report_stats: False
497
498
499
## API Configuration ##
500
501
# A list of event types that will be included in the room_invite_state
502
room_invite_state_types:
503
    - "m.room.join_rules"
504
    - "m.room.canonical_alias"
505
    - "m.room.avatar"
506
    - "m.room.name"
507
508
509
# A list of application service config file to use
510
app_service_config_files: []
511
512
513
macaroon_secret_key: "CHANGEME_50CHAR_RANDOM"
514
515
# Used to enable access token expiration.
516
expire_access_token: False
517
518
# a secret which is used to calculate HMACs for form values, to stop
519
# falsification of values
520
form_secret: "CHANGEME_50CHAR_RANDOM"
521
522
## Signing Keys ##
523
524
# Path to the signing key to sign messages with
525
signing_key_path: "%%ETCDIR%%/example.com.signing.key"
526
527
# The keys that the server used to sign messages with but won't use
528
# to sign new messages. E.g. it has lost its private key
529
old_signing_keys: {}
530
#  "ed25519:auto":
531
#    # Base64 encoded public key
532
#    key: "The public part of your old signing key."
533
#    # Millisecond POSIX timestamp when the key expired.
534
#    expired_ts: 123456789123
535
536
# How long key response published by this server is valid for.
537
# Used to set the valid_until_ts in /key/v2 APIs.
538
# Determines how quickly servers will query to check which keys
539
# are still valid.
540
key_refresh_interval: "1d" # 1 Day.
541
542
# The trusted servers to download signing keys from.
543
perspectives:
544
  servers:
545
    "matrix.org":
546
      verify_keys:
547
        "ed25519:auto":
548
          key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
549
550
551
552
# Enable SAML2 for registration and login. Uses pysaml2
553
# config_path:      Path to the sp_conf.py configuration file
554
# idp_redirect_url: Identity provider URL which will redirect
555
#                   the user back to /login/saml2 with proper info.
556
# See pysaml2 docs for format of config.
557
#saml2_config:
558
#   enabled: true
559
#   config_path: "%%ETCDIR%%/sp_conf.py"
560
#   idp_redirect_url: "http://example.com/idp"
561
562
563
564
# Enable CAS for registration and login.
565
#cas_config:
566
#   enabled: true
567
#   server_url: "https://cas-server.com"
568
#   service_url: "https://homesever.domain.com:8448"
569
#   #required_attributes:
570
#   #    name: value
571
572
573
# The JWT needs to contain a globally unique "sub" (subject) claim.
574
#
575
# jwt_config:
576
#    enabled: true
577
#    secret: "a secret"
578
#    algorithm: "HS256"
579
580
581
582
# Enable password for login.
583
password_config:
584
   enabled: true
585
   # Uncomment and change to a secret random string for extra security.
586
   # DO NOT CHANGE THIS AFTER INITIAL SETUP!
587
   #pepper: ""
588
589
590
591
# Enable sending emails for notification events
592
# Defining a custom URL for Riot is only needed if email notifications
593
# should contain links to a self-hosted installation of Riot; when set
594
# the "app_name" setting is ignored.
595
#
596
# If your SMTP server requires authentication, the optional smtp_user &
597
# smtp_pass variables should be used
598
#
599
#email:
600
#   enable_notifs: false
601
#   smtp_host: "localhost"
602
#   smtp_port: 25
603
#   smtp_user: "exampleusername"
604
#   smtp_pass: "examplepassword"
605
#   require_transport_security: False
606
#   notif_from: "Your Friendly %(app)s Home Server <noreply@example.com>"
607
#   app_name: Matrix
608
#   # if template_dir is unset, uses the example templates that are part of
609
#   # the Synapse distribution.
610
#   #template_dir: res/templates
611
#   notif_template_html: notif_mail.html
612
#   notif_template_text: notif_mail.txt
613
#   notif_for_new_users: True
614
#   riot_base_url: "http://localhost/riot"
615
616
617
# password_providers:
618
#     - module: "ldap_auth_provider.LdapAuthProvider"
619
#       config:
620
#         enabled: true
621
#         uri: "ldap://ldap.example.com:389"
622
#         start_tls: true
623
#         base: "ou=users,dc=example,dc=com"
624
#         attributes:
625
#            uid: "cn"
626
#            mail: "email"
627
#            name: "givenName"
628
#         #bind_dn:
629
#         #bind_password:
630
#         #filter: "(objectClass=posixAccount)"
631
632
633
634
# Clients requesting push notifications can either have the body of
635
# the message sent in the notification poke along with other details
636
# like the sender, or just the event ID and room ID (`event_id_only`).
637
# If clients choose the former, this option controls whether the
638
# notification request includes the content of the event (other details
639
# like the sender are still included). For `event_id_only` push, it
640
# has no effect.
641
642
# For modern android devices the notification content will still appear
643
# because it is loaded by the app. iPhone, however will send a
644
# notification saying only that a message arrived and who it came from.
645
#
646
#push:
647
#   include_content: true
648
649
650
# spam_checker:
651
#     module: "my_custom_project.SuperSpamChecker"
652
#     config:
653
#         example_option: 'things'
654
655
656
# Whether to allow non server admins to create groups on this server
657
enable_group_creation: false
658
659
# If enabled, non server admins can only create groups with local parts
660
# starting with this prefix
661
# group_creation_prefix: "unofficial/"
662
663
664
665
# User Directory configuration
666
#
667
# 'search_all_users' defines whether to search all users visible to your HS
668
# when searching the user directory, rather than limiting to users visible
669
# in public rooms.  Defaults to false.  If you set it True, you'll have to run
670
# UPDATE user_directory_stream_pos SET stream_id = NULL;
671
# on your database to tell it to rebuild the user_directory search indexes.
672
#
673
#user_directory:
674
#   search_all_users: false
675
676
677
# User Consent configuration
678
#
679
# for detailed instructions, see
680
# https://github.com/matrix-org/synapse/blob/master/docs/consent_tracking.md
681
#
682
# Parts of this section are required if enabling the 'consent' resource under
683
# 'listeners', in particular 'template_dir' and 'version'.
684
#
685
# 'template_dir' gives the location of the templates for the HTML forms.
686
# This directory should contain one subdirectory per language (eg, 'en', 'fr'),
687
# and each language directory should contain the policy document (named as
688
# '<version>.html') and a success page (success.html).
689
#
690
# 'version' specifies the 'current' version of the policy document. It defines
691
# the version to be served by the consent resource if there is no 'v'
692
# parameter.
693
#
694
# 'server_notice_content', if enabled, will send a user a "Server Notice"
695
# asking them to consent to the privacy policy. The 'server_notices' section
696
# must also be configured for this to work. Notices will *not* be sent to
697
# guest users unless 'send_server_notice_to_guests' is set to true.
698
#
699
# 'block_events_error', if set, will block any attempts to send events
700
# until the user consents to the privacy policy. The value of the setting is
701
# used as the text of the error.
702
#
703
# user_consent:
704
#   template_dir: res/templates/privacy
705
#   version: 1.0
706
#   server_notice_content:
707
#     msgtype: m.text
708
#     body: >-
709
#       To continue using this homeserver you must review and agree to the
710
#       terms and conditions at %(consent_uri)s
711
#   send_server_notice_to_guests: True
712
#   block_events_error: >-
713
#     To continue using this homeserver you must review and agree to the
714
#     terms and conditions at %(consent_uri)s
715
#
716
717
718
# Server Notices room configuration
719
#
720
# Uncomment this section to enable a room which can be used to send notices
721
# from the server to users. It is a special room which cannot be left; notices
722
# come from a special "notices" user id.
723
#
724
# If you uncomment this section, you *must* define the system_mxid_localpart
725
# setting, which defines the id of the user which will be used to send the
726
# notices.
727
#
728
# It's also possible to override the room name, the display name of the
729
# "notices" user, and the avatar for the user.
730
#
731
# server_notices:
732
#   system_mxid_localpart: notices
733
#   system_mxid_display_name: "Server Notices"
734
#   system_mxid_avatar_url: "mxc://server.com/oumMVlgDnLYFaPVkExemNVVZ"
735
#   room_name: "Server Notices"
736
737
738
739
# The `alias_creation` option controls who's allowed to create aliases
740
# on this server.
741
#
742
# The format of this option is a list of rules that contain globs that
743
# match against user_id and the new alias (fully qualified with server
744
# name). The action in the first rule that matches is taken, which can
745
# currently either be "allow" or "deny".
746
#
747
# If no rules match the request is denied.
748
alias_creation_rules:
749
    - user_id: "*"
750
      alias: "*"
751
      action: allow
(-)py-matrix-synapse/files/patch-python_dependencies.py (-5 / +5 lines)
Lines 1-11 Link Here
1
--- synapse/python_dependencies.py.orig	2019-01-10 17:51:27.362204447 +0100
1
--- synapse/python_dependencies.py.orig	2019-02-14 17:20:02.000000000 +0000
2
+++ synapse/python_dependencies.py	2019-01-10 17:51:47.559224870 +0100
2
+++ synapse/python_dependencies.py	2019-02-28 20:31:10.838648000 +0000
3
@@ -58,7 +58,7 @@
3
@@ -62,7 +62,7 @@
4
     "six>=1.10",
4
     "six>=1.10",
5
     # prometheus_client 0.4.0 changed the format of counter metrics
5
     # prometheus_client 0.4.0 changed the format of counter metrics
6
     # (cf https://github.com/matrix-org/synapse/issues/4001)
6
     # (cf https://github.com/matrix-org/synapse/issues/4001)
7
-    "prometheus_client>=0.0.18,<0.4.0",
7
-    "prometheus_client>=0.0.18,<0.4.0",
8
+    "prometheus_client>=0.0.18",
8
+    "prometheus_client>=0.0.18",
9
 
9
     # we use attr.s(slots), which arrived in 16.0.0
10
     # we use attr.s(slots), which arrived in 16.0.0
10
     "attrs>=16.0.0",
11
     # Twisted 18.7.0 requires attrs>=17.4.0
11
     "netaddr>=0.7.18",
(-)py-matrix-synapse/files/pkg-message.in (-14 / +6 lines)
Lines 1-22 Link Here
1
Configuring Synapse:
1
Configuring Synapse:
2
2
3
You may use the sample config located at %%ETCDIR%% to get started. It
3
The following command can be used to generate a sample configuration of synapse:
4
already is configured to find the configuration in that location and
5
places the database in %%DBDIR%% and the logs in %%LOGDIR%%, but there
6
are some crucial values you will need to populate with unique data:
7
registration_shared_secret and macaroon_secret_key. Both of these
8
by default are 50 character random strings. These are by default set to
9
CHANGEME_50CHAR_RANDOM in the sample homeserver.yaml.
10
4
11
If you wish to have Synapse handle this for you including generation of
12
self-signed TLS certificates and dhparams you can use the following
13
command:
14
15
%%PYTHON_CMD%% -B -m synapse.app.homeserver -c %%ETCDIR%%/homeserver.yaml --generate-config -H <SERVER_NAME> --report-stats no
5
%%PYTHON_CMD%% -B -m synapse.app.homeserver -c %%ETCDIR%%/homeserver.yaml --generate-config -H <SERVER_NAME> --report-stats no
16
6
17
Please note that you will still need to manually configure paths to log
7
Please note that you will still need to manually configure paths to log
18
directory, database, and media storage with this method.
8
directory, database, and media storage with this method.
19
9
20
It is also important that you deploy a TLS certificate that your
10
NOTE: Starting with Synapse v1.0, valid TLS certificates will be required for
21
clients accept as valid or some functionality will fail to work
11
server-to-server communication. Self-signed certificates often autogenerated
22
correctly (eg, media file retrieval).
12
with previous versions will no longer suffice. Please ensure that the
13
certificate specified by the "tls_certificate_path" option in your
14
homeserver.yaml points to a valid certificate.

Return to bug 236260