mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-05-25 23:59:15 +00:00
works on docker
This commit is contained in:
17
src/lic.rs
17
src/lic.rs
@@ -38,13 +38,16 @@ pub fn check_lic(email: &str, version: &str) -> bool {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let machine = get_lic();
|
let is_docker = std::path::Path::new("/.dockerenv").exists();
|
||||||
let path = Path::new(LICENSE_FILE);
|
let machine = if is_docker { "".to_owned() } else { get_lic() };
|
||||||
if Path::is_file(&path) {
|
if !is_docker {
|
||||||
let contents = std::fs::read_to_string(&path).unwrap_or("".to_owned());
|
let path = Path::new(LICENSE_FILE);
|
||||||
if verify(&contents, &machine) {
|
if Path::is_file(&path) {
|
||||||
async_check_email(&machine, email, version, 0);
|
let contents = std::fs::read_to_string(&path).unwrap_or("".to_owned());
|
||||||
return true;
|
if verify(&contents, &machine) {
|
||||||
|
async_check_email(&machine, email, version, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user