Skip to content

Commit 21f4f97

Browse files
Merge branch 'main' into window-size
2 parents f576dbf + 604bcae commit 21f4f97

18 files changed

+244
-85
lines changed

.github/workflows/release.yaml

Lines changed: 69 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ jobs:
225225
asset_path: src-tauri/target/${{ matrix.target }}/product-signed/defguard.pkg
226226
asset_name: defguard-${{ matrix.target }}-${{ env.VERSION }}.pkg
227227
asset_content_type: application/octet-stream
228+
229+
# Building signed windows bundle involves a few steps as described here:
230+
# https://wixtoolset.org/docs/tools/signing/#signing-bundles-at-the-command-line
231+
# 1. Build defguard & bundle the binaries (defguard & wireguard) using wix (windows)
232+
# 2. Detach the burn engine from the bundle so that it can be signed (also windows)
233+
# 3. Sign the burn engine (linux)
234+
# 4. Reattach the burn engine back to the bundle (windows again)
235+
# 5. Sign the whole bundle (linux)
228236
build-windows:
229237
needs:
230238
- create-release
@@ -271,18 +279,70 @@ jobs:
271279
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
272280
- name: Bundle application
273281
run: |
282+
# prepare wix extension
274283
dotnet tool install --global wix --version 4.0.5
275284
wix extension add WixToolset.Bal.wixext/4
285+
# bundle defguard & wireguard binaries together
276286
wix build .\src-tauri\resources-windows\defguard-client.wxs -ext .\.wix\extensions\WixToolset.Bal.wixext\4\wixext4\WixToolset.Bal.wixext.dll
277-
- name: Upload installer artifact
287+
# detach burn engine from the bundle to be signed
288+
wix burn detach .\src-tauri\resources-windows\defguard-client.exe -engine .\src-tauri\resources-windows\burnengine.exe
289+
- name: Upload unsigned bundle and burn-engine
278290
uses: actions/upload-artifact@v4
279291
with:
280-
name: defguard-client.exe
281-
path: src-tauri/resources-windows/defguard-client.exe
282-
sign-msi:
292+
name: unsigned-bundle-and-burnengine
293+
path: |
294+
src-tauri/resources-windows/defguard-client.exe
295+
src-tauri/resources-windows/burnengine.exe
296+
sign-burn-engine:
283297
needs:
284298
- build-windows
299+
runs-on:
300+
- self-hosted
301+
- Linux
302+
steps:
303+
- name: Write release version
304+
run: |
305+
VERSION=$(echo ${GITHUB_REF_NAME#v} | cut -d '-' -f1)
306+
echo Version: $VERSION
307+
echo "VERSION=$VERSION" >> $GITHUB_ENV
308+
- name: Download unsigned bundle & burn-engine
309+
uses: actions/download-artifact@v4
310+
with:
311+
name: unsigned-bundle-and-burnengine
312+
- name: Sign burn-engine
313+
run: osslsigncode sign -pkcs11module /srv/codesign/certum/sc30pkcs11-3.0.6.68-MS.so -certs /srv/codesign/29ee7778ca5217107841bbbf6b3062e1.pem -key ${{ secrets.CODESIGN_KEYID }} -pass ${{ secrets.CODESIGN_PIN }} -h sha256 -t http://time.certum.pl/ -in burnengine.exe -out burnengine-signed.exe
314+
- name: Upload bundle and burn-engine artifact
315+
uses: actions/upload-artifact@v4
316+
with:
317+
name: unsigned-bundle-and-signed-burnengine
318+
path: |
319+
defguard-client.exe
320+
burnengine-signed.exe
321+
reattach-burn-engine:
322+
needs:
323+
- sign-burn-engine
324+
runs-on: windows-latest
325+
steps:
326+
- name: Download unsigned bundle & signed burn-engine
327+
uses: actions/download-artifact@v4
328+
with:
329+
name: unsigned-bundle-and-signed-burnengine
330+
- name: Reattach burn-engine
331+
run: |
332+
# prepare wix extension
333+
dotnet tool install --global wix --version 4.0.5
334+
wix extension add WixToolset.Bal.wixext/4
335+
# reattach burn engine to the bundle
336+
wix burn reattach defguard-client.exe -engine burnengine-signed.exe -o defguard-client-reattached.exe
337+
- name: Upload bundle with reattached burn-engine
338+
uses: actions/upload-artifact@v4
339+
with:
340+
name: unsigned-bundle-with-reattached-signed-burn-engine
341+
path: defguard-client-reattached.exe
342+
sign-bundle:
343+
needs:
285344
- create-release
345+
- reattach-burn-engine
286346
runs-on:
287347
- self-hosted
288348
- Linux
@@ -292,13 +352,13 @@ jobs:
292352
VERSION=$(echo ${GITHUB_REF_NAME#v} | cut -d '-' -f1)
293353
echo Version: $VERSION
294354
echo "VERSION=$VERSION" >> $GITHUB_ENV
295-
- name: Download a single artifact
355+
- name: Download unsigned bundle & signed burn-engine
296356
uses: actions/download-artifact@v4
297357
with:
298-
name: defguard-client.exe
299-
- name: Sign MSI
300-
run: osslsigncode sign -pkcs11module /srv/codesign/certum/sc30pkcs11-3.0.6.68-MS.so -certs /srv/codesign/29ee7778ca5217107841bbbf6b3062e1.pem -key ${{ secrets.CODESIGN_KEYID }} -pass ${{ secrets.CODESIGN_PIN }} -h sha256 -t http://time.certum.pl/ -in defguard-client.exe -out defguard-client-signed.exe
301-
- name: Upload installer
358+
name: unsigned-bundle-with-reattached-signed-burn-engine
359+
- name: Sign bundle
360+
run: osslsigncode sign -pkcs11module /srv/codesign/certum/sc30pkcs11-3.0.6.68-MS.so -certs /srv/codesign/29ee7778ca5217107841bbbf6b3062e1.pem -key ${{ secrets.CODESIGN_KEYID }} -pass ${{ secrets.CODESIGN_PIN }} -h sha256 -t http://time.certum.pl/ -in defguard-client-reattached.exe -out defguard-client-signed.exe
361+
- name: Upload installer asset
302362
uses: actions/[email protected]
303363
env:
304364
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ To learn more about the system see our [documentation](https://defguard.gitbook.
2525

2626
Make sure to install prerequisites from [tauri](https://tauri.app/v1/guides/getting-started/prerequisites/).
2727

28+
### Proto submodule
29+
Make sure you have cloned, and up to date, proto submodule in `src-tauri/proto`
30+
31+
### Protoc compiler
32+
Make sure you have [protoc](https://grpc.io/docs/protoc-installation/) available.
33+
2834
### Install pnpm and node deps
2935

3036
```bash
@@ -37,10 +43,16 @@ pnpm install
3743
pnpm tauri dev
3844
```
3945

46+
### Build command
47+
```bash
48+
pnpm tauri build
49+
```
50+
Built packages are available after in `src-tauri/target/release/bundle`.
51+
4052
### Windows
4153

4254
Remove `default-run` line from `[package]` section in `Cargo.toml` to build the project.
4355

4456
# Legal
4557

46-
- *defguard is not an official WireGuard project, and WireGuard is a registered trademark of Jason A. Donenfeld.*
58+
- *defguard is not an official WireGuard project, and WireGuard is a registered trademark of Jason A. Donenfeld.*

src-tauri/.sqlx/query-66208ae39fb096ab67d767447c7671429006b303eb6aeb452b1a99716a933ba6.json renamed to src-tauri/.sqlx/query-25e253a71c188be173e3dce3c640e3028e88be06d10c112e4b4a16b1599f8657.json

Lines changed: 17 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/.sqlx/query-e7e1186f31f01b80f2bd575e704db5377b5aa389e4e71d0aaf1f7fc5312574d2.json renamed to src-tauri/.sqlx/query-294b2d391d5cf01a2e756ae357869b9fb274d4254b479816b3892c9593f76b13.json

Lines changed: 17 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/.sqlx/query-c372f0b7ed83311ea369a309b6da796e6944d87b1be160ce7aa2cdbf57c20e78.json renamed to src-tauri/.sqlx/query-31cce786a98f42f93bef6beb172aff153682182940f382d977a59ebf8cf7def0.json

Lines changed: 17 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)