no message
parent
7427d3c21e
commit
a2a07d2806
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData">
|
||||
<serverData>
|
||||
<paths name="sspanel">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
</serverData>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="PHARS">
|
||||
<CLASSES>
|
||||
<root url="phar://$MODULE_DIR$/composer.phar/" />
|
||||
<root url="phar://$MODULE_DIR$/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar/" />
|
||||
</CLASSES>
|
||||
<SOURCES>
|
||||
<root url="phar://$MODULE_DIR$/composer.phar/" />
|
||||
<root url="phar://$MODULE_DIR$/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/m.feiyang.li.iml" filepath="$PROJECT_DIR$/.idea/m.feiyang.li.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,125 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ea4d3696-0e14-436a-b7d9-1014e4076b61" name="Default" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="-8" />
|
||||
<option name="y" value="-8" />
|
||||
<option name="width" value="1936" />
|
||||
<option name="height" value="1066" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="m.feiyang.li" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="m.feiyang.li" />
|
||||
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
<pane id="Scratches" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="ea4d3696-0e14-436a-b7d9-1014e4076b61" name="Default" comment="" />
|
||||
<created>1497075041330</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1497075041330</updated>
|
||||
<workItem from="1497075045768" duration="671000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="671000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-8" y="-8" width="1936" height="1066" extended-state="7" />
|
||||
<layout>
|
||||
<window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="processedProjectFiles" value="true" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,383 @@
|
||||
<?php
|
||||
|
||||
namespace App\Utils;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Node;
|
||||
use App\Models\Relay;
|
||||
use App\Services\Config;
|
||||
|
||||
class URL
|
||||
{
|
||||
/*
|
||||
* 1 SSR can
|
||||
* 2 SS can
|
||||
* 3 Both can
|
||||
*/
|
||||
public static function CanMethodConnect($method) {
|
||||
$ss_aead_method_list = Config::getSupportParam('ss_aead_method');
|
||||
if(in_array($method, $ss_aead_method_list)) {
|
||||
return 2;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1 SSR can
|
||||
* 2 SS can
|
||||
* 3 Both can
|
||||
*/
|
||||
public static function CanProtocolConnect($protocol) {
|
||||
if($protocol != 'origin') {
|
||||
if(strpos($protocol, '_compatible') === FALSE) {
|
||||
return 1;
|
||||
}else{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1 SSR can
|
||||
* 2 SS can
|
||||
* 3 Both can
|
||||
* 4 Both can, But ssr need set obfs to plain
|
||||
* 5 Both can, But ss need set obfs to plain
|
||||
*/
|
||||
public static function CanObfsConnect($obfs) {
|
||||
if($obfs != 'plain') {
|
||||
//SS obfs only
|
||||
$ss_obfs = Config::getSupportParam('ss_obfs');
|
||||
if(in_array($obfs, $ss_obfs)) {
|
||||
if(strpos($obfs, '_compatible') === FALSE) {
|
||||
return 2;
|
||||
}else{
|
||||
return 4;//SSR need origin plain
|
||||
}
|
||||
}else{
|
||||
//SSR obfs only
|
||||
if(strpos($obfs, '_compatible') === FALSE) {
|
||||
return 1;
|
||||
}else{
|
||||
return 5;//SS need plain
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function SSCanConnect($user, $mu_port = 0) {
|
||||
if($mu_port != 0) {
|
||||
$mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
|
||||
|
||||
if ($mu_user == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
return URL::SSCanConnect($mu_user);
|
||||
}
|
||||
|
||||
if(URL::CanMethodConnect($user->method) >= 2 && URL::CanProtocolConnect($user->protocol) >= 2 && URL::CanObfsConnect($user->obfs) >= 2) {
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function SSRCanConnect($user, $mu_port = 0) {
|
||||
if($mu_port != 0) {
|
||||
$mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
|
||||
|
||||
if ($mu_user == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
return URL::SSRCanConnect($mu_user);
|
||||
}
|
||||
|
||||
if(URL::CanMethodConnect($user->method) != 2 && URL::CanProtocolConnect($user->protocol) != 2 && URL::CanObfsConnect($user->obfs) != 2) {
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSSConnectInfo($user) {
|
||||
$new_user = clone $user;
|
||||
if(URL::CanObfsConnect($new_user->obfs) == 5) {
|
||||
$new_user->obfs = 'plain';
|
||||
$new_user->obfs_param = '';
|
||||
}
|
||||
|
||||
if(URL::CanProtocolConnect($new_user->protocol) == 3) {
|
||||
$new_user->protocol = 'origin';
|
||||
$new_user->protocol_param = '';
|
||||
}
|
||||
|
||||
$new_user->obfs = str_replace("_compatible", "", $new_user->obfs);
|
||||
$new_user->protocol = str_replace("_compatible", "", $new_user->protocol);
|
||||
|
||||
return $new_user;
|
||||
}
|
||||
|
||||
public static function getSSRConnectInfo($user) {
|
||||
$new_user = clone $user;
|
||||
if(URL::CanObfsConnect($new_user->obfs) == 4) {
|
||||
$new_user->obfs = 'plain';
|
||||
$new_user->obfs_param = '';
|
||||
}
|
||||
|
||||
$new_user->obfs = str_replace("_compatible", "", $new_user->obfs);
|
||||
$new_user->protocol = str_replace("_compatible", "", $new_user->protocol);
|
||||
|
||||
return $new_user;
|
||||
}
|
||||
|
||||
public static function getAllItems($user, $is_mu = 0, $is_ss = 0) {
|
||||
$return_array = array();
|
||||
if ($user->is_admin) {
|
||||
$nodes=Node::where(
|
||||
function ($query) {
|
||||
$query->where('sort', 0)
|
||||
->orwhere('sort', 10);
|
||||
}
|
||||
)->where("type", "1")->orderBy("name")->get();
|
||||
} else {
|
||||
$nodes=Node::where(
|
||||
function ($query) {
|
||||
$query->where('sort', 0)
|
||||
->orwhere('sort', 10);
|
||||
}
|
||||
)->where(
|
||||
function ($query) use ($user){
|
||||
$query->where("node_group", "=", $user->node_group)
|
||||
->orWhere("node_group", "=", 0);
|
||||
}
|
||||
)->where("type", "1")->where("node_class", "<=", $user->class)->orderBy("name")->get();
|
||||
}
|
||||
|
||||
if($is_mu) {
|
||||
if ($user->is_admin) {
|
||||
$mu_nodes = Node::where('sort', 9)->where("type", "1")->get();
|
||||
} else {
|
||||
$mu_nodes = Node::where('sort', 9)->where('node_class', '<=', $user->class)->where("type", "1")->where(
|
||||
function ($query) use ($user) {
|
||||
$query->where("node_group", "=", $user->node_group)
|
||||
->orWhere("node_group", "=", 0);
|
||||
}
|
||||
)->get();
|
||||
}
|
||||
}
|
||||
|
||||
$relay_rules = Relay::where('user_id', $user->id)->orwhere('user_id', 0)->orderBy('id', 'asc')->get();
|
||||
|
||||
if (!Tools::is_protocol_relay($user)) {
|
||||
$relay_rules = array();
|
||||
}
|
||||
|
||||
foreach ($nodes as $node) {
|
||||
if ($node->mu_only != 1 && $is_mu == 0) {
|
||||
if ($node->sort == 10) {
|
||||
$relay_rule_id = 0;
|
||||
|
||||
$relay_rule = Tools::pick_out_relay_rule($node->id, $user->port, $relay_rules);
|
||||
|
||||
if ($relay_rule != null) {
|
||||
if ($relay_rule->dist_node() != null) {
|
||||
$relay_rule_id = $relay_rule->id;
|
||||
}
|
||||
}
|
||||
|
||||
$item = URL::getItem($user, $node, 0, $relay_rule_id, $is_ss);
|
||||
if($item != null) {
|
||||
array_push($return_array, $item);
|
||||
}
|
||||
}else{
|
||||
$item = URL::getItem($user, $node, 0, 0, $is_ss);
|
||||
if($item != null) {
|
||||
array_push($return_array, $item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($node->custom_rss == 1 && $node->mu_only != -1 && $is_mu == 1) {
|
||||
foreach ($mu_nodes as $mu_node) {
|
||||
if ($node->sort == 10) {
|
||||
$relay_rule_id = 0;
|
||||
|
||||
$relay_rule = Tools::pick_out_relay_rule($node->id, $mu_node->server, $relay_rules);
|
||||
|
||||
if ($relay_rule != null) {
|
||||
if ($relay_rule->dist_node() != null) {
|
||||
$relay_rule_id = $relay_rule->id;
|
||||
}
|
||||
}
|
||||
|
||||
$item = URL::getItem($user, $node, $mu_node->server, $relay_rule_id, $is_ss);
|
||||
if($item != null) {
|
||||
array_push($return_array, $item);
|
||||
}
|
||||
}else{
|
||||
$item = URL::getItem($user, $node, $mu_node->server, 0, $is_ss);
|
||||
if($item != null) {
|
||||
array_push($return_array, $item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
public static function getAllUrl($user, $is_mu, $is_ss = 0, $enter = 0) {
|
||||
$items = URL::getAllItems($user, $is_mu, $is_ss);
|
||||
$return_url = '';
|
||||
foreach($items as $item) {
|
||||
$return_url .= URL::getItemUrl($item, $is_ss).($enter == 0 ? ' ' : "\n");
|
||||
}
|
||||
return $return_url;
|
||||
}
|
||||
|
||||
public static function getItemUrl($item, $is_ss) {
|
||||
$ss_obfs_list = Config::getSupportParam('ss_obfs');
|
||||
|
||||
if(!$is_ss) {
|
||||
$ssurl = $item['address'].":".$item['port'].":".$item['protocol'].":".$item['method'].":".$item['obfs'].":".Tools::base64_url_encode($item['passwd'])."/?obfsparam=".Tools::base64_url_encode($item['obfs_param'])."&protoparam=".Tools::base64_url_encode($item['protocol_param'])."&remarks=".Tools::base64_url_encode($item['remark'])."&group=".Tools::base64_url_encode(Config::get('appName'));
|
||||
return "ssr://".Tools::base64_url_encode($ssurl);
|
||||
} else {
|
||||
if($is_ss == 2) {
|
||||
$personal_info = $item['method'].':'.$item['passwd']."@".$item['address'].":".$item['port'];
|
||||
$ssurl = "ss://".Tools::base64_url_encode($personal_info);
|
||||
|
||||
$ssurl .= "#".rawurlencode(Config::get('appName')." - ".$item['remark']);
|
||||
}else{
|
||||
$personal_info = $item['method'].':'.$item['passwd'];
|
||||
$ssurl = "ss://".Tools::base64_url_encode($personal_info)."@".$item['address'].":".$item['port'];
|
||||
|
||||
if(in_array($item['obfs'], $ss_obfs_list)) {
|
||||
if(strpos($item['obfs'], 'http') !== FALSE) {
|
||||
$ssurl .= "?plugin=obfs-local%3Bobfs%3Dhttp";
|
||||
} else {
|
||||
$ssurl .= "?plugin=obfs-local%3Bobfs%3Dtls";
|
||||
}
|
||||
}
|
||||
|
||||
$ssurl .= "#".rawurlencode(Config::get('appName')." - ".$item['remark']);
|
||||
}
|
||||
return $ssurl;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getJsonObfs($item) {
|
||||
$ss_obfs_list = Config::getSupportParam('ss_obfs');
|
||||
$plugin = "";
|
||||
if(in_array($item['obfs'], $ss_obfs_list)) {
|
||||
if(strpos($item['obfs'], 'http') !== FALSE) {
|
||||
$plugin .= "obfs-local --obfs http";
|
||||
} else {
|
||||
$plugin .= "obfs-local --obfs tls";
|
||||
}
|
||||
|
||||
if($item['obfs_param'] != '') {
|
||||
$plugin .= "--obfs-host ".$item['obfs_param'];
|
||||
}
|
||||
}
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
|
||||
public static function getSurgeObfs($item) {
|
||||
$ss_obfs_list = Config::getSupportParam('ss_obfs');
|
||||
$plugin = "";
|
||||
if(in_array($item['obfs'], $ss_obfs_list)) {
|
||||
if(strpos($item['obfs'], 'http') !== FALSE) {
|
||||
$plugin .= ",obfs=http";
|
||||
} else {
|
||||
$plugin .= ",obfs=tls";
|
||||
}
|
||||
|
||||
if($item['obfs_param'] != '') {
|
||||
$plugin .= ",obfs-host=".$item['obfs_param'];
|
||||
}
|
||||
}
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
|
||||
/*
|
||||
* Conn info
|
||||
* address
|
||||
* port
|
||||
* passwd
|
||||
* method
|
||||
* remark
|
||||
* protocol
|
||||
* protocol_param
|
||||
* obfs
|
||||
* obfs_param
|
||||
*/
|
||||
|
||||
public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0) {
|
||||
$relay_rule = Relay::where('id', $relay_rule_id)->where(
|
||||
function ($query) use ($user) {
|
||||
$query->Where("user_id", "=", $user->id)
|
||||
->orWhere("user_id", "=", 0);
|
||||
}
|
||||
)->first();
|
||||
|
||||
$node_name = $node->name;
|
||||
|
||||
if ($relay_rule != null) {
|
||||
$node_name .= " - ".$relay_rule->dist_node()->name;
|
||||
}
|
||||
|
||||
if($mu_port != 0) {
|
||||
$mu_user = User::where('port', '=', $mu_port)->where("is_multi_user", "<>", 0)->first();
|
||||
|
||||
if ($mu_user == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$mu_user->obfs_param = $user->getMuMd5();
|
||||
$mu_user->protocol_param = $user->id.":".$user->passwd;
|
||||
|
||||
$user = $mu_user;
|
||||
|
||||
$node_name .= " - ".$mu_port." 端口单端口多用户";
|
||||
}
|
||||
|
||||
if($is_ss) {
|
||||
if(!URL::SSCanConnect($user)) {
|
||||
return;
|
||||
}
|
||||
$user = URL::getSSConnectInfo($user);
|
||||
}else{
|
||||
if(!URL::SSRCanConnect($user)) {
|
||||
return;
|
||||
}
|
||||
$user = URL::getSSRConnectInfo($user);
|
||||
}
|
||||
|
||||
$return_array['address'] = $node->server;
|
||||
$return_array['port'] = $user->port;
|
||||
$return_array['passwd'] = $user->passwd;
|
||||
$return_array['method'] = $user->method;
|
||||
$return_array['remark'] = $node_name;
|
||||
$return_array['protocol'] = $user->protocol;
|
||||
$return_array['protocol_param'] = $user->protocol_param;
|
||||
$return_array['obfs'] = $user->obfs;
|
||||
$return_array['obfs_param'] = $user->obfs_param;
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
public static function cloneUser($user) {
|
||||
$new_user = clone $user;
|
||||
return $new_user;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,903 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 4.4.15.6
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: 2017-05-26 20:29:46
|
||||
-- 服务器版本: 5.5.48-log
|
||||
-- PHP Version: 7.0.7
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- Database: `sspanel`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `alive_ip`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `alive_ip` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`nodeid` int(11) NOT NULL,
|
||||
`userid` int(11) NOT NULL,
|
||||
`ip` text NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `announcement`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `announcement` (
|
||||
`id` int(11) NOT NULL,
|
||||
`date` datetime NOT NULL,
|
||||
`content` longtext NOT NULL,
|
||||
`markdown` longtext NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `auto`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `auto` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`type` int(11) NOT NULL,
|
||||
`value` longtext NOT NULL,
|
||||
`sign` longtext NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `blockip`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `blockip` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`nodeid` int(11) NOT NULL,
|
||||
`ip` text NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `bought`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `bought` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`shopid` bigint(20) NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL,
|
||||
`renew` bigint(11) NOT NULL,
|
||||
`coupon` text NOT NULL,
|
||||
`price` decimal(12,2) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `code`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `code` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`code` text NOT NULL,
|
||||
`type` int(11) NOT NULL,
|
||||
`number` decimal(11,2) NOT NULL,
|
||||
`isused` int(11) NOT NULL DEFAULT '0',
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`usedatetime` datetime NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `coupon`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `coupon` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`code` text NOT NULL,
|
||||
`onetime` int(11) NOT NULL,
|
||||
`expire` bigint(20) NOT NULL,
|
||||
`shop` text NOT NULL,
|
||||
`credit` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `detect_list`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `detect_list` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`name` longtext NOT NULL,
|
||||
`text` longtext NOT NULL,
|
||||
`regex` longtext NOT NULL,
|
||||
`type` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `detect_log`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `detect_log` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
`list_id` bigint(20) NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL,
|
||||
`node_id` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `disconnect_ip`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `disconnect_ip` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`ip` text NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `email_verify`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `email_verify` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`ip` text NOT NULL,
|
||||
`code` text NOT NULL,
|
||||
`expire_in` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `link`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `link` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`type` int(11) NOT NULL,
|
||||
`address` text NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
`token` text NOT NULL,
|
||||
`ios` int(11) NOT NULL DEFAULT '0',
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`isp` text,
|
||||
`geo` int(11) DEFAULT NULL,
|
||||
`method` text
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- 转存表中的数据 `link`
|
||||
--
|
||||
|
||||
INSERT INTO `link` (`id`, `type`, `address`, `port`, `token`, `ios`, `userid`, `isp`, `geo`, `method`) VALUES
|
||||
(1, -1, 'smart', 0, 'uqLssejxwrnwpMj7', 1, 1, NULL, 0, 'smart'),
|
||||
(2, 9, 'smart', 0, '7d7VqbO3kDPeXyOq', 0, 1, NULL, 0, 'smart'),
|
||||
(3, 10, '', 0, 'SLXNV6TKViEvIkV7', 0, 1, NULL, 0, ''),
|
||||
(4, 10, '', 0, 'tyMNIMkJiSZCRwbz', 0, 1, NULL, 1, '');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `login_ip`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `login_ip` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`ip` text NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL,
|
||||
`type` int(11) NOT NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- 转存表中的数据 `login_ip`
|
||||
--
|
||||
|
||||
INSERT INTO `login_ip` (`id`, `userid`, `ip`, `datetime`, `type`) VALUES
|
||||
(1, 1, '211.86.158.21', 1495801576, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `payback`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `payback` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`total` decimal(12,2) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`ref_by` bigint(20) NOT NULL,
|
||||
`ref_get` decimal(12,2) NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `paylist`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paylist` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`total` decimal(12,2) NOT NULL,
|
||||
`status` int(11) NOT NULL DEFAULT '0',
|
||||
`tradeno` text,
|
||||
`datetime` bigint(20) NOT NULL DEFAULT '0'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `radius_ban`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `radius_ban` (
|
||||
`id` int(11) NOT NULL,
|
||||
`userid` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `relay`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `relay` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
`source_node_id` bigint(20) NOT NULL,
|
||||
`dist_node_id` bigint(20) NOT NULL,
|
||||
`dist_ip` text NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
`priority` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `shop`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `shop` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`price` decimal(12,2) NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
`auto_renew` int(11) NOT NULL,
|
||||
`auto_reset_bandwidth` int(11) NOT NULL DEFAULT '0',
|
||||
`status` int(11) NOT NULL DEFAULT '1'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `speedtest`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `speedtest` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`nodeid` int(11) NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL,
|
||||
`telecomping` text NOT NULL,
|
||||
`telecomeupload` text NOT NULL,
|
||||
`telecomedownload` text NOT NULL,
|
||||
`unicomping` text NOT NULL,
|
||||
`unicomupload` text NOT NULL,
|
||||
`unicomdownload` text NOT NULL,
|
||||
`cmccping` text NOT NULL,
|
||||
`cmccupload` text NOT NULL,
|
||||
`cmccdownload` text NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `ss_invite_code`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ss_invite_code` (
|
||||
`id` int(11) NOT NULL,
|
||||
`code` varchar(128) NOT NULL,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`updated_at` timestamp NOT NULL DEFAULT '2016-06-01 00:00:00'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `ss_node`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ss_node` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(128) NOT NULL,
|
||||
`type` int(3) NOT NULL,
|
||||
`server` varchar(128) NOT NULL,
|
||||
`method` varchar(64) NOT NULL,
|
||||
`info` varchar(128) NOT NULL,
|
||||
`status` varchar(128) NOT NULL,
|
||||
`sort` int(3) NOT NULL,
|
||||
`custom_method` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`traffic_rate` float NOT NULL DEFAULT '1',
|
||||
`node_class` int(11) NOT NULL DEFAULT '0',
|
||||
`node_speedlimit` decimal(12,2) NOT NULL DEFAULT '0.00',
|
||||
`node_connector` int(11) NOT NULL DEFAULT '0',
|
||||
`node_bandwidth` bigint(20) NOT NULL DEFAULT '0',
|
||||
`node_bandwidth_limit` bigint(20) NOT NULL DEFAULT '0',
|
||||
`bandwidthlimit_resetday` int(11) NOT NULL DEFAULT '0',
|
||||
`node_heartbeat` bigint(20) NOT NULL DEFAULT '0',
|
||||
`node_ip` text,
|
||||
`node_group` int(11) NOT NULL DEFAULT '0',
|
||||
`custom_rss` int(11) NOT NULL DEFAULT '0',
|
||||
`mu_only` int(11) DEFAULT '0'
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
--
|
||||
-- 转存表中的数据 `ss_node`
|
||||
--
|
||||
|
||||
INSERT INTO `ss_node` (`id`, `name`, `type`, `server`, `method`, `info`, `status`, `sort`, `custom_method`, `traffic_rate`, `node_class`, `node_speedlimit`, `node_connector`, `node_bandwidth`, `node_bandwidth_limit`, `bandwidthlimit_resetday`, `node_heartbeat`, `node_ip`, `node_group`, `custom_rss`, `mu_only`) VALUES
|
||||
(1, '统一验证登陆', 0, 'zhaojin97.cn', 'radius', '统一登陆验证', '可用', 999, 0, 1, 0, '0.00', 0, 0, 0, 0, 0, '', 0, 0, 0),
|
||||
(2, 'VPN 统一流量结算', 0, 'zhaojin97.cn', 'radius', 'VPN 统一流量结算', '可用', 999, 0, 1, 0, '0.00', 0, 0, 0, 0, 0, NULL, 0, 0, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `ss_node_info`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ss_node_info` (
|
||||
`id` int(11) NOT NULL,
|
||||
`node_id` int(11) NOT NULL,
|
||||
`uptime` float NOT NULL,
|
||||
`load` varchar(32) NOT NULL,
|
||||
`log_time` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `ss_node_online_log`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ss_node_online_log` (
|
||||
`id` int(11) NOT NULL,
|
||||
`node_id` int(11) NOT NULL,
|
||||
`online_user` int(11) NOT NULL,
|
||||
`log_time` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `ss_password_reset`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ss_password_reset` (
|
||||
`id` int(11) NOT NULL,
|
||||
`email` varchar(32) NOT NULL,
|
||||
`token` varchar(128) NOT NULL,
|
||||
`init_time` int(11) NOT NULL,
|
||||
`expire_time` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `telegram_session`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `telegram_session` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
`type` int(11) NOT NULL,
|
||||
`session_content` text NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `ticket`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ticket` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`title` longtext NOT NULL,
|
||||
`content` longtext NOT NULL,
|
||||
`rootid` bigint(20) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL,
|
||||
`status` int(11) NOT NULL DEFAULT '1'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `unblockip`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `unblockip` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`ip` text NOT NULL,
|
||||
`datetime` bigint(20) NOT NULL,
|
||||
`userid` bigint(20) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `user`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `user` (
|
||||
`id` int(11) NOT NULL,
|
||||
`user_name` varchar(128) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`email` varchar(32) NOT NULL,
|
||||
`pass` varchar(64) NOT NULL,
|
||||
`passwd` varchar(16) NOT NULL,
|
||||
`t` int(11) NOT NULL DEFAULT '0',
|
||||
`u` bigint(20) NOT NULL,
|
||||
`d` bigint(20) NOT NULL,
|
||||
`plan` varchar(2) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'A',
|
||||
`transfer_enable` bigint(20) NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
`switch` tinyint(4) NOT NULL DEFAULT '1',
|
||||
`enable` tinyint(4) NOT NULL DEFAULT '1',
|
||||
`type` tinyint(4) NOT NULL DEFAULT '1',
|
||||
`last_get_gift_time` int(11) NOT NULL DEFAULT '0',
|
||||
`last_check_in_time` int(11) NOT NULL DEFAULT '0',
|
||||
`last_rest_pass_time` int(11) NOT NULL DEFAULT '0',
|
||||
`reg_date` datetime NOT NULL,
|
||||
`invite_num` int(8) NOT NULL,
|
||||
`money` decimal(12,2) NOT NULL,
|
||||
`ref_by` int(11) NOT NULL DEFAULT '0',
|
||||
`expire_time` int(11) NOT NULL DEFAULT '0',
|
||||
`method` varchar(64) NOT NULL DEFAULT 'rc4-md5',
|
||||
`is_email_verify` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`reg_ip` varchar(128) NOT NULL DEFAULT '127.0.0.1',
|
||||
`node_speedlimit` decimal(12,2) NOT NULL DEFAULT '0.00',
|
||||
`node_connector` int(11) NOT NULL DEFAULT '0',
|
||||
`is_admin` int(2) NOT NULL DEFAULT '0',
|
||||
`im_type` int(11) DEFAULT '1',
|
||||
`im_value` text,
|
||||
`last_day_t` bigint(20) NOT NULL DEFAULT '0',
|
||||
`sendDailyMail` int(11) NOT NULL DEFAULT '1',
|
||||
`class` int(11) NOT NULL DEFAULT '0',
|
||||
`class_expire` datetime NOT NULL DEFAULT '1989-06-04 00:05:00',
|
||||
`expire_in` datetime NOT NULL DEFAULT '2099-06-04 00:05:00',
|
||||
`theme` text NOT NULL,
|
||||
`ga_token` text NOT NULL,
|
||||
`ga_enable` int(11) NOT NULL DEFAULT '0',
|
||||
`pac` longtext,
|
||||
`remark` text,
|
||||
`node_group` int(11) NOT NULL DEFAULT '0',
|
||||
`auto_reset_day` int(11) NOT NULL DEFAULT '0',
|
||||
`auto_reset_bandwidth` decimal(12,2) NOT NULL DEFAULT '0.00',
|
||||
`protocol` varchar(128) DEFAULT 'origin',
|
||||
`protocol_param` varchar(128) DEFAULT NULL,
|
||||
`obfs` varchar(128) DEFAULT 'plain',
|
||||
`obfs_param` varchar(128) DEFAULT NULL,
|
||||
`forbidden_ip` longtext,
|
||||
`forbidden_port` longtext,
|
||||
`disconnect_ip` longtext,
|
||||
`is_hide` int(11) NOT NULL DEFAULT '0',
|
||||
`is_multi_user` int(11) NOT NULL DEFAULT '0',
|
||||
`telegram_id` bigint(20) DEFAULT NULL
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- 转存表中的数据 `user`
|
||||
--
|
||||
|
||||
INSERT INTO `user` (`id`, `user_name`, `email`, `pass`, `passwd`, `t`, `u`, `d`, `plan`, `transfer_enable`, `port`, `switch`, `enable`, `type`, `last_get_gift_time`, `last_check_in_time`, `last_rest_pass_time`, `reg_date`, `invite_num`, `money`, `ref_by`, `expire_time`, `method`, `is_email_verify`, `reg_ip`, `node_speedlimit`, `node_connector`, `is_admin`, `im_type`, `im_value`, `last_day_t`, `sendDailyMail`, `class`, `class_expire`, `expire_in`, `theme`, `ga_token`, `ga_enable`, `pac`, `remark`, `node_group`, `auto_reset_day`, `auto_reset_bandwidth`, `protocol`, `protocol_param`, `obfs`, `obfs_param`, `forbidden_ip`, `forbidden_port`, `disconnect_ip`, `is_hide`, `is_multi_user`, `telegram_id`) VALUES
|
||||
(1, 'admin', 'ss@feiyang.li', '25f5e13433dccbb8d6eb680c4ac831ec6a0cd1d6c4bc8f68f11e7cd328dbc6fc', 'nHHpgf', 0, 0, 0, 'A', 107374182400, 1025, 1, 1, 1, 0, 0, 0, '2017-05-26 20:04:42', 0, '0.00', 0, 0, 'rc4-md5', 0, '127.0.0.1', '0.00', 0, 1, 1, '', 0, 1, 0, '1989-06-04 00:05:00', '2291-03-10 20:04:42', 'material', '2TFGSYHQ3FJLZSWX', 0, NULL, NULL, 0, 0, '0.00', 'origin', NULL, 'plain', NULL, NULL, NULL, NULL, 0, 0, NULL);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `user_token`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `user_token` (
|
||||
`id` int(11) NOT NULL,
|
||||
`token` varchar(256) NOT NULL,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`create_time` int(11) NOT NULL,
|
||||
`expire_time` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- 表的结构 `user_traffic_log`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `user_traffic_log` (
|
||||
`id` int(11) NOT NULL,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`u` bigint(20) NOT NULL,
|
||||
`d` bigint(20) NOT NULL,
|
||||
`node_id` int(11) NOT NULL,
|
||||
`rate` float NOT NULL,
|
||||
`traffic` varchar(32) NOT NULL,
|
||||
`log_time` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Indexes for table `alive_ip`
|
||||
--
|
||||
ALTER TABLE `alive_ip`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `announcement`
|
||||
--
|
||||
ALTER TABLE `announcement`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `auto`
|
||||
--
|
||||
ALTER TABLE `auto`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `blockip`
|
||||
--
|
||||
ALTER TABLE `blockip`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `bought`
|
||||
--
|
||||
ALTER TABLE `bought`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `code`
|
||||
--
|
||||
ALTER TABLE `code`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `coupon`
|
||||
--
|
||||
ALTER TABLE `coupon`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `detect_list`
|
||||
--
|
||||
ALTER TABLE `detect_list`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `detect_log`
|
||||
--
|
||||
ALTER TABLE `detect_log`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `disconnect_ip`
|
||||
--
|
||||
ALTER TABLE `disconnect_ip`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `email_verify`
|
||||
--
|
||||
ALTER TABLE `email_verify`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `link`
|
||||
--
|
||||
ALTER TABLE `link`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `login_ip`
|
||||
--
|
||||
ALTER TABLE `login_ip`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `payback`
|
||||
--
|
||||
ALTER TABLE `payback`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `paylist`
|
||||
--
|
||||
ALTER TABLE `paylist`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `radius_ban`
|
||||
--
|
||||
ALTER TABLE `radius_ban`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `relay`
|
||||
--
|
||||
ALTER TABLE `relay`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `shop`
|
||||
--
|
||||
ALTER TABLE `shop`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `speedtest`
|
||||
--
|
||||
ALTER TABLE `speedtest`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `ss_invite_code`
|
||||
--
|
||||
ALTER TABLE `ss_invite_code`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `user_id` (`user_id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `ss_node`
|
||||
--
|
||||
ALTER TABLE `ss_node`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `ss_node_info`
|
||||
--
|
||||
ALTER TABLE `ss_node_info`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `ss_node_online_log`
|
||||
--
|
||||
ALTER TABLE `ss_node_online_log`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `ss_password_reset`
|
||||
--
|
||||
ALTER TABLE `ss_password_reset`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `telegram_session`
|
||||
--
|
||||
ALTER TABLE `telegram_session`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `ticket`
|
||||
--
|
||||
ALTER TABLE `ticket`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `unblockip`
|
||||
--
|
||||
ALTER TABLE `unblockip`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `user`
|
||||
--
|
||||
ALTER TABLE `user`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `user_name` (`user_name`),
|
||||
ADD KEY `uid` (`id`),
|
||||
ADD KEY `email` (`email`);
|
||||
|
||||
--
|
||||
-- Indexes for table `user_token`
|
||||
--
|
||||
ALTER TABLE `user_token`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `user_traffic_log`
|
||||
--
|
||||
ALTER TABLE `user_traffic_log`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `alive_ip`
|
||||
--
|
||||
ALTER TABLE `alive_ip`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `announcement`
|
||||
--
|
||||
ALTER TABLE `announcement`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `auto`
|
||||
--
|
||||
ALTER TABLE `auto`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `blockip`
|
||||
--
|
||||
ALTER TABLE `blockip`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `bought`
|
||||
--
|
||||
ALTER TABLE `bought`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `code`
|
||||
--
|
||||
ALTER TABLE `code`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `coupon`
|
||||
--
|
||||
ALTER TABLE `coupon`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `detect_list`
|
||||
--
|
||||
ALTER TABLE `detect_list`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `detect_log`
|
||||
--
|
||||
ALTER TABLE `detect_log`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `disconnect_ip`
|
||||
--
|
||||
ALTER TABLE `disconnect_ip`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `email_verify`
|
||||
--
|
||||
ALTER TABLE `email_verify`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `link`
|
||||
--
|
||||
ALTER TABLE `link`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `login_ip`
|
||||
--
|
||||
ALTER TABLE `login_ip`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `payback`
|
||||
--
|
||||
ALTER TABLE `payback`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `paylist`
|
||||
--
|
||||
ALTER TABLE `paylist`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `radius_ban`
|
||||
--
|
||||
ALTER TABLE `radius_ban`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `relay`
|
||||
--
|
||||
ALTER TABLE `relay`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `shop`
|
||||
--
|
||||
ALTER TABLE `shop`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `speedtest`
|
||||
--
|
||||
ALTER TABLE `speedtest`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `ss_invite_code`
|
||||
--
|
||||
ALTER TABLE `ss_invite_code`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `ss_node`
|
||||
--
|
||||
ALTER TABLE `ss_node`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `ss_node_info`
|
||||
--
|
||||
ALTER TABLE `ss_node_info`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `ss_node_online_log`
|
||||
--
|
||||
ALTER TABLE `ss_node_online_log`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `ss_password_reset`
|
||||
--
|
||||
ALTER TABLE `ss_password_reset`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `telegram_session`
|
||||
--
|
||||
ALTER TABLE `telegram_session`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `ticket`
|
||||
--
|
||||
ALTER TABLE `ticket`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `unblockip`
|
||||
--
|
||||
ALTER TABLE `unblockip`
|
||||
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `user`
|
||||
--
|
||||
ALTER TABLE `user`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `user_token`
|
||||
--
|
||||
ALTER TABLE `user_token`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
--
|
||||
-- AUTO_INCREMENT for table `user_traffic_log`
|
||||
--
|
||||
ALTER TABLE `user_traffic_log`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
Loading…
Reference in New Issue