diff --git a/lgarret/health-check-bundle/1.0/config/packages/health_check.yaml b/lgarret/health-check-bundle/1.0/config/packages/health_check.yaml new file mode 100644 index 00000000..5e59a05b --- /dev/null +++ b/lgarret/health-check-bundle/1.0/config/packages/health_check.yaml @@ -0,0 +1,11 @@ +health_check: + path: '/health' + secret: '%env(HEALTH_CHECK_SECRET)%' + header: 'Authorization' + timeout: 5 + cache: + enabled: true + ttl: 300 + checks: + doctrine: true + asset_mapper: true diff --git a/lgarret/health-check-bundle/1.0/config/routes/health_check.yaml b/lgarret/health-check-bundle/1.0/config/routes/health_check.yaml new file mode 100644 index 00000000..efdf9682 --- /dev/null +++ b/lgarret/health-check-bundle/1.0/config/routes/health_check.yaml @@ -0,0 +1,3 @@ +health_check: + resource: . + type: health_check diff --git a/lgarret/health-check-bundle/1.0/manifest.json b/lgarret/health-check-bundle/1.0/manifest.json new file mode 100644 index 00000000..5edc78fe --- /dev/null +++ b/lgarret/health-check-bundle/1.0/manifest.json @@ -0,0 +1,26 @@ +{ + "bundles": { + "Lgarret\\HealthCheckBundle\\HealthCheckBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "HEALTH_CHECK_SECRET": "!ChangeMe!" + }, + "post-install-output": [ + " * The health check endpoint is exposed at /health.", + "", + " * Replace the HEALTH_CHECK_SECRET placeholder in .env with a real value.", + " Callers sending it in the Authorization header get the detailed check results;", + " everyone else only sees the global status.", + "", + " * If your firewall covers every path, grant it anonymous access in config/packages/security.yaml:", + " access_control:", + " - { path: ^/health$, roles: PUBLIC_ACCESS }", + "", + " * Enable, disable and tune the checks in config/packages/health_check.yaml.", + "", + " * Docs: https://github.com/LouisGarret/health-check-bundle" + ] +}