Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: 'lint'
name: "lint"

on:
push:
branches:
- main
- dev
- 'release/**'
- "release/**"
pull_request:
branches:
- main
- dev
- 'release/**'
- "release/**"

jobs:
lint-web:
runs-on: [self-hosted, Linux, X64]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: 'recursive'
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "22"

- uses: pnpm/action-setup@v2
with:
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
architecture: [arm64, amd64]
runs-on: [self-hosted, macOS]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
repository: WireGuard/wireguard-go
ref: master
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
deb_arch: amd64
binary_arch: x86_64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: "recursive"
- name: Write release version
Expand All @@ -81,7 +81,7 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: "20"
node-version: "22"
- uses: pnpm/action-setup@v2
with:
version: 9
Expand All @@ -90,7 +90,7 @@ jobs:
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
APPLE_ID: "kamil@defguard.net"
APPLE_TEAM_ID: "82GZ7KN29J"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: "recursive"
- name: Write release version
Expand All @@ -240,15 +240,15 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: "20"
node-version: "22"
- uses: pnpm/action-setup@v2
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
- create-release
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: "recursive"
- name: Write release version
Expand All @@ -322,15 +322,15 @@ jobs:
echo "VERSION=$env:VERSION" >> $env:GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: "20"
node-version: "22"
- uses: pnpm/action-setup@v2
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $env:GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,24 @@ env:
jobs:
test:
runs-on: [self-hosted, Linux, X64]
container: rust:1
container:
image: rust:1
options: --user root
defaults:
run:
working-directory: ./src-tauri

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: recursive
- name: Debug
run: echo ${{ github.ref_name }}
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Install required packages
run: |
apt-get update
apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libxdo-dev unzip
- name: Install protobuf compiler
run: |
PB_REL='https://github.com/protocolbuffers/protobuf/releases'
PB_VERSION='3.20.0' && curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip
unzip protoc-$PB_VERSION-linux-x86_64.zip bin/protoc include/google/* -d /usr/local
apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libxdo-dev unzip protobuf-compiler
- name: Check format
run: |
rustup component add rustfmt
Expand Down
16 changes: 8 additions & 8 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src-tauri/src/bin/defguard-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,13 @@ fn main() {
});
debug!("Ctrl-C handler has been set up successfully");
}
RunEvent::ExitRequested { api, .. } => {
RunEvent::ExitRequested { code, api, .. } => {
debug!("Received exit request");
// Prevent shutdown on window close.
api.prevent_exit();
// `code` is `None` when the exit is requested by user interaction.
if code.is_none() {
// Prevent shutdown on window close.
api.prevent_exit();
}
}
// Handle shutdown.
RunEvent::Exit => {
Expand Down
9 changes: 4 additions & 5 deletions src-tauri/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ use crate::{
ConnectionType,
};

#[cfg(target_os = "windows")]
use crate::active_connections::find_connection;

pub(crate) static DEFAULT_ROUTE_IPV4: &str = "0.0.0.0/0";
pub(crate) static DEFAULT_ROUTE_IPV6: &str = "::/0";

Expand Down Expand Up @@ -927,11 +930,7 @@ async fn check_connection(
}
}

if appstate
.find_connection(id, connection_type)
.await
.is_some()
{
if find_connection(id, connection_type).await.is_some() {
debug!("{connection_type} {name} has already a connected state, skipping synchronization");
return Ok(());
}
Expand Down