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
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.5.0"
edition = "2021"

[dependencies]
defguard_version = { git = "https://github.com/DefGuard/defguard.git", rev = "a5709e7117103458ad8417d4437a8a369ca5bbce" }
defguard_version = { git = "https://github.com/DefGuard/defguard.git", rev = "db678a95398e38b72bbb4ecef36a27caa427e48c" }
axum = { version = "0.8", features = ["macros"] }
base64 = "0.22"
clap = { version = "4.5", features = ["derive", "env"] }
Expand Down
7 changes: 4 additions & 3 deletions src/version.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
use defguard_version::Version;
use defguard_version::{is_version_lower, Version};

const MIN_CORE_VERSION: Version = Version::new(1, 5, 0);

/// Ensures the core version meets minimum version requirements.
/// Terminates the process if it doesn't.
pub(crate) fn ensure_core_version_supported(core_version: Option<&Version>) {
let Some(core_version) = core_version else {
error!("Missing core component version information. This most likely means that core component uses unsupported version. Exiting.");
error!("Missing core component version information. This most likely means that core component uses outdated version. Exiting.");
std::process::exit(1);
};
if core_version < &MIN_CORE_VERSION {

if is_version_lower(core_version, &MIN_CORE_VERSION) {
error!("Core version {core_version} is not supported. Minimal supported core version is {MIN_CORE_VERSION}. Exiting.");
std::process::exit(1);
}
Expand Down