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
468 changes: 259 additions & 209 deletions src-tauri/Cargo.lock

Large diffs are not rendered by default.

53 changes: 30 additions & 23 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["cli", "common"]
default-members = [".", "cli"]

[workspace.dependencies]
defguard_wireguard_rs = { git = "https://github.com/DefGuard/wireguard-rs.git", rev = "v0.7.4" }
defguard_wireguard_rs = "0.7.5"

[workspace.package]
authors = ["Defguard"]
Expand All @@ -27,8 +27,7 @@ version.workspace = true

[build-dependencies]
tauri-build = { version = "1.5", features = [] }
tonic-build = { version = "0.12" }
prost-build = { version = "0.13" }
tonic-prost-build = { version = "0.14" }
vergen-git2 = { version = "1.0", features = ["build"] }

[dependencies]
Expand All @@ -41,7 +40,7 @@ dark-light = "2.0"
defguard_wireguard_rs = { workspace = true, features = ["check_dependencies"] }
dirs-next = "2.0"
log = { version = "0.4", features = ["serde"] }
prost = "0.13"
prost = "0.14"
regex = "1.11"
reqwest = { version = "0.12", features = ["cookies", "json"] }
# 0.21.2 causes config parsing errors
Expand All @@ -50,24 +49,24 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = "3.11"
sqlx = { version = "0.8", features = [
"chrono",
"sqlite",
"runtime-tokio",
"uuid",
"macros",
"chrono",
"sqlite",
"runtime-tokio",
"uuid",
"macros",
] }
struct-patch = "0.9"
struct-patch = "0.10"
strum = { version = "0.27", features = ["derive"] }
tauri = { version = "1.8", features = [
"notification-all",
"dialog-all",
"clipboard-all",
"http-all",
"window-all",
"system-tray",
"native-tls-vendored",
"icon-png",
"fs-all",
"notification-all",
"dialog-all",
"clipboard-all",
"http-all",
"window-all",
"system-tray",
"native-tls-vendored",
"icon-png",
"fs-all",
] }
tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
Expand All @@ -76,15 +75,23 @@ thiserror = "2.0"
time = { version = "0.3", features = ["formatting", "macros"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal"] }
tokio-util = "0.7"
tonic = "0.12"
tonic = { version = "0.14", default-features = false, features = [
"codegen",
"gzip",
"router",
"tls-native-roots",
"tls-ring",
"transport",
] }
tonic-prost = "0.14"
tracing = "0.1"
tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
webbrowser = "1.0"
x25519-dalek = { version = "2", features = [
"getrandom",
"serde",
"static_secrets",
"getrandom",
"serde",
"static_secrets",
] }

[target.'cfg(unix)'.dependencies]
Expand Down
33 changes: 16 additions & 17 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let git2 = Git2Builder::default().branch(true).sha(true).build()?;
Emitter::default().add_instructions(&git2)?.emit()?;

// compiling protos using path on build time
let mut config = prost_build::Config::new();
// enable optional fields
config.protoc_arg("--experimental_allow_proto3_optional");
// make sure empty DNS is deserialized correctly as None
config.type_attribute(".DeviceConfig", "#[serde_as]");
config.field_attribute(
".DeviceConfig.dns",
"#[serde_as(deserialize_as = \"NoneAsEmptyString\")]",
);
// Make all messages serde-serializable
config.type_attribute(".", "#[derive(serde::Serialize,serde::Deserialize)]");
tonic_build::configure().compile_protos_with_config(
config,
&["proto/client/client.proto", "proto/core/proxy.proto"],
&["proto/client", "proto/core"],
)?;
tonic_prost_build::configure()
// Enable optional fields.
.protoc_arg("--experimental_allow_proto3_optional")
// Make sure empty DNS is deserialized correctly as `None`.
.type_attribute(".DeviceConfig", "#[serde_as]")
.field_attribute(
".DeviceConfig.dns",
"#[serde_as(deserialize_as = \"NoneAsEmptyString\")]",
)
// Make all messages serde-serializable.
.type_attribute(".", "#[derive(serde::Serialize,serde::Deserialize)]")
.compile_protos(
&["proto/client/client.proto", "proto/core/proxy.proto"],
&["proto/client", "proto/core"],
)?;

tauri_build::build();

println!("cargo:rerun-if-changed=proto");
Ok(())
}
4 changes: 2 additions & 2 deletions src-tauri/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ rust-version.workspace = true
version.workspace = true

[build-dependencies]
prost-build = "0.13"
prost-build = "0.14"

[dependencies]
clap = { version = "4.5", features = ["cargo", "derive", "env"] }
common = { path = "../common" }
defguard_wireguard_rs = { workspace = true, features = ["check_dependencies"] }
dirs-next = "2.0"
prost = "0.13"
prost = "0.14"
reqwest = { version = "0.12", features = ["cookies", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
Loading