mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-12-27 22:04:33 -05:00
Merge f3f2762597 into 9fe0e80128
This commit is contained in:
commit
4555ff29ef
4 changed files with 18 additions and 2 deletions
|
|
@ -56,6 +56,8 @@ This option configures if a proxy instance should only keep the latest version
|
|||
of a room key from a certain user around. This effectively means that only newly
|
||||
incoming messages will be decryptable, the proxy will be unable to decrypt the
|
||||
room history. Defaults to "No".
|
||||
.It Cm ClientMaxSize
|
||||
The maximum size of a request, in bytes. Defaults to "104857600".
|
||||
.It Cm SearchRequests
|
||||
This option configures if the proxy should make additional HTTP requests to the
|
||||
server when clients use the search API endpoint. Some data that is required to
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ The following keys are optional in the proxy instance sections:
|
|||
> incoming messages will be decryptable, the proxy will be unable to decrypt the
|
||||
> room history. Defaults to "No".
|
||||
|
||||
**ClientMaxSize**
|
||||
|
||||
> The maximum size of a request, in bytes. Defaults to "104857600".
|
||||
|
||||
Additional to the homeserver section a special section with the name
|
||||
**Default**
|
||||
can be used to configure the following values for all homeservers:
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class PanConfigParser(configparser.ConfigParser):
|
|||
"HistoryFetchDelay": "3000",
|
||||
"DebugEncryption": "False",
|
||||
"DropOldKeys": "False",
|
||||
"ClientMaxSize": "104857600",
|
||||
},
|
||||
converters={
|
||||
"address": parse_address,
|
||||
|
|
@ -124,6 +125,7 @@ class ServerConfig:
|
|||
requests in seconds.
|
||||
drop_old_keys (bool): Should Pantalaimon only keep the most recent
|
||||
decryption key around.
|
||||
client_max_size (int): The maximum size of a request, in bytes.
|
||||
"""
|
||||
|
||||
name = attr.ib(type=str)
|
||||
|
|
@ -141,6 +143,7 @@ class ServerConfig:
|
|||
indexing_batch_size = attr.ib(type=int, default=100)
|
||||
history_fetch_delay = attr.ib(type=int, default=3)
|
||||
drop_old_keys = attr.ib(type=bool, default=False)
|
||||
client_max_size = attr.ib(type=int, default=1024**2 * 100)
|
||||
|
||||
|
||||
@attr.s
|
||||
|
|
@ -234,6 +237,13 @@ class PanConfig:
|
|||
listen_set.add(listen_tuple)
|
||||
drop_old_keys = section.getboolean("DropOldKeys")
|
||||
|
||||
client_max_size = section.getint("ClientMaxSize")
|
||||
|
||||
if not 0 < client_max_size:
|
||||
raise PanConfigError(
|
||||
"The client max size must be a positive integer"
|
||||
)
|
||||
|
||||
server_conf = ServerConfig(
|
||||
section_name,
|
||||
homeserver,
|
||||
|
|
@ -248,6 +258,7 @@ class PanConfig:
|
|||
indexing_batch_size,
|
||||
history_fetch_delay / 1000,
|
||||
drop_old_keys,
|
||||
client_max_size,
|
||||
)
|
||||
|
||||
self.servers[section_name] = server_conf
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ async def init(data_dir, server_conf, send_queue, recv_queue):
|
|||
client_store_class=store_class,
|
||||
)
|
||||
|
||||
# 100 MB max POST size
|
||||
app = web.Application(client_max_size=1024**2 * 100)
|
||||
app = web.Application(client_max_size=server_conf.client_max_size)
|
||||
|
||||
app.add_routes(
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue