From 816145ec04eea8b4a7c5b771954ab1d7aeef3348 Mon Sep 17 00:00:00 2001 From: hael Date: Mon, 9 Sep 2024 11:09:43 +0000 Subject: [PATCH] get vpn url --- functions.php | 8 ++++++++ install.php | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/functions.php b/functions.php index c19a435..4261f85 100644 --- a/functions.php +++ b/functions.php @@ -137,6 +137,14 @@ function redis_remove($key) { } } +function get_vpn_url($domain,$passkey) { + + $date = gmdate("Ymd"); + $hash = hash("sha256",$passkey*$date); + $url = $domain."/".$passkey."/secret"; + return $url; +} + // not in use function put_install_envs() { diff --git a/install.php b/install.php index 9991796..6e1b199 100644 --- a/install.php +++ b/install.php @@ -12,6 +12,15 @@ if ($_POST["SMARTHOST_PROXY"]=="Y") { } +if ($_POST["VPN_PROXY"]=="Y") { + $vpnkey_url = get_vpn_url($_POST["VPN_DOMAIN"],$_POST["VPN_KEY"]); + // DEBUG + + echo $vpnkey_url; + echo "
"; + echo file_get_contents($vpnkey_url); +} + if ($_POST["DISCOVERY"]=="yes") { if ($_POST["DISCOVERY_DIR"] == "" ) $_POST["DISCOVERY_DIR"]="/usr/local/bin/"; if (substr($_POST["DISCOVERY_DIR"],0,1)!="/") {