From 733e8517e34160ec5f9eb02549fdef728c173bf4 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Wed, 2 Apr 2025 17:04:21 +0200 Subject: [PATCH] Improve deployment config --- fly.toml | 9 ++++++++- src/anonchat/__init__.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fly.toml b/fly.toml index de4ab97..3d7987b 100644 --- a/fly.toml +++ b/fly.toml @@ -14,11 +14,18 @@ primary_region = 'ams' [http_service] internal_port = 5000 force_https = true - auto_stop_machines = 'stop' + auto_stop_machines = 'suspend' auto_start_machines = true min_machines_running = 1 processes = ['app'] +[[http_service.checks]] + grace_period = "10s" + interval = "30s" + method = "GET" + timeout = "5s" + path = "/" + [[vm]] size = 'shared-cpu-1x' memory = '256mb' diff --git a/src/anonchat/__init__.py b/src/anonchat/__init__.py index 25f0216..00c8c51 100644 --- a/src/anonchat/__init__.py +++ b/src/anonchat/__init__.py @@ -47,7 +47,7 @@ elif app.config['SESSION_TYPE'] == 'filesystem': app.config['SESSION_KEY_PREFIX'] = 'anonchat_session:' if app.config['BEHIND_PROXY']: - app.wsgi_app = ProxyFix(app.wsgi_app) + app.wsgi_app = ProxyFix(app.wsgi_app, x_for=2) # Initialize password hasher # Parameters source: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id