From 30e551444dfcaa49eb7d859a58822bec3617aee3 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Tue, 17 Aug 2021 02:24:30 -0700 Subject: [PATCH] fix: deb package --- doc/linux.md | 13 +++++++++++++ packages/core/src/modules/server/index.js | 7 +++++-- packages/gui/package.json | 9 ++++++--- packages/gui/src/bridge/auto-start/backend.js | 2 +- packages/gui/src/bridge/update/backend.js | 3 +++ packages/gui/vue.config.js | 4 ++-- packages/mitmproxy/src/index.js | 11 +++++++---- test/test.js | 1 - 8 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 doc/linux.md diff --git a/doc/linux.md b/doc/linux.md new file mode 100644 index 0000000..234989b --- /dev/null +++ b/doc/linux.md @@ -0,0 +1,13 @@ +# linux + +## anzhuang + +## zhengshu + +### huohu + +### chrome + +## xiezai + + diff --git a/packages/core/src/modules/server/index.js b/packages/core/src/modules/server/index.js index a0515a9..48ada82 100644 --- a/packages/core/src/modules/server/index.js +++ b/packages/core/src/modules/server/index.js @@ -82,8 +82,11 @@ const serverApi = { serverProcess.on('beforeExit', (code) => { log.warn('server process beforeExit', code) }) - serverProcess.on('exit', (code) => { - log.warn('server process exit', code) + serverProcess.on('SIGPIPE', (code, signal) => { + log.warn('server process SIGPIPE', code, signal) + }) + serverProcess.on('exit', (code, signal) => { + log.warn('server process exit', code, signal) }) serverProcess.on('uncaughtException', (err, origin) => { log.error('server process uncaughtException', err) diff --git a/packages/gui/package.json b/packages/gui/package.json index a988089..08fa190 100644 --- a/packages/gui/package.json +++ b/packages/gui/package.json @@ -3,6 +3,7 @@ "version": "1.5.1", "private": false, "license": "MPL-2.0", + "main": "background.js", "scripts": { "serve": "vue-cli-service serve", "lint": "vue-cli-service lint", @@ -13,8 +14,11 @@ "electron:icons": "electron-icon-builder --input=./public/logo/win.png --output=build --flatten", "electron:icons-mac": "electron-icon-builder --input=./public/logo/mac.png --output=build --flatten" }, - "author": "Greper", - "main": "background.js", + "homepage": "https://github.com/docmirror/dev-sidecar", + "author": { + "email": "xiaojunnuo@qq.com", + "name": "Greper" + }, "dependencies": { "@docmirror/dev-sidecar": "^1.5.1", "@docmirror/mitmproxy": "^1.5.1", @@ -47,7 +51,6 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.0", "json5-loader": "^4.0.1", - "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-service": "~4.5.0", diff --git a/packages/gui/src/bridge/auto-start/backend.js b/packages/gui/src/bridge/auto-start/backend.js index 5dce8c5..e04cbb1 100644 --- a/packages/gui/src/bridge/auto-start/backend.js +++ b/packages/gui/src/bridge/auto-start/backend.js @@ -8,7 +8,7 @@ export default { // 开启 开机自启动 ipcMain.on('auto-start', (event, message) => { - console.log('updateExe', ex) + log.info('auto-start', app.getPath('exe')) if (message.value) { app.setLoginItemSettings({ openAtLogin: true, diff --git a/packages/gui/src/bridge/update/backend.js b/packages/gui/src/bridge/update/backend.js index 22ae8b2..a212450 100644 --- a/packages/gui/src/bridge/update/backend.js +++ b/packages/gui/src/bridge/update/backend.js @@ -10,6 +10,7 @@ import logger from '../../utils/util.log' import appPathUtil from '../../utils/util.apppath' // eslint-disable-next-line no-unused-vars const isMac = process.platform === 'darwin' +const isLinux = process.platform === 'linux' function downloadFile (uri, filePath, onProgress, onSuccess, onError) { progress(request(uri), { @@ -54,6 +55,8 @@ function updateHandle (app, api, win, beforeQuit, quit, log) { }) if (isMac) { autoUpdater.updateConfigPath = path.join(__dirname, 'mac/DevSidecar.app/Contents/Resources/app-update.yml') + } else if (isLinux) { + autoUpdater.updateConfigPath = path.join(__dirname, 'mac/DevSidecar.app/Contents/Resources/app-update.yml') } else { autoUpdater.updateConfigPath = path.join(__dirname, 'win-unpacked/resources/app-update.yml') } diff --git a/packages/gui/vue.config.js b/packages/gui/vue.config.js index 864bac2..174a9bf 100644 --- a/packages/gui/vue.config.js +++ b/packages/gui/vue.config.js @@ -47,7 +47,7 @@ module.exports = { } ], appId: 'dev-sidecar', - productName: 'DevSidecar', + productName: 'dev-sidecar', // eslint-disable-next-line no-template-curly-in-string artifactName: 'DevSidecar-${version}.${ext}', copyright: 'Copyright © 2020-2021 Greper', @@ -67,7 +67,7 @@ module.exports = { linux: { icon: './build/mac/', target: [ - 'AppImage' + 'deb' ] }, publish: { diff --git a/packages/mitmproxy/src/index.js b/packages/mitmproxy/src/index.js index 1caa54a..08b3e2c 100644 --- a/packages/mitmproxy/src/index.js +++ b/packages/mitmproxy/src/index.js @@ -37,11 +37,14 @@ function registerProcessListener () { process.on('uncaughtExceptionMonitor', (err, origin) => { log.info('uncaughtExceptionMonitor:', err, origin) }) - process.on('exit', function (code) { - log.info('代理服务进程被关闭:', code) + process.on('exit', function (code, signal) { + log.info('代理服务进程被关闭:', code, signal) }) - process.on('beforeExit', (code) => { - console.log('Process beforeExit event with code: ', code) + process.on('beforeExit', (code, signal) => { + console.log('Process beforeExit event with code: ', code, signal) + }) + process.on('SIGPIPE', (code, signal) => { + log.warn('sub Process SIGPIPE', code, signal) }) } diff --git a/test/test.js b/test/test.js index e6bf0c4..0864d34 100644 --- a/test/test.js +++ b/test/test.js @@ -31,7 +31,6 @@ function testCa() { process.env.NODE_EXTRA_CA_CERTS = 'C:\\Users\\Administrator\\.dev-sidecar\\dev-sidecar.ca.crt' process.env.GLOBAL_AGENT_HTTP_PROXY = "http://127.0.0.1:1181" process.env.GLOBAL_AGENT_HTTPS_PROXY = "http://127.0.0.1:1181" - console.log('111', process.env.NODE_EXTRA_CA_CERTS) const options = { agent : new https.Agent({