Skip to content

Commit d4cd30e

Browse files
committed
Disable sandbox
1 parent 3799101 commit d4cd30e

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

.github/workflows/build.yml

+19-5
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,23 @@ jobs:
3535
run: npm run build
3636

3737
- name: Build Electron app
38+
if: matrix.os != 'ubuntu-latest'
39+
run: npm run electron-build
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Build Electron app (Linux)
44+
if: matrix.os == 'ubuntu-latest'
45+
shell: bash
3846
run: |
3947
npm run electron-build
48+
# Remove chrome-sandbox from both unpacked and packaged versions
49+
rm -f dist/linux-unpacked/chrome-sandbox
50+
cd dist
51+
tar xzf drivechain-launcher-*.tar.gz
52+
rm -f drivechain-launcher-*/chrome-sandbox
53+
tar czf drivechain-launcher-*.tar.gz drivechain-launcher-*/
54+
rm -rf drivechain-launcher-*/
4055
env:
4156
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4257

@@ -46,21 +61,20 @@ jobs:
4661
with:
4762
name: linux-artifacts
4863
path: |
49-
dist/*.deb
50-
dist/*.tar.gz
64+
dist/drivechain-launcher-*.tar.gz
5165
5266
- name: Upload Windows artifacts
5367
if: matrix.os == 'windows-latest'
5468
uses: actions/upload-artifact@v4
5569
with:
5670
name: windows-artifacts
57-
path: dist/*.exe
71+
path: dist/Drivechain-Launcher-Setup-*.exe
5872

5973
- name: Upload macOS artifacts
6074
if: matrix.os == 'macos-latest'
6175
uses: actions/upload-artifact@v4
6276
with:
6377
name: macos-artifacts
6478
path: |
65-
dist/*.dmg
66-
dist/*.pkg
79+
dist/Drivechain-Launcher-*-x64.dmg
80+
dist/Drivechain-Launcher-*-arm64.dmg

package.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,21 @@
9090
"linux": {
9191
"target": ["deb", "tar.gz"],
9292
"category": "Development",
93-
"maintainer": "Drivechain <support@drivechain.info>"
93+
"maintainer": "Drivechain <support@drivechain.info>",
94+
"asarUnpack": ["**/chrome-sandbox"],
95+
"executableName": "drivechain-launcher",
96+
"executableArgs": ["--no-sandbox"],
97+
"artifactName": "Drivechain-Launcher-${version}-${arch}.${ext}"
9498
},
9599
"win": {
96-
"target": "nsis"
100+
"target": "nsis",
101+
"artifactName": "Drivechain-Launcher-Setup-${version}.${ext}"
97102
},
98103
"mac": {
99104
"target": ["dmg", "pkg"],
100-
"category": "public.app-category.developer-tools"
105+
"category": "public.app-category.developer-tools",
106+
"artifactName": "Drivechain-Launcher-${version}-${arch}.${ext}",
107+
"arch": ["x64", "arm64"]
101108
}
102109
},
103110
"devDependencies": {

public/electron.js

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
const { app, BrowserWindow, ipcMain, shell } = require("electron");
2+
3+
// Disable sandbox for Linux
4+
if (process.platform === 'linux') {
5+
app.commandLine.appendSwitch('no-sandbox');
6+
app.commandLine.appendSwitch('disable-setuid-sandbox');
7+
process.env.ELECTRON_DISABLE_SANDBOX = '1';
8+
}
29
const path = require("path");
310
const fs = require("fs-extra");
411
const isDev = require("electron-is-dev");
@@ -42,6 +49,7 @@ function createWindow() {
4249
contextIsolation: true,
4350
nodeIntegration: false,
4451
preload: path.join(__dirname, "preload.js"),
52+
sandbox: false
4553
},
4654
});
4755
mainWindow.loadURL(
@@ -514,6 +522,9 @@ async function initialize() {
514522
}
515523
}
516524

525+
// Disable sandbox
526+
app.commandLine.appendSwitch('no-sandbox');
527+
517528
app.whenReady().then(initialize);
518529

519530
let isShuttingDown = false;

0 commit comments

Comments
 (0)