From 860ccd6b3a8cffd9bce8fee153c0c4f273783a37 Mon Sep 17 00:00:00 2001 From: botanicvelious Date: Wed, 11 Jan 2023 17:35:47 -0700 Subject: [PATCH] add env variables for RENDEZVOUS_SERVERS check for env variable RENDEZVOUS_SERVER1-3 if not use the default --- libs/hbb_common/src/config.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index 970740045..95b7944fc 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -77,10 +77,20 @@ const CHARS: &'static [char] = &[ 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ]; +//check for env variable RENDEZVOUS_SERVER1-3 if not use the default pub const RENDEZVOUS_SERVERS: &'static [&'static str] = &[ - "rs-ny.rustdesk.com", - "rs-sg.rustdesk.com", - "rs-cn.rustdesk.com", + match option_env!("RENDEZVOUS_SERVER1") { + Some(key) => key, + None => "rs-ny.rustdesk.com", + }, + match option_env!("RENDEZVOUS_SERVER2") { + Some(key) => key, + None => "rs-sg.rustdesk.com", + }, + match option_env!("RENDEZVOUS_SERVER3") { + Some(key) => key, + None => "rs-cn.rustdesk.com", + }, ]; //check for env variable RS_PUB_KEY if not use default