@lethevimlet/sshift 1.0.3 → 1.0.5
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 +18 -5
- package/package.json +1 -1
- package/src/server/endpoints/rest/sessions.js +3 -0
- package/src/server/endpoints/rest/system.js +139 -17
- package/src/server/endpoints/ws/sftp.js +3 -1
- package/src/server/endpoints/ws/ssh.js +3 -2
- package/src/server/endpoints/ws/tabs.js +2 -0
- package/src/server/index.js +18 -3
- package/src/server/services/ssh-manager.js +22 -4
- package/src/webapp/css/style.css +146 -0
- package/src/webapp/index.html +144 -92
- package/src/webapp/js/app.js +386 -60
- package/src/webapp/js/mobile-terminal.js +166 -14
- package/src/webapp/sw.js +19 -2
- package/sshift +44 -2
- package/sshift-install.ps1 +1 -1
- package/sshift-install.sh +1 -1
package/src/webapp/index.html
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
10
10
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
11
11
|
<meta name="apple-mobile-web-app-title" content="SSHIFT">
|
|
12
|
-
<link rel="manifest" href="/manifest.json">
|
|
12
|
+
<link rel="manifest" href="/manifest.json?v=__VERSION__">
|
|
13
13
|
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
|
|
14
14
|
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
|
|
15
15
|
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
|
|
16
16
|
<title>SSHIFT - SSH & SFTP Terminal Client</title>
|
|
17
17
|
<!-- Local resources for offline support -->
|
|
18
|
-
<link rel="stylesheet" href="/libs/xterm/xterm.css">
|
|
19
|
-
<link rel="stylesheet" href="/libs/font-awesome/css/all.min.css">
|
|
20
|
-
<link rel="stylesheet" href="/css/style.css">
|
|
21
|
-
<script src="/libs/lucide/lucide.min.js"></script>
|
|
18
|
+
<link rel="stylesheet" href="/libs/xterm/xterm.css?v=__VERSION__">
|
|
19
|
+
<link rel="stylesheet" href="/libs/font-awesome/css/all.min.css?v=__VERSION__">
|
|
20
|
+
<link rel="stylesheet" href="/css/style.css?v=__VERSION__">
|
|
21
|
+
<script src="/libs/lucide/lucide.min.js?v=__VERSION__"></script>
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
24
|
<!-- Lock Screen Overlay (shown by default, hidden by JS if no password) -->
|
|
@@ -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
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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-
|
|
998
|
-
<button class="modal-close" id="
|
|
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="
|
|
1004
|
-
<div class="
|
|
1005
|
-
<
|
|
1006
|
-
<
|
|
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
|
-
|
|
1015
|
-
<
|
|
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
|
-
|
|
1022
|
-
<
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
</
|
|
1026
|
-
<
|
|
1027
|
-
|
|
1028
|
-
|
|
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="
|
|
1042
|
-
<i class="fas fa-check"></i>
|
|
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>
|
|
@@ -1087,16 +1138,16 @@
|
|
|
1087
1138
|
|
|
1088
1139
|
<!-- Scripts -->
|
|
1089
1140
|
<!-- xterm.js and addons - Local files for offline support -->
|
|
1090
|
-
<script src="/libs/xterm/xterm.js"></script>
|
|
1091
|
-
<script src="/libs/xterm/xterm-addon-fit.js"></script>
|
|
1092
|
-
<script src="/libs/xterm/xterm-addon-web-links.js"></script>
|
|
1093
|
-
<script src="/libs/xterm/xterm-addon-search.js"></script>
|
|
1094
|
-
<script src="/libs/xterm/xterm-addon-serialize.js"></script>
|
|
1095
|
-
<script src="/libs/xterm/xterm-addon-webgl.js"></script>
|
|
1096
|
-
<script src="/libs/xterm/xterm-addon-image.js"></script>
|
|
1141
|
+
<script src="/libs/xterm/xterm.js?v=__VERSION__"></script>
|
|
1142
|
+
<script src="/libs/xterm/xterm-addon-fit.js?v=__VERSION__"></script>
|
|
1143
|
+
<script src="/libs/xterm/xterm-addon-web-links.js?v=__VERSION__"></script>
|
|
1144
|
+
<script src="/libs/xterm/xterm-addon-search.js?v=__VERSION__"></script>
|
|
1145
|
+
<script src="/libs/xterm/xterm-addon-serialize.js?v=__VERSION__"></script>
|
|
1146
|
+
<script src="/libs/xterm/xterm-addon-webgl.js?v=__VERSION__"></script>
|
|
1147
|
+
<script src="/libs/xterm/xterm-addon-image.js?v=__VERSION__"></script>
|
|
1097
1148
|
|
|
1098
1149
|
<!-- Mobile terminal support -->
|
|
1099
|
-
<script src="/js/mobile-terminal.js"></script>
|
|
1150
|
+
<script src="/js/mobile-terminal.js?v=__VERSION__"></script>
|
|
1100
1151
|
|
|
1101
1152
|
<!-- Normalize addon exports - UMD pattern exports { FitAddon: class } not the class directly -->
|
|
1102
1153
|
<script>
|
|
@@ -1234,52 +1285,53 @@
|
|
|
1234
1285
|
</script>
|
|
1235
1286
|
|
|
1236
1287
|
<script src="/socket.io/socket.io.js"></script>
|
|
1237
|
-
<script src="/js/app.js"></script>
|
|
1288
|
+
<script src="/js/app.js?v=__VERSION__"></script>
|
|
1238
1289
|
<script>
|
|
1239
1290
|
if ('serviceWorker' in navigator) {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
if (
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1291
|
+
window.addEventListener('load', () => {
|
|
1292
|
+
navigator.serviceWorker.register('/sw.js').then((reg) => {
|
|
1293
|
+
console.log('[SSHIFT] Service Worker registered, scope:', reg.scope);
|
|
1294
|
+
window._swRegistration = reg;
|
|
1295
|
+
if (reg.active) {
|
|
1296
|
+
window._swStatus = 'active';
|
|
1297
|
+
} else if (reg.installing) {
|
|
1298
|
+
window._swStatus = 'installing';
|
|
1299
|
+
} else if (reg.waiting) {
|
|
1300
|
+
window._swStatus = 'waiting';
|
|
1301
|
+
} else {
|
|
1302
|
+
window._swStatus = 'registered';
|
|
1303
|
+
}
|
|
1304
|
+
window._swError = null;
|
|
1305
|
+
reg.addEventListener('updatefound', () => {
|
|
1306
|
+
const newWorker = reg.installing;
|
|
1307
|
+
newWorker.addEventListener('statechange', () => {
|
|
1308
|
+
if (newWorker.state === 'activated') {
|
|
1309
|
+
window._swStatus = 'active';
|
|
1310
|
+
if (navigator.serviceWorker.controller) {
|
|
1311
|
+
console.log('[SSHIFT] New service worker activated, reloading for updates');
|
|
1312
|
+
window.location.reload();
|
|
1313
|
+
}
|
|
1314
|
+
} else if (newWorker.state === 'redundant') {
|
|
1315
|
+
if (!navigator.serviceWorker.controller) {
|
|
1316
|
+
window._swStatus = 'redundant';
|
|
1317
|
+
window._swError = 'Service Worker became redundant. This usually means the certificate is not trusted.';
|
|
1266
1318
|
}
|
|
1267
|
-
}
|
|
1319
|
+
}
|
|
1268
1320
|
});
|
|
1269
|
-
// Also check if the page is controlled by a SW
|
|
1270
|
-
if (navigator.serviceWorker.controller) {
|
|
1271
|
-
window._swStatus = 'active';
|
|
1272
|
-
}
|
|
1273
|
-
}).catch((err) => {
|
|
1274
|
-
console.warn('[SSHIFT] Service Worker registration failed:', err.message);
|
|
1275
|
-
window._swStatus = 'failed';
|
|
1276
|
-
window._swError = err.message;
|
|
1277
1321
|
});
|
|
1322
|
+
if (navigator.serviceWorker.controller) {
|
|
1323
|
+
window._swStatus = 'active';
|
|
1324
|
+
}
|
|
1325
|
+
}).catch((err) => {
|
|
1326
|
+
console.warn('[SSHIFT] Service Worker registration failed:', err.message);
|
|
1327
|
+
window._swStatus = 'failed';
|
|
1328
|
+
window._swError = err.message;
|
|
1278
1329
|
});
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1330
|
+
});
|
|
1331
|
+
} else {
|
|
1332
|
+
window._swStatus = 'unsupported';
|
|
1333
|
+
window._swError = 'Service Workers not supported in this browser';
|
|
1334
|
+
}
|
|
1283
1335
|
</script>
|
|
1284
1336
|
</body>
|
|
1285
1337
|
</html>
|