From cb736aae19a0fd74cbdb834d3af44e4a2ed5ba76 Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Wed, 20 Aug 2025 14:23:26 +0100 Subject: [PATCH] Optimisations to invenio server config --- caddy/Caddyfile | 18 ++++++++++++++++++ invenio/invenio.cfg | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/caddy/Caddyfile b/caddy/Caddyfile index cc9a78c..c93df28 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,5 +1,12 @@ { admin off + http_port 80 + https_port 443 + servers { + trusted_proxies static private_ranges + protocols h1 h2 h3 + max_header_size 16k + } } am-d-model.eu { @@ -12,6 +19,15 @@ am-d-model.eu { } invenio.am-d-model.eu { + rate_limit { + * 20 50 + } + header { + Strict-Transport-Security "max-age=31536000;" + X-Frame-Options "SAMEORIGIN" + X-Content-Type-Options "nosniff" + Referrer-Policy "strict-origin-when-cross-origin" + } request_body { max_size 1TB } @@ -19,7 +35,9 @@ invenio.am-d-model.eu { try_files {path} {path}/ /index.html reverse_proxy invenio-rdm:5000 { transport http { + dial_timeout 10s response_header_timeout 5m + idle_conn_timeout 10m } } file_server diff --git a/invenio/invenio.cfg b/invenio/invenio.cfg index 009e601..3276817 100644 --- a/invenio/invenio.cfg +++ b/invenio/invenio.cfg @@ -103,6 +103,11 @@ APP_ALLOWED_HOSTS = ["localhost", "127.0.0.1"] # Set via env variable # SQLALCHEMY_DATABASE_URI= +SQLALCHEMY_ENGINE_OPTIONS = { + "pool_size": 5, + "max_overflow": 5, + "pool_recycle": 3600, +} # Invenio-App