feat: seed SSH users from env var and authorized_keys file #31

Merged
lerko merged 3 commits from feat/onboarding-keys into main 2026-05-27 21:15:01 +00:00

3 Commits

Author SHA1 Message Date
lerko c8e9893b59 fix(lint): sanitize UPTOP_KEYS path for gosec G703
CI / test (pull_request) Successful in 2m59s
CI / lint (pull_request) Successful in 1m11s
CI / vulncheck (pull_request) Successful in 1m2s
2026-05-27 16:59:02 -04:00
lerko 64b49187f5 fix(lint): handle file close error in key seeding
CI / test (pull_request) Successful in 2m35s
CI / lint (pull_request) Failing after 1m11s
CI / vulncheck (pull_request) Successful in 1m1s
2026-05-27 16:45:57 -04:00
lerko d5587958e8 feat: seed SSH users from UPTOP_ADMIN_KEY env and UPTOP_KEYS file
CI / test (pull_request) Successful in 2m59s
CI / lint (pull_request) Failing after 1m6s
CI / vulncheck (pull_request) Successful in 1m6s
On startup, reads SSH public keys from two sources:
- UPTOP_ADMIN_KEY env var (single key, quick setup)
- UPTOP_KEYS file path (authorized_keys format, team setup)

Keys already in the database are skipped (idempotent across restarts).
All seeded users get admin role. Username parsed from key comment.

Dockerfile already sets UPTOP_KEYS=/data/authorized_keys — Docker users
just drop their keys file in ./data/ and start the container.
2026-05-27 16:32:33 -04:00