-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathforge.config.js
More file actions
166 lines (155 loc) · 4.82 KB
/
Copy pathforge.config.js
File metadata and controls
166 lines (155 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
const { FusesPlugin } = require("@electron-forge/plugin-fuses");
const { FuseV1Options, FuseVersion } = require("@electron/fuses");
const path = require("path");
const fs = require("fs");
const { execSync } = require("child_process");
const desc =
"A network traffic analysis tool, designed to help users understand and monitor network activity on their devices.";
const vendor = "oxasploits, llc";
const author = "Marshall Whittaker";
const copyright = `Copyright (c) 2026 ${vendor}`;
const homepage = "https://oxasploits.github.io/PacketSnitch/";
const maintainer = "Marshall Whittaker <marshall@oxasploit.com>";
function detectPlatformFamily() {
switch (process.platform) {
case "win32":
return "windows";
case "linux":
try {
const osRelease = fs.readFileSync("/etc/os-release", "utf8");
if (
osRelease.includes("ID=debian") ||
osRelease.includes("ID=ubuntu") ||
osRelease.includes("ID_LIKE=debian")
) {
return "debian";
}
if (
osRelease.includes("ID=fedora") ||
osRelease.includes("ID=rhel") ||
osRelease.includes("ID=centos") ||
osRelease.includes('ID_LIKE="rhel fedora"') ||
osRelease.includes("ID_LIKE=fedora") ||
osRelease.includes("ID_LIKE=rhel")
) {
return "redhat";
}
} catch {
// ignore
}
return "linux";
default:
return process.platform;
}
}
const platform = detectPlatformFamily();
const makers = [];
if (platform === "windows") {
makers.push({
name: "@electron-forge/maker-squirrel",
config: {
loadingGif: path.resolve(__dirname, "logo/ps-install-loop.gif"),
iconUrl:
"https://raw.githubusercontent.com/oxasploits/PacketSnitch/refs/heads/main/logo/ps-icon.ico",
setupIcon: path.resolve(__dirname, "logo/ps-installer-icon.ico"),
name: "PacketSnitch",
setupExe: `PacketSnitch-${require("./package.json").version}-Installer.exe`,
vendor: vendor,
authors: author,
copyright: copyright,
primaryIcon: path.resolve(__dirname, "logo/ps-icon.ico"),
productName: "PacketSnitch",
description: desc,
},
});
}
if (platform === "debian") {
makers.push({
name: "@electron-forge/maker-deb",
config: {
primaryIcon: path.resolve(__dirname, "logo/ps-icon.png"),
name: "packetsnitch",
authors: author,
copyright: copyright,
productName: "PacketSnitch",
description: desc,
homepage: homepage,
maintainer: maintainer,
categories: [
"Utility",
"Network",
"kali-network-information",
"kali-network-service-discovery",
"kali-network-sniffing",
],
vendor: vendor,
icon: path.resolve(__dirname, "logo/ps-icon-rounded.png"),
desktopTemplate: path.resolve(__dirname, "desktop.ejs"),
},
});
}
if (platform === "redhat") {
makers.push({
name: "@electron-forge/maker-rpm",
config: {
options: {
name: "packetsnitch",
authors: author,
copyright: copyright,
productName: "PacketSnitch",
description: desc,
homepage: homepage,
maintainer: maintainer,
categories: ["Utility", "Network"],
vendor: vendor,
icon: path.resolve(__dirname, "logo/ps-icon-rounded.png"),
desktopTemplate: path.join(__dirname, "desktop.ejs"),
},
},
});
}
module.exports = {
packagerConfig: {
icon: path.join(__dirname, "logo", "ps-icon"),
asar: true,
extraResource: ["src/backend/snitch", "src/backend/common/", "src/data/new_session.json", "src/data/goodies.txt", "src/data/valid-keys.txt", "config/models.json", "themes", "src/ui/fragments"],
},
rebuildConfig: {},
makers,
plugins: [
{
name: "@electron-forge/plugin-auto-unpack-natives",
config: {},
},
{
name: "@electron-forge/plugin-webpack",
config: {
mainConfig: "./webpack.main.config.js",
renderer: {
config: "./webpack.renderer.config.js",
entryPoints: [
{
html: "./src/index.html",
js: "./src/renderer.js",
name: "main_window",
preload: {
js: "./src/preload.js",
},
},
],
},
},
},
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
};