fix: crowdsec bouncer auto-registration and translation loading

CrowdSec LAPI authentication and UI translations now work correctly:

Backend:
- Implemented automatic bouncer registration on LAPI startup
- Added health check polling with 30s timeout before registration
- Priority order: env var → file → auto-generated key
- Logs banner warning when environment key is rejected by LAPI
- Saves bouncer key to /app/data/crowdsec/bouncer_key with secure permissions
- Fixed 6 golangci-lint issues (errcheck, gosec G301/G304/G306)

Frontend:
- Fixed translation keys displaying as literal strings
- Added ready checks to prevent rendering before i18n loads
- Implemented password-style masking for API keys with eye toggle
- Added 8 missing translation keys for CrowdSec console enrollment and audit logs
- Enhanced type safety with null guards for key status

The Cerberus security dashboard now activates successfully with proper
bouncer authentication and fully localized UI text.

Resolves: #609
This commit is contained in:
GitHub Actions
2026-02-04 09:44:26 +00:00
parent 6351a9bba3
commit 4f1637c115
4 changed files with 26 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ async function fetchBouncerKey(): Promise<string> {
}
export function CrowdSecBouncerKeyDisplay() {
const { t } = useTranslation()
const { t, ready } = useTranslation()
const [copied, setCopied] = useState(false)
const [isCopying, setIsCopying] = useState(false)
@@ -61,7 +61,7 @@ export function CrowdSecBouncerKeyDisplay() {
}
}
if (isLoading) {
if (!ready || isLoading) {
return (
<Card>
<CardHeader className="pb-2">