.gitignore does not exclude secrets, and .dockerignore does not exclude .git #40
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?
From the repo-standards audit against
REPO_POLICIES.md. Present onmainand on the pending lint branch. Smallest change on the milestone with real security value.The gap
Policy is unambiguous:
> Never commit secrets.
.envfiles, credentials, API keys, and private keys must be in.gitignore. No exceptions.The current
.gitignorein full:It contains no secret patterns at all — no
.env, no.env.*, no*.pem, no*.key. The canonical org.gitignorecarries all four. It is also missing the standard editor patterns (*.swp,*.swo,*~,*.bak,.idea/,.vscode/),node_modules/, andThumbs.db.The irony is the point: this is a secret manager.
*.keyand*.pemare precisely the files a developer generates while testing unlockers and encryption, in this repo more than any other. A stray test key committed to a public repo (this one is public, WTFPL) is unrecoverable — rotation is the only remedy, and only if it is noticed.Separately,
.dockerignoreomits.git. TheDockerfiledoesCOPY . .in both the lint and build stages, so the entire git history is copied into the build context and baked into two image layers. The canonical.dockerignoreis three lines:.git,node_modules,.DS_Store. The current file is longer and more elaborate but misses the one entry that matters most for context size. It also lacks a trailing newline, which contradictsinsert_final_newline = truein the repo's own.editorconfig.Definition of done
.gitignorecovers, at minimum:.env,.env.*,*.pem,*.key, plus the standard OS and editor patterns from the canonical org file./secret(the built binary),*.test,settings.local.json.# Stale files(.cursorrules,coverage.out) are removed — both files were deleted in7546cb0and no longer need ignoring..dockerignoregains.gitandnode_modules, and ends with a trailing newline.git ls-filesbefore and after and confirm the set is unchanged. Adding*.keyto.gitignoredoes not untrack an already-tracked file, but it does silently hide it from futuregit add, which is its own trap..dockerignorehalf.make checkgreen.TODO.mdupdated in the same commit.Implementation requirements
.gitignoreon the canonical org file rather than hand-adding four lines, so this repo stops drifting from the standard.secretunanchored — it would match theinternal/secret/package directory. The existing/secretanchoring is correct and deliberate; preserve it.git ls-filesfiltered for*.key,*.pem,*.age, and.envshould come back empty. If it does not, stop and report on this issue rather than quietly deleting — a committed key needs rotation, not just removal.Plan, on branch
issue-40-gitignore-secrets(basenext):Precondition already checked:
git ls-filesfiltered for*.key,*.pem,*.age,.envcomes back empty — no key material is tracked, so nothing to stop for..gitignore: replace with the canonical org file fromsneak/prompts(OS, editors, Node, and the.env/.env.*/*.pem/*.keysecrets block), then append a project section carrying the repo-specific entries forward:/secret(anchored, so it cannot matchinternal/secret/),*.log,*.test,settings.local.json. Dropped as redundant or stale:**/.DS_Store(already covered),cli.testandvault.test(covered by*.test), and the# Stale filespair.cursorrules/coverage.out..dockerignore: additive — add.gitandnode_modules, and a trailing newline to satisfyinsert_final_newlinein.editorconfig. Existing entries stay.TODO.md: one additive Completed Steps entry, same commit.Verification:
git ls-filesdiffed before and after for byte-identical output;script/cibuild(docker build --ulimit memlock=-1:-1 .) green, with the build-context transfer size recorded before and after for the PR body.