Add option to change max body size for AS API
ref tulir/mautrix-appservice-python#3
This commit is contained in:
@@ -17,6 +17,9 @@ appservice:
|
|||||||
# The hostname and port where this appservice should listen.
|
# The hostname and port where this appservice should listen.
|
||||||
hostname: 0.0.0.0
|
hostname: 0.0.0.0
|
||||||
port: 8080
|
port: 8080
|
||||||
|
# The maximum body size of appservice API requests (from the homeserver) in mebibytes
|
||||||
|
# Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
|
||||||
|
max_body_size: 1
|
||||||
|
|
||||||
# The full URI to the database. SQLite and Postgres are fully supported.
|
# The full URI to the database. SQLite and Postgres are fully supported.
|
||||||
# Other DBMSes supported by SQLAlchemy may or may not work.
|
# Other DBMSes supported by SQLAlchemy may or may not work.
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ appserv = AppService(config["homeserver.address"], config["homeserver.domain"],
|
|||||||
config["appservice.as_token"], config["appservice.hs_token"],
|
config["appservice.as_token"], config["appservice.hs_token"],
|
||||||
config["appservice.bot_username"], log="mau.as", loop=loop,
|
config["appservice.bot_username"], log="mau.as", loop=loop,
|
||||||
verify_ssl=config["homeserver.verify_ssl"], state_store=state_store,
|
verify_ssl=config["homeserver.verify_ssl"], state_store=state_store,
|
||||||
real_user_content_key="net.maunium.telegram.puppet")
|
real_user_content_key="net.maunium.telegram.puppet",
|
||||||
|
aiohttp_params={"client_max_size": config["appservice.max_body_size"]})
|
||||||
|
|
||||||
context = Context(appserv, db_session, config, loop, session_container)
|
context = Context(appserv, db_session, config, loop, session_container)
|
||||||
|
|
||||||
@@ -101,7 +102,6 @@ if config["appservice.provisioning.enabled"]:
|
|||||||
provisioning_api.app)
|
provisioning_api.app)
|
||||||
context.provisioning_api = provisioning_api
|
context.provisioning_api = provisioning_api
|
||||||
|
|
||||||
|
|
||||||
with appserv.run(config["appservice.hostname"], config["appservice.port"]) as start:
|
with appserv.run(config["appservice.hostname"], config["appservice.port"]) as start:
|
||||||
init_db(db_session)
|
init_db(db_session)
|
||||||
init_abstract_user(context)
|
init_abstract_user(context)
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ class Config(DictWithRecursion):
|
|||||||
copy("appservice.address")
|
copy("appservice.address")
|
||||||
copy("appservice.hostname")
|
copy("appservice.hostname")
|
||||||
copy("appservice.port")
|
copy("appservice.port")
|
||||||
|
copy("appservice.max_body_size")
|
||||||
|
|
||||||
copy("appservice.database")
|
copy("appservice.database")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user