This commit is contained in:
deajan 2025-02-14 12:43:55 +01:00
commit cc3b67ea7d
3 changed files with 21 additions and 8 deletions

View file

@ -79,6 +79,9 @@
- Added manual --init command (already executed by first backup)
- Updated internal restic binary to restic 0.17.3 compiled with go1.23.1 (except for Windows legacy version which stays on 0.16.2 for compat)
- Added heartbeat log for long commands
- Updated Nuitka compiler to 2.6.4
- Updated non-legacy Python from 3.12 to 3.13 on Windows builds
- Windows builds are done via msvc instead of gcc because AV engines don't like gcc (!)
## 2.2.2 - 14/12/2023 (internal build only)
- Fixed backup paths of '/' root partitions

View file

@ -2,17 +2,13 @@
:: This is an example compiler script
SET PYTHON64=c:\python312-64\python.exe
SET PYTHON64=c:\python313-64\python.exe
SET PYTHON32=c:\python37-32\python.exe
cd C:\GIT\npbackup
git pull || GOTO ERROR
:: cd RESTIC_SOURCE_FILES
:: cat update_restic.sh | dos2unix | sh
:: cd ..
:: Make sure we add npbackup in python path so bin and npbackup subfolders become packages
SET OLD_PYTHONPATH=%PYTHONPATH%
SET PYTHONPATH=c:\GIT\npbackup

View file

@ -33,6 +33,11 @@ from command_runner import command_runner
from ofunctions.platform import python_arch, get_os
if os.name == "nt":
EXTERNAL_SIGNER = r"C:\ev_signer_npbackup\ev_signer_npbackup.exe"
if os.path.isfile(EXTERNAL_SIGNER):
SIGN_EXTERNALY = True
else:
SIGN_EXTERNALY = False
from npbackup.windows.sign_windows import sign
from npbackup.__version__ import IS_LEGACY
@ -366,7 +371,16 @@ def compile(
npbackup_executable = os.path.join(
compiled_output_dir, "npbackup-{}.exe".format(build_type)
)
if os.path.isfile(ev_cert_data):
if SIGN_EXTERNALY:
print(f"Signing with external signer {EXTERNAL_SIGNER}")
cmd = f"{EXTERNAL_SIGNER} --executable {npbackup_executable}"
print(cmd)
exit_code, output = command_runner(cmd, shell=True)
if exit_code != 0:
print(f"ERROR: Could not sign: {output}")
errors = True
elif os.path.isfile(ev_cert_data):
print(f"Signing with interal signer {ev_cert_data}")
sign(
executable=npbackup_executable,
arch=arch,
@ -374,7 +388,7 @@ def compile(
dry_run=args.dry_run,
)
else:
print("ERROR: Cannot sign windows executable without EV certificate data")
print(f"ERROR: Cannot sign windows executable: {SIGN_EXTERNALY} {ev_cert_data}")
errors = True
if not onefile: