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)!="/") {