coa: coa_uid 1001 — remap the image node user; refuse a uid another account owns #5

Merged
ben merged 1 commit from coa-uid into main 2026-08-31 05:07:49 +00:00
Owner

Pre-deploy fix found while dry-running coa#39 from Ben's laptop: on matou uid 1000 is dev, so the role's user: coa uid=1000 would fail at useradd (check mode shows it as a clean changed).

  • coa_uid defaults to 1001; the node image's node user/group is remapped to coa_uid at build, so host owner and container user agree without needing 1000.
  • New guard before user creation: getent passwd coa_uid must be empty or coa, else the role fails naming the account that holds the uid.
  • CHANGELOG bullet.

Verified against matou: --check -t coa passes the guard at 1001 and reaches the known check-mode limit (become_user before the user exists); --check -e coa_uid=1000 fails at the guard with uid 1000 already belongs to dev.

Refs coa#39.

Pre-deploy fix found while dry-running coa#39 from Ben's laptop: on matou uid 1000 is `dev`, so the role's `user: coa uid=1000` would fail at useradd (check mode shows it as a clean *changed*). - `coa_uid` defaults to **1001**; the node image's `node` user/group is remapped to `coa_uid` at build, so host owner and container user agree without needing 1000. - New guard before user creation: `getent passwd coa_uid` must be empty or `coa`, else the role fails naming the account that holds the uid. - CHANGELOG bullet. Verified against matou: `--check -t coa` passes the guard at 1001 and reaches the known check-mode limit (become_user before the user exists); `--check -e coa_uid=1000` fails at the guard with *uid 1000 already belongs to dev*. Refs coa#39.
On matou uid 1000 is `dev`, so `user: coa uid=1000` fails at useradd (check
mode reports it as a clean "changed"). The bind-mounted checkout only needs
the host owner and the container user to agree, not to be 1000: default
coa_uid to 1001, remap the node image's `node` user/group to coa_uid at build
(usermod moves /home/node ownership with it, so corepack/pnpm caches keep
working), and assert before creating the user that the uid is free or already
`coa`, with a message naming the account that holds it.

Verified against matou: --check passes the guard at 1001 and reaches the
same check-mode limit as before (become_user before the user exists);
--check -e coa_uid=1000 fails at the guard with "uid 1000 already belongs to
dev". Rendered Dockerfile reviewed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GQbmqqvWYUo1dFb5pxwKVy
ben merged commit 64136abe14 into main 2026-08-31 05:07:49 +00:00
ben deleted branch coa-uid 2026-08-31 05:07:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/matou-distributed-servers!5
No description provided.