mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2025-07-01 15:25:29 +00:00
make hbbr / hbbs share the PORT value of .env
This commit is contained in:
parent
fe3b42809a
commit
d88e4b5151
13
src/hbbr.rs
13
src/hbbr.rs
@ -29,9 +29,18 @@ fn main() -> ResultType<()> {
|
||||
section.iter().for_each(|(k, v)| std::env::set_var(k, v));
|
||||
}
|
||||
}
|
||||
let mut port = RELAY_PORT;
|
||||
if let Ok(v) = std::env::var("PORT") {
|
||||
let v: i32 = v.parse().unwrap_or_default();
|
||||
if v > 0 {
|
||||
port = v + 1;
|
||||
}
|
||||
}
|
||||
start(
|
||||
matches.value_of("port").unwrap_or(&RELAY_PORT.to_string()),
|
||||
matches.value_of("key").unwrap_or(""),
|
||||
matches.value_of("port").unwrap_or(&port.to_string()),
|
||||
matches
|
||||
.value_of("key")
|
||||
.unwrap_or(&std::env::var("KEY").unwrap_or_default()),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
pub const VERSION: &str = "1.1.7";
|
||||
#[allow(dead_code)]
|
||||
pub const BUILD_DATE: &str = "2023-02-01 10:45";
|
Loading…
x
Reference in New Issue
Block a user