feat(captcha): add ALTCHA configuration endpoint and integrate into HomeController
- Introduced a new endpoint `/api/v1/altcha/config` in CaptchaController to return the status of the ALTCHA captcha. - Updated HomeController to inject AltchaService and pass the captcha status to the home page template. - Modified the home.html.twig template to conditionally render the ALTCHA widget based on the captcha status. - Updated manifest.json and cache files to reflect changes in the codebase.
This commit is contained in:
+13
-4
@@ -37,8 +37,9 @@ x-app-env: &app-env
|
||||
MAX_FILE_SIZE_BYTES: "5242880"
|
||||
UPLOAD_DIR: var/uploads
|
||||
# ALTCHA self-hosted captcha. HMAC key is a secret → inject from Coolify's
|
||||
# Environment Variables tab. Enabled in prod; tunables fixed here.
|
||||
ALTCHA_ENABLED: "1"
|
||||
# Environment Variables tab. Symfony reads this via %env(bool:...)% so
|
||||
# true/false (or 1/0) both work; کپچا در prod روشن است.
|
||||
ALTCHA_ENABLED: "true"
|
||||
ALTCHA_HMAC_KEY: ${ALTCHA_HMAC_KEY}
|
||||
ALTCHA_MAX_NUMBER: "100000"
|
||||
ALTCHA_EXPIRE_SECONDS: "300"
|
||||
@@ -95,7 +96,11 @@ services:
|
||||
stop_grace_period: 30s
|
||||
# No port to probe — just confirm the consumer process is alive (busybox ps).
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "ps -o args 2>/dev/null | grep -q '[m]essenger:consume async' || exit 1"]
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"ps -o args 2>/dev/null | grep -q '[m]essenger:consume async' || exit 1",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
@@ -114,7 +119,11 @@ services:
|
||||
depends_on: [app]
|
||||
stop_grace_period: 30s
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "ps -o args 2>/dev/null | grep -q '[m]essenger:consume scheduler_default' || exit 1"]
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"ps -o args 2>/dev/null | grep -q '[m]essenger:consume scheduler_default' || exit 1",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
Reference in New Issue
Block a user