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

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

73 changes: 68 additions & 5 deletions Cargo.lock

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

13 changes: 12 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ resolver = "2"

[workspace.dependencies]
# internal crates
defguard_core = { path = "./crates/defguard_core", version = "1.5.0" }
defguard_common = { path = "./crates/defguard_common", version = "1.5.0" }
defguard_core = { path = "./crates/defguard_core", version = "0.0.0" }
defguard_event_logger = { path = "./crates/defguard_event_logger", version = "0.0.0" }
defguard_event_router = { path = "./crates/defguard_event_router", version = "0.0.0" }
defguard_mail = { path = "./crates/defguard_mail", version = "0.0.0" }
defguard_proto = { path = "./crates/defguard_proto", version = "0.0.0" }
defguard_version = { path = "./crates/defguard_version", version = "0.0.0" }
defguard_web_ui = { path = "./crates/defguard_web_ui", version = "0.0.0" }
model_derive = { path = "./crates/model_derive", version = "0.0.0" }
Expand All @@ -35,6 +38,7 @@ chrono = { version = "0.4", default-features = false, features = [
"clock",
"serde",
] }
claims = "0.8"
clap = { version = "4.5", features = ["derive", "env"] }
humantime = "2.1"
# match version used by sqlx
Expand All @@ -43,10 +47,15 @@ jsonwebkey = { version = "0.3", features = ["pkcs-convert"] }
jsonwebtoken = "9.3"
ldap3 = { version = "0.11", default-features = false, features = ["tls"] }
lettre = { version = "0.11", features = ["tokio1-native-tls"] }
matches = "0.1"
md4 = "0.10"
openidconnect = { version = "4.0", default-features = false, features = [
"reqwest",
] }
parse_link_header = "0.4"
paste = "1.0"
pgp = { version = "0.16", default-features = false }
prost = "0.14"
pulldown-cmark = "0.13"
# match version used by sqlx
rand = "0.8"
Expand Down Expand Up @@ -93,6 +102,8 @@ tonic = { version = "0.14", features = [
"tls-ring",
] }
tonic-health = "0.14"
tonic-prost = "0.14"
tonic-prost-build = "0.14"
totp-lite = { version = "2.0" }
tower-http = { version = "0.6", features = ["fs", "trace", "set-header"] }
tracing = "0.1"
Expand Down
2 changes: 2 additions & 0 deletions crates/defguard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ rust-version.workspace = true

[dependencies]
# internal crates
defguard_common = { workspace = true }
defguard_core = { workspace = true }
defguard_event_router = { workspace = true }
defguard_event_logger = { workspace = true }
defguard_mail = { workspace = true }
defguard_version = { workspace = true }

# external dependencies
Expand Down
20 changes: 11 additions & 9 deletions crates/defguard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ use std::{
};

use bytes::Bytes;
use defguard_core::{
SERVER_CONFIG, VERSION,
auth::failed_login::FailedLoginMap,
config::{Command, DefGuardConfig},
use defguard_common::{
VERSION,
config::{Command, DefGuardConfig, SERVER_CONFIG},
db::{
AppEvent, GatewayEvent, Settings, User, init_db,
models::settings::initialize_current_settings,
init_db,
models::{Settings, settings::initialize_current_settings},
},
};
use defguard_core::{
auth::failed_login::FailedLoginMap,
db::{AppEvent, GatewayEvent, User},
enterprise::{
activity_log_stream::activity_log_stream_manager::run_activity_log_stream_manager,
license::{License, run_periodic_license_check, set_cached_license},
Expand All @@ -23,16 +26,15 @@ use defguard_core::{
gateway::{client_state::ClientMap, map::GatewayMap},
run_grpc_bidi_stream, run_grpc_server,
},
init_dev_env, init_vpn_location,
mail::{Mail, run_mail_handler},
run_web_server,
init_dev_env, init_vpn_location, run_web_server,
utility_thread::run_utility_thread,
version::IncompatibleComponents,
wireguard_peer_disconnect::run_periodic_peer_disconnect,
wireguard_stats_purge::run_periodic_stats_purge,
};
use defguard_event_logger::{message::EventLoggerMessage, run_event_logger};
use defguard_event_router::{RouterReceiverSet, run_event_router};
use defguard_mail::{Mail, run_mail_handler};
use secrecy::ExposeSecret;
use tokio::sync::{broadcast, mpsc::unbounded_channel};

Expand Down
39 changes: 39 additions & 0 deletions crates/defguard_common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[package]
name = "defguard_common"
version = "1.5.0"
edition.workspace = true
license-file.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]
model_derive.workspace = true

anyhow.workspace = true
base64.workspace = true
chrono.workspace = true
clap.workspace = true
ed25519-dalek = { version = "2.2", features = ["rand_core"] }
humantime.workspace = true
ipnetwork.workspace = true
jsonwebtoken.workspace = true
openidconnect.workspace = true
rand.workspace = true
reqwest.workspace = true
rsa.workspace = true
secrecy.workspace = true
serde.workspace = true
sqlx.workspace = true
struct-patch.workspace = true
thiserror.workspace = true
tonic.workspace = true
tracing.workspace = true
utoipa.workspace = true
uuid.workspace = true

[dev-dependencies]
matches.workspace = true

[build-dependencies]
vergen-git2 = { version = "1.0", features = ["build"] }
10 changes: 10 additions & 0 deletions crates/defguard_common/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use vergen_git2::{Emitter, Git2Builder};

fn main() -> Result<(), Box<dyn std::error::Error>> {
// 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()?;

println!("cargo:rerun-if-changed=../../migrations");
Ok(())
}
Loading