get vpn url

This commit is contained in:
2024-09-09 11:09:43 +00:00
parent ed1008397d
commit 816145ec04
2 changed files with 17 additions and 0 deletions

View File

@@ -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 // not in use
function put_install_envs() { function put_install_envs() {

View File

@@ -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 "<br>";
echo file_get_contents($vpnkey_url);
}
if ($_POST["DISCOVERY"]=="yes") { if ($_POST["DISCOVERY"]=="yes") {
if ($_POST["DISCOVERY_DIR"] == "" ) $_POST["DISCOVERY_DIR"]="/usr/local/bin/"; if ($_POST["DISCOVERY_DIR"] == "" ) $_POST["DISCOVERY_DIR"]="/usr/local/bin/";
if (substr($_POST["DISCOVERY_DIR"],0,1)!="/") { if (substr($_POST["DISCOVERY_DIR"],0,1)!="/") {