@lethevimlet/sshift 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,24 +24,37 @@ A modern, responsive web-based SSH and SFTP terminal client built with Node.js,
24
24
 
25
25
  - 🔐 **SSH Terminal** - Full xterm.js emulation with TUI support (vim, nano, htop, tmux)
26
26
  - 📁 **SFTP Browser** - File manager interface with upload/download
27
+ - 🔗 **Persistent Sessions** - Background SSH sessions stay alive even while browsing
27
28
  - 🤖 **AI Attention Alerts** - Tab flash notifications when AI tools (OpenCode, Claude) need your input
28
29
  - 🗂️ **Tabbed Interface** - Multiple concurrent sessions
29
30
  - 🔖 **Bookmarks** - Save connection details for quick access
30
31
  - 🔒 **Password Protection** - Optional password lock for app access
31
32
  - ⌨️ **Mobile-Friendly** - Special keys popup for mobile devices
32
- - 🎨 **Modern UI** - GitHub-inspired dark theme, fully responsive
33
+ - 🎨 **Modern UI** - Configurable light/dark themes, accent colors, terminal color schemes, fully responsive
33
34
 
34
35
  ## 🚀 Quick Start
35
36
 
37
+ **Linux/macOS:**
36
38
  ```bash
37
- # Install globally
38
- npm install -g @lethevimlet/sshift
39
+ curl -fsSL https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.sh | bash
40
+ ```
41
+
42
+ **Windows (PowerShell):**
43
+ ```powershell
44
+ Set-ExecutionPolicy Bypass -Scope Process
45
+ Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/lethevimlet/sshift/main/sshift-install.ps1" -UseBasicParsing).Content
46
+ ```
47
+
48
+ The installer handles Node.js, npm, autostart, and HTTPS config automatically. The application will be available at `https://localhost:8022`
39
49
 
40
- # Start the server
50
+ Alternatively, install globally via npm:
51
+
52
+ ```bash
53
+ npm install -g @lethevimlet/sshift
41
54
  sshift
42
55
  ```
43
56
 
44
- The application will be available at `https://localhost:8022`
57
+ > **Note:** When installing via npm, you'll need to configure autostart yourself (e.g., systemd, launchd, or Task Scheduler).
45
58
 
46
59
  ## 📖 Documentation
47
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lethevimlet/sshift",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Web-based SSH + SFTP terminal client with tabs and bookmarks",
5
5
  "main": "src/server/index.js",
6
6
  "bin": {
@@ -4,7 +4,7 @@
4
4
 
5
5
  const fs = require('fs');
6
6
  const path = require('path');
7
- const { getDataDir } = require('../../utils/config');
7
+ const { getDataDir, getCertPath, getKeyPath, getConfigPath } = require('../../utils/config');
8
8
 
9
9
  const SSL_CERT_FILE = 'ssl-cert.pem';
10
10
  const SSL_KEY_FILE = 'ssl-key.pem';
@@ -21,6 +21,7 @@ function registerSystemEndpoints(app, io) {
21
21
  const staleUpdateMarker = path.join(dataDir, UPDATE_MARKER_FILE);
22
22
  const staleUpdateScript = path.join(dataDir, '.sshift-update.sh');
23
23
  const stalePsScript = path.join(dataDir, '.sshift-update.ps1');
24
+ const staleUpdateLog = path.join(dataDir, '.sshift-update.log');
24
25
  try {
25
26
  if (fs.existsSync(staleUpdateMarker)) {
26
27
  fs.unlinkSync(staleUpdateMarker);
@@ -32,6 +33,11 @@ function registerSystemEndpoints(app, io) {
32
33
  if (fs.existsSync(stalePsScript)) {
33
34
  fs.unlinkSync(stalePsScript);
34
35
  }
36
+ if (fs.existsSync(staleUpdateLog)) {
37
+ const logContent = fs.readFileSync(staleUpdateLog, 'utf8');
38
+ console.log('[UPDATE] Previous update log:\n' + logContent);
39
+ fs.unlinkSync(staleUpdateLog);
40
+ }
35
41
  } catch (e) {
36
42
  console.error('[UPDATE] Failed to clean up marker file:', e.message);
37
43
  }
@@ -133,6 +139,7 @@ function registerSystemEndpoints(app, io) {
133
139
  app.get('/api/update-status', (req, res) => {
134
140
  const dataDir = getDataDir();
135
141
  const updateMarker = path.join(dataDir, UPDATE_MARKER_FILE);
142
+ const updateLogPath = path.join(dataDir, '.sshift-update.log');
136
143
 
137
144
  // Read package.json for current version
138
145
  let version = 'unknown';
@@ -146,11 +153,25 @@ function registerSystemEndpoints(app, io) {
146
153
 
147
154
  // Check if we're in the middle of an update
148
155
  const isUpdating = fs.existsSync(updateMarker);
156
+
157
+ // Check for update error log
158
+ let updateError = null;
159
+ if (!isUpdating && fs.existsSync(updateLogPath)) {
160
+ try {
161
+ const logContent = fs.readFileSync(updateLogPath, 'utf8');
162
+ if (logContent.includes('npm install failed')) {
163
+ updateError = 'Update failed: npm install exited with an error.';
164
+ }
165
+ } catch (e) {
166
+ // Ignore log read errors
167
+ }
168
+ }
149
169
 
150
170
  res.json({
151
171
  version,
152
172
  updating: isUpdating,
153
- ready: !isUpdating
173
+ ready: !isUpdating,
174
+ updateError
154
175
  });
155
176
  });
156
177
 
@@ -171,32 +192,54 @@ function registerSystemEndpoints(app, io) {
171
192
  // API: Get security context info
172
193
  app.get('/api/security-info', (req, res) => {
173
194
  const dataDir = getDataDir();
174
- const certPath = path.join(dataDir, SSL_CERT_FILE);
175
- const hasCert = fs.existsSync(certPath);
195
+ const selfSignedCertPath = path.join(dataDir, SSL_CERT_FILE);
196
+ const hasCert = fs.existsSync(selfSignedCertPath);
176
197
  const protocol = req.protocol;
177
198
  const isSecure = req.secure || protocol === 'https';
178
199
  const isLocalhost = req.hostname === 'localhost' || req.hostname === '127.0.0.1' || req.hostname === '::1';
200
+ const usesCustomCert = !!(getCertPath() && getKeyPath());
179
201
 
180
202
  res.json({
181
203
  isSecure,
182
204
  isLocalhost,
183
205
  protocol,
184
206
  certAvailable: hasCert,
207
+ usesCustomCert,
185
208
  hostname: req.hostname
186
209
  });
187
210
  });
188
211
 
212
+ // API: Debug info (paths and config)
213
+ app.get('/api/debug-info', (req, res) => {
214
+ const dataDir = getDataDir();
215
+ const selfSignedCertPath = path.join(dataDir, SSL_CERT_FILE);
216
+ const selfSignedKeyPath = path.join(dataDir, SSL_KEY_FILE);
217
+ const customCertPath = getCertPath();
218
+ const customKeyPath = getKeyPath();
219
+ const usesCustomCert = !!(customCertPath && customKeyPath);
220
+
221
+ res.json({
222
+ configPath: getConfigPath(),
223
+ dataDir,
224
+ certPath: usesCustomCert ? customCertPath : selfSignedCertPath,
225
+ keyPath: usesCustomCert ? customKeyPath : selfSignedKeyPath,
226
+ usesCustomCert
227
+ });
228
+ });
229
+
189
230
  // API: Trigger update
190
231
  app.post('/api/update', async (req, res) => {
191
232
  try {
192
- const { spawn } = require('child_process');
233
+ const { spawn, execSync } = require('child_process');
193
234
  const platform = process.platform;
194
235
  const dataDir = getDataDir();
195
236
 
196
237
  // Write update marker to indicate update in progress
197
238
  const updateMarker = path.join(dataDir, UPDATE_MARKER_FILE);
239
+ let oldVersion = 'unknown';
198
240
  try {
199
241
  const pkg = require('../../../../package.json');
242
+ oldVersion = pkg.version;
200
243
  fs.mkdirSync(dataDir, { recursive: true });
201
244
  fs.writeFileSync(updateMarker, JSON.stringify({
202
245
  startTime: Date.now(),
@@ -205,28 +248,105 @@ function registerSystemEndpoints(app, io) {
205
248
  } catch (e) {
206
249
  console.error('[UPDATE] Failed to write update marker:', e.message);
207
250
  }
208
-
209
- // Send response immediately, then update in background
210
- res.json({ message: 'Update started. Server will restart automatically.' });
211
-
212
- // Write a temporary update script and run it detached
251
+
252
+ // Resolve the npm and sshift binary paths
253
+ let npmBinPath;
254
+ let sshiftBinPath;
255
+ try {
256
+ npmBinPath = execSync('command -v npm || which npm', { encoding: 'utf8' }).trim();
257
+ } catch (e) {
258
+ // Fallback: try common locations
259
+ const nodeDir = path.dirname(process.execPath);
260
+ npmBinPath = path.join(nodeDir, 'npm');
261
+ }
262
+
263
+ try {
264
+ sshiftBinPath = execSync('command -v sshift || which sshift', { encoding: 'utf8' }).trim();
265
+ } catch (e) {
266
+ sshiftBinPath = null;
267
+ }
268
+
269
+ // If sshift isn't in PATH, try to resolve it relative to npm's global bin dir
270
+ if (!sshiftBinPath) {
271
+ try {
272
+ const npmGlobalBinDir = execSync('npm bin -g', { encoding: 'utf8' }).trim();
273
+ sshiftBinPath = path.join(npmGlobalBinDir, 'sshift');
274
+ } catch (e) {
275
+ sshiftBinPath = null;
276
+ }
277
+ }
278
+
279
+ // Fallback: derive from process.argv[1] if available
280
+ if (!sshiftBinPath && process.argv[1]) {
281
+ sshiftBinPath = process.argv[1];
282
+ }
283
+
284
+ if (!sshiftBinPath) {
285
+ console.error('[UPDATE] Cannot determine sshift binary path for restart');
286
+ try { fs.unlinkSync(updateMarker); } catch (e) { /* ignore */ }
287
+ return res.status(500).json({ error: 'Cannot determine sshift binary path for restart' });
288
+ }
289
+
213
290
  const nodeExe = process.execPath;
214
- const sshiftScript = process.argv[1];
215
291
  const updateScriptPath = path.join(dataDir, '.sshift-update.sh');
292
+ const updateLogPath = path.join(dataDir, '.sshift-update.log');
293
+
294
+ // Send response immediately, then update in background
295
+ res.json({ message: 'Update started. Server will restart automatically.' });
216
296
 
217
297
  if (platform === 'win32') {
218
- const psScript = `npm install -g @lethevimlet/sshift@latest; & '${nodeExe}' '${sshiftScript}'`;
219
- fs.writeFileSync(updateScriptPath.replace('.sh', '.ps1'), psScript, 'utf8');
298
+ const sshiftCmd = sshiftBinPath.includes(' ') ? `& '${sshiftBinPath}'` : `sshift`;
299
+ const psScript = `$ErrorActionPreference = 'Continue'
300
+ try {
301
+ & npm install -g @lethevimlet/sshift@latest 2>&1 | Out-File -FilePath '${updateLogPath}' -Append
302
+ if ($LASTEXITCODE -ne 0) {
303
+ Write-Output 'npm install failed with exit code ' + $LASTEXITCODE | Out-File -FilePath '${updateLogPath}' -Append
304
+ exit 1
305
+ }
306
+ } catch {
307
+ Write-Output $_.Exception.Message | Out-File -FilePath '${updateLogPath}' -Append
308
+ exit 1
309
+ }
310
+ Remove-Item -Path '${updateMarker}' -Force -ErrorAction SilentlyContinue
311
+ & '${nodeExe}' '${sshiftBinPath}'
312
+ `;
313
+ const psScriptPath = updateScriptPath.replace('.sh', '.ps1');
314
+ fs.writeFileSync(psScriptPath, psScript, 'utf8');
220
315
  } else {
221
316
  const updateScript = `#!/bin/sh
222
- npm install -g @lethevimlet/sshift@latest
223
- exec "${nodeExe}" "${sshiftScript}"
317
+ set -e
318
+ LOG="${updateLogPath}"
319
+ echo "$(date): Starting sshift update..." > "$LOG"
320
+
321
+ # Try npm install
322
+ NPM_BIN="${npmBinPath}"
323
+ echo "$(date): Using npm at: $NPM_BIN" >> "$LOG"
324
+
325
+ if ! "$NPM_BIN" install -g @lethevimlet/sshift@latest >> "$LOG" 2>&1; then
326
+ echo "$(date): npm install failed, removing update marker" >> "$LOG"
327
+ rm -f "${updateMarker}"
328
+ exit 1
329
+ fi
330
+
331
+ echo "$(date): npm install completed successfully" >> "$LOG"
332
+
333
+ # Remove the update marker before restart so the new instance sees a clean state
334
+ rm -f "${updateMarker}"
335
+
336
+ # Find the sshift binary — prefer PATH lookup since npm just updated it
337
+ SSHIFT_BIN="$(command -v sshift 2>/dev/null || which sshift 2>/dev/null || echo "${sshiftBinPath}")"
338
+
339
+ echo "$(date): Restarting sshift from: $SSHIFT_BIN" >> "$LOG"
340
+ exec "${nodeExe}" "$SSHIFT_BIN"
224
341
  `;
225
342
  fs.writeFileSync(updateScriptPath, updateScript, 'utf8');
226
343
  fs.chmodSync(updateScriptPath, 0o755);
227
344
  }
228
345
 
229
346
  console.log('[UPDATE] Starting update process...');
347
+ console.log('[UPDATE] npm path:', npmBinPath);
348
+ console.log('[UPDATE] sshift restart path:', sshiftBinPath);
349
+ console.log('[UPDATE] Log file:', updateLogPath);
230
350
 
231
351
  let spawnFailed = false;
232
352
  let spawnCommand, spawnArgs;
@@ -248,12 +368,14 @@ exec "${nodeExe}" "${sshiftScript}"
248
368
  updateProcess.on('error', (err) => {
249
369
  console.error('[UPDATE] Failed to start update process:', err.message);
250
370
  spawnFailed = true;
251
- // Clean up marker since update failed
252
371
  try { fs.unlinkSync(updateMarker); } catch (e) { /* ignore */ }
253
372
  });
254
373
 
255
374
  updateProcess.unref();
256
375
 
376
+ // Give the update script enough time to start before exiting.
377
+ // The script runs npm install (which can take time) in the background,
378
+ // but we need to wait long enough for the spawn to succeed.
257
379
  setTimeout(() => {
258
380
  if (spawnFailed) {
259
381
  console.error('[UPDATE] Update process failed to start. Keeping server running.');
@@ -261,7 +383,7 @@ exec "${nodeExe}" "${sshiftScript}"
261
383
  }
262
384
  console.log('[UPDATE] Exiting for update...');
263
385
  process.exit(0);
264
- }, 500);
386
+ }, 2000);
265
387
  } catch (err) {
266
388
  console.error('Error triggering update:', err);
267
389
  res.status(500).json({ error: 'Failed to trigger update' });
@@ -3482,6 +3482,120 @@ body.dragging-tabs .tabs-container {
3482
3482
  pointer-events: none;
3483
3483
  }
3484
3484
 
3485
+ /* Security Info Modal - Service Worker Status */
3486
+ .sw-status-card {
3487
+ flex-direction: column !important;
3488
+ align-items: center !important;
3489
+ text-align: center;
3490
+ padding: 24px 16px;
3491
+ }
3492
+
3493
+ .sw-status-icon {
3494
+ font-size: 48px;
3495
+ margin-bottom: 12px;
3496
+ line-height: 1;
3497
+ }
3498
+
3499
+ .sw-status-active .sw-status-icon {
3500
+ color: var(--accent-success);
3501
+ }
3502
+
3503
+ .sw-status-failed .sw-status-icon {
3504
+ color: var(--accent-danger);
3505
+ }
3506
+
3507
+ .sw-status-unsupported .sw-status-icon {
3508
+ color: var(--accent-warning);
3509
+ }
3510
+
3511
+ .sw-status-title {
3512
+ font-size: 18px;
3513
+ font-weight: 700;
3514
+ color: var(--text-primary);
3515
+ margin-bottom: 4px;
3516
+ }
3517
+
3518
+ .sw-status-active .sw-status-title {
3519
+ color: var(--accent-success);
3520
+ }
3521
+
3522
+ .sw-status-failed .sw-status-title {
3523
+ color: var(--accent-danger);
3524
+ }
3525
+
3526
+ .sw-status-unsupported .sw-status-title {
3527
+ color: var(--accent-warning);
3528
+ }
3529
+
3530
+ .sw-status-detail {
3531
+ max-width: 400px;
3532
+ }
3533
+
3534
+ .sw-feature-list {
3535
+ list-style: none;
3536
+ padding: 0;
3537
+ margin: 8px 0 0;
3538
+ text-align: left;
3539
+ display: inline-block;
3540
+ }
3541
+
3542
+ .sw-feature-list li {
3543
+ padding: 3px 0;
3544
+ font-size: 13px;
3545
+ display: flex;
3546
+ align-items: center;
3547
+ gap: 8px;
3548
+ }
3549
+
3550
+ .sw-feature-list li i {
3551
+ width: 16px;
3552
+ text-align: center;
3553
+ }
3554
+
3555
+ .sw-status-active .sw-feature-list li i {
3556
+ color: var(--accent-success);
3557
+ }
3558
+
3559
+ .sw-status-failed .sw-feature-list li i,
3560
+ .sw-status-unsupported .sw-feature-list li i {
3561
+ color: var(--accent-danger);
3562
+ }
3563
+
3564
+ .sw-hint {
3565
+ margin: 8px 0 0;
3566
+ font-size: 12px;
3567
+ color: var(--text-secondary);
3568
+ font-style: italic;
3569
+ }
3570
+
3571
+ .sw-install-link {
3572
+ color: var(--accent-primary);
3573
+ text-decoration: underline !important;
3574
+ }
3575
+
3576
+ .sw-install-link:hover {
3577
+ color: var(--accent-secondary);
3578
+ text-decoration: underline !important;
3579
+ }
3580
+
3581
+ .sw-custom-cert-warning {
3582
+ display: flex;
3583
+ align-items: flex-start;
3584
+ gap: 8px;
3585
+ padding: 10px 12px;
3586
+ background: var(--bg-tertiary, rgba(255, 152, 0, 0.1));
3587
+ border: 1px solid var(--accent-warning, #d29922);
3588
+ border-radius: 6px;
3589
+ font-size: 13px;
3590
+ color: var(--accent-warning, #d29922);
3591
+ line-height: 1.4;
3592
+ }
3593
+
3594
+ .sw-custom-cert-warning i {
3595
+ margin-top: 2px;
3596
+ flex-shrink: 0;
3597
+ }
3598
+
3485
3599
  /* Settings Modal Styles */
3486
3600
  .setting-group {
3487
3601
  margin-bottom: 20px;
@@ -3544,6 +3658,37 @@ body.dragging-tabs .tabs-container {
3544
3658
  opacity: 1;
3545
3659
  }
3546
3660
 
3661
+ .debug-info-list {
3662
+ display: flex;
3663
+ flex-direction: column;
3664
+ gap: 12px;
3665
+ }
3666
+
3667
+ .debug-info-item {
3668
+ display: flex;
3669
+ flex-direction: column;
3670
+ gap: 4px;
3671
+ }
3672
+
3673
+ .debug-info-label {
3674
+ font-size: 12px;
3675
+ font-weight: 600;
3676
+ color: var(--text-secondary);
3677
+ text-transform: uppercase;
3678
+ letter-spacing: 0.5px;
3679
+ }
3680
+
3681
+ .debug-info-value {
3682
+ font-size: 13px;
3683
+ color: var(--text-primary);
3684
+ font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
3685
+ background: var(--bg-tertiary);
3686
+ padding: 6px 10px;
3687
+ border-radius: 6px;
3688
+ word-break: break-all;
3689
+ border: 1px solid var(--border-color);
3690
+ }
3691
+
3547
3692
  .toggle-switch {
3548
3693
  position: relative;
3549
3694
  display: inline-block;
@@ -4564,6 +4709,7 @@ body.dragging-tabs .tabs-container {
4564
4709
  bottom: 0;
4565
4710
  pointer-events: none;
4566
4711
  z-index: 10;
4712
+ overflow: hidden;
4567
4713
  }
4568
4714
 
4569
4715
  .mobile-selection-rect {
@@ -912,6 +912,23 @@
912
912
  </div>
913
913
  </div>
914
914
 
915
+ <!-- Debug Info -->
916
+ <div class="setting-group">
917
+ <div class="setting-item">
918
+ <label class="setting-label">
919
+ <i class="fas fa-bug"></i> Debug Info
920
+ </label>
921
+ <div class="setting-description">
922
+ Show certificate and configuration file paths currently in use.
923
+ </div>
924
+ <div class="setting-control">
925
+ <button class="btn btn-secondary" id="showDebugInfoBtn">
926
+ <i class="fas fa-info-circle"></i> View Paths
927
+ </button>
928
+ </div>
929
+ </div>
930
+ </div>
931
+
915
932
  <!-- Plugins -->
916
933
  <div class="setting-group">
917
934
  <h3 class="setting-group-title"><i class="fas fa-puzzle-piece"></i> Plugins</h3>
@@ -990,56 +1007,90 @@
990
1007
  </div>
991
1008
  </div>
992
1009
 
993
- <!-- Security Info Modal -->
994
- <div class="modal" id="securityInfoModal">
995
- <div class="modal-content modal-lg">
1010
+ <!-- Security Info Modal -->
1011
+ <div class="modal" id="securityInfoModal">
1012
+ <div class="modal-content modal-lg">
1013
+ <div class="modal-header">
1014
+ <h2><i class="fas fa-shield-alt"></i> Security & Connection Info</h2>
1015
+ <button class="modal-close" id="closeSecurityInfoModal">
1016
+ <i class="fas fa-times"></i>
1017
+ </button>
1018
+ </div>
1019
+ <div class="modal-body">
1020
+ <div class="setting-group">
1021
+ <div id="swStatusContainer" class="setting-item sw-status-card">
1022
+ <div class="sw-status-icon" id="swStatusIcon">
1023
+ <i class="fas fa-spinner fa-spin"></i>
1024
+ </div>
1025
+ <div class="sw-status-title" id="swStatusTitle">Checking...</div>
1026
+ <div class="setting-description sw-status-detail" id="swStatusText">Detecting service worker status</div>
1027
+ </div>
1028
+
1029
+ <div class="setting-item" style="flex-direction: column; align-items: stretch;">
1030
+ <label class="setting-label"><i class="fas fa-lock"></i> SSL Certificate</label>
1031
+ <div class="setting-description">
1032
+ Service workers require a trusted HTTPS connection. To use this app over LAN with a self-signed certificate, install the certificate as a trusted root CA on your device. See the <a href="https://lethevimlet.github.io/sshift/installation.html#trusting-the-https-certificate" target="_blank" rel="noopener noreferrer" class="sw-install-link">installation instructions</a> for details.
1033
+ </div>
1034
+ <div id="customCertWarning" class="sw-custom-cert-warning" style="display: none; margin-top: 8px;">
1035
+ <i class="fas fa-exclamation-circle"></i> A custom certificate is configured. Download the certificate from your administrator.
1036
+ </div>
1037
+ <button class="btn btn-secondary" id="downloadCertBtn" style="margin-top: 8px;">
1038
+ <i class="fas fa-download"></i> Download Certificate
1039
+ </button>
1040
+ </div>
1041
+ </div>
1042
+ </div>
1043
+ <div class="modal-footer">
1044
+ <label style="display: flex; align-items: center; gap: 8px; margin-right: auto; cursor: pointer;">
1045
+ <label class="toggle-switch">
1046
+ <input type="checkbox" id="dontShowSecurityInfo">
1047
+ <span class="toggle-slider"></span>
1048
+ </label>
1049
+ <span style="font-size: 13px;">Don't show this on startup</span>
1050
+ </label>
1051
+ <button class="btn btn-primary" id="closeSecurityInfoBtn">
1052
+ <i class="fas fa-check"></i> Got it
1053
+ </button>
1054
+ </div>
1055
+ </div>
1056
+ </div>
1057
+
1058
+ <!-- Debug Info Modal -->
1059
+ <div class="modal" id="debugInfoModal">
1060
+ <div class="modal-content modal-sm">
996
1061
  <div class="modal-header">
997
- <h2><i class="fas fa-shield-alt"></i> Security & Connection Info</h2>
998
- <button class="modal-close" id="closeSecurityInfoModal">
1062
+ <h2><i class="fas fa-bug"></i> Debug Info</h2>
1063
+ <button class="modal-close" id="closeDebugInfoModal">
999
1064
  <i class="fas fa-times"></i>
1000
1065
  </button>
1001
1066
  </div>
1002
1067
  <div class="modal-body">
1003
- <div class="setting-group">
1004
- <div class="setting-item" style="flex-direction: column; align-items: stretch;">
1005
- <label class="setting-label"><i class="fas fa-info-circle"></i> Instructions</label>
1006
- <div class="setting-description" style="font-size: 12px; line-height: 1.5;">
1007
- <strong>Chrome/Edge (Desktop):</strong> Open <a href="chrome://settings/certificates" style="color: var(--accent-primary); word-break: break-all;">chrome://settings/certificates</a> (or <a href="edge://settings/certificates" style="color: var(--accent-primary);">edge://settings/certificates</a>) in the address bar, then import the downloaded .crt file to "Trusted Root Certification Authorities".<br><br>
1008
- <strong>Chrome (Android):</strong> Settings > Security > Install from SD card > Select the downloaded file.<br><br>
1009
- <strong>Firefox:</strong> Open <a href="about:preferences#privacy" style="color: var(--accent-primary);">about:preferences#privacy</a> > View Certificates > Import > Trust for identifying websites.<br><br>
1010
- <strong>macOS/iOS:</strong> Double-click the .crt file > Add to Keychain > Set trust to "Always Trust". On iOS: Settings > General > VPN & Device Management > Install profile, then Settings > General > About > Certificate Trust Settings > Enable full trust.
1011
- </div>
1068
+ <div class="debug-info-list" id="debugInfoList">
1069
+ <div class="debug-info-item">
1070
+ <span class="debug-info-label">Config File</span>
1071
+ <span class="debug-info-value" id="debugConfigPath">Loading...</span>
1012
1072
  </div>
1013
-
1014
- <div id="swStatusContainer" class="setting-item" style="flex-direction: column; align-items: stretch;">
1015
- <label class="setting-label"><i class="fas fa-hard-drive"></i> Service Worker</label>
1016
- <div class="setting-description" id="swStatusText">
1017
- <i class="fas fa-spinner fa-spin"></i> Checking...
1018
- </div>
1073
+ <div class="debug-info-item">
1074
+ <span class="debug-info-label">Data Directory</span>
1075
+ <span class="debug-info-value" id="debugDataDir">Loading...</span>
1019
1076
  </div>
1020
-
1021
- <div class="setting-item" style="flex-direction: column; align-items: stretch;">
1022
- <label class="setting-label"><i class="fas fa-lock"></i> SSL Certificate</label>
1023
- <div class="setting-description">
1024
- Service workers require a trusted HTTPS connection. To use this app over LAN with a self-signed certificate, install the certificate as a trusted root CA on your device.
1025
- </div>
1026
- <button class="btn btn-secondary" id="downloadCertBtn" style="margin-top: 8px;">
1027
- <i class="fas fa-download"></i> Download Certificate
1028
- </button>
1077
+ <div class="debug-info-item">
1078
+ <span class="debug-info-label">SSL Certificate</span>
1079
+ <span class="debug-info-value" id="debugCertPath">Loading...</span>
1080
+ </div>
1081
+ <div class="debug-info-item">
1082
+ <span class="debug-info-label">SSL Private Key</span>
1083
+ <span class="debug-info-value" id="debugKeyPath">Loading...</span>
1084
+ </div>
1085
+ <div class="debug-info-item">
1086
+ <span class="debug-info-label">Certificate Type</span>
1087
+ <span class="debug-info-value" id="debugCertType">Loading...</span>
1029
1088
  </div>
1030
- </div>
1031
-
1032
- <div class="setting-item" style="margin-top: 12px;">
1033
- <label class="toggle-switch">
1034
- <input type="checkbox" id="dontShowSecurityInfo">
1035
- <span class="toggle-slider"></span>
1036
- </label>
1037
- <span style="margin-left: 8px; font-size: 13px;">Don't show this on startup</span>
1038
1089
  </div>
1039
1090
  </div>
1040
1091
  <div class="modal-footer">
1041
- <button class="btn btn-primary" id="closeSecurityInfoBtn">
1042
- <i class="fas fa-check"></i> Got it
1092
+ <button class="btn btn-primary" id="closeDebugInfoBtn">
1093
+ <i class="fas fa-check"></i> Close
1043
1094
  </button>
1044
1095
  </div>
1045
1096
  </div>