Skip to content

Commit af56358

Browse files
vveerrggclaude
andcommitted
feat: Vault master password gating, inline unlock, docs reorg
Gate vault and API key pages behind master password — all vault interfaces show a locked state until encryption is set up. Added inline unlock form on vault tab, unencrypted-keys warning banner on Home, forgot-password reset flow, and three-state vault view (no password / locked / unlocked). Reordered tabs to Home | Vault | Apps | Relays | Settings. Moved project docs to docs_project_info/ to separate from website files in docs/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8c96118 commit af56358

35 files changed

Lines changed: 1730 additions & 145 deletions

distros/chrome/api-keys/api-keys.build.js

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/chrome/api-keys/api-keys.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
</head>
1010

1111
<body class="p-4 md:p-8 lg:p-16 max-w-5xl mx-auto">
12+
<!-- Locked gate -->
13+
<div id="vault-locked-gate" style="display:none;">
14+
<div style="display:flex;flex-direction:column;align-items:center;gap:16px;padding:64px 16px;">
15+
<svg aria-hidden="true" width="56" height="56" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
16+
<path d="M16 12V8a4 4 0 10-8 0v4" stroke="#a6e22e" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
17+
<rect x="5" y="12" width="14" height="10" rx="2" stroke="#a6e22e" stroke-width="1.5"></rect>
18+
<circle cx="12" cy="17" r="1.5" fill="#a6e22e"></circle>
19+
</svg>
20+
<span style="font-size:1.25rem;font-weight:700;color:#f8f8f2;">Vault Locked</span>
21+
<p style="color:#b0b0a8;font-size:14px;text-align:center;max-width:320px;">Set a master password to encrypt your data at rest before using the API key vault.</p>
22+
<button id="gate-security-btn" class="button">Set Master Password</button>
23+
</div>
24+
</div>
25+
26+
<!-- Main content (hidden until password check passes) -->
27+
<div id="vault-main-content" style="display:none;">
1228
<div class="flex items-start justify-between mb-4">
1329
<h1 class="section-header">API Key Vault</h1>
1430
<button id="close-btn" class="button" type="button" title="Close" aria-label="Close" style="min-width:auto;padding:8px 12px;">
@@ -95,6 +111,7 @@ <h3 class="text-sm font-bold mb-2">Add Key</h3>
95111
/>
96112
</label>
97113
</div>
114+
</div><!-- /vault-main-content -->
98115

99116
<!-- Toast -->
100117
<div

distros/chrome/background-sw.build.js

Lines changed: 80 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/chrome/background.build.js

Lines changed: 80 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/chrome/security/security.build.js

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/chrome/security/security.html

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66
<script defer src="security.build.js"></script>
77
<link rel="stylesheet" href="/options.build.css" />
88
<title>Security Settings</title>
9+
<style>
10+
.input, select.input {
11+
background-color: #49483e;
12+
border: 1px solid #49483e;
13+
border-radius: 8px;
14+
color: #f8f8f2;
15+
}
16+
.input:focus, select.input:focus {
17+
border-color: #a6e22e;
18+
outline: 2px solid #a6e22e;
19+
outline-offset: 2px;
20+
}
21+
.input::placeholder {
22+
color: #b0b0a8;
23+
}
24+
</style>
925
</head>
1026

1127
<body class="p-4 md:p-8 lg:p-16 max-w-5xl mx-auto">
@@ -18,13 +34,13 @@ <h1 class="section-header">Security Settings</h1>
1834
</button>
1935
</div>
2036

21-
<!-- LOCKED STATE — unlock before accessing settings -->
37+
<!-- LOCKED STATE — existing vault detected -->
2238
<div id="locked-view" class="section" style="display:none;">
23-
<h2 class="section-header">Unlock Required</h2>
24-
<p class="text-sm italic">
25-
Enter your master password to access security settings.
39+
<h2 class="section-header">Existing Vault Detected</h2>
40+
<p class="text-sm" style="color:#b0b0a8;">
41+
An encrypted vault already exists. Enter your master password to restore access to your keys and vault data.
2642
</p>
27-
<form id="unlock-form" class="mt-3">
43+
<form id="unlock-form" class="mt-4">
2844
<div class="mt-2">
2945
<label for="unlock-password">Master Password</label>
3046
<br />
@@ -39,14 +55,36 @@ <h2 class="section-header">Unlock Required</h2>
3955
</div>
4056
<div
4157
id="unlock-error"
42-
class="text-red-500 text-sm font-bold mt-1"
43-
style="display:none;"
58+
class="text-sm font-bold mt-1"
59+
style="display:none;color:#f92672;"
4460
aria-live="assertive"
4561
></div>
46-
<div class="mt-2">
47-
<button class="button" type="submit">Unlock</button>
62+
<div class="mt-2" style="padding-top:24px;">
63+
<button class="button" type="submit">Restore Vault</button>
4864
</div>
4965
</form>
66+
67+
<hr style="border:0;border-top:1px solid #49483e;margin:32px 0;" />
68+
69+
<!-- Delete and start fresh -->
70+
<div id="delete-vault-section">
71+
<h3 class="subsection-header">Forgot Password?</h3>
72+
<p class="text-sm" style="color:#b0b0a8;margin-bottom:12px;">
73+
If you've forgotten your password, you can delete the existing vault and start fresh. This will permanently delete all your profiles, keys, and vault data.
74+
</p>
75+
<button id="show-delete-confirm-btn" class="button" type="button" style="border-color:#f92672;color:#f92672;">
76+
Delete Vault & Start Fresh
77+
</button>
78+
<!-- Confirmation dialog (hidden by default) -->
79+
<div id="delete-confirm-dialog" class="hidden" style="margin-top:16px;padding:16px;background:#3e3d32;border-radius:8px;border:1px solid #f92672;">
80+
<p style="color:#f92672;font-size:0.9rem;font-weight:bold;margin-bottom:8px;">Are you sure?</p>
81+
<p style="color:#b0b0a8;font-size:0.85rem;margin-bottom:16px;">This will permanently delete all your profiles, private keys, and vault data. This cannot be undone.</p>
82+
<div class="flex gap-2">
83+
<button id="confirm-delete-btn" class="button" type="button" style="border-color:#f92672;color:#f92672;">Yes, Delete Everything</button>
84+
<button id="cancel-delete-btn" class="button" type="button">Cancel</button>
85+
</div>
86+
</div>
87+
</div>
5088
</div>
5189

5290
<!-- UNLOCKED STATE — all settings -->
@@ -75,7 +113,7 @@ <h2 class="section-header">Master Password</h2>
75113
<!-- No password set: show Set Password form -->
76114
<div id="set-password-section" class="mt-3" style="display:none;">
77115
<h3 class="subsection-header">Set Master Password</h3>
78-
<p class="text-sm text-red-700 font-bold mt-1">
116+
<p class="text-sm font-bold mt-1" style="color:#cca066;">
79117
Warning: There is no password recovery. If you lose your
80118
master password, you lose access to your private keys.
81119
Keep a backup of your nsec/hex keys before enabling this.
@@ -110,11 +148,11 @@ <h3 class="subsection-header">Set Master Password</h3>
110148
</div>
111149
<div
112150
id="security-error"
113-
class="text-red-500 text-sm font-bold mt-1"
114-
style="display:none;"
151+
class="text-sm font-bold mt-1"
152+
style="display:none;color:#f92672;"
115153
aria-live="assertive"
116154
></div>
117-
<div class="mt-2">
155+
<div class="mt-2" style="padding-top:24px;">
118156
<button
119157
class="button"
120158
type="submit"
@@ -167,11 +205,11 @@ <h3 class="subsection-header">Change Master Password</h3>
167205
</div>
168206
<div
169207
id="change-error"
170-
class="text-red-500 text-sm font-bold mt-1"
171-
style="display:none;"
208+
class="text-sm font-bold mt-1"
209+
style="display:none;color:#f92672;"
172210
aria-live="assertive"
173211
></div>
174-
<div class="mt-2">
212+
<div class="mt-2" style="padding-top:24px;">
175213
<button
176214
class="button"
177215
type="submit"
@@ -183,8 +221,10 @@ <h3 class="subsection-header">Change Master Password</h3>
183221
</div>
184222
</form>
185223

224+
<hr style="border:0;border-top:1px solid #49483e;margin:32px 0;" />
225+
186226
<!-- Remove Password -->
187-
<h3 class="subsection-header mt-6">Remove Master Password</h3>
227+
<h3 class="subsection-header">Remove Master Password</h3>
188228
<p class="text-sm italic mt-1">
189229
This will decrypt your keys and store them without
190230
encryption. You must enter your current password to confirm.
@@ -203,11 +243,11 @@ <h3 class="subsection-header mt-6">Remove Master Password</h3>
203243
</div>
204244
<div
205245
id="remove-error"
206-
class="text-red-500 text-sm font-bold mt-1"
207-
style="display:none;"
246+
class="text-sm font-bold mt-1"
247+
style="display:none;color:#f92672;"
208248
aria-live="assertive"
209249
></div>
210-
<div class="mt-2">
250+
<div class="mt-2" style="padding-top:24px;">
211251
<button
212252
class="button"
213253
type="submit"
@@ -229,7 +269,7 @@ <h2 class="section-header">Auto-Lock</h2>
229269
</p>
230270

231271
<div id="autolock-disabled-msg" class="mt-3" style="display:none;">
232-
<p class="text-sm font-bold" style="color:#fd971f;">
272+
<p class="text-sm font-bold" style="color:#cca066;">
233273
Set a master password above to enable auto-lock.
234274
</p>
235275
</div>
@@ -248,8 +288,8 @@ <h2 class="section-header">Auto-Lock</h2>
248288
</div>
249289
<div
250290
id="autolock-success"
251-
class="text-green-700 text-sm font-bold mt-2"
252-
style="display:none;"
291+
class="text-sm font-bold mt-2"
292+
style="display:none;color:#a6e22e;"
253293
aria-live="polite"
254294
></div>
255295
</div>

distros/chrome/sidepanel.build.js

Lines changed: 103 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)