Persist JWT signing secret across server restarts #38
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
JwtServiceImplgenerates a random signing secret on each server startup. This means every server restart invalidates all issued JWTs, forcing all agents to re-register and all UI users to re-login.In an HA/LB setup with multiple server instances, each instance would have a different secret, making tokens non-portable between instances.
Proposed Change
Make the JWT signing secret configurable via environment variable (e.g.
CAMELEER_JWT_SECRET). If not set, fall back to generating a random one (current behavior, suitable for dev).For production, the secret should be stored in a K8s Secret and mounted as an env var, shared across all server replicas.
Context
Identified during UI planning. Acceptable for single-instance v1 deployments, but blocks HA/LB scenarios where the UI connects to any backend instance behind a load balancer.