From ad01c39914eb78e2c9007a94d6f91d4885ab9752 Mon Sep 17 00:00:00 2001
From: MadLittleMods
Unix socket support (Added in Synapse 1.88.0):
+path
: A path and filename for a Unix socket. Make sure it is located in a
+directory with read and write permissions, and that it already exists (the directory
+will not be created). Defaults to None
.
+path
and port
options for the same listener
is not
+compatible.x_forwarded
option defaults to true when using Unix sockets and can be omitted.bind_addresses
and tls
will be ignored and can be removed.mode
: The file permissions to set on the UNIX socket. Defaults to 666
type: http
(does not support metrics
and manhole
).
+Also make sure that metrics
is not included in resources
-> names
Valid resource names are:
media
: the media API (/_matrix/media).
metrics
: the metrics interface. See here.
metrics
: the metrics interface. See here. (Not compatible with Unix sockets)
openid
: OpenID authentication. See here.
Example configuration #3:
+listeners:
+ # Unix socket listener: Ideal for Synapse deployments behind a reverse proxy, offering
+ # lightweight interprocess communication without TCP/IP overhead, avoid port
+ # conflicts, and providing enhanced security through system file permissions.
+ #
+ # Note that x_forwarded will default to true, when using a UNIX socket. Please see
+ # https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
+ #
+ - path: /var/run/synapse/main_public.sock
+ type: http
+ resources:
+ - names: [client, federation]
+
manhole_settings
Connection settings for the manhole. You can find more information
@@ -3531,6 +3562,13 @@ inside the listener
block for a replication
listener.<
host: localhost
port: 8034
+
Example configuration(#2, for UNIX sockets):
+instance_map:
+ main:
+ path: /var/run/synapse/main_replication.sock
+ worker1:
+ path: /var/run/synapse/worker1_replication.sock
+
stream_writers
Experimental: When using workers you can define which workers should @@ -3670,6 +3708,17 @@ requests from other workers.
resources: - names: [client, federation] +Example configuration(#2, using UNIX sockets with a replication
listener):
worker_listeners:
+ - type: http
+ path: /var/run/synapse/worker_public.sock
+ resources:
+ - names: [client, federation]
+ - type: http
+ path: /var/run/synapse/worker_replication.sock
+ resources:
+ - names: [replication]
+
worker_manhole
A worker may have a listener for manhole
.
--
cgit 1.5.1