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: 12 additions & 2 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,23 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version: 25
node-version: 26

- uses: pnpm/action-setup@v6
with:
cache: true
version: 10
version: 11

# Change to '--frozen-lockfile' once this gets fixed:
# https://github.com/pnpm/action-setup/issues/40
- name: Install Node dependencies
run: pnpm install --no-frozen-lockfile

- name: Install Node dependencies for New UI
run: |
cd new-ui
pnpm install --no-frozen-lockfile

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -63,6 +68,11 @@ jobs:
- name: Unlock keychain
run: security -v unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" login.keychain

- name: Build new UI
run: |
cd new-ui
pnpm build

- name: Build app
uses: tauri-apps/tauri-action@v0
env:
Expand Down
33 changes: 20 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,41 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version: 25
node-version: 26

- uses: pnpm/action-setup@v6
with:
version: 10
cache: true
version: 11
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v5
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-lint-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-lint-store-

# Change to '--frozen-lockfile' once this gets fixed:
# https://github.com/pnpm/action-setup/issues/40
- name: Install Node dependencies
run: pnpm install --no-frozen-lockfile

- name: Install Node dependencies for new UI
run: |
cd new-ui
pnpm install --no-frozen-lockfile

- name: Run Biome and Prettier Lint
run: pnpm lint

# TODO: Restore when it works again: https://github.com/pnpm/pnpm/issues/11265
# - name: Audit
# run: pnpm audit --prod
- name: Audit
run: pnpm audit --prod

- name: Run Biome and Prettier Lint for new UI
run: |
cd new-ui
pnpm lint

- name: Audit new UI
run: |
cd new-ui
pnpm audit --prod
56 changes: 28 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
cache: true
version: 11

- uses: actions/setup-node@v6
with:
node-version: 25
node-version: 26

- name: Get pnpm store directory
run: |
Expand All @@ -78,26 +79,29 @@ jobs:
echo Version: $VERSION
echo "VERSION=$VERSION" >> ${GITHUB_ENV}
echo "DEFGUARD_CLIENT_BUILD_VERSION=${GITHUB_REF_NAME#v}" >> ${GITHUB_ENV}
- uses: actions/cache@v5
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-build-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-build-store-

# Change to '--frozen-lockfile' once this gets fixed:
# https://github.com/pnpm/action-setup/issues/40
- name: Install Node dependencies
run: pnpm install --no-frozen-lockfile

- name: Install Node dependencies for new UI
run: |
cd new-ui
pnpm install --no-frozen-lockfile

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: |
apt-get install -y build-essential libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libxdo-dev unzip protobuf-compiler libprotobuf-dev rpm

- name: Build new UI
run: |
cd new-ui
pnpm build

- name: Build packages
uses: tauri-apps/tauri-action@v0.5.23
env:
Expand Down Expand Up @@ -166,31 +170,29 @@ jobs:
echo "DEFGUARD_CLIENT_BUILD_VERSION=${GITHUB_REF_NAME#v}" >> ${GITHUB_ENV}
- uses: actions/setup-node@v6
with:
node-version: 25
node-version: 26

- uses: pnpm/action-setup@v6
with:
version: 10
cache: true
version: 11
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> ${GITHUB_ENV}

- name: Setup pnpm cache
uses: actions/cache@v5
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-build-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-build-store-

# Change to '--frozen-lockfile' once this gets fixed:
# https://github.com/pnpm/action-setup/issues/40
- name: Install Node dependencies
run: pnpm install --no-frozen-lockfile

- name: Install Node dependencies for new UI
run: |
cd new-ui
pnpm install --no-frozen-lockfile

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

Expand All @@ -199,6 +201,11 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libxdo-dev unzip protobuf-compiler libprotobuf-dev rpm

- name: Build new UI
run: |
cd new-ui
pnpm build

- name: Build packages
uses: tauri-apps/tauri-action@v0.5.23 # .24 seems broken, TODO: update when fixed
env:
Expand Down Expand Up @@ -343,21 +350,14 @@ jobs:
# echo "VERSION=$env:VERSION" >> $env:GITHUB_ENV
# - uses: actions/setup-node@v6
# with:
# node-version: 25
# node-version: 26
# - uses: pnpm/action-setup@v6
# with:
# version: 10
# version: 11
# run_install: false
# - name: Get pnpm store directory
# shell: bash
# run: echo "STORE_PATH=$(pnpm store path --silent)" >> ${GITHUB_ENV}
# - uses: actions/cache@v5
# name: Setup pnpm cache
# with:
# path: ${{ env.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-build-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-build-store-
# - name: Install deps
# run: pnpm install --frozen-lockfile
# - uses: dtolnay/rust-toolchain@stable
Expand Down
6 changes: 6 additions & 0 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ use vergen_git2::{Emitter, Git2Builder};
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-env-changed=DEFGUARD_CLIENT_BUILD_VERSION");

println!("cargo:rerun-if-env-changed=DEFGUARD_CLIENT_DEV");
println!("cargo::rustc-check-cfg=cfg(defguard_client_dev)");
if std::env::var("DEFGUARD_CLIENT_DEV").is_ok() {
println!("cargo::rustc-cfg=defguard_client_dev");
}

// set VERGEN_GIT_SHA env variable based on git commit hash
let git2 = Git2Builder::default().branch(true).sha(true).build()?;
Emitter::default().add_instructions(&git2)?.emit()?;
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/bin/defguard-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ fn main() {
app.manage(state);

// Open new UI window.
let new_url = if cfg!(debug_assertions) {
let new_url = if cfg!(defguard_client_dev) {
WebviewUrl::External("http://localhost:5072".parse().unwrap())
} else {
WebviewUrl::App("new-ui/".into())
Expand All @@ -360,7 +360,7 @@ fn main() {
.build()?;

// Open old UI window.
let old_url = if cfg!(debug_assertions) {
let old_url = if cfg!(defguard_client_dev) {
WebviewUrl::External("http://localhost:5071".parse().unwrap())
} else {
WebviewUrl::App("old-ui/index.html/".into())
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ pub const OLD_UI_WIDTH: f64 = 920.0;
pub const OLD_UI_HEIGHT: f64 = 720.0;

fn new_ui_url() -> WebviewUrl {
if cfg!(debug_assertions) {
if cfg!(defguard_client_dev) {
WebviewUrl::External("http://localhost:5072".parse().unwrap())
} else {
WebviewUrl::App("new-ui/".into())
}
}

fn old_ui_url() -> WebviewUrl {
if cfg!(debug_assertions) {
if cfg!(defguard_client_dev) {
WebviewUrl::External("http://localhost:5071".parse().unwrap())
} else {
WebviewUrl::App("old-ui/index.html".into())
Expand Down