forked-synapse/synapse
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
..
_scripts Make cleaning up pushers depend on the device_id instead of the token_id (#15280) 2023-03-24 11:09:39 -04:00
api Fix spinloop during partial state sync when a prev event is in backoff (#15351) 2023-03-30 13:36:41 +01:00
app Experimental Unix socket support (#15353) 2023-04-03 10:27:51 +01:00
appservice Implement MSC3984 to proxy /keys/query requests to appservices. (#15321) 2023-03-30 08:39:38 -04:00
config Experimental Unix socket support (#15353) 2023-04-03 10:27:51 +01:00
crypto Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
events Bump ruff from 0.0.252 to 0.0.259 (#15328) 2023-03-28 09:46:47 +01:00
federation Implement MSC3984 to proxy /keys/query requests to appservices. (#15321) 2023-03-30 08:39:38 -04:00
handlers Revert pruning of old devices (#15360) 2023-03-31 13:51:51 +01:00
http Experimental Unix socket support (#15353) 2023-04-03 10:27:51 +01:00
logging Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
media Separate HTTP preview code and URL previewer. (#15269) 2023-03-20 14:32:26 -04:00
metrics Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
module_api Move Account Validity callbacks to a dedicated file (#15237) 2023-03-16 10:35:31 +00:00
push Fix missing app variable in mail subject for password resets (#15352) 2023-03-30 11:44:53 +01:00
replication Add some clarification to the doc/comments regarding TCP replication (#15354) 2023-03-30 12:51:35 +02:00
res Fix copyright year in SSO footer template (#15358) 2023-03-31 18:20:40 +01:00
rest Load /password_policy endpoint on workers. (#15331) 2023-03-27 07:37:17 -04:00
server_notices Remove unused room_alias field from /createRoom response (#15093) 2023-02-22 11:07:28 +00:00
spam_checker_api Fix import in module_api module and docs on the new check_event_for_spam signature (#12918) 2022-05-31 12:04:53 +02:00
state Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
static Add viewport directive to HTML templates to optimise for mobile (#13493) 2022-08-11 14:04:20 +01:00
storage Revert pruning of old devices (#15360) 2023-03-31 13:51:51 +01:00
streams Use mypy 1.0 (#15052) 2023-02-16 16:09:11 +00:00
types Experimental Unix socket support (#15353) 2023-04-03 10:27:51 +01:00
util Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
__init__.py Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
event_auth.py More speedups/fixes to creating batched events (#15195) 2023-03-07 13:54:39 -08:00
notifier.py Fix a bug in the send_local_online_presence_to module API (#14880) 2023-01-25 21:34:37 +00:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Move Account Validity callbacks to a dedicated file (#15237) 2023-03-16 10:35:31 +00:00
visibility.py Refactor filter_events_for_server (#15240) 2023-03-10 15:31:25 +00:00