subscription page
This commit is contained in:
@@ -26,3 +26,5 @@ docker-compose.override.yml
|
|||||||
backup.json
|
backup.json
|
||||||
app/webapp/override/
|
app/webapp/override/
|
||||||
.rest
|
.rest
|
||||||
|
|
||||||
|
subscription.php
|
||||||
+44
@@ -6316,6 +6316,9 @@ DNS-over-HTTPS with IP:
|
|||||||
$hash = $this->getHashBot();
|
$hash = $this->getHashBot();
|
||||||
|
|
||||||
$text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['email']}\n";
|
$text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['email']}\n";
|
||||||
|
if (file_exists(__DIR__ . '/subscription.php')) {
|
||||||
|
$text[] = "<a href='$scheme://{$domain}/pac$hash/sub?id={$c['id']}'>subscription</a>";
|
||||||
|
}
|
||||||
$text[] = "<pre><code>{$this->linkXray($i)}</code></pre>\n";
|
$text[] = "<pre><code>{$this->linkXray($i)}</code></pre>\n";
|
||||||
|
|
||||||
$text[] = "<a href='$scheme://{$domain}/pac$hash?t=s&r=v&s={$c['id']}#{$c['email']}'>import://v2rayng</a>";
|
$text[] = "<a href='$scheme://{$domain}/pac$hash?t=s&r=v&s={$c['id']}#{$c['email']}'>import://v2rayng</a>";
|
||||||
@@ -6443,6 +6446,47 @@ DNS-over-HTTPS with IP:
|
|||||||
return $c['domain'] ?: $this->ip;
|
return $c['domain'] ?: $this->ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sub()
|
||||||
|
{
|
||||||
|
$xr = $this->getXray();
|
||||||
|
$pac = $this->getPacConf();
|
||||||
|
$st = $this->getXrayStats();
|
||||||
|
$domain = $_GET['cdn'] ?: ($_SERVER['SERVER_NAME'] ?: $this->getDomain($pac['transport'] != 'Reality'));
|
||||||
|
$scheme = empty($this->nginxGetTypeCert()) ? 'http' : 'https';
|
||||||
|
$hash = $this->getHashBot();
|
||||||
|
$flag = true;
|
||||||
|
foreach ($xr['inbounds'][0]['settings']['clients'] as $k => $v) {
|
||||||
|
if ($v['id'] == $_GET['id']) {
|
||||||
|
if (empty($v['off'])) {
|
||||||
|
$flag = false;
|
||||||
|
}
|
||||||
|
$uid = $v['id'];
|
||||||
|
$email = $v['email'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$download = $this->getBytes($st['users'][$k]['global']['download'] + $st['users'][$k]['session']['download']);
|
||||||
|
$upload = $this->getBytes($st['users'][$k]['global']['upload'] + $st['users'][$k]['session']['upload']);
|
||||||
|
$singbox = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
|
||||||
|
'h' => $hash,
|
||||||
|
't' => 'si',
|
||||||
|
's' => $uid,
|
||||||
|
]));
|
||||||
|
$xray = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
|
||||||
|
'h' => $hash,
|
||||||
|
't' => 's',
|
||||||
|
's' => $uid,
|
||||||
|
]));
|
||||||
|
$clash = "$scheme://{$domain}/pac$hash/" . base64_encode(serialize([
|
||||||
|
'h' => $hash,
|
||||||
|
't' => 'cl',
|
||||||
|
's' => $uid,
|
||||||
|
]));
|
||||||
|
$vless = $this->linkXray($k);
|
||||||
|
$windows = "$scheme://{$domain}/pac$hash?t=si&r=w&s=$uid";
|
||||||
|
require __DIR__ . '/subscription.php';
|
||||||
|
}
|
||||||
|
|
||||||
public function subscription()
|
public function subscription()
|
||||||
{
|
{
|
||||||
switch ($_GET['t']) {
|
switch ($_GET['t']) {
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ switch (true) {
|
|||||||
echo "/adguard$hash/";
|
echo "/adguard$hash/";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case preg_match('~^' . preg_quote("/pac$hash/sub") . '~', $_SERVER['REQUEST_URI']) && file_exists(__DIR__ . '/subscription.php'):
|
||||||
|
$bot->sub();
|
||||||
|
exit;
|
||||||
|
|
||||||
// subs & pac
|
// subs & pac
|
||||||
case preg_match('~^' . preg_quote("/pac$hash") . '~', $_SERVER['REQUEST_URI']):
|
case preg_match('~^' . preg_quote("/pac$hash") . '~', $_SERVER['REQUEST_URI']):
|
||||||
if (!empty($t = unserialize(base64_decode(explode('/', $_SERVER['REQUEST_URI'])[2])))) { // fix sing-box import
|
if (!empty($t = unserialize(base64_decode(explode('/', $_SERVER['REQUEST_URI'])[2])))) { // fix sing-box import
|
||||||
|
|||||||
Reference in New Issue
Block a user