@lethevimlet/sshift 0.3.1 → 0.5.0

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.
@@ -4,6 +4,14 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, interactive-widget=resizes-content">
6
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:;">
7
+ <meta name="theme-color" content="#1a1b26">
8
+ <meta name="apple-mobile-web-app-capable" content="yes">
9
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
10
+ <meta name="apple-mobile-web-app-title" content="SSHIFT">
11
+ <link rel="manifest" href="/manifest.json">
12
+ <link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
13
+ <link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
14
+ <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
7
15
  <title>SSHIFT - SSH & SFTP Terminal Client</title>
8
16
  <!-- Local resources for offline support -->
9
17
  <link rel="stylesheet" href="/libs/xterm/xterm.css">
@@ -12,6 +20,24 @@
12
20
  <script src="/libs/lucide/lucide.min.js"></script>
13
21
  </head>
14
22
  <body>
23
+ <!-- Lock Screen Overlay (shown by default, hidden by JS if no password) -->
24
+ <div class="lock-screen" id="lockScreen">
25
+ <div class="lock-screen-content">
26
+ <div class="lock-screen-icon">
27
+ <i class="fas fa-spinner fa-spin"></i>
28
+ </div>
29
+ <h2 class="lock-screen-title">SSHIFT</h2>
30
+ <p class="lock-screen-subtitle" id="lockScreenSubtitle">Loading...</p>
31
+ <form id="lockScreenForm" class="lock-screen-form" style="display: none;">
32
+ <input type="password" id="lockScreenPassword" class="lock-screen-input" placeholder="Enter password" autocomplete="current-password" autofocus>
33
+ <button type="submit" class="btn btn-primary lock-screen-submit">
34
+ <i class="fas fa-sign-in-alt"></i> Unlock
35
+ </button>
36
+ </form>
37
+ <p class="lock-screen-error" id="lockScreenError" style="display: none;"></p>
38
+ </div>
39
+ </div>
40
+
15
41
  <div class="app-container">
16
42
  <!-- Header -->
17
43
  <header class="header">
@@ -357,7 +383,17 @@
357
383
  </div>
358
384
  <div class="form-group">
359
385
  <label for="connPrivateKey">Private Key (optional)</label>
360
- <textarea id="connPrivateKey" rows="4" placeholder="Paste your private key here..."></textarea>
386
+ <div class="private-key-upload">
387
+ <button type="button" class="btn btn-sm key-upload-btn" id="connKeyUploadBtn" title="Upload key file">
388
+ <i class="fas fa-upload"></i> Upload File
389
+ </button>
390
+ <input type="file" id="connKeyFileInput" accept=".pem,.key,.ppk,.pub,.priv,.id_rsa,.id_ed25519,.id_ecdsa,.id_dsa" style="display:none">
391
+ <span class="key-format-badge" id="connKeyFormatBadge" style="display:none"></span>
392
+ <button type="button" class="btn btn-sm key-clear-btn" id="connKeyClearBtn" style="display:none" title="Clear key">
393
+ <i class="fas fa-times"></i>
394
+ </button>
395
+ </div>
396
+ <textarea id="connPrivateKey" rows="4" placeholder="Paste your private key or upload a file (supports OpenSSH, PEM, PPK, PKCS8)..."></textarea>
361
397
  </div>
362
398
  <div class="form-group">
363
399
  <label for="connPassphrase">Key Passphrase (optional)</label>
@@ -436,7 +472,17 @@
436
472
  </div>
437
473
  <div class="form-group">
438
474
  <label for="bookmarkPrivateKey">Private Key (optional)</label>
439
- <textarea id="bookmarkPrivateKey" rows="4" placeholder="Paste your private key here..."></textarea>
475
+ <div class="private-key-upload">
476
+ <button type="button" class="btn btn-sm key-upload-btn" id="bookmarkKeyUploadBtn" title="Upload key file">
477
+ <i class="fas fa-upload"></i> Upload File
478
+ </button>
479
+ <input type="file" id="bookmarkKeyFileInput" accept=".pem,.key,.ppk,.pub,.priv,.id_rsa,.id_ed25519,.id_ecdsa,.id_dsa" style="display:none">
480
+ <span class="key-format-badge" id="bookmarkKeyFormatBadge" style="display:none"></span>
481
+ <button type="button" class="btn btn-sm key-clear-btn" id="bookmarkKeyClearBtn" style="display:none" title="Clear key">
482
+ <i class="fas fa-times"></i>
483
+ </button>
484
+ </div>
485
+ <textarea id="bookmarkPrivateKey" rows="4" placeholder="Paste your private key or upload a file (supports OpenSSH, PEM, PPK, PKCS8)..."></textarea>
440
486
  </div>
441
487
  <div class="form-group">
442
488
  <label for="bookmarkPassphrase">Key Passphrase (optional)</label>
@@ -772,6 +818,26 @@
772
818
  </div>
773
819
  </div>
774
820
 
821
+ <!-- Password Protection -->
822
+ <div class="setting-group">
823
+ <div class="setting-item">
824
+ <label class="setting-label">
825
+ <i class="fas fa-lock"></i> Password Protection
826
+ </label>
827
+ <div class="setting-description">
828
+ Require a password to access the application. When enabled, all endpoints are blocked until the correct password is provided.
829
+ </div>
830
+ <div class="setting-description password-disclaimer">
831
+ <i class="fas fa-exclamation-triangle"></i> <strong>Disclaimer:</strong> This is a basic access restriction, not a substitute for proper authentication. If you expose sshift to a public network, you should use additional security measures such as a reverse proxy with authentication, a VPN, or firewall rules.
832
+ </div>
833
+ <div class="setting-control">
834
+ <button class="btn btn-secondary" id="togglePasswordBtn">
835
+ <i class="fas fa-lock-open"></i> <span id="togglePasswordLabel">Enable Password</span>
836
+ </button>
837
+ </div>
838
+ </div>
839
+ </div>
840
+
775
841
  <!-- Manage Sessions -->
776
842
  <div class="setting-group">
777
843
  <div class="setting-item">
@@ -789,7 +855,11 @@
789
855
  </div>
790
856
  </div>
791
857
  </div>
792
- <div class="modal-footer">
858
+ <div class="modal-footer" style="justify-content: space-between;">
859
+ <button class="btn btn-danger" id="logoutBtn" style="display: none;">
860
+ <i class="fas fa-sign-out-alt"></i> Logout
861
+ </button>
862
+ <div style="flex:1;"></div>
793
863
  <button class="btn" id="cancelSettings">Cancel</button>
794
864
  <button class="btn btn-primary" id="saveSettings">
795
865
  <i class="fas fa-save"></i> Save
@@ -824,6 +894,37 @@
824
894
  </div>
825
895
  </div>
826
896
 
897
+ <!-- Password Modal -->
898
+ <div class="modal" id="passwordModal">
899
+ <div class="modal-content modal-sm">
900
+ <div class="modal-header">
901
+ <h2 id="passwordModalTitle"><i class="fas fa-lock"></i> Enter Password</h2>
902
+ <button class="modal-close" id="closePasswordModal">
903
+ <i class="fas fa-times"></i>
904
+ </button>
905
+ </div>
906
+ <div class="modal-body">
907
+ <div class="setting-group">
908
+ <div class="setting-item" style="flex-direction: column; align-items: stretch;">
909
+ <label class="setting-label" id="passwordModalLabel">Password</label>
910
+ <input type="password" id="passwordModalInput" class="setting-input" placeholder="Enter password" autocomplete="off" style="width:100%; margin-top:8px;">
911
+ <div id="confirmPasswordGroup" style="display: none; margin-top: 12px;">
912
+ <label class="setting-label" style="margin-bottom: 8px;">Confirm Password</label>
913
+ <input type="password" id="passwordModalConfirmInput" class="setting-input" placeholder="Confirm password" autocomplete="off" style="width:100%;">
914
+ </div>
915
+ </div>
916
+ </div>
917
+ <p class="password-modal-error" id="passwordModalError" style="display: none; color: var(--accent-danger); font-size: 13px; margin-top: 8px;"></p>
918
+ </div>
919
+ <div class="modal-footer">
920
+ <button class="btn" id="passwordModalCancel">Cancel</button>
921
+ <button class="btn btn-primary" id="passwordModalSubmit">
922
+ <i class="fas fa-check"></i> Confirm
923
+ </button>
924
+ </div>
925
+ </div>
926
+ </div>
927
+
827
928
  <!-- Mobile Keys Bar -->
828
929
  <div class="mobile-keys-bar" id="mobileKeysBar">
829
930
  <div class="mobile-keys-row">
@@ -1007,5 +1108,12 @@
1007
1108
 
1008
1109
  <script src="/socket.io/socket.io.js"></script>
1009
1110
  <script src="/js/app.js"></script>
1111
+ <script>
1112
+ if ('serviceWorker' in navigator) {
1113
+ window.addEventListener('load', () => {
1114
+ navigator.serviceWorker.register('/sw.js').catch(() => {});
1115
+ });
1116
+ }
1117
+ </script>
1010
1118
  </body>
1011
1119
  </html>