You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,18 +59,23 @@ npm run test:static:notification
59
59
# Single spec file
60
60
npm run pretest && NODE_EXTRA_CA_CERTS=ssl.crt npx playwright test tests/static/autofill-forms.spec.ts
61
61
62
-
# Public (live site) tests
62
+
# Public (live site) tests — NEVER run these; they hit real external sites
63
63
npm run test:public:debug
64
64
65
65
# Accessibility tests
66
66
npm run test:a11y:browser
67
67
npm run test:a11y:web
68
68
69
69
# Utilities
70
+
npm run flightcheck # check environment prerequisites
70
71
npm run prettier:fix # format all files
71
72
npm run typecheck # typecheck scripts/ and tests/
73
+
npm run setup:install # generate and write BW_INSTALLATION_ID / BW_INSTALLATION_KEY
74
+
npm run setup:crypto # generate and write crypto values to .env
75
+
npm run setup:flags # sync feature flags from REMOTE_VAULT_CONFIG_MATCH into flags.json
72
76
npm run setup:vault # create account + seed vault
73
77
npm run seed:vault:ciphers # seed vault only (account must exist)
78
+
npm run seed:vault:import # import a vault JSON file (requires VAULT_IMPORT_FILE)
74
79
```
75
80
76
81
## Debug Helpers
@@ -82,6 +87,7 @@ npm run seed:vault:ciphers # seed vault only (account must exist)
82
87
83
88
1.**No real credentials in test data**: All vault passwords are fake (e.g., `"fakeBasicFormPassword"`). Prefix test credential values with `fake`.
84
89
2.**No secrets in source**: Crypto material, master password hashes, and API keys live only in `.env` (gitignored). Generated by `npm run setup:crypto` — never set manually.
90
+
-`VAULT_EMAIL` is used as a PBKDF2 salt and as a seeding value for generating the install keys — changing it invalidates `MASTER_PASSWORD_HASH` and requires manually removing the generated crypto vars from `.env`, running `npm run setup:crypto`, and starting fresh with a new DB.
85
91
3.**Zero-knowledge invariant**: Account creation in `create-account.ts` sends a pre-hashed master password and encrypted key material — never the plaintext password — to the server API.
86
92
4.**Downloads disabled**: The browser fixture sets `acceptDownloads: false`.
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,12 +73,23 @@ As a secondary concern, BIT aspires to track and anticipate feature compatibilit
73
73
- Next run `npm run setup:all`, entering your system password when prompted.
74
74
- Run static tests with `npm run test:static`.
75
75
76
+
## Returning Workflow
77
+
78
+
Run `npm run flightcheck` to check which prerequisites are satisfied and get specific commands for anything that needs attention. Typically you only need to do the initial set up once; after that all that's needed is:
79
+
80
+
```bash
81
+
docker compose up -d --wait # start the vault server
82
+
npm run test:static:debug
83
+
```
84
+
76
85
## Setup
77
86
78
87
- Create an `.env` file in the root directory with values pointing to the vault you want to test against (use `.env.example` as guidance) and populate it with your desired values
79
88
80
89
> Important! Once you've generated installation and crypto values for your `.env` file, DO NOT CHANGE the seeding values (`VAULT_EMAIL`, `VAULT_PASSWORD`, `KDF_ITERATIONS`). Doing so requires regenerating your installation and crypto secret values and rebuilding/updating server.
81
90
91
+
> If you do need to change `VAULT_EMAIL` or `VAULT_PASSWORD`, manually remove the generated crypto vars (`KDF_ITERATIONS`, `MASTER_PASSWORD_HASH`, `PROTECTED_SYMMETRIC_KEY`, `GENERATED_RSA_KEY_PAIR_PUBLIC_KEY`, `GENERATED_RSA_KEY_PAIR_PROTECTED_PRIVATE_KEY`) from your `.env`, run `npm run setup:crypto`, then `npm run setup:vault`. Note that changing `VAULT_EMAIL` may also require regenerating install keys (`npm run setup:install`) and rebuilding the vault, depending on what you're trying to do.
92
+
82
93
- Run `npm run setup:install` to generate and add installation values to your dotfile
83
94
- Alternatively, you can generate them at `https://bitwarden.com/host` and add them to your dotfile manually as `BW_INSTALLATION_ID` and `BW_INSTALLATION_KEY`
84
95
- Run `npm run setup:crypto` to generate and add crypto values to your dotfile
@@ -113,6 +124,14 @@ Using Docker Compose will set up all the services required by the extension for
113
124
114
125
Create and start the containers and volumes with `docker compose up -d --build --remove-orphans`, and teardown with `docker compose down -v`
115
126
127
+
> If the image pull fails with a network error (e.g. `unexpected EOF`), re-run `docker compose pull` and then retry. If it continues to fail, try increasing the timeout: `COMPOSE_HTTP_TIMEOUT=120 docker compose pull`. A common underlying cause is endpoint protection or firewall rules blocking the pull.
128
+
129
+
> If startup fails with `port is already allocated`, a previous container session is holding the port — often a prior BIT stack (e.g. after updating the image version). Run `npm run flightcheck` to identify which project owns the port and get the exact teardown command.
130
+
131
+
> Each compose project uses its own database volume. Switching to a different vault image version means a fresh database — re-run `npm run setup:vault` after bringing the new stack up. Old project volumes are not removed automatically. If `npm run flightcheck` detects a wrong-version or missing stack, it will list any BIT volumes from other projects and show the `docker volume rm` commands to clean them up.
132
+
133
+
> If you have previously seeded a vault, you don't need to run setup again — just start it. This is especially relevant when switching between several environments (for example, different server images or feature flag configurations): each has its own volume, so bringing one back up restores its prior state as-is.
134
+
116
135
### Seeding Your Vault
117
136
118
137
> If using Docker Compose to host the server environment (as described in the previous section), you may need to wait for the services within the `bitwarden` container to enter a running state before running any seeding scripts.
0 commit comments