Merge pull request #521 from betaxab/fix-surge-subs

Protocols: Surge: fix surge & surfboard MANAGED-CONFIG URL
This commit is contained in:
tokumeikoi 2022-04-15 01:07:47 +08:00 committed by GitHub
commit 0bcaf2889a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Client\Protocols; namespace App\Http\Controllers\Client\Protocols;
use App\Utils\Helper;
class Surfboard class Surfboard
{ {
@ -53,7 +54,8 @@ class Surfboard
} }
// Subscription link // Subscription link
$subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token']; $subsHost = Helper::getSubscribeHost();
$subsURL = "{$subsHost}/api/v1/client/subscribe?token={$user['token']}";
$subsDomain = $_SERVER['SERVER_NAME']; $subsDomain = $_SERVER['SERVER_NAME'];
$config = str_replace('$subs_link', $subsURL, $config); $config = str_replace('$subs_link', $subsURL, $config);

View File

@ -2,6 +2,8 @@
namespace App\Http\Controllers\Client\Protocols; namespace App\Http\Controllers\Client\Protocols;
use App\Utils\Helper;
class Surge class Surge
{ {
public $flag = 'surge'; public $flag = 'surge';
@ -52,7 +54,8 @@ class Surge
} }
// Subscription link // Subscription link
$subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token']; $subsHost = Helper::getSubscribeHost();
$subsURL = "{$subsHost}/api/v1/client/subscribe?token={$user['token']}";
$subsDomain = $_SERVER['SERVER_NAME']; $subsDomain = $_SERVER['SERVER_NAME'];
$config = str_replace('$subs_link', $subsURL, $config); $config = str_replace('$subs_link', $subsURL, $config);