synapse-old/synapse/config
Jason Little 56efa9b167
Experimental Unix socket support (#15353)
* Add IReactorUNIX to ISynapseReactor type hint.

* Create listen_unix().

Two options, 'path' to the file and 'mode' of permissions(not umask, recommend 666 as default as
nginx/other reverse proxies write to it and it's setup as user www-data)

For the moment, leave the option to always create a PID lockfile turned on by default

* Create UnixListenerConfig and wire it up.

Rename ListenerConfig to TCPListenerConfig, then Union them together into ListenerConfig.
This spidered around a bit, but I think I got it all. Metrics and manhole have been placed
behind a conditional in case of accidental putting them onto a unix socket.

Use new helpers to get if a listener is configured for TLS, and to help create a site tag
for logging.

There are 2 TODO things in parse_listener_def() to finish up at a later point.

* Refactor SynapseRequest to handle logging correctly when using a unix socket.

This prevents an exception when an IP address can not be retrieved for a request.

* Make the 'Synapse now listening on Unix socket' log line a little prettier.

* No silent failures on generic workers when trying to use a unix socket with metrics or manhole.

* Inline variables in app/_base.py

* Update docstring for listen_unix() to remove reference to a hardcoded permission of 0o666 and add a few comments saying where the default IS declared.

* Disallow both a unix socket and a ip/port combo on the same listener resource

* Linting

* Changelog

* review: simplify how listen_unix returns(and get rid of a type: ignore)

* review: fix typo from ConfigError in app/homeserver.py

* review: roll conditional for http_options.tag into get_site_tag() helper(and add docstring)

* review: enhance the conditionals for checking if a port or path is valid, remove a TODO line

* review: Try updating comment in get_client_ip_if_available to clarify what is being retrieved and why

* Pretty up how 'Synapse now listening on Unix Socket' looks by decoding the byte string.

* review: In parse_listener_def(), raise ConfigError if neither socket_path nor port is declared(and fix a typo)
2023-04-03 10:27:51 +01:00
..
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
__main__.py Additional type hints for config module. (#11465) 2021-12-01 07:28:23 -05:00
_base.py Prefer `type(x) is int` to `isinstance(x, int)` (#14945) 2023-01-31 10:33:07 +00:00
_base.pyi Re-enable some linting (#14821) 2023-01-12 10:52:07 +00:00
_util.py Allow selecting "prejoin" events by state keys (#14642) 2022-12-13 00:54:46 +00:00
account_validity.py Fix a typo in docs and in some warnings (#13538) 2022-08-17 10:59:05 +01:00
api.py Allow selecting "prejoin" events by state keys (#14642) 2022-12-13 00:54:46 +00:00
appservice.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
auth.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
background_updates.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
cache.py Prefer `type(x) is int` to `isinstance(x, int)` (#14945) 2023-01-31 10:33:07 +00:00
captcha.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
cas.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
consent.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
database.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
emailconfig.py Drop support for delegating email validation, round 2 (#13596) 2022-08-23 11:40:00 +00:00
experimental.py Implement MSC3984 to proxy /keys/query requests to appservices. (#15321) 2023-03-30 08:39:38 -04:00
federation.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
homeserver.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
jwt.py Allow dependency errors to pass through (#13113) 2022-06-30 19:48:04 +02:00
key.py Fix a bug where Synapse fails to start if a signing key file contains an empty line. (#13738) 2022-09-08 11:18:03 +01:00
logger.py Reload the pyo3-log config when the Python logging config changes. (#14976) 2023-02-03 08:27:31 -05:00
metrics.py Remove legacy Prometheus metrics names. They were deprecated in Synapse v1.69.0 and disabled by default in Synapse v1.71.0. (#14538) 2022-11-24 09:09:17 +00:00
modules.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
oembed.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
oidc.py Add the ability to enable/disable registrations when in the OIDC flow (#14978) 2023-03-30 11:09:41 +00:00
password_auth_providers.py Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
push.py Add `push.enabled` option to disable push notification calculation (#14551) 2022-12-01 13:46:24 +00:00
ratelimiting.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
redis.py Support for selecting the Redis logical database. (#15034) 2023-02-15 07:39:31 -05:00
registration.py Support `registration_shared_secret` in a file (#13614) 2022-08-25 16:27:46 +00:00
repository.py Refactor media modules. (#15146) 2023-02-27 08:26:05 -05:00
retention.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
room.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
room_directory.py Return read-only collections from `@cached` methods (#13755) 2023-02-10 23:29:00 +00:00
saml2.py Allow dependency errors to pass through (#13113) 2022-06-30 19:48:04 +02:00
server.py Experimental Unix socket support (#15353) 2023-04-03 10:27:51 +01:00
server_notices.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
spam_checker.py Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
sso.py Fix a typo in docs and in some warnings (#13538) 2022-08-17 10:59:05 +01:00
stats.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
third_party_event_rules.py Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
tls.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
tracer.py Allow dependency errors to pass through (#13113) 2022-06-30 19:48:04 +02:00
user_directory.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
voip.py Remove code generating comments in configuration file (#12941) 2022-06-14 07:53:42 -07:00
workers.py Experimental Unix socket support (#15353) 2023-04-03 10:27:51 +01:00