diff --git a/editions.yaml b/editions.yaml index 5458ec6..7a6869c 100644 --- a/editions.yaml +++ b/editions.yaml @@ -7,6 +7,7 @@ splatoon: RNEX_VIRTUAL_PORT_INSECURE: "1:10" RNEX_VIRTUAL_PORT_SECURE: "1:10" RNEX_DEFAULT_PORT: 6000 + RNEX_ACCESS_KEY: "6f599f81" splatoon2: features: - v4-3-11 @@ -25,3 +26,4 @@ friends: RNEX_VIRTUAL_PORT_INSECURE: "1:10" RNEX_VIRTUAL_PORT_SECURE: "1:10" RNEX_DEFAULT_PORT: 6000 + RNEX_ACCESS_KEY: "ridfebb9" diff --git a/proxy-common/src/lib.rs b/proxy-common/src/lib.rs index dc6ed11..5cc13b7 100644 --- a/proxy-common/src/lib.rs +++ b/proxy-common/src/lib.rs @@ -31,6 +31,8 @@ const RNEX_DEFAULT_PORT: u16 = match u16::from_str_radix(env!("RNEX_DEFAULT_PORT Err(_) => panic!("unable to get default port from env"), }; +pub const RNEX_ACCESS_KEY: &'static str = env!("RNEX_ACCESS_KEY"); + #[derive(Error, Debug)] pub enum Error { #[error("error getting environment variable \"{0}\": {1}")] diff --git a/prudpv0/src/crypto/friends_common.rs b/prudpv0/src/crypto/friends_common.rs index b11af1d..a8f1629 100644 --- a/prudpv0/src/crypto/friends_common.rs +++ b/prudpv0/src/crypto/friends_common.rs @@ -1,5 +1,6 @@ use hmac::Hmac; use md5::Md5; +use proxy_common::RNEX_ACCESS_KEY; -pub const ACCESS_KEY: &str = "ridfebb9"; +pub const ACCESS_KEY: &str = RNEX_ACCESS_KEY; pub type HmacMd5 = Hmac; diff --git a/prudpv1/src/executables/proxy_insecure.rs b/prudpv1/src/executables/proxy_insecure.rs index 975f837..06299d1 100644 --- a/prudpv1/src/executables/proxy_insecure.rs +++ b/prudpv1/src/executables/proxy_insecure.rs @@ -19,6 +19,7 @@ use std::time::Duration; use tokio::net::TcpStream; use tokio::task; use tokio::time::sleep; +use proxy_common::RNEX_ACCESS_KEY; pub async fn start() { /*let conn = tokio::net::TcpStream::connect(&*EDGE_NODE_HOLDER) @@ -43,7 +44,7 @@ pub async fn start() { .expect("unable to start router"); let mut socket_secure = router_secure - .add_socket(VirtualPort::new(1, 10), Unsecure("6f599f81")) + .add_socket(VirtualPort::new(1, 10), Unsecure(RNEX_ACCESS_KEY)) .await .expect("unable to add socket"); diff --git a/prudpv1/src/executables/proxy_secure.rs b/prudpv1/src/executables/proxy_secure.rs index 8446391..6bf3434 100644 --- a/prudpv1/src/executables/proxy_secure.rs +++ b/prudpv1/src/executables/proxy_secure.rs @@ -21,6 +21,7 @@ use std::time::Duration; use tokio::net::TcpStream; use tokio::task; use tokio::time::sleep; +use proxy_common::RNEX_ACCESS_KEY; pub async fn start() { let (router_secure, _) = Router::new(SocketAddrV4::new(*OWN_IP_PRIVATE, *SERVER_PORT)) @@ -30,7 +31,7 @@ pub async fn start() { let mut socket_secure = router_secure .add_socket( VirtualPort::new(1, 10), - Secure("6f599f81", SECURE_SERVER_ACCOUNT.clone()), + Secure(RNEX_ACCESS_KEY, SECURE_SERVER_ACCOUNT.clone()), ) .await .expect("unable to add socket");