diff --git a/.gitignore b/.gitignore index 0b8e5e9b..72dadd2e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/ # Dist dir dist +packaging/_precompiled/ # Custom dev deops go.mod.* @@ -52,3 +53,7 @@ go.work.sum # Kext releases windows_kext/release/kext_release_*.zip windows_core_dll/.vs/windows_core_dll + +#windows_core_dll +windows_core_dll/x64/ +windows_core_dll/portmaster-core/x64/ diff --git a/Earthfile b/Earthfile index ab7c09a8..d029fac3 100644 --- a/Earthfile +++ b/Earthfile @@ -535,31 +535,44 @@ release-prep: # Build update manager COPY (+go-build/output/updatemgr --GOARCH=amd64 --GOOS=linux --CMDS=updatemgr) ./updatemgr - - # Get binary artifacts from current release - RUN mkdir -p ./output/download/windows_amd64 && ./updatemgr download https://updates.safing.io/stable.v3.json --platform windows_amd64 ./output/download/windows_amd64 - - # Create new binary index from artifacts - RUN ./updatemgr scan --dir "./output/binary" > ./output/binary/index.json - - # Get intel index and assets + # Get "portmaster-kext.sys" and "portmaster-core.dll" from current stable release + RUN mkdir -p ./output/downloaded/windows_amd64 && ./updatemgr download https://updates.safing.io/stable.v3.json --platform windows_amd64 ./output/downloaded/windows_amd64 + RUN find ./output/downloaded/windows_amd64 -type f ! -name "portmaster-kext.sys" ! -name "portmaster-core.dll" -delete # We are only interested in the KEXT and core DLL. Remove the rest. + # Get intel artifacts RUN mkdir -p ./output/intel && ./updatemgr download https://updates.safing.io/intel.v3.json ./output/intel - - # Save all artifacts to output folder - SAVE ARTIFACT --if-exists --keep-ts "output/binary/index.json" AS LOCAL "${outputDir}/binary/index.json" - SAVE ARTIFACT --if-exists --keep-ts "output/binary/all/*" AS LOCAL "${outputDir}/binary/all/" - SAVE ARTIFACT --if-exists --keep-ts "output/binary/linux_amd64/*" AS LOCAL "${outputDir}/binary/linux_amd64/" - SAVE ARTIFACT --if-exists --keep-ts "output/binary/windows_amd64/*" AS LOCAL "${outputDir}/binary/windows_amd64/" - SAVE ARTIFACT --if-exists --keep-ts "output/intel/*" AS LOCAL "${outputDir}/intel/" - SAVE ARTIFACT --if-exists --keep-ts "output/download/windows_amd64/portmaster-kext.*" AS LOCAL "${outputDir}/download/windows_amd64/" # precompiled (downloaded) KEXT binary + + # Save all artifacts to output folder (on host) + SAVE ARTIFACT --keep-ts "output/binary/all/*" AS LOCAL "${outputDir}/binary/all/" + SAVE ARTIFACT --keep-ts "output/binary/linux_amd64/*" AS LOCAL "${outputDir}/binary/linux_amd64/" + SAVE ARTIFACT --keep-ts "output/binary/windows_amd64/*" AS LOCAL "${outputDir}/binary/windows_amd64/" + SAVE ARTIFACT --keep-ts "output/intel/*" AS LOCAL "${outputDir}/intel/" + SAVE ARTIFACT --keep-ts "output/downloaded/*" AS LOCAL "${outputDir}/downloaded/" # KEXT and core DLL: artifacts from the current stable release # Save all artifacts to the container output folder so other containers can access it. - SAVE ARTIFACT --if-exists --keep-ts "output/binary/index.json" "output/binary/index.json" - SAVE ARTIFACT --if-exists --keep-ts "output/binary/all/*" "output/binary/all/" - SAVE ARTIFACT --if-exists --keep-ts "output/binary/linux_amd64/*" "output/binary/linux_amd64/" - SAVE ARTIFACT --if-exists --keep-ts "output/binary/windows_amd64/*" "output/binary/windows_amd64/" - SAVE ARTIFACT --if-exists --keep-ts "output/intel/*" "output/intel/" - SAVE ARTIFACT --if-exists --keep-ts "output/download/*" "output/download/" + SAVE ARTIFACT --keep-ts "output/binary/all/*" "output/binary/all/" + SAVE ARTIFACT --keep-ts "output/binary/linux_amd64/*" "output/binary/linux_amd64/" + SAVE ARTIFACT --keep-ts "output/binary/windows_amd64/*" "output/binary/windows_amd64/" + SAVE ARTIFACT --keep-ts "output/intel/*" "output/intel/" + SAVE ARTIFACT --keep-ts "output/downloaded/*" "output/downloaded/" + + # IMPORTANT: COPYING PRECOMPILED LOCAL FILES! + # If "packaging/_precompiled" foledr exists, it's contents has priority to be used; it's files will overwrite the ones from the build! + # Expected structure: + # - packaging/_precompiled/binary/... + # - packaging/_precompiled/intel + # Careful! If there are any files in the '_precompiled/intel' folder, the final 'intel/index.json' may be broken due to incorrect hash values! + COPY --if-exists --keep-ts ./packaging/_precompiled/binary ./packaging/precompiled/binary + COPY --if-exists --keep-ts ./packaging/_precompiled/intel ./packaging/precompiled/intel + IF --no-cache [ -d ./packaging/precompiled ] + RUN --no-cache echo "[ !!! ATTENTION !!! ] PRECOMPILED FILES IN USE:" && find ./packaging/precompiled -type f; + IF --no-cache [ -d ./packaging/precompiled/intel ] + RUN --no-cache echo "[!!! ATTENTION !!!] ENSURE THAT 'intel/index.json' CONTAINS THE CORRECT HASHES!" + END + SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/intel/*" AS LOCAL "${outputDir}/intel/" # save to host + SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/binary/*" AS LOCAL "${outputDir}/binary/" # save to host + SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/intel/*" "output/intel/" # save to container (so other containers can access it) + SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/binary/*" "output/binary/" # save to container (so other containers can access it) + END installer-linux: FROM +rust-base @@ -582,7 +595,6 @@ installer-linux: COPY (+release-prep/output/binary/linux_amd64/portmaster) ./target/${target}/release/portmaster RUN mkdir -p binary - COPY (+release-prep/output/binary/index.json) ./binary/index.json COPY (+release-prep/output/binary/linux_amd64/portmaster-core) ./binary/portmaster-core COPY (+release-prep/output/binary/all/portmaster.zip) ./binary/portmaster.zip COPY (+release-prep/output/binary/all/assets.zip) ./binary/assets.zip diff --git a/desktop/tauri/src-tauri/tauri.conf.json5 b/desktop/tauri/src-tauri/tauri.conf.json5 index e33b1867..28b9f772 100644 --- a/desktop/tauri/src-tauri/tauri.conf.json5 +++ b/desktop/tauri/src-tauri/tauri.conf.json5 @@ -39,7 +39,7 @@ } }, "productName": "Portmaster", - "version": "0.1.0", // If removed the version number from Cargo.toml is used. + "version": "0.1.3", // If removed the version number from Cargo.toml is used. "identifier": "io.safing.portmaster", // this is added as a property to the shortcut on windows (ApplicationUserModelID). Used for notifications. "app": { "withGlobalTauri": true, @@ -63,7 +63,6 @@ "/usr/lib/systemd/system/portmaster.service": "../../../packaging/linux/portmaster.service", // Binary files - "/usr/lib/portmaster/index.json": "binary/index.json", "/usr/lib/portmaster/portmaster-core": "binary/portmaster-core", "/usr/lib/portmaster/portmaster.zip": "binary/portmaster.zip", "/usr/lib/portmaster/assets.zip": "binary/assets.zip", @@ -94,7 +93,6 @@ "/usr/lib/systemd/system/portmaster.service": "../../../packaging/linux/portmaster.service", // Binary files - "/usr/lib/portmaster/index.json": "binary/index.json", "/usr/lib/portmaster/portmaster-core": "binary/portmaster-core", "/usr/lib/portmaster/portmaster.zip": "binary/portmaster.zip", "/usr/lib/portmaster/assets.zip": "binary/assets.zip", diff --git a/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh b/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh index e7e528f7..24a543c9 100644 --- a/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh +++ b/desktop/tauri/src-tauri/templates/nsis/install_hooks.nsh @@ -17,7 +17,6 @@ var dataDir ${EndIf} ${EndIf} - File "..\..\..\..\binary\index.json" File "..\..\..\..\binary\portmaster-core.exe" File "..\..\..\..\binary\portmaster-kext.sys" File "..\..\..\..\binary\portmaster-core.dll" diff --git a/desktop/tauri/src-tauri/templates/wix/files.wxs b/desktop/tauri/src-tauri/templates/wix/files.wxs index 0fd5a801..70000ee4 100644 --- a/desktop/tauri/src-tauri/templates/wix/files.wxs +++ b/desktop/tauri/src-tauri/templates/wix/files.wxs @@ -12,7 +12,6 @@ - diff --git a/packaging/windows/generate_windows_installers.ps1 b/packaging/windows/generate_windows_installers.ps1 index ec57bfae..7e3acacd 100644 --- a/packaging/windows/generate_windows_installers.ps1 +++ b/packaging/windows/generate_windows_installers.ps1 @@ -20,7 +20,7 @@ # # 3. Sign All Binaries (Windows environment) # ``` -# .\sign_binaries_in_dist.ps1 -certSha1 +# .\packaging\windows\sign_binaries_in_dist.ps1 -certSha1 # ``` # This signs all binary files in the dist directory # @@ -33,7 +33,7 @@ # # 5. Sign Installers (Windows environment) # ``` -# .\sign_binaries_in_dist.ps1 -certSha1 +# .\packaging\windows\sign_binaries_in_dist.ps1 -certSha1 # ``` # This signs the newly created installer files # @@ -140,13 +140,12 @@ try { # Copying BINARY FILES Write-Output "`n[+] Copying binary files:" $filesToCopy = @( - @{Folder=""; File="portmaster-kext.sys"; Destination=$binaryDir; AlternateFolder="dist/download/windows_amd64"}, - @{Folder="dist/binary/windows_amd64"; File="portmaster-core.dll"; Destination=$binaryDir; AlternateFolder="dist/download/windows_amd64"}, + @{Folder="dist/binary/windows_amd64"; File="portmaster-kext.sys"; Destination=$binaryDir; AlternateFolder="dist/downloaded/windows_amd64"}, + @{Folder="dist/binary/windows_amd64"; File="portmaster-core.dll"; Destination=$binaryDir; AlternateFolder="dist/downloaded/windows_amd64"}, @{Folder="dist/binary/windows_amd64"; File="portmaster-core.exe"; Destination=$binaryDir}, @{Folder="dist/binary/windows_amd64"; File="WebView2Loader.dll"; Destination=$binaryDir}, @{Folder="dist/binary/all"; File="portmaster.zip"; Destination=$binaryDir}, @{Folder="dist/binary/all"; File="assets.zip"; Destination=$binaryDir}, - @{Folder="dist/binary"; File="index.json"; Destination=$binaryDir}, @{Folder="dist/binary/windows_amd64"; File="portmaster.exe"; Destination=$targetDir} ) foreach ($file in $filesToCopy) {