aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authoropentrade <[email protected]>2021-05-04 21:59:59 +0800
committeropentrade <[email protected]>2021-05-04 21:59:59 +0800
commitf432bba3666a595426df3a06485068aea6bb7b00 (patch)
tree2fa021f2ff7b8525cbdb49c14bc4b9eb02ba7195 /src
parentac258cb132399fb2958591cb3b51f25cd46594d3 (diff)
downloadrustdesk-server-f432bba3666a595426df3a06485068aea6bb7b00.tar.gz
rustdesk-server-f432bba3666a595426df3a06485068aea6bb7b00.zip
works on docker
Diffstat (limited to 'src')
-rw-r--r--src/lic.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lic.rs b/src/lic.rs
index e9feb8e..a268acc 100644
--- a/src/lic.rs
+++ b/src/lic.rs
@@ -38,13 +38,16 @@ pub fn check_lic(email: &str, version: &str) -> bool {
return false;
}
- let machine = get_lic();
- let path = Path::new(LICENSE_FILE);
- if Path::is_file(&path) {
- let contents = std::fs::read_to_string(&path).unwrap_or("".to_owned());
- if verify(&contents, &machine) {
- async_check_email(&machine, email, version, 0);
- return true;
+ let is_docker = std::path::Path::new("/.dockerenv").exists();
+ let machine = if is_docker { "".to_owned() } else { get_lic() };
+ if !is_docker {
+ let path = Path::new(LICENSE_FILE);
+ if Path::is_file(&path) {
+ let contents = std::fs::read_to_string(&path).unwrap_or("".to_owned());
+ if verify(&contents, &machine) {
+ async_check_email(&machine, email, version, 0);
+ return true;
+ }
}
}