Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/no-env-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: No env files

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
no-env-files:
name: No env files
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Fail if an env or vars file is tracked
run: |
tracked=$(git ls-files)
bad=$(printf '%s\n' "$tracked" | grep -Ei '(^|/)[^/]*(\.env|\.vars|\.envrc)(\.[^/]*)?(/|$)' | grep -Eiv '\.(example|sample|template)$' | grep -Ev '(^|/)\.cursor/infisical\.env$' || true)
Comment thread
swu-rob[bot] marked this conversation as resolved.
Resolved
Comment thread
swu-wise[bot] marked this conversation as resolved.
Resolved
if [ -n "$bad" ]; then
echo "::error::Tracked env or vars files are not allowed. All secrets live only in Infisical."
echo "$bad"
exit 1
fi
- name: Check Infisical coordinates files hold no secrets
run: |
status=0
tracked=$(git ls-files)
while IFS= read -r f; do
[ -n "$f" ] || continue
if grep -Ev -- '^[[:space:]]*(#.*)?$' "./$f" | grep -Evq '^INFISICAL_(PROJECT_ID|ENV|DOMAIN)=[A-Za-z0-9._:/@-]*$'; then
echo "::error::$f may hold only INFISICAL_PROJECT_ID, INFISICAL_ENV and INFISICAL_DOMAIN"
status=1
fi
done < <(printf '%s\n' "$tracked" | grep -E '(^|/)\.cursor/infisical\.env$' || true)
exit $status
- name: Check placeholder env files hold no real values
run: |
status=0
tracked=$(git ls-files)
while IFS= read -r f; do
[ -n "$f" ] || continue
hits=$(grep -E -- '^[A-Za-z_][A-Za-z0-9_]*=[^[:space:]#]+' "./$f" | grep -Ev -- "^[A-Za-z_][A-Za-z0-9_]*=(\"\"|'')[[:space:]]*(#.*)?$" | sed -E 's/[[:space:]]+#.*$//' | awk '{ i = index($0, "="); k = tolower(substr($0, 1, i - 1)); v = tolower(substr($0, i + 1)); if (k ~ /(secret|token|password|passwd|api[-_]?key|private|credential|_key|(^|_)auth)/ && k !~ /^(author|auth_enabled)$/ && v !~ /(xxx|\.\.\.|<|changeme|change-me|your[-_]|example|placeholder|path\/to|redacted|dummy|todo)/) print }' || true)
if [ -n "$hits" ]; then
Comment thread
swu-rob[bot] marked this conversation as resolved.
Resolved
echo "::error::$f is a placeholder file but a credential-like key carries a non-placeholder value"
status=1
fi
done < <(printf '%s\n' "$tracked" | grep -Ei '(^|/)[^/]*(\.env|\.vars|\.envrc)(\.[^/]*)?(/|$)' | grep -Ei '\.(example|sample|template)$' || true)
Comment thread
swu-rob[bot] marked this conversation as resolved.
Resolved
exit $status
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,22 @@ _site/
ios/CodeCapsCompanion/build/
__pycache__/
*.pyc

# --- No secrets in files: all secrets live only in Infisical ---
.env
.env.*
*.env
.dev.vars
.dev.vars.*
.prod.vars
.prod.vars.*
*.vars
Comment thread
kody-ai[bot] marked this conversation as resolved.
Resolved
*.vars.*
*.env.*
.envrc
*.envrc
*.envrc.*
!*.example
!*.sample
!*.template
!.cursor/infisical.env
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,9 @@ that goes backwards silently strands every installed copy.
- Audit batches use the `audit-#N` branch naming and ship in
`docs/audits/<date>-<topic>.md`.
- UI changes must be covered by automated visual verification where feasible: Playwright screenshot assertions for web surfaces, `xcrun simctl io booted screenshot` for iOS simulator. The owner never takes manual screenshots and does not run local UI preview sessions. Native Mac app UI is verified through code review and CI.

## No secrets in files

All secrets live only in Infisical. Never put a secret in a `.env`, `.vars`, `.dev.vars`, `.prod.vars` or any similar file, tracked or untracked, in any repo, ever. Read secrets from Infisical at run time through this repo's documented reader. Only `*.example`, `*.sample` and `*.template` files with empty or placeholder values may be committed. `.gitignore` blocks these file names and the `No env files` CI check fails any PR that tracks one. If a secret file is ever committed, delete it from the tree right away and keep a backup on our own systems (never in the repo or in chat). A history purge is a separate owner decision.
Comment thread
swu-wise[bot] marked this conversation as resolved.
Resolved

The one exception is `.cursor/infisical.env`, which may hold only the `INFISICAL_PROJECT_ID`, `INFISICAL_ENV` and `INFISICAL_DOMAIN` coordinates and never a credential; CI checks its content.
Loading