From e2ff99dc9995d65704fb02bfdaa3cecfd98e3172 Mon Sep 17 00:00:00 2001 From: Baibhav Saxena Date: Tue, 1 Oct 2024 17:15:01 +0530 Subject: [PATCH 1/5] fix: electron make cmd dependency updated --- Electron/Electron31/original/package.json | 20 ++++++++++---------- Electron/Electron31/protected/package.json | 19 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Electron/Electron31/original/package.json b/Electron/Electron31/original/package.json index 0c5fe9f..23e7329 100644 --- a/Electron/Electron31/original/package.json +++ b/Electron/Electron31/original/package.json @@ -30,9 +30,7 @@ { "name": "@electron-forge/maker-rpm" }, - { - "name": "@electron-forge/maker-dmg" - }, + { "name": "@electron-forge/maker-zip" } @@ -58,13 +56,15 @@ } }, "devDependencies": { - "@electron-forge/cli": "~6.0.0-beta.54", - "@electron-forge/maker-deb": "~6.0.0-beta.54", - "@electron-forge/maker-dmg": "~6.0.0-beta.54", - "@electron-forge/maker-rpm": "~6.0.0-beta.54", - "@electron-forge/maker-squirrel": "~6.0.0-beta.54", - "@electron-forge/maker-zip": "~6.0.0-beta.54", - "@electron-forge/plugin-webpack": "6.0.0-beta.54", + "@electron-forge/cli": "^6.0.0", + "@electron-forge/maker-deb": "^6.0.0", + "@electron-forge/plugin-auto-unpack-natives": "^7.5.0", + "@electron-forge/plugin-fuses": "^7.5.0", + "@electron-forge/maker-rpm": "^6.0.0", + "@electron-forge/maker-squirrel": "^6.0.0", + "@electron-forge/maker-zip": "^6.0.0", + "@electron-forge/plugin-webpack": "^6.0.0", + "@electron/fuses": "^1.8.0", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@typescript-eslint/eslint-plugin": "~4.0.1", "@typescript-eslint/parser": "~4.0.1", diff --git a/Electron/Electron31/protected/package.json b/Electron/Electron31/protected/package.json index 771d90f..a6edf86 100644 --- a/Electron/Electron31/protected/package.json +++ b/Electron/Electron31/protected/package.json @@ -30,9 +30,6 @@ { "name": "@electron-forge/maker-rpm" }, - { - "name": "@electron-forge/maker-dmg" - }, { "name": "@electron-forge/maker-zip" } @@ -58,13 +55,15 @@ } }, "devDependencies": { - "@electron-forge/cli": "~6.0.0-beta.54", - "@electron-forge/maker-deb": "~6.0.0-beta.54", - "@electron-forge/maker-dmg": "~6.0.0-beta.54", - "@electron-forge/maker-rpm": "~6.0.0-beta.54", - "@electron-forge/maker-squirrel": "~6.0.0-beta.54", - "@electron-forge/maker-zip": "~6.0.0-beta.54", - "@electron-forge/plugin-webpack": "6.0.0-beta.54", + "@electron-forge/cli": "^6.0.0", + "@electron-forge/maker-deb": "^6.0.0", + "@electron-forge/plugin-auto-unpack-natives": "^7.5.0", + "@electron-forge/plugin-fuses": "^7.5.0", + "@electron-forge/maker-rpm": "^6.0.0", + "@electron-forge/maker-squirrel": "^6.0.0", + "@electron-forge/maker-zip": "^6.0.0", + "@electron-forge/plugin-webpack": "^6.0.0", + "@electron/fuses": "^1.8.0", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@preemptive/jsdefender-core": "file:assets/preemptive-jsdefender-core-{version}.tgz", "@preemptive/jsdefender-webpack-plugin": "file:assets/preemptive-jsdefender-webpack-plugin-{version}.tgz", From cc480f85618f757c8326c780bc7727ad8431026e Mon Sep 17 00:00:00 2001 From: Baibhav Saxena Date: Tue, 1 Oct 2024 18:10:47 +0530 Subject: [PATCH 2/5] fix: electron make commands updated --- Electron/Electron31/protected/package.json | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Electron/Electron31/protected/package.json b/Electron/Electron31/protected/package.json index a6edf86..a2403b1 100644 --- a/Electron/Electron31/protected/package.json +++ b/Electron/Electron31/protected/package.json @@ -55,15 +55,13 @@ } }, "devDependencies": { - "@electron-forge/cli": "^6.0.0", - "@electron-forge/maker-deb": "^6.0.0", - "@electron-forge/plugin-auto-unpack-natives": "^7.5.0", - "@electron-forge/plugin-fuses": "^7.5.0", - "@electron-forge/maker-rpm": "^6.0.0", - "@electron-forge/maker-squirrel": "^6.0.0", - "@electron-forge/maker-zip": "^6.0.0", - "@electron-forge/plugin-webpack": "^6.0.0", - "@electron/fuses": "^1.8.0", + "@electron-forge/cli": "~6.0.0-beta.54", + "@electron-forge/maker-deb": "~6.0.0-beta.54", + "@electron-forge/maker-dmg": "~6.0.0-beta.54", + "@electron-forge/maker-rpm": "~6.0.0-beta.54", + "@electron-forge/maker-squirrel": "~6.0.0-beta.54", + "@electron-forge/maker-zip": "~6.0.0-beta.54", + "@electron-forge/plugin-webpack": "6.0.0-beta.54", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@preemptive/jsdefender-core": "file:assets/preemptive-jsdefender-core-{version}.tgz", "@preemptive/jsdefender-webpack-plugin": "file:assets/preemptive-jsdefender-webpack-plugin-{version}.tgz", From 2fef44a46c2e49863821174ac23ae2b8799ff10f Mon Sep 17 00:00:00 2001 From: Baibhav Saxena Date: Tue, 1 Oct 2024 18:11:45 +0530 Subject: [PATCH 3/5] fix: electron make commands updated --- Electron/Electron31/original/package.json | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Electron/Electron31/original/package.json b/Electron/Electron31/original/package.json index 23e7329..175ebbd 100644 --- a/Electron/Electron31/original/package.json +++ b/Electron/Electron31/original/package.json @@ -56,15 +56,13 @@ } }, "devDependencies": { - "@electron-forge/cli": "^6.0.0", - "@electron-forge/maker-deb": "^6.0.0", - "@electron-forge/plugin-auto-unpack-natives": "^7.5.0", - "@electron-forge/plugin-fuses": "^7.5.0", - "@electron-forge/maker-rpm": "^6.0.0", - "@electron-forge/maker-squirrel": "^6.0.0", - "@electron-forge/maker-zip": "^6.0.0", - "@electron-forge/plugin-webpack": "^6.0.0", - "@electron/fuses": "^1.8.0", + "@electron-forge/cli": "~6.0.0-beta.54", + "@electron-forge/maker-deb": "~6.0.0-beta.54", + "@electron-forge/maker-dmg": "~6.0.0-beta.54", + "@electron-forge/maker-rpm": "~6.0.0-beta.54", + "@electron-forge/maker-squirrel": "~6.0.0-beta.54", + "@electron-forge/maker-zip": "~6.0.0-beta.54", + "@electron-forge/plugin-webpack": "6.0.0-beta.54", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@typescript-eslint/eslint-plugin": "~4.0.1", "@typescript-eslint/parser": "~4.0.1", From 8fc68847670cea8b8d1c47d236a4fac33d4024c5 Mon Sep 17 00:00:00 2001 From: Baibhav Saxena Date: Tue, 8 Oct 2024 14:48:39 +0530 Subject: [PATCH 4/5] fix: electron make issue fixed --- Electron/Electron31/original/package.json | 15 ++++++++------- Electron/Electron31/protected/package.json | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Electron/Electron31/original/package.json b/Electron/Electron31/original/package.json index 175ebbd..a7ab49e 100644 --- a/Electron/Electron31/original/package.json +++ b/Electron/Electron31/original/package.json @@ -40,6 +40,7 @@ "name": "@electron-forge/plugin-webpack", "config": { "mainConfig": "./webpack.main.config.js", + "devContentSecurityPolicy": "default-src * 'self' blob: data: gap; style-src * 'self' 'unsafe-inline' blob: data: gap; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap; object-src * 'self' blob: data: gap; img-src * 'self' 'unsafe-inline' blob: data: gap; connect-src 'self' * blob: data: gap; frame-src * 'self' blob: data: gap;", "renderer": { "config": "./webpack.renderer.config.js", "entryPoints": [ @@ -56,13 +57,13 @@ } }, "devDependencies": { - "@electron-forge/cli": "~6.0.0-beta.54", - "@electron-forge/maker-deb": "~6.0.0-beta.54", - "@electron-forge/maker-dmg": "~6.0.0-beta.54", - "@electron-forge/maker-rpm": "~6.0.0-beta.54", - "@electron-forge/maker-squirrel": "~6.0.0-beta.54", - "@electron-forge/maker-zip": "~6.0.0-beta.54", - "@electron-forge/plugin-webpack": "6.0.0-beta.54", + "@electron-forge/cli": "~6.0.0", + "@electron-forge/maker-deb": "~6.0.0", + "@electron-forge/maker-dmg": "~6.0.0", + "@electron-forge/maker-rpm": "~6.0.0", + "@electron-forge/maker-squirrel": "~6.0.0", + "@electron-forge/maker-zip": "~6.0.0", + "@electron-forge/plugin-webpack": "6.0.0", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@typescript-eslint/eslint-plugin": "~4.0.1", "@typescript-eslint/parser": "~4.0.1", diff --git a/Electron/Electron31/protected/package.json b/Electron/Electron31/protected/package.json index a2403b1..8c81376 100644 --- a/Electron/Electron31/protected/package.json +++ b/Electron/Electron31/protected/package.json @@ -39,6 +39,7 @@ "name": "@electron-forge/plugin-webpack", "config": { "mainConfig": "./webpack.main.config.js", + "devContentSecurityPolicy": "default-src * 'self' blob: data: gap; style-src * 'self' 'unsafe-inline' blob: data: gap; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap; object-src * 'self' blob: data: gap; img-src * 'self' 'unsafe-inline' blob: data: gap; connect-src 'self' * blob: data: gap; frame-src * 'self' blob: data: gap;", "renderer": { "config": "./webpack.renderer.config.js", "entryPoints": [ @@ -55,13 +56,13 @@ } }, "devDependencies": { - "@electron-forge/cli": "~6.0.0-beta.54", - "@electron-forge/maker-deb": "~6.0.0-beta.54", - "@electron-forge/maker-dmg": "~6.0.0-beta.54", - "@electron-forge/maker-rpm": "~6.0.0-beta.54", - "@electron-forge/maker-squirrel": "~6.0.0-beta.54", - "@electron-forge/maker-zip": "~6.0.0-beta.54", - "@electron-forge/plugin-webpack": "6.0.0-beta.54", + "@electron-forge/cli": "~6.0.0", + "@electron-forge/maker-deb": "~6.0.0", + "@electron-forge/maker-dmg": "~6.0.0", + "@electron-forge/maker-rpm": "~6.0.0", + "@electron-forge/maker-squirrel": "~6.0.0", + "@electron-forge/maker-zip": "~6.0.0", + "@electron-forge/plugin-webpack": "6.0.0", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@preemptive/jsdefender-core": "file:assets/preemptive-jsdefender-core-{version}.tgz", "@preemptive/jsdefender-webpack-plugin": "file:assets/preemptive-jsdefender-webpack-plugin-{version}.tgz", From 038f906d16900037074ac0f57733df16f9879e9a Mon Sep 17 00:00:00 2001 From: Baibhav Saxena Date: Tue, 8 Oct 2024 20:59:11 +0530 Subject: [PATCH 5/5] doc: updated README file --- Electron/Electron31/protected/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Electron/Electron31/protected/README.md b/Electron/Electron31/protected/README.md index dc7849a..b90972d 100644 --- a/Electron/Electron31/protected/README.md +++ b/Electron/Electron31/protected/README.md @@ -73,4 +73,9 @@ Info: Protected files rendered successfully. ``` ### **enableInDevelopmentMode** -By setting `enableInDevelopmentMode` option of the plugin to true, the protection is enabled for all modes('development', 'production'). To change this behavior, set this option as false. For more details refer to this [link](https://www.preemptive.com/jsdefender/userguide/en/webpack_plugin.html). \ No newline at end of file +By setting `enableInDevelopmentMode` option of the plugin to true, the protection is enabled for all modes('development', 'production'). To change this behavior, set this option as false. For more details refer to this [link](https://www.preemptive.com/jsdefender/userguide/en/webpack_plugin.html). + +### CSP Error for unsafe-eval +Electron forge using webpack and webpack-ts template faces runtime CSP(Content Security Policy) error while using the 'npm run start' command to run this on the dev mode. However 'npm un make' to build the production will not face this issue. This is the issue of electron forge webpack. +In order to allow this unsafe-eval there is a config in the package.json 'devContentSecurityPolicy'. This config allows the unsafe-eval and thus, allows the application to run in the dev mode along with production as well. +This config fix the issue only for Electron forge, as eval is also not allowed by the JSDefender, this config will not fix the JSDefender issue, as it is related to core JSDefender. \ No newline at end of file