electerm 3.3.3 → 3.3.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 CHANGED
@@ -90,9 +90,6 @@ Check [https://electerm-repos.html5beta.com/deb](https://electerm-repos.html5bet
90
90
  ```bash
91
91
  npm i -g electerm
92
92
 
93
- # After installation, it will immediately open for windows and linux,
94
- # For macOS, it will open the drag to install panel
95
-
96
93
  ```
97
94
 
98
95
  ## Upgrade
package/npm/electerm CHANGED
@@ -34,6 +34,21 @@ function getElectermExePath () {
34
34
  return path.join(packageRoot, 'electerm', 'electerm')
35
35
  }
36
36
 
37
+ function isSandboxReady () {
38
+ // chrome-sandbox must be owned by root (uid 0) and have setuid bit set (mode 4755)
39
+ // This requires root during install, which npm global install does not provide.
40
+ try {
41
+ const sandboxPath = path.join(packageRoot, 'electerm', 'chrome-sandbox')
42
+ if (!fs.existsSync(sandboxPath)) return false
43
+ const stat = fs.statSync(sandboxPath)
44
+ const hasSetuid = (stat.mode & 0o4000) !== 0
45
+ const ownedByRoot = stat.uid === 0
46
+ return hasSetuid && ownedByRoot
47
+ } catch (e) {
48
+ return false
49
+ }
50
+ }
51
+
37
52
  function launchElecterm () {
38
53
  const exePath = getElectermExePath()
39
54
 
@@ -46,7 +61,12 @@ function launchElecterm () {
46
61
  process.exit(1)
47
62
  }
48
63
 
49
- const child = spawn(exePath, process.argv.slice(2), {
64
+ const extraArgs = []
65
+ if (plat === 'linux' && !isSandboxReady()) {
66
+ extraArgs.push('--no-sandbox')
67
+ }
68
+
69
+ const child = spawn(exePath, [...extraArgs, ...process.argv.slice(2)], {
50
70
  stdio: 'inherit',
51
71
  detached: plat !== 'win32',
52
72
  windowsHide: false
package/npm/install.js CHANGED
@@ -192,11 +192,15 @@ async function runLinux (folderName, filePattern) {
192
192
  mv(join(tmpDir, extractedFolder), extractDir)
193
193
 
194
194
  // Fix chrome-sandbox permissions on Linux (Electron requires specific permissions)
195
+ // Note: setting the setuid bit requires root ownership, which npm install cannot provide.
196
+ // The launcher handles this by passing --no-sandbox when the sandbox is not root-owned.
195
197
  if (plat === 'linux') {
196
198
  const chromeSandboxPath = join(extractDir, 'chrome-sandbox')
197
199
  if (fs.existsSync(chromeSandboxPath)) {
198
- console.log(' Fixing chrome-sandbox permissions...')
199
- fs.chmodSync(chromeSandboxPath, 0o4755)
200
+ console.log(' Note: To enable the Electron sandbox, run:')
201
+ console.log(` sudo chown root:root "${chromeSandboxPath}"`)
202
+ console.log(` sudo chmod 4755 "${chromeSandboxPath}"`)
203
+ console.log(' Otherwise, electerm will launch with --no-sandbox automatically.')
200
204
  }
201
205
  }
202
206
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electerm",
3
- "version": "3.3.3",
3
+ "version": "3.3.5",
4
4
  "description": "Terminal/ssh/telnet/serialport/sftp client(linux, mac, win)",
5
5
  "main": "app.js",
6
6
  "bin": "npm/electerm",