opentrade лет назад: 4
Родитель
Сommit
f432bba366
1 измененных файлов с 10 добавлено и 7 удалено
  1. 10 7
      src/lic.rs

+ 10 - 7
src/lic.rs

@@ -38,13 +38,16 @@ pub fn check_lic(email: &str, version: &str) -> bool {
38 38
         return false;
39 39
     }
40 40
 
41
-    let machine = get_lic();
42
-    let path = Path::new(LICENSE_FILE);
43
-    if Path::is_file(&path) {
44
-        let contents = std::fs::read_to_string(&path).unwrap_or("".to_owned());
45
-        if verify(&contents, &machine) {
46
-            async_check_email(&machine, email, version, 0);
47
-            return true;
41
+    let is_docker = std::path::Path::new("/.dockerenv").exists();
42
+    let machine = if is_docker { "".to_owned() } else { get_lic() };
43
+    if !is_docker {
44
+        let path = Path::new(LICENSE_FILE);
45
+        if Path::is_file(&path) {
46
+            let contents = std::fs::read_to_string(&path).unwrap_or("".to_owned());
47
+            if verify(&contents, &machine) {
48
+                async_check_email(&machine, email, version, 0);
49
+                return true;
50
+            }
48 51
         }
49 52
     }
50 53