-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNetSentinelCLI.spec
More file actions
86 lines (77 loc) · 2.61 KB
/
Copy pathNetSentinelCLI.spec
File metadata and controls
86 lines (77 loc) · 2.61 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
# -*- mode: python ; coding: utf-8 -*-
"""
NetSentinel CLI — PyInstaller build specification.
Produces a single-file console executable: dist/NetSentinel-cli[.exe]
The CLI binary is intentionally lightweight:
- No PyQt6 / GUI stack
- No matplotlib
- No Scapy (all CLI commands use standard-library networking only)
Build:
pyinstaller NetSentinelCLI.spec
"""
import os
import sys
# ── Data files ────────────────────────────────────────────────────────────────
datas = [("offenders.json", ".")]
# ── Hidden imports ────────────────────────────────────────────────────────────
# cli.py imports all modules inside function bodies (lazy), so PyInstaller's
# static tracer may not follow every path. List them explicitly here.
hiddenimports: list = [
# RULE-WIN21 console codec — imported at cli.py module scope
"modules.console_codec",
"modules.crash_net",
"modules.log_rotation",
"modules.rogue_device",
"modules.port_scanner",
"modules.network_diagnostics",
"modules.network_logger",
"modules.private_endpoint_checker",
"modules.report_exporter",
"modules.utils",
"modules.nl_query",
"modules.cloud_metadata",
"modules.log_chart",
# xml.etree used by report_exporter for Nmap XML output
"xml.etree.ElementTree",
]
# ── Analysis ──────────────────────────────────────────────────────────────────
a = Analysis(
["cli.py"],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Explicitly exclude the heavy GUI/ML stacks to keep the binary small.
"PyQt6",
"matplotlib",
"scapy",
"tkinter",
],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name="NetSentinel-cli",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True, # CLI is always a console application
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon="assets/icons/NetSentinel.ico" if sys.platform == "win32" else None,
)