diff --git a/config/config.py b/config/config.py index 549b50b..6b3d3d9 100644 --- a/config/config.py +++ b/config/config.py @@ -318,6 +318,12 @@ class Config(object): # Content Directory for static content like the changelog, terms & conditions, privacy statement, ... CONTENT_DIR = '/app/content' + # Ensure health check endpoints are exempt from CSRF protection + SECURITY_EXEMPT_URLS = [ + r'^/healthz($|/.*)', + r'^/_healthz($|/.*)', + ] + class DevConfig(Config): DEVELOPMENT = True diff --git a/eveai_app/__init__.py b/eveai_app/__init__.py index 3177a0a..c5b9bb4 100644 --- a/eveai_app/__init__.py +++ b/eveai_app/__init__.py @@ -86,6 +86,14 @@ def create_app(config_file=None): # Register Cache Handlers register_cache_handlers(app) + # Register standard health endpoints at /healthz (liveness/readiness) + # These must be public and not require authentication. + try: + from flask_healthz import healthz as healthz_blueprint + app.register_blueprint(healthz_blueprint, url_prefix="/healthz") + except Exception as e: + app.logger.warning(f"Failed to register /healthz blueprint: {e}") + # Custom url_for function for templates @app.context_processor def override_url_for(): diff --git a/scaleway/manifests/base/applications/frontend/eveai-app/deployment.yaml b/scaleway/manifests/base/applications/frontend/eveai-app/deployment.yaml index b546e9b..24c2149 100644 --- a/scaleway/manifests/base/applications/frontend/eveai-app/deployment.yaml +++ b/scaleway/manifests/base/applications/frontend/eveai-app/deployment.yaml @@ -62,9 +62,9 @@ spec: periodSeconds: 10 livenessProbe: httpGet: - path: /healthz/ready + path: /healthz/live port: http - initialDelaySeconds: 20 + initialDelaySeconds: 25 periodSeconds: 20 --- apiVersion: v1