Browse Source

移除 Radius 功能

從此 commit 開始,SSPanel-UIM 將不再支持以下節點的配置:
1. VPN
2. SSH
3. AnyConnect
兩足大貓貓 4 years ago
parent
commit
adfaa8d147

+ 1 - 3
.gitignore

@@ -35,6 +35,4 @@ storage/*.*
 .user.ini
 public/.user.ini
 
-resources/views/material/analytics.tpl
-
-test/tpl_files.txt
+resources/views/material/analytics.tpl

+ 0 - 1
composer.json

@@ -5,7 +5,6 @@
         "ext-mysqli": "*",
         "ext-xml": "*",
         "aws/aws-sdk-php": "3.*",
-        "chen-see/chen-pay": "^1.0@dev",
         "cloudflare/sdk": "1.1.1",
         "esdeathlove/datatables": "^1.6",
         "firebase/php-jwt": "~3.0",

+ 0 - 8
config/.config.example.php

@@ -490,14 +490,6 @@ $_ENV['redis_port']             = 6379;
 $_ENV['redis_database']         = '';
 $_ENV['redis_password']         = '';
 
-#Radius设置
-$_ENV['enable_radius']          = false;            //是否开启Radius
-$_ENV['radius_db_host']         = '';               //以下4项为Radius数据库设置
-$_ENV['radius_db_database']     = '';
-$_ENV['radius_db_user']         = '';
-$_ENV['radius_db_password']     = '';
-$_ENV['radius_secret']          = '';               //Radius连接密钥
-
 #Cloudflare
 $_ENV['cloudflare_enable']      = false;         //是否开启 Cloudflare 解析
 $_ENV['cloudflare_email']       = '';            //Cloudflare 邮箱地址

+ 0 - 182
resources/email/password/vpn.tpl

@@ -1,182 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-<head>
-    <meta name="viewport" content="width=device-width"/>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>Billing e.g. invoices and receipts</title>
-
-
-    <style type="text/css">
-        img {
-            max-width: 100%;
-        }
-
-        body {
-            -webkit-font-smoothing: antialiased;
-            -webkit-text-size-adjust: none;
-            width: 100% !important;
-            height: 100%;
-            line-height: 1.6em;
-        }
-
-        body {
-            background-color: #f6f6f6;
-        }
-
-        @media only screen and (max-width: 640px) {
-            body {
-                padding: 0 !important;
-            }
-
-            h1 {
-                font-weight: 800 !important;
-                margin: 20px 0 5px !important;
-            }
-
-            h2 {
-                font-weight: 800 !important;
-                margin: 20px 0 5px !important;
-            }
-
-            h3 {
-                font-weight: 800 !important;
-                margin: 20px 0 5px !important;
-            }
-
-            h4 {
-                font-weight: 800 !important;
-                margin: 20px 0 5px !important;
-            }
-
-            h1 {
-                font-size: 22px !important;
-            }
-
-            h2 {
-                font-size: 18px !important;
-            }
-
-            h3 {
-                font-size: 16px !important;
-            }
-
-            .container {
-                padding: 0 !important;
-                width: 100% !important;
-            }
-
-            .content {
-                padding: 0 !important;
-            }
-
-            .content-wrap {
-                padding: 10px !important;
-            }
-
-            .invoice {
-                width: 100% !important;
-            }
-        }
-    </style>
-</head>
-
-<body itemscope itemtype="http://schema.org/EmailMessage"
-      style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;"
-      bgcolor="#f6f6f6">
-
-<table class="body-wrap"
-       style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;"
-       bgcolor="#f6f6f6">
-    <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-        <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;"
-            valign="top"></td>
-        <td class="container" width="600"
-            style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;"
-            valign="top">
-            <div class="content"
-                 style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
-                <table class="main" width="100%" cellpadding="0" cellspacing="0"
-                       style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;"
-                       bgcolor="#fff">
-                    <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                        <td class="content-wrap aligncenter"
-                            style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: center; margin: 0; padding: 20px;"
-                            align="center" valign="top">
-                            <table width="100%" cellpadding="0" cellspacing="0"
-                                   style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                    <td class="content-block"
-                                        style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
-                                        valign="top">
-                                        <h1 class="aligncenter"
-                                            style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; box-sizing: border-box; font-size: 32px; color: #000; line-height: 1.2em; font-weight: 500; text-align: center; margin: 40px 0 0;"
-                                            align="center">{$config['appName']}</h1>
-                                    </td>
-                                </tr>
-                                <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                    <td class="content-block"
-                                        style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
-                                        valign="top">
-                                        <h2 class="aligncenter"
-                                            style="font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; box-sizing: border-box; font-size: 24px; color: #000; line-height: 1.2em; font-weight: 400; text-align: center; margin: 40px 0 0;"
-                                            align="center">密码更新通知</h2>
-                                    </td>
-                                </tr>
-                                <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                    <td class="content-block aligncenter"
-                                        style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: center; margin: 0; padding: 0 0 20px;"
-                                        align="center" valign="top">
-                                        <table class="invoice"
-                                               style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; text-align: left; width: 80%; margin: 40px auto;">
-                                            <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                                <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 5px 0;"
-                                                    valign="top">Hi, {$user->user_name}<br
-                                                            style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"/>邮箱: {$user->email}
-                                                </td>
-                                            </tr>
-
-                                            <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                                <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 5px 0;"
-                                                    valign="top">{$text}
-                                                </td>
-                                            </tr>
-
-                                        </table>
-                                    </td>
-                                </tr>
-                                <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                    <td class="content-block aligncenter"
-                                        style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: center; margin: 0; padding: 0 0 20px;"
-                                        align="center" valign="top">
-                                        <a href="{$config['baseUrl']}"
-                                           style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #348eda; text-decoration: underline; margin: 0;">{$config['appName']}</a>
-                                    </td>
-                                </tr>
-                                <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                                    <td class="content-block aligncenter"
-                                        style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; text-align: center; margin: 0; padding: 0 0 20px;"
-                                        align="center" valign="top">
-                                    </td>
-                                </tr>
-                            </table>
-                        </td>
-                    </tr>
-                </table>
-                <div class="footer"
-                     style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
-                    <table width="100%"
-                           style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                        <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
-                        </tr>
-                    </table>
-                </div>
-            </div>
-        </td>
-        <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;"
-            valign="top"></td>
-    </tr>
-</table>
-</body>
-</html>

+ 0 - 11
resources/email/test.tpl

@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-</head>
-<body>
-<p>This is a testing mail.</p>
-<p>Send from {$config['appName']}</p>
-<p>{$time}</p>
-</body>
-</html>

+ 0 - 3
resources/views/material/admin/node/create.tpl

@@ -94,9 +94,6 @@
                                         <label class="floating-label" for="sort">节点类型</label>
                                         <select id="sort" class="form-control maxwidth-edit" name="sort">
                                             <option value="0">Shadowsocks</option>
-                                            <option value="1">VPN/Radius基础</option>
-                                            <option value="2">SSH</option>
-                                            <option value="5">Anyconnect</option>
                                             <option value="9">Shadowsocks 单端口多用户</option>
                                             <option value="10">Shadowsocks 中转</option>
                                             <option value="11">V2Ray</option>

+ 0 - 75
resources/views/material/user/nodeinfoanyconnect.tpl

@@ -1,75 +0,0 @@
-{include file='user/header_info.tpl'}
-
-<main class="content">
-    <div class="content-header ui-content-header">
-        <div class="container">
-            <h1 class="content-heading">节点信息</h1>
-        </div>
-    </div>
-    <div class="container">
-        <section class="content-inner margin-top-no">
-            <div class="ui-card-wrap">
-                <div class="row">
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">注意!</p>
-                                    <p>下面为您的 Anyconnect 配置。</p>
-                                </div>
-
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">配置信息</p>
-                                    <p>{$json_show}</p>
-                                </div>
-
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">客户端下载</p>
-                                    <p>由于版权问题,此处不提供下载。</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">配置方法</p>
-                                    <p>Windows:下载客户端安装后打开,再打开的窗口中点击左下角的设施(齿轮)按钮,取消勾选Block connections to untrusted
-                                        servers,之后在框中输入服务器地址,点击connect,如果出现提示框点击connext
-                                        anyway即可,并在随后弹出的认证框中填写用户名密码连接就好。</p>
-                                    <p>Mac OS X:下载客户端安装后打开,再打开的窗口中点击左下角的设施(齿轮)按钮,取消勾选Block connections to untrusted
-                                        servers,之后在框中输入服务器地址,点击connect,如果出现提示框点击connext
-                                        anyway即可,并在随后弹出的认证框中填写用户名密码连接就好。</p>
-                                    <p>
-                                        Android:下载客户端安装后打开。点击连接-添加新的VPN连接,并在其中输入服务器地址(如配置信息所示)后点击完成并在上一页中选择新建的连接,之后返回第一页,在anyconnect
-                                        VPN一行中有个开关,点击开关将其打开,如出现安全警告,点击继续即可,之后在弹出的认证框中输入用户名密码,连接即可。</p>
-                                    <p>iOS:从 App Store
-                                        中下载客户端安装后打开。点击连接-添加新的VPN连接,并在其中输入服务器地址(如配置信息所示)后点击完成并在上一页中选择新建的连接,之后返回第一页,在anyconnect
-                                        VPN一行中有个开关,点击开关将其打开,如出现安全警告,点击继续即可,之后在弹出的认证框中输入用户名密码,连接即可。</p>
-                                    <p>windows
-                                        Phone:在应用商店中下载客户端安装后打开设置-网络-VPN-添加VPN连接,VPN提供商一栏选择anyconnect,连接名称任意,服务器名称或地址中填写如配置信息所示的地址,之后点击保存即可,连接时点击对应的新建的VPN,点击连接,之后会提示输入用户名与密码,分别输入后即可。</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-</main>
-
-{include file='user/footer.tpl'}

+ 0 - 51
resources/views/material/user/nodeinfossh.tpl

@@ -1,51 +0,0 @@
-{include file='user/header_info.tpl'}
-
-<main class="content">
-    <div class="content-header ui-content-header">
-        <div class="container">
-            <h1 class="content-heading">节点信息</h1>
-        </div>
-    </div>
-    <div class="container">
-        <section class="content-inner margin-top-no">
-            <div class="ui-card-wrap">
-                <div class="row">
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">注意!</p>
-                                    <p>下面为您的 SSH 配置。</p>
-                                </div>
-
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">配置信息</p>
-                                    <p>{$json_show}</p>
-                                </div>
-
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">配置方法</p>
-                                    <p>未完待续</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </section>
-    </div>
-</main>
-
-{include file='user/footer.tpl'}

+ 0 - 51
resources/views/material/user/nodeinfovpn.tpl

@@ -1,51 +0,0 @@
-{include file='user/header_info.tpl'}
-
-<main class="content">
-    <div class="content-header ui-content-header">
-        <div class="container">
-            <h1 class="content-heading">节点信息</h1>
-        </div>
-    </div>
-    <div class="container">
-        <section class="content-inner margin-top-no">
-            <div class="ui-card-wrap">
-                <div class="row">
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">注意!</p>
-                                    <p>下面为您的 VPN 配置。</p>
-                                </div>
-
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">配置信息</p>
-                                    <p>{$json_show}</p>
-                                </div>
-
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-lg-12 col-sm-12">
-                        <div class="card">
-                            <div class="card-main">
-                                <div class="card-inner margin-bottom-no">
-                                    <p class="card-heading">配置方法</p>
-                                    <p>未完待续</p>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </section>
-    </div>
-</main>
-
-{include file='user/footer.tpl'}

+ 0 - 9
sql/glzjin_all.sql

@@ -51,11 +51,6 @@ CREATE TABLE IF NOT EXISTS `login_ip` (
   `type`     int(11)      NOT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 
-CREATE TABLE IF NOT EXISTS `radius_ban` (
-  `id`     int(11) NOT NULL,
-  `userid` int(11) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
 CREATE TABLE IF NOT EXISTS `speedtest` (
   `id`               bigint(20) NOT NULL,
   `nodeid`           int(11)    NOT NULL,
@@ -205,8 +200,6 @@ ALTER TABLE `link`
   ADD PRIMARY KEY (`id`);
 ALTER TABLE `login_ip`
   ADD PRIMARY KEY (`id`);
-ALTER TABLE `radius_ban`
-  ADD PRIMARY KEY (`id`);
 ALTER TABLE `speedtest`
   ADD PRIMARY KEY (`id`);
 ALTER TABLE `ss_invite_code`
@@ -243,8 +236,6 @@ ALTER TABLE `link`
   MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
 ALTER TABLE `login_ip`
   MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
-ALTER TABLE `radius_ban`
-  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
 ALTER TABLE `speedtest`
   MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
 ALTER TABLE `ss_invite_code`

+ 1 - 8
src/Command/Backup.php

@@ -43,20 +43,13 @@ class Backup extends Command
             system('mysqldump --user=' . $_ENV['db_username'] . ' --password=' . $_ENV['db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' ' . $_ENV['db_database'] . ' > /tmp/ssmodbackup/mod.sql');
         } else {
             system(
-                'mysqldump --user=' . $_ENV['db_username'] . ' --password=' . $_ENV['db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' ' . $_ENV['db_database'] . ' announcement auto blockip bought code coupon disconnect_ip link login_ip payback radius_ban shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql',
+                'mysqldump --user=' . $_ENV['db_username'] . ' --password=' . $_ENV['db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' ' . $_ENV['db_database'] . ' announcement auto blockip bought code coupon disconnect_ip link login_ip payback shop speedtest ss_invite_code ss_node ss_password_reset ticket unblockip user user_token email_verify detect_list relay paylist> /tmp/ssmodbackup/mod.sql',
                 $ret
             );
             system(
                 'mysqldump --opt --user=' . $_ENV['db_username'] . ' --password=' . $_ENV['db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' -d ' . $_ENV['db_database'] . ' alive_ip ss_node_info ss_node_online_log user_traffic_log detect_log telegram_session >> /tmp/ssmodbackup/mod.sql',
                 $ret
             );
-            if ($_ENV['enable_radius'] == true) {
-                $db_address_array = explode(':', $_ENV['radius_db_host']);
-                system(
-                    'mysqldump --user=' . $_ENV['radius_db_user'] . ' --password=' . $_ENV['radius_db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . '' . $_ENV['radius_db_database'] . '> /tmp/ssmodbackup/radius.sql',
-                    $ret
-                );
-            }
         }
 
         system('cp ' . BASE_PATH . '/config/.config.php /tmp/ssmodbackup/configbak.php', $ret);

+ 0 - 31
src/Command/Job.php

@@ -13,7 +13,6 @@ use App\Models\LoginIp;
 use App\Models\DetectLog;
 use App\Models\UnblockIp;
 use App\Models\Speedtest;
-use App\Models\RadiusBan;
 use App\Models\TrafficLog;
 use App\Models\Disconnect;
 use App\Models\EmailVerify;
@@ -28,7 +27,6 @@ use App\Services\Mail;
 use App\Utils\QQWry;
 use App\Utils\Telegram\TelegramTools;
 use App\Utils\Tools;
-use App\Utils\Radius;
 use App\Utils\Telegram;
 use App\Utils\DatatablesHelper;
 use ArrayObject;
@@ -421,23 +419,6 @@ class Job extends Command
             echo '节点掉线检测结束' . PHP_EOL;
         }
 
-        $rbusers = RadiusBan::all();
-        foreach ($rbusers as $sinuser) {
-            $user = User::find($sinuser->userid);
-
-            if ($user == null) {
-                $sinuser->delete();
-                continue;
-            }
-
-            if ($user->enable == 1 && (strtotime($user->expire_in) > time() || strtotime(
-                $user->expire_in
-            ) < 644447105) && $user->transfer_enable > $user->u + $user->d) {
-                $sinuser->delete();
-                Radius::Add($user, $user->passwd);
-            }
-        }
-
         if ($_ENV['enable_telegram'] === true) {
             $this->Telegram();
         }
@@ -475,18 +456,6 @@ class Job extends Command
     {
         $users = User::all();
         foreach ($users as $user) {
-            if (($user->transfer_enable <= $user->u + $user->d || $user->enable == 0 || (strtotime(
-                $user->expire_in
-            ) < time() && strtotime($user->expire_in) > 644447105)) && RadiusBan::where(
-                'userid',
-                $user->id
-            )->first() == null) {
-                $rb = new RadiusBan();
-                $rb->userid = $user->id;
-                $rb->save();
-                Radius::Delete($user->email);
-            }
-
             if (strtotime($user->expire_in) < time() && $user->expire_notified == false) {
                 $user->transfer_enable = 0;
                 $user->u = 0;

+ 0 - 236
src/Command/SyncRadius.php

@@ -1,236 +0,0 @@
-<?php
-
-
-namespace App\Command;
-
-use App\Models\User;
-use App\Models\Node;
-use App\Models\RadiusRadPostauth;
-use App\Models\RadiusRadAcct;
-use App\Models\RadiusNas;
-use App\Models\TrafficLog;
-use App\Utils\Tools;
-use App\Utils\Radius;
-
-class SyncRadius extends Command
-{
-    public $description = ''
-        . '├─=: php xcat SyncRadius [选项]' . PHP_EOL
-        . '│ ├─ syncnas  ' . PHP_EOL
-        . '│ ├─ syncvpn  ' . PHP_EOL
-        . '│ ├─ syncusers' . PHP_EOL
-        . '│ ├─ synclogin' . PHP_EOL;
-
-    public function boot()
-    {
-        if (count($this->argv) === 2) {
-            echo $this->description;
-        } else {
-            $methodName = $this->argv[2];
-            if (method_exists($this, $methodName)) {
-                $this->$methodName();
-            } else {
-                echo '方法不存在.' . PHP_EOL;
-            }
-        }
-    }
-
-    public static function synclogin()
-    {
-        if ($_ENV['enable_radius'] == false) {
-            return;
-        }
-        $tempuserbox = array();
-        $users = User::all();
-        foreach ($users as $user) {
-            $email = $user->email;
-            $email = Radius::GetUserName($email);
-            $tempuserbox[$email] = $user->id;
-        }
-
-        /*$tempnodebox=array();
-        $nodes = Node::all();
-        foreach($nodes as $node){
-            if(strpos($node->name,"Shadowsocks")!=FALSE)
-            {
-                $ip=gethostbyname($node->server);
-                $tempnodebox[$ip]=$node->id;
-            }
-        }*/
-
-
-        $logs = RadiusRadPostauth::where('authdate', '<', date('Y-m-d H:i:s'))->where('authdate', '>', date('Y-m-d H:i:s', time() - 60))->get();
-
-        foreach ($logs as $log) {
-            if (isset($tempuserbox[$log->username])) {
-                $traffic = new TrafficLog();
-                $traffic->user_id = $tempuserbox[$log->username];
-                $traffic->u = 0;
-                $traffic->d = 10000;
-                $traffic->node_id = 1;
-                $traffic->rate = 1;
-                $traffic->traffic = Tools::flowAutoShow(10000);
-                $traffic->log_time = time();
-                $traffic->save();
-
-                $user = User::find($tempuserbox[$log->username]);
-                $user->t = time();
-                $user->u += 0;
-                $user->d += 10000;
-                $user->save();
-            }
-        }
-
-
-        /*$stmt = $db->query("SELECT * FROM `radacct` WHERE `acctstoptime`<'".date("Y-m-d H:i:s")."' AND `acctstoptime`>'".date("Y-m-d H:i:s",time()-60)."'");
-        $result = $stmt->fetchAll();
-
-        foreach($result as $row)
-        {
-            $traffic = new TrafficLog();
-            $traffic->user_id = $tempuserbox[$row["username"]];
-            $traffic->u = $row["acctinputoctets"];
-            $traffic->d = $row["acctoutputoctets"];
-            $traffic->node_id = 150;
-            $traffic->rate = 1;
-            $traffic->traffic = Tools::flowAutoShow(($row["acctinputoctets"]+$row["acctoutputoctets"])/1024/1024);
-            $traffic->log_time = time();
-            $traffic->save();
-
-            $user->t = time();
-            $user->u = $user->u + $row["acctinputoctets"];
-            $user->d = $user->d + $row["acctoutputoctets"];
-            $user->save();
-        }  */
-    }
-
-    public static function syncvpn()
-    {
-        if ($_ENV['radius_db_host'] == '') {
-            return;
-        }
-
-        $tempuserbox = array();
-        $users = User::all();
-        foreach ($users as $user) {
-            $email = $user->email;
-            $email = Radius::GetUserName($email);
-            $tempuserbox[$email] = $user->id;
-        }
-
-        /*$tempnodebox=array();
-        $nodes = Node::all();
-        foreach($nodes as $node){
-            if(strpos($node->name,"Shadowsocks")!=FALSE)
-            {
-                $ip=gethostbyname($node->server);
-                $tempnodebox[$ip]=$node->id;
-            }
-        }*/
-
-        /*$stmt = $db->query("SELECT * FROM `radpostauth` WHERE `authdate`<'".date("Y-m-d H:i:s")."' AND`authdate`>'".date("Y-m-d H:i:s",time()-60)."'");
-        $result = $stmt->fetchAll();
-
-        foreach($result as $row)
-        {
-            //if($row["pass"]!="")
-            {
-                $traffic = new TrafficLog();
-                $traffic->user_id = $tempuserbox[$row["username"]];
-                $traffic->u = 0;
-                $traffic->d = 10000;
-                $traffic->node_id = 149;
-                $traffic->rate = 1;
-                $traffic->traffic = Tools::flowAutoShow(10000);
-                $traffic->log_time = time();
-                $traffic->save();
-
-                $user->t = time();
-                $user->u = $user->u + 0;
-                $user->d = $user->d + 10000;
-                $user->save();
-            }
-        }
-        */
-
-
-        $logs = RadiusRadAcct::where('acctstoptime', '<', date('Y-m-d H:i:s'))->where('acctstoptime', '>', date('Y-m-d H:i:s', time() - 60))->get();
-
-        foreach ($logs as $log) {
-            $traffic = new TrafficLog();
-            $traffic->user_id = $tempuserbox[$log->username];
-            $traffic->u = $log->acctinputoctets;
-            $traffic->d = $log->acctoutputoctets;
-            $traffic->node_id = 2;
-            $traffic->rate = 1;
-            $traffic->traffic = Tools::flowAutoShow($log->acctinputoctets + $log->acctoutputoctets);
-            $traffic->log_time = time();
-            $traffic->save();
-
-            $user = User::find($tempuserbox[$log->username]);
-            $user->t = time();
-            $user->u += $log->acctinputoctets;
-            $user->d += $log->acctoutputoctets;
-            $user->save();
-        }
-    }
-
-    public static function syncusers()
-    {
-        $users = User::all();
-        foreach ($users as $user) {
-            Radius::Add($user, $user->passwd);
-            echo 'Send sync mail to user: ' . $user->id;
-            $user->sendMail(
-                $_ENV['appName'] . '-密码更新通知',
-                'password/vpn.tpl',
-                [
-                    'text'  => '您好,为了保证密码系统的统一,刚刚系统已经将您 vpn 等连接方式的用户名已经重置为:' . Radius::GetUserName($user->email) . ',密码自动重置为您 ss 的密码:' . $user->passwd . '  了,以后您修改 ss 密码就会自动修改 vpn 等连接方式的密码了,感谢您的支持。 '
-                ],
-                []
-            );
-        }
-    }
-
-    public static function syncnas()
-    {
-        if ($_ENV['radius_db_host'] != '') {
-            $md5txt = '';
-
-            $nases = RadiusNas::all();
-
-            foreach ($nases as $nas) {
-                //if($row["pass"]!="")
-                {
-                    $md5txt = $md5txt . $nas->id . $nas->nasname . $nas->shortname . $nas->secret . $nas->description;
-                }
-            }
-
-            $md5 = MD5($md5txt);
-
-
-            $oldmd5 = file_get_contents(BASE_PATH . '/storage/nas.md5');
-
-            if ($oldmd5 != $md5) {
-                //Restart radius
-                $myfile = fopen(BASE_PATH . '/storage/nas.md5', 'wb+') or die('Unable to open file!');
-                echo ('Restarting...');
-                system('/bin/bash /sbin/service radiusd restart', $retval);
-                echo ($retval);
-                $txt = $md5;
-                fwrite($myfile, $txt);
-                fclose($myfile);
-            }
-        }
-
-        $Nodes = Node::where('sort', 0)->where('node_ip', '<>', '')->where('node_ip', '<>', 'NULL')->get();
-        foreach ($Nodes as $Node) {
-            if (file_exists('/usr/local/psionic/portsentry/portsentry.ignore')) {
-                $content = file_get_contents('/usr/local/psionic/portsentry/portsentry.ignore');
-                if (strpos($content, $Node->node_ip) === false) {
-                    file_put_contents('/usr/local/psionic/portsentry/portsentry.ignore', "\n" . $Node->node_ip . '/32', FILE_APPEND);
-                }
-            }
-        }
-    }
-}

+ 0 - 27
src/Controllers/Admin/NodeController.php

@@ -6,7 +6,6 @@ use App\Controllers\AdminController;
 use App\Models\Node;
 use App\Utils\{
     Tools,
-    Radius,
     Telegram,
     CloudflareDriver,
     DatatablesHelper
@@ -120,9 +119,6 @@ class NodeController extends AdminController
             $node->node_ip = '';
         }
 
-        if ($node->sort == 1) {
-            Radius::AddNas($node->node_ip, $request->getParam('server'));
-        }
         $node->node_class                 = $request->getParam('class');
         $node->node_bandwidth_limit       = $request->getParam('node_bandwidth_limit') * 1024 * 1024 * 1024;
         $node->bandwidthlimit_resetday    = $request->getParam('bandwidthlimit_resetday');
@@ -221,17 +217,6 @@ class NodeController extends AdminController
             Tools::updateRelayRuleIp($node);
         }
 
-        if ($node->sort == 1) {
-            $SS_Node = Node::where('sort', '=', 0)->where('server', '=', $request->getParam('server'))->first();
-            if ($SS_Node != null) {
-                if ($SS_Node->node_heartbeat == 0 || time() - $SS_Node->node_heartbeat < 300) {
-                    Radius::AddNas(gethostbyname($request->getParam('server')), $request->getParam('server'));
-                }
-            } else {
-                Radius::AddNas(gethostbyname($request->getParam('server')), $request->getParam('server'));
-            }
-        }
-
         $node->status                     = $request->getParam('status');
         $node->node_class                 = $request->getParam('class');
         $node->node_bandwidth_limit       = $request->getParam('node_bandwidth_limit') * 1024 * 1024 * 1024;
@@ -266,9 +251,6 @@ class NodeController extends AdminController
     {
         $id = $request->getParam('id');
         $node = Node::find($id);
-        if ($node->sort == 1) {
-            Radius::DelNas($node->node_ip);
-        }
 
         if (!$node->delete()) {
             return $response->withJson(
@@ -361,15 +343,6 @@ class NodeController extends AdminController
                 case 0:
                     $sort = 'Shadowsocks';
                     break;
-                case 1:
-                    $sort = 'VPN/Radius基础';
-                    break;
-                case 2:
-                    $sort = 'SSH';
-                    break;
-                case 5:
-                    $sort = 'Anyconnect';
-                    break;
                 case 9:
                     $sort = 'Shadowsocks - 单端口多用户';
                     break;

+ 0 - 3
src/Controllers/Admin/UserController.php

@@ -21,7 +21,6 @@ use App\Utils\{
     Hash,
     Tools,
     QQWry,
-    Radius,
     Cookie
 };
 use Exception;
@@ -326,8 +325,6 @@ class UserController extends AdminController
 
         $passwd = $request->getParam('passwd');
 
-        Radius::ChangeUserName($email1, $email2, $passwd);
-
         if ($request->getParam('pass') != '') {
             $user->pass = Hash::passwordHash($request->getParam('pass'));
             $user->clean_link();

+ 0 - 2
src/Controllers/AuthController.php

@@ -13,7 +13,6 @@ use App\Utils\{
     Hash,
     Check,
     Tools,
-    Radius,
     Geetest,
     TelegramSessionManager
 };
@@ -440,7 +439,6 @@ class AuthController extends BaseController
             $res['ret'] = 1;
             $res['msg'] = '注册成功!正在进入登录界面';
 
-            Radius::Add($user, $user->passwd);
             return $res;
         }
         $res['ret'] = 0;

+ 0 - 29
src/Controllers/User/NodeController.php

@@ -11,7 +11,6 @@ use App\Models\{
 use App\Utils\{
     URL,
     Tools,
-    Radius,
     DatatablesHelper
 };
 use Slim\Http\{
@@ -186,34 +185,6 @@ class NodeController extends UserController
                     return $this->view()->assign('node', $node)->assign('user', $user)->assign('mu', $mu)->assign('relay_rule_id', $relay_rule_id)->registerClass('URL', URL::class)->display('user/nodeinfo.tpl');
                 }
                 break;
-            case 1:
-                if ($user->class >= $node->node_class && ($user->node_group == $node->node_group || $node->node_group == 0)) {
-                    $email = $this->user->email;
-                    $email = Radius::GetUserName($email);
-                    $json_show = 'VPN 信息<br>地址:' . $node->server . '<br>' . '用户名:' . $email . '<br>密码:' . $this->user->passwd . '<br>支持方式:' . $node->method . '<br>备注:' . $node->info;
-
-                    return $this->view()->assign('json_show', $json_show)->display('user/nodeinfovpn.tpl');
-                }
-                break;
-            case 2:
-                if ($user->class >= $node->node_class && ($user->node_group == $node->node_group || $node->node_group == 0)) {
-                    $email = $this->user->email;
-                    $email = Radius::GetUserName($email);
-                    $json_show = 'SSH 信息<br>地址:' . $node->server . '<br>' . '用户名:' . $email . '<br>密码:' . $this->user->passwd . '<br>支持方式:' . $node->method . '<br>备注:' . $node->info;
-
-                    return $this->view()->assign('json_show', $json_show)->display('user/nodeinfossh.tpl');
-                }
-                break;
-            case 5:
-                if ($user->class >= $node->node_class && ($user->node_group == $node->node_group || $node->node_group == 0)) {
-                    $email = $this->user->email;
-                    $email = Radius::GetUserName($email);
-
-                    $json_show = 'Anyconnect 信息<br>地址:' . $node->server . '<br>' . '用户名:' . $email . '<br>密码:' . $this->user->passwd . '<br>支持方式:' . $node->method . '<br>备注:' . $node->info;
-
-                    return $this->view()->assign('json_show', $json_show)->display('user/nodeinfoanyconnect.tpl');
-                }
-                break;
             case 10:
                 if ((($user->class >= $node->node_class && ($user->node_group == $node->node_group || $node->node_group == 0)) || $user->is_admin) && ($node->node_bandwidth_limit == 0 || $node->node_bandwidth < $node->node_bandwidth_limit)) {
                     return $this->view()->assign('node', $node)->assign('user', $user)->assign('mu', $mu)->assign('relay_rule_id', $relay_rule_id)->registerClass('URL', URL::class)->display('user/nodeinfo.tpl');

+ 0 - 3
src/Controllers/UserController.php

@@ -40,7 +40,6 @@ use App\Utils\{
     Check,
     QQWry,
     Tools,
-    Radius,
     Cookie,
     Geetest,
     Telegram,
@@ -1214,8 +1213,6 @@ class UserController extends BaseController
         $user->updateSsPwd($pwd);
         $res['ret'] = 1;
 
-        Radius::Add($user, $pwd);
-
         return $this->echoJson($response, $res);
     }
 

+ 0 - 9
src/Models/RadiusBan.php

@@ -1,9 +0,0 @@
-<?php
-
-namespace App\Models;
-
-class RadiusBan extends Model
-{
-    protected $connection = 'default';
-    protected $table = 'radius_ban';
-}

+ 0 - 9
src/Models/RadiusNas.php

@@ -1,9 +0,0 @@
-<?php
-
-namespace App\Models;
-
-class RadiusNas extends Model
-{
-    protected $connection = 'radius';
-    protected $table = 'nas';
-}

+ 0 - 9
src/Models/RadiusRadAcct.php

@@ -1,9 +0,0 @@
-<?php
-
-namespace App\Models;
-
-class RadiusRadAcct extends Model
-{
-    protected $connection = 'radius';
-    protected $table = 'radacct';
-}

+ 0 - 9
src/Models/RadiusRadCheck.php

@@ -1,9 +0,0 @@
-<?php
-
-namespace App\Models;
-
-class RadiusRadCheck extends Model
-{
-    protected $connection = 'radius';
-    protected $table = 'radcheck';
-}

+ 0 - 9
src/Models/RadiusRadPostauth.php

@@ -1,9 +0,0 @@
-<?php
-
-namespace App\Models;
-
-class RadiusRadPostauth extends Model
-{
-    protected $connection = 'radius';
-    protected $table = 'radpostauth';
-}

+ 0 - 9
src/Models/RadiusRadUserGroup.php

@@ -1,9 +0,0 @@
-<?php
-
-namespace App\Models;
-
-class RadiusRadUserGroup extends Model
-{
-    protected $connection = 'radius';
-    protected $table = 'radusergroup';
-}

+ 0 - 4
src/Models/User.php

@@ -7,7 +7,6 @@ use App\Utils\{
     Hash,
     GA,
     QQWry,
-    Radius,
     Telegram,
     URL
 };
@@ -344,9 +343,6 @@ class User extends Model
         $uid = $this->attributes['id'];
         $email = $this->attributes['email'];
 
-        Radius::Delete($email);
-
-        RadiusBan::where('userid', '=', $uid)->delete();
         Disconnect::where('userid', '=', $uid)->delete();
         Bought::where('userid', '=', $uid)->delete();
         Ip::where('userid', '=', $uid)->delete();

+ 0 - 10
src/Services/Boot.php

@@ -25,16 +25,6 @@ class Boot
         }
 
         $capsule->setAsGlobal();
-
-        if ($_ENV['enable_radius'] === true) {
-            try {
-                $capsule->addConnection(Config::getRadiusDbConfig(), 'radius');
-                $capsule->getConnection('radius')->getPdo();
-            } catch (\Exception $e) {
-                die('Could not connect to radius database: ' . $e->getMessage());
-            }
-        }
-        
         $capsule->bootEloquent();
 
         View::$connection = $capsule->getDatabaseManager();

+ 1 - 14
src/Services/Config.php

@@ -107,20 +107,7 @@ class Config
             'prefix'        => $_ENV['db_prefix'],
         ];
     }
-
-    public static function getRadiusDbConfig()
-    {
-        return [
-            'driver'    => $_ENV['db_driver'],
-            'host'      => $_ENV['radius_db_host'],
-            'database'  => $_ENV['radius_db_database'],
-            'username'  => $_ENV['radius_db_user'],
-            'password'  => $_ENV['radius_db_password'],
-            'charset'   => $_ENV['db_charset'],
-            'collation' => $_ENV['db_collation']
-        ];
-    }
-
+    
     public static function getMuKey()
     {
         $muKeyList = array_key_exists('muKeyList', $_ENV) ? $_ENV['muKeyList'] : [' '];

+ 0 - 133
src/Utils/Radius.php

@@ -1,133 +0,0 @@
-<?php
-
-namespace App\Utils;
-
-use App\Models\User;
-use App\Models\RadiusRadCheck;
-use App\Models\RadiusRadUserGroup;
-use App\Models\RadiusNas;
-use App\Models\RadiusBan;
-use App\Services\Config;
-
-class Radius
-{
-
-    /**
-     * 添加或者更新密码信息
-     */
-    public static function Add($user, $pwd)
-    {
-        if ($_ENV['enable_radius'] == true) {
-            $email = $user->email;
-            $email = str_replace(array('@', '.'), '', $email);
-
-            $exists = RadiusRadCheck::where('username', $email)->first();
-
-            if ($exists == null) {
-                $rb = RadiusBan::where('userid', $user->id)->first();
-                if ($rb != null) {
-                    return;
-                }
-
-                $newRad = new RadiusRadCheck();
-                $newRad->username = $email;
-                $newRad->attribute = 'Cleartext-Password';
-                $newRad->op = ':=';
-                $newRad->value = $pwd;
-                $newRad->save();
-
-                $newRad = new RadiusRadUserGroup();
-                $newRad->username = $email;
-                $newRad->groupname = 'user';
-                $newRad->priority = '0';
-                $newRad->save();
-            } else {
-                $exists->value = $pwd;
-                $exists->save();
-            }
-        }
-    }
-
-
-    public static function Delete($email)
-    {
-        if ($_ENV['enable_radius'] == true) {
-            $email = str_replace(array('@', '.'), '', $email);
-
-
-            $exists = RadiusRadCheck::where('username', $email)->first();
-
-            if ($exists != null) {
-                RadiusRadCheck::where('username', $email)->delete();
-                RadiusRadUserGroup::where('username', $email)->delete();
-            }
-        }
-    }
-
-    public static function ChangeUserName($origin_email, $new_email, $passwd)
-    {
-        if ($_ENV['enable_radius'] == true) {
-            $email1 = str_replace(array('@', '.'), '', $origin_email);
-            $email2 = str_replace(array('@', '.'), '', $new_email);
-
-            $exists = RadiusRadCheck::where('username', $email1)->first();
-
-            if ($exists != null) {
-                $exists->username = $email2;
-                $exists->value = $passwd;
-                $exists->save();
-
-                $exists = RadiusRadUserGroup::where('username', $email1)->first();
-                $exists->username = $email2;
-                $exists->save();
-            } else {
-                $user = User::where('email', '=', $origin_email)->first();
-                $rb = RadiusBan::where('userid', $user->id)->first();
-                if ($rb != null) {
-                    return;
-                }
-
-                $newRad = new RadiusRadCheck();
-                $newRad->username = $email2;
-                $newRad->attribute = 'Cleartext-Password';
-                $newRad->op = ':=';
-                $newRad->value = $passwd;
-                $newRad->save();
-
-                $newRad = new RadiusRadUserGroup();
-                $newRad->username = $email2;
-                $newRad->groupname = 'user';
-                $newRad->priority = '0';
-                $newRad->save();
-            }
-        }
-    }
-
-    public static function AddNas($ip, $name)
-    {
-        if ($_ENV['enable_radius'] == true) {
-            $exists = RadiusNas::where('shortname', $ip)->first();
-            if ($exists == null) {
-                $exists = new RadiusNas();
-                $exists->nasname = $ip;
-                $exists->shortname = $ip;
-                $exists->type = 'other';
-                $exists->secret = $_ENV['radius_secret'];
-                $exists->description = $ip;
-                $exists->save();
-            }
-        }
-    }
-
-    public static function DelNas($ip)
-    {
-        if ($_ENV['enable_radius'] == true) {
-            RadiusNas::where('shortname', $ip)->delete();
-        }
-    }
-
-    public static function GetUserName($email)
-    {
-        return str_replace(array('@', '.'), '', $email);
-    }
-}