mirror of
https://github.com/go-sigma/sigma.git
synced 2026-10-28 17:06:24 +08:00
auth.credentialKey is optional, so a deployment must work without operator input. Generate a random 32-byte key on first start and persist it in the settings table, which keeps the credential service able to decrypt values written by an earlier process. - run the task right after the services are registered, before signing - take a distributed lock around the check-then-create and re-read inside it, otherwise two replicas starting together would generate different keys and leave half the credentials unreadable - when auth.credentialKey is set it is authoritative: only its length is validated and nothing is written to the settings table Verification: - go test -tags "netgo,timetzdata,exclude_graphdriver_btrfs,containers_image_openpgp" ./pkg/app/bootstrap/...