-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebshare.spec
More file actions
191 lines (178 loc) · 4.3 KB
/
webshare.spec
File metadata and controls
191 lines (178 loc) · 4.3 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller spec for WebShare Pro.
Synced with the active runtime packaging policy:
- derive APP_VERSION from config.py
- bundle standardized API error utilities and optional network/WebDAV modules
- load UI from the real templates/ and static/ directories, not legacy inline templates
"""
from pathlib import Path
from importlib.util import find_spec
import re
_spec_version = "7.2.1"
_config_text = Path("config.py").read_text(encoding="utf-8")
_match = re.search(r'^APP_VERSION\s*=\s*"([^\"]+)"', _config_text, re.MULTILINE)
APP_VERSION = _match.group(1) if _match else _spec_version
block_cipher = None
def _installed(module_name: str) -> bool:
try:
return find_spec(module_name) is not None
except (ImportError, ModuleNotFoundError, ValueError):
return False
def _optional_hiddenimports(*module_names: str) -> list[str]:
return [module_name for module_name in module_names if _installed(module_name)]
hiddenimports = [
# Flask/Web
"flask",
"flask.json",
"werkzeug",
"werkzeug.serving",
"werkzeug.utils",
"werkzeug.security",
"jinja2",
"jinja2.ext",
"markupsafe",
# GUI/Media
"PIL",
"PIL.Image",
"PIL._tkinter_finder",
"PyQt6",
"PyQt6.QtCore",
"PyQt6.QtGui",
"PyQt6.QtWidgets",
"PyQt6.sip",
# Security/Crypto
"cryptography",
"cryptography.fernet",
"cryptography.hazmat.primitives",
"cryptography.hazmat.primitives.kdf.pbkdf2",
# App modules
"config",
"i18n",
"server",
"utils",
"utils.log_manager",
"utils.file_utils",
"utils.helpers",
"utils.dashboard_service",
"utils.listing",
"utils.zip_utils",
"utils.request_policy",
"utils.api_errors",
"security",
"security.auth",
"security.csrf",
"security.ip_blocker",
"security.permissions",
"features",
"features.audit_log",
"features.duplicates",
"features.cloud_sync",
"features.job_store",
"features.share_links_store",
"features.trash",
"features.metadata",
"features.crypto",
"features.search_indexer",
"features.network",
"features.webdav_server",
"features.transcoder",
"routes",
"routes.main_routes",
"routes.file_routes",
"routes.api_routes",
"routes.root_api_routes",
"routes.media_routes",
"routes.share_routes",
"routes.trash_routes",
"routes.metadata_routes",
"routes.security_routes",
"routes.admin_routes",
"routes.upload_routes",
"routes.duplicate_routes",
"routes.cloud_routes",
"routes.network_routes",
"routes.pwa_routes",
"gui",
"gui.pyqt_gui",
# Optional runtime deps
"flask_compress",
"cachetools",
"orjson",
]
hiddenimports += _optional_hiddenimports(
"miniupnpc",
"wsgidav",
"wsgidav.dc.base_dc",
"wsgidav.fs_dav_provider",
"wsgidav.wsgidav_app",
"cheroot",
"ffmpeg",
"watchdog",
"watchdog.events",
"watchdog.observers",
"watchdog.observers.polling",
"watchdog.observers.read_directory_changes",
"watchdog.observers.winapi",
)
a = Analysis(
["main.py"],
pathex=["."],
binaries=[],
datas=[
("static", "static"),
("templates", "templates"),
],
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
"numpy",
"pandas",
"scipy",
"matplotlib",
"IPython",
"jupyter",
"notebook",
"pytest",
"sphinx",
"setuptools",
"pip",
"unittest",
"pydoc",
"doctest",
"distutils",
"lib2to3",
"test",
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=f"WebSharePro_v{APP_VERSION}",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=None,
version=None,
uac_admin=False,
uac_uiaccess=False,
)