From 6d139075886665b270442bec7dc070bbeca9e660 Mon Sep 17 00:00:00 2001 From: red binder Date: Sun, 12 Apr 2026 22:15:15 +0200 Subject: [PATCH 1/3] Dynamically define access key --- editions.yaml | 2 ++ proxy-common/src/lib.rs | 5 +++++ prudpv0/src/crypto/friends_common.rs | 2 +- prudpv1/src/executables/proxy_insecure.rs | 2 +- prudpv1/src/executables/proxy_secure.rs | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) 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..9c18f2e 100644 --- a/proxy-common/src/lib.rs +++ b/proxy-common/src/lib.rs @@ -31,6 +31,11 @@ const RNEX_DEFAULT_PORT: u16 = match u16::from_str_radix(env!("RNEX_DEFAULT_PORT Err(_) => panic!("unable to get default port from env"), }; +const RNEX_ACCESS_KEY: u16 = match u16::from_str_radix(env!("RNEX_ACCESS_KEY"), 10) { + Ok(v) => v, + Err(_) => panic!("unable to get access key from env"), +}; + #[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..6ae6e42 100644 --- a/prudpv0/src/crypto/friends_common.rs +++ b/prudpv0/src/crypto/friends_common.rs @@ -1,5 +1,5 @@ use hmac::Hmac; use md5::Md5; -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..4049566 100644 --- a/prudpv1/src/executables/proxy_insecure.rs +++ b/prudpv1/src/executables/proxy_insecure.rs @@ -43,7 +43,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..a16360e 100644 --- a/prudpv1/src/executables/proxy_secure.rs +++ b/prudpv1/src/executables/proxy_secure.rs @@ -30,7 +30,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"); From fc39e3295b249e53818876654f57a90f8650cc56 Mon Sep 17 00:00:00 2001 From: red binder Date: Sun, 12 Apr 2026 22:33:02 +0200 Subject: [PATCH 2/3] Correctly evaluate access key --- proxy-common/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proxy-common/src/lib.rs b/proxy-common/src/lib.rs index 9c18f2e..75665a0 100644 --- a/proxy-common/src/lib.rs +++ b/proxy-common/src/lib.rs @@ -31,10 +31,7 @@ const RNEX_DEFAULT_PORT: u16 = match u16::from_str_radix(env!("RNEX_DEFAULT_PORT Err(_) => panic!("unable to get default port from env"), }; -const RNEX_ACCESS_KEY: u16 = match u16::from_str_radix(env!("RNEX_ACCESS_KEY"), 10) { - Ok(v) => v, - Err(_) => panic!("unable to get access key from env"), -}; +const RNEX_ACCESS_KEY: &'static str = env!("RNEX_ACCESS_KEY"); #[derive(Error, Debug)] pub enum Error { From c9c4a575b572bde91d454f1dceececd20db41250 Mon Sep 17 00:00:00 2001 From: red binder Date: Sun, 12 Apr 2026 22:35:07 +0200 Subject: [PATCH 3/3] oops --- proxy-common/src/lib.rs | 2 +- prudpv0/src/crypto/friends_common.rs | 1 + prudpv1/src/executables/proxy_insecure.rs | 1 + prudpv1/src/executables/proxy_secure.rs | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy-common/src/lib.rs b/proxy-common/src/lib.rs index 75665a0..5cc13b7 100644 --- a/proxy-common/src/lib.rs +++ b/proxy-common/src/lib.rs @@ -31,7 +31,7 @@ const RNEX_DEFAULT_PORT: u16 = match u16::from_str_radix(env!("RNEX_DEFAULT_PORT Err(_) => panic!("unable to get default port from env"), }; -const RNEX_ACCESS_KEY: &'static str = env!("RNEX_ACCESS_KEY"); +pub const RNEX_ACCESS_KEY: &'static str = env!("RNEX_ACCESS_KEY"); #[derive(Error, Debug)] pub enum Error { diff --git a/prudpv0/src/crypto/friends_common.rs b/prudpv0/src/crypto/friends_common.rs index 6ae6e42..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 = RNEX_ACCESS_KEY; pub type HmacMd5 = Hmac; diff --git a/prudpv1/src/executables/proxy_insecure.rs b/prudpv1/src/executables/proxy_insecure.rs index 4049566..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) diff --git a/prudpv1/src/executables/proxy_secure.rs b/prudpv1/src/executables/proxy_secure.rs index a16360e..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))