Compare commits

...

2 Commits

Author SHA1 Message Date
Cadwalader df2f920703 New File 6 years ago
Cadwalader f98f872088 Delete old files 6 years ago

@ -2,53 +2,3 @@
[English](#English)
[简体中文](#简体中文)
## English
### Pull Requests
1. Fork the this repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch against the dev branch.
It is very important to separate new features or improvements into separate feature branches, and to send a
pull request for each branch. This allows each feature or improvement to be reviewed and merged individually.
### Coding Style
All pull requests and commits **must** adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) at least.
And we **recommend** adhering to the [PSR-12 standard](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md).
### Commit message
The Commit message **must** containe all the changes you maked in sort.
Please **do not** use words like "fix", "improve" only.
### Rule
If you want to add a new function for router callback, please follow the structure of the HomeController.
Please use the function from PSR-7 like `$request->getParsedBodyParam()`, `getParsedBodyParam()` as possible.
## 简体中文
### Pull Request
1. Fork 本项目
2. 为每一项新特性或改进创建一个新的分支
3. 为每一项新特性或改进创建一个独立的 Pull Request 至 dev 分支
我们建议你将不同的新特性置于不同的分支并以不同的 Pull Request 提交,这将有利于我们独立审查代码并独立合并。
### 代码风格
所有的 Pull request 和 commit 都至少**必须**遵守 [PSR-2 标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)。
我们建议**最好**遵守 [PSR-12 标准](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md)。
### Commit 消息
Commit 消息必须简洁地包含你所有的修改。请不要仅使用「修复」、「改进」等字样。
### 规范
若你需要新增/修改 Router callback,请依照类似 HomeController 的形式。
如无必要,请不要使用`$request->getParam()`并尽量使用 PSR-7 中的`$request->getParsedBodyParam()`、`getParsedBodyParam()`等一系列用于获取参数的方法。

@ -1,121 +1,3 @@
# 欢迎使用 SSPanel V3 魔改再次修改版
**ss-panel-v3-mod**是一款专为 Shadowsocks/ShadowsocksR 设计的管理面板,再次感谢 ss-panel-v3-mod 的制作者,修改后的功能简介:
此仓库由 GeekQu 维护,修改记录 **[在此查看](https://github.com/GeekQu/ss-panel-v3-mod_Uim/blob/dev/GeekQu.md)**。
- **支付系统集成**:集成 支付宝当面付 易付通 码支付 TrimePay 等多种支付系统,使用方法见项目[wiki](https://github.com/Anankke/SSPanel-Uim/wiki/)
- **UI** :修改为 ~~援交~~ 圆角、并自定义了几个图标的显示,节点列表等級 0 可见等級 1 节点但无法看见节点详情,增加了国家图标显示
- **商店**:商品增加同时连接设备数,用户限速属性
- 从肥羊那里**抄**来的:新用户注册现金奖励|高等级节点体验|设备数量限制
- **优化**:css 和 js 等置入本地提升加载速度
- 增加 **v2Ray** 功能,详情请看 wiki: [Indexyz 版](https://github.com/Anankke/SSPanel-Uim/wiki/v2ray---indexyz-%E7%89%88%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B) | [Rico 版](https://github.com/Anankke/SSPanel-Uim/wiki/v2ray---Rico-%E7%89%88%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B)
- 巨量性能优化
- 更多新功能写不下了。(确信)
Telegram 频道 :https://t.me/sspanel_Uim
Telegram ~~可能是个官方~~水群 :https://t.me/SSUnion
记得点小星星!
演示站: [sspanel.host](https://sspanel.host) 账号和密码都是 admin 对接节点的 mukey=NimaQu
**原作者** [galaxychuck](https://github.com/galaxychuck)
[支持开发者请点我](https://github.com/Anankke/SSPanel-Uim#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
## 搭建教程
GitHub Wiki : https://github.com/Anankke/SSPanel-Uim/wiki/%E5%89%8D%E7%AB%AF%E5%AE%89%E8%A3%85
Wiki 已经启用,欢迎为此面板维护 wiki
#### 鸣谢
##### [Anankke](https://github.com/galaxychuck)
- 面板现**维护者**
##### [galaxychuck](https://github.com/galaxychuck)
- 面板**原作者**
##### [hkserversolution](https://www.hkserversolution.com/cart.php)
- Demo 演示站服务器赞助
##### [dumplin](https://github.com/dumplin233)
- 码支付对接 + 码支付当面付二合一
- 为面板加入 AFF 链接功能
- 商品增加限速和限制 ip 属性
- 多端口订阅
- 解决用户列表加载缓慢历史遗留问题
##### [RinSAMA](https://github.com/mxihan)
- 整理分类 config.php
- 美观性调整
- 客服系统优化
##### [miku](https://github.com/xcxnig)
- 美观和性能优化
##### [Tony Zou](https://github.com/ZJY2003)
- 为公告增加群发邮件功能
- 节点负载情况显示&用户账户过期在首页弹窗提醒
- 增加返利列表
[**Indexyz**](https://github.com/Indexyz)
- 为面板增加 v2Ray 功能
[**NeverBehave**](https://github.com/NeverBehave)
- 添加 Telegram OAuth
[**CGDF**](https://github.com/CGDF-GitHub)
- xcat一键update
- 适配SSD
- 用户列表分页加载
[**CHEN**](https://github.com/ChenSee)
- 免签约支付宝与微信,自带监听,不需第三方软件,直接到个人账户
[**laurieryayoi**](https://github.com/laurieryayoi)
- 重做美化UI(~~援交~~圆角化)
- 重写节点列表,支持分级显示所有级别节点
#### 还有所有被引用过代码的同学,以及所有提交过 pr/issue 的同学。
#### 关于捐赠
您对我们的帮助将是支持我们做下去的动力,只需您在购买部分产品或向他人推荐产品时从我们的返利链接购买,这就是对我们很大的支持了。~~没有钱了,肯定要做啊,不做没有钱用啊,打工是不可能打工的,这辈子不可能打工的~~
##### Anankke
- [Anankke 很可爱请给 Anankke 钱](https://t.me/anankke/5)
##### dumplin
- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)
##### galaxychuck
- [黛米付-支付接入](https://www.daimiyun.cn/register.php?aff=624)
- [冲上云霄云主机](http://console.soar-clouds.com/aff.php?aff=94)
- [Vultr](https://www.vultr.com/?ref=7205737)
[laurieryayoi 的前端课程报名](https://t.me/kinokonominoco)
## 免责声明
本程序由 MIT License 授权。**不提供任何担保**。使用本程序即表明,您知情并同意:程序开发者不对此程序导致的任何服务中断、数据损失或任何少见未列出的事故负责。

@ -1,33 +1,4 @@
# 此项目本是个付费主题,可是他们放弃了,我不想 Malio 就此消失就放到了这里
# 请勿泄露源码给他人,当你让他人为你debug或进行其他操作时,切勿让他访问你网站的全部代码,尤其是不认识的人。泄露源码对你我都没好处。
# 不能删改页面底部的 Powered by SSPANEL.,不能删改staff页面的任何信息。
## 删除Powered by SSPANEL可能会导致你的网站被D,现在 Theme by editXY 可以随意去掉
本主题包含了SSPANEL的完整代码,需要删除原来的面板,然后全新安装(数据库通用),操作前请备份面板
## Wiki
[详细安装教程](https://gitlab.com/maxitio/malio-theme-for-sspanel/wikis/详细安装教程)
[授权说明](https://gitlab.com/maxitio/malio-theme-for-sspanel/wikis/授权说明)
## 注意事项
.malio_config.php 文件里的商品id必须设置好,不然在商店plans模式下没办法购买。
在.config.php里设置新用户注册等级为-1,如果不设置为-1的话,就没有新手引导教程,同时需要在.config.php里设置用户等级过期时间,建议设置为超过一个月的时间(720小时)。
安装完成后如果旧用户无法登录的话,检查下 .config.php 里面的 salt 和 pwdMethod 的值是否跟原来的 .config.php 一致。
端口偏移的说明查看 [端口偏移的食用方法](https://678765.xyz/2019/2.html),根据群友说支持普通端口和单端口,格式跟uim原版的偏移不一样
如果需要配置Stripe支付接口的话,请看本仓库的wiki
需要去.config.php打开订阅记录的开关才会记录订阅
## Telegram
主题交流群 [@章鱼哥的SSPanel之家](https://t.me/woaizyg)
## AFF
推荐的支付平台👉 [BitPayX](https://merchants.mugglepay.com/user/register?ref=MP8DF1B016220D) ,支持数字货币、支付宝、微信,提款数字货币
## CREDIT
基于 [rico](https://github.com/rico93) 和 [GeekQu](https://github.com/GeekQu) 维护的 [ss-panel-v3-mod_Uim](https://github.com/rico93/ss-panel-v3-mod_Uim) 修改
## 删除Powered by SSPANEL可能会导致你的网站被D,现在 Theme by 彩虹 可以随意去掉

@ -22,8 +22,7 @@ class ExtMail
try {
Mail::send($to, $subject, 'ext/back.tpl', [
'user' => $user, 'text' => $text
], [
]);
], []);
} catch (Exception $e) {
echo $e->getMessage();
}
@ -43,8 +42,31 @@ class ExtMail
try {
Mail::send($to, $subject, 'ext/back.tpl', [
'user' => $user, 'text' => $text
], [
]);
], []);
} catch (Exception $e) {
echo $e->getMessage();
}
}
}
}
public static function customEmail()
{
echo '发送自定义邮件 (邮件内容请编辑)';
// ask for input
fwrite(STDOUT, '请输入邮件标题: ');
// get input
$emailTitle = trim(fgets(STDIN));
echo "邮件标题: $emailTitle";
fwrite(STDOUT, "按下[Y]确认来发送邮件..... \n");
$y = trim(fgets(STDIN));
if (strtolower($y) == 'y') {
$users = User::all();
foreach ($users as $user) {
echo 'Send daily mail to user: ' . $user->id . ' ('.$user->email.')';
try {
Mail::send($user->email, $emailTitle, 'customEmail.tpl', ['user' => $user], []);
} catch (Exception $e) {
echo $e->getMessage();
}

@ -112,6 +112,8 @@ class XCat
return Malio::GenerateUUIDforAllUsers();
case ('delSubCache'):
return $this->delSubCache();
case ('sendCustomEmail'):
return ExtMail::customEmail();
default:
return $this->defaultAction();
}

@ -6,6 +6,8 @@ use App\Models\User;
use App\Models\PasswordReset;
use App\Services\Password;
use App\Utils\Hash;
use App\Services\Internationalization;
use App\Services\MalioConfig;
/***
* Class Password
@ -14,9 +16,16 @@ use App\Utils\Hash;
*/
class PasswordController extends BaseController
{
public function reset()
public function reset($request, $response, $args)
{
return $this->view()->display('password/reset.tpl');
$i18n = new Internationalization();
if (MalioConfig::get('only_one_lang') != 'none') {
$i18n->lang = MalioConfig::get('only_one_lang');
} else {
$i18n->detectLang($request, $response, $args);
}
return $this->view()->assign('i18n', $i18n)->display('password/reset.tpl');
}
public function handleReset($request, $response, $args)
@ -43,7 +52,15 @@ class PasswordController extends BaseController
public function token($request, $response, $args)
{
$token = $args['token'];
return $this->view()->assign('token', $token)->display('password/token.tpl');
$i18n = new Internationalization();
if (MalioConfig::get('only_one_lang') != 'none') {
$i18n->lang = MalioConfig::get('only_one_lang');
} else {
$i18n->detectLang($request, $response, $args);
}
return $this->view()->assign('i18n', $i18n)->assign('token', $token)->display('password/token.tpl');
}
public function handleToken($request, $response, $args)

@ -14,6 +14,7 @@ use App\Models\User;
use App\Models\Code;
use App\Services\Config;
use App\Utils\Telegram;
use App\Models\Shop;
use Slim\Http\{Request, Response};
abstract class AbstractPayment
@ -83,6 +84,15 @@ abstract class AbstractPayment
$Payback->save();
}
if ($p->shopid != null && $p->shopid != 0 ) {
$shop = Shop::where('id', $p->shopid)->first();
if ($shop != null) {
$user->money -= $p->total;
$user->save();
$shop->buy($user);
}
}
if (Config::get('enable_donate') == true) {
if ($user->is_hide == 1) {
Telegram::Send('一位不愿透露姓名的大老爷给我们捐了 ' . $codeq->number . ' 元!');
@ -135,6 +145,15 @@ abstract class AbstractPayment
$Payback->save();
}
if ($p->shopid != null && $p->shopid != 0 ) {
$shop = Shop::where('id', $p->shopid)->first();
if ($shop != null) {
$user->money -= $p->total;
$user->save();
$shop->buy($user);
}
}
if (Config::get('enable_donate') == 'true') {
if ($user->is_hide == 1) {
Telegram::Send('一位不愿透露姓名的大老爷给我们捐了 ' . $codeq->number . ' 元!');

@ -11,6 +11,7 @@ namespace App\Services\Gateway;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
use App\Services\MalioConfig;
use App\Services\View;
use Exception;
use Omnipay\Omnipay;
@ -69,7 +70,7 @@ class AopF2F extends AbstractPayment
return json_encode($return);
}
public function purchase_maliopay($type, $price)
public function purchase_maliopay($type, $price, $shopid=null)
{
$amount = $price;
$user = Auth::getUser();
@ -78,6 +79,9 @@ class AopF2F extends AbstractPayment
$pl->userid = $user->id;
$pl->tradeno = self::generateGuid();
$pl->total = $amount;
if ($shopid != 0) {
$pl->shopid = $shopid;
}
$pl->save();
$gateway = Omnipay::create('Alipay_AopF2F');

@ -151,7 +151,7 @@ class BitPayX extends AbstractPayment
return json_encode(['errcode' => -1, 'errmsg' => $result . error]);
}
public function purchase_maliopay($type, $price)
public function purchase_maliopay($type, $price, $shopid=0)
{
$user = Auth::getUser();
$pl = new Paylist();

@ -0,0 +1,116 @@
<?php
namespace App\Services\Gateway;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
use App\Services\View;
use App\Services\MalioConfig;
class CustomPay extends AbstractPayment
{
public function __construct()
{
}
public function purchase($request, $response, $args)
{
$price = $request->getParam('price');
$type = $request->getParam('type');
$shopid = $request->getParam('shopid');
$user = Auth::getUser();
if (!is_numeric($shopid)) {
return array(
'ret' => 0,
'msg' => 'shopid只能是数字'
);
}
if (!is_numeric($price)) {
return array(
'ret' => 0,
'msg' => '金额错误'
);
}
// 这里写发起支付请求
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
$pl->shopid = $shopid;
$pl->save();
return array(
'ret' => 1,
'url' => 'https://example.alipay.com/pay',
// url填写为跳转的url
// 如果是扫码支付的话,要输出这样的格式(其中的type可换为wechat) '/user/qrcode?type=alipay&qrcode=https%3A%2F%2Fexample.alipay.com%2Fpay&tradeno=5BDD1D44Z&price=12.1'
// 示例代码👇
// 'url' => '/user/qrcode?type='.$type.'&qrcode='.rawurlencode($qrContent).'&tradeno='.$tradeno.'&price='.$price;
);
}
public function purchase_maliopay($type, $price, $shopid=0)
{
$user = Auth::getUser();
// 这里写发起支付请求
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
$pl->shopid = $shopid;
$pl->save();
if ($type == 'alipay') {
return array(
'url' => $pl->tradeno,
'errcode' => 0,
'tradeno' => $pl->tradeno
);
} else {
return array(
'url' => $pl->tradeno,
'errcode' => 0,
'tradeno' => $pl->tradeno
);
}
}
public function notify($request, $response, $args)
{
// 处理回调
}
public function getPurchaseHTML()
{
return 1;
}
public function getReturnHTML($request, $response, $args)
{
$pid = $_GET['source'];
$p = Paylist::where('tradeno', '=', $pid)->first();
$money = $p->total;
if ($p->status === 1) {
$success = 1;
} else {
$success = 0;
}
return View::getSmarty()->assign('money', $money)->assign('success', $success)->fetch('user/pay_success.tpl');
}
public function getStatus($request, $response, $args)
{
$p = Paylist::where('id', $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;
return json_encode($return);
}
}

@ -17,6 +17,12 @@ class MalioPay extends AbstractPayment
{
$price = $request->getParam('price');
$type = $request->getParam('type');
$shopid = $request->getParam('shopid');
if ($shopid == null) {
$shopid = 0;
}
$user = Auth::getUser();
if ($type != 'alipay' and $type != 'wechat') {
return json_encode(['ret' => 0, 'msg' => 'wrong type']);
@ -35,7 +41,7 @@ class MalioPay extends AbstractPayment
switch ($payment_system) {
case ('bitpayx'):
$bitpayx = new BitPayX(Config::get('bitpay_secret'));
$result = $bitpayx->purchase_maliopay($type, $price);
$result = $bitpayx->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -69,7 +75,7 @@ class MalioPay extends AbstractPayment
return json_encode($return);
case ('f2fpay'):
$f2fpay = new AopF2F();
$result = $f2fpay->purchase_maliopay($type, $price);
$result = $f2fpay->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -86,7 +92,7 @@ class MalioPay extends AbstractPayment
return json_encode($return);
case ('stripe'):
$stripe = new StripePay();
$result = $stripe->purchase_maliopay($type, $price);
$result = $stripe->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -103,7 +109,7 @@ class MalioPay extends AbstractPayment
return json_encode($return);
case ('wolfpay'):
$wolfpay = new Wolfpay();
$result = $wolfpay->purchase_maliopay($type, $price);
$result = $wolfpay->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -120,7 +126,7 @@ class MalioPay extends AbstractPayment
return json_encode($return);
case ('materialpay'):
$materialpay = new MaterialPay(Config::get('materialpay_secret'));
$result = $materialpay->purchase_maliopay($type, $price);
$result = $materialpay->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -141,7 +147,7 @@ class MalioPay extends AbstractPayment
switch ($payment_system) {
case ('bitpayx'):
$bitpayx = new BitPayX(Config::get('bitpay_secret'));
$result = $bitpayx->purchase_maliopay($type, $price);
$result = $bitpayx->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -175,7 +181,7 @@ class MalioPay extends AbstractPayment
return json_encode($return);
case ('stripe'):
$stripe = new StripePay();
$result = $stripe->purchase_maliopay($type, $price);
$result = $stripe->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,
@ -192,7 +198,7 @@ class MalioPay extends AbstractPayment
return json_encode($return);
case ('materialpay'):
$materialpay = new MaterialPay(Config::get('materialpay_secret'));
$result = $materialpay->purchase_maliopay($type, $price);
$result = $materialpay->purchase_maliopay($type, $price,$shopid);
if ($result['errcode'] == 0) {
$return = array(
'ret' => 1,

@ -63,7 +63,6 @@ class MaterialPay extends AbstractPayment
{
$price = $request->getParam('price');
$type = $request->getParam('type');
if ($price <= 0) {
return json_encode(['code' => -1, 'errmsg' => '非法的金额.']);
}
@ -92,7 +91,7 @@ class MaterialPay extends AbstractPayment
return json_encode($result);
}
public function purchase_maliopay($type, $price)
public function purchase_maliopay($type, $price, $shopid=0)
{
if ($price <= 0) {
return json_encode(['code' => -1, 'errmsg' => '非法的金额.']);
@ -108,6 +107,9 @@ class MaterialPay extends AbstractPayment
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
if ($shopid != 0) {
$pl->shopid = $shopid;
}
$pl->save();
$data['appId'] = Config::get('materialpay_appid');

@ -1,189 +1,189 @@
<?php
namespace App\Services\Gateway;
use App\Services\View;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
class PAYJS extends AbstractPayment
{
private $appSecret;
private $gatewayUri;
/**
* 签名初始化
* @param merKey 签名密钥
*/
public function __construct($appSecret)
{
$this->appSecret = $appSecret;
$this->gatewayUri = 'https://payjs.cn/api/';
}
/**
* @name 准备签名/验签字符串
*/
public function prepareSign($data)
{
$data['mchid'] = Config::get('payjs_mchid');
$data = array_filter($data);
ksort($data);
return http_build_query($data);
}
/**
* @name 生成签名
* @param sourceData
* @return 签名数据
*/
public function sign($data)
{
return strtoupper(md5(urldecode($data) . '&key=' . $this->appSecret));
}
/*
* @name 验证签名
* @param signData 签名数据
* @param sourceData 原数据
* @return
*/
public function verify($data, $signature)
{
$mySign = $this->sign($data);
return $mySign === $signature;
}
public function post($data, $type = 'pay')
{
if ($type == 'pay') {
$this->gatewayUri .= 'cashier';
} elseif ($type == 'refund') {
$this->gatewayUri .= 'refund';
} else {
$this->gatewayUri .= 'check';
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->gatewayUri);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$data = curl_exec($curl);
curl_close($curl);
return $data;
}
public function purchase($request, $response, $args)
{
$price = $request->getParam('price');
$type = $request->getParam('type');
if ($price <= 0) {
return json_encode(['code' => -1, 'errmsg' => '非法的金额.']);
}
$user = Auth::getUser();
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
$pl->save();
//if ($type != 'alipay') {
//$type = '';
//}
$data['mchid'] = Config::get('payjs_mchid');
//$data['type'] = $type;
$data['out_trade_no'] = $pl->tradeno;
$data['total_fee'] = (float) $price * 100;
$data['notify_url'] = Config::get('baseUrl') . '/payment/notify?way=payjs';
//$data['callback_url'] = Config::get('baseUrl') . '/user/code';
$params = $this->prepareSign($data);
$data['sign'] = $this->sign($params);
$url = 'https://payjs.cn/api/cashier?' . http_build_query($data);
return json_encode(['code' => 0, 'url' => $url, 'pid' => $data['out_trade_no']]);
//$result = json_decode($this->post($data), true);
//$result['pid'] = $pl->tradeno;
//return json_encode($result);
}
public function query($tradeNo)
{
$data['payjs_order_id'] = $tradeNo;
$params = $this->prepareSign($data);
$data['sign'] = $this->sign($params);
return json_decode($this->post($data, $type = 'query'), true);
}
public function notify($request, $response, $args)
{
$data = $_POST;
if($data['return_code'] == 1){
// 验证签名
$in_sign = $data['sign'];
unset($data['sign']);
$data = array_filter($data);
ksort($data);
$sign = strtoupper(md5(urldecode(http_build_query($data) . '&key=' . $this->appSecret)));
$resultVerify = $sign ? true : false;
//$str_to_sign = $this->prepareSign($data);
//$resultVerify = $this->verify($str_to_sign, $request->getParam('sign'));
if ($resultVerify) {
// 验重
$p = Paylist::where('tradeno', '=', $data['out_trade_no'])->first();
$money = $p->total;
if ($p->status != 1) {
$this->postPayment($data['out_trade_no'], '微信支付');
echo 'SUCCESS';
} else {
echo 'ERROR';
}
} else {
echo 'FAIL2';
}
} else {
echo 'FAIL1';
}
}
public function refund($merchantTradeNo)
{
$data['payjs_order_id'] = $merchantTradeNo;
$params = $this->prepareSign($data);
$data['sign'] = $this->sign($params);
return $this->post($data, 'refund');
}
public function getPurchaseHTML()
{
return 1;
}
public function getReturnHTML($request, $response, $args)
{
$pid = $_GET['merchantTradeNo'];
$p = Paylist::where('tradeno', '=', $pid)->first();
$money = $p->total;
if ($p->status == 1) {
$success = 1;
} else {
$data = $_POST;
$in_sign = $data['sign'];
unset($data['sign']);
$data = array_filter($data);
ksort($data);
$sign = strtoupper(md5(urldecode(http_build_query($data) . '&key=' . $this->appSecret)));
$resultVerify = $sign ? true : false;
if ($resultVerify) {
$this->postPayment($data['out_trade_no'], '微信支付');
$success = 1;
} else {
$success = 0;
}
}
return View::getSmarty()->assign('money', $money)->assign('success', $success)->fetch('user/pay_success.tpl');
}
public function getStatus($request, $response, $args)
{
$return = [];
$p = Paylist::where('tradeno', $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;
return json_encode($return);
}
}
<?php
namespace App\Services\Gateway;
use App\Services\View;
use App\Services\Auth;
use App\Services\Config;
use App\Models\Paylist;
class PAYJS extends AbstractPayment
{
private $appSecret;
private $gatewayUri;
/**
* 签名初始化
* @param merKey 签名密钥
*/
public function __construct($appSecret)
{
$this->appSecret = $appSecret;
$this->gatewayUri = 'https://payjs.cn/api/';
}
/**
* @name 准备签名/验签字符串
*/
public function prepareSign($data)
{
$data['mchid'] = Config::get('payjs_mchid');
$data = array_filter($data);
ksort($data);
return http_build_query($data);
}
/**
* @name 生成签名
* @param sourceData
* @return 签名数据
*/
public function sign($data)
{
return strtoupper(md5(urldecode($data) . '&key=' . $this->appSecret));
}
/*
* @name 验证签名
* @param signData 签名数据
* @param sourceData 原数据
* @return
*/
public function verify($data, $signature)
{
$mySign = $this->sign($data);
return $mySign === $signature;
}
public function post($data, $type = 'pay')
{
if ($type == 'pay') {
$this->gatewayUri .= 'cashier';
} elseif ($type == 'refund') {
$this->gatewayUri .= 'refund';
} else {
$this->gatewayUri .= 'check';
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->gatewayUri);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$data = curl_exec($curl);
curl_close($curl);
return $data;
}
public function purchase($request, $response, $args)
{
$price = $request->getParam('price');
$type = $request->getParam('type');
if ($price <= 0) {
return json_encode(['code' => -1, 'errmsg' => '非法的金额.']);
}
$user = Auth::getUser();
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
$pl->save();
//if ($type != 'alipay') {
//$type = '';
//}
$data['mchid'] = Config::get('payjs_mchid');
//$data['type'] = $type;
$data['out_trade_no'] = $pl->tradeno;
$data['total_fee'] = (float) $price * 100;
$data['notify_url'] = Config::get('baseUrl') . '/payment/notify?way=payjs';
//$data['callback_url'] = Config::get('baseUrl') . '/user/code';
$params = $this->prepareSign($data);
$data['sign'] = $this->sign($params);
$url = 'https://payjs.cn/api/cashier?' . http_build_query($data);
return json_encode(['code' => 0, 'url' => $url, 'pid' => $data['out_trade_no']]);
//$result = json_decode($this->post($data), true);
//$result['pid'] = $pl->tradeno;
//return json_encode($result);
}
public function query($tradeNo)
{
$data['payjs_order_id'] = $tradeNo;
$params = $this->prepareSign($data);
$data['sign'] = $this->sign($params);
return json_decode($this->post($data, $type = 'query'), true);
}
public function notify($request, $response, $args)
{
$data = $_POST;
if($data['return_code'] == 1){
// 验证签名
$in_sign = $data['sign'];
unset($data['sign']);
$data = array_filter($data);
ksort($data);
$sign = strtoupper(md5(urldecode(http_build_query($data) . '&key=' . $this->appSecret)));
$resultVerify = $sign ? true : false;
//$str_to_sign = $this->prepareSign($data);
//$resultVerify = $this->verify($str_to_sign, $request->getParam('sign'));
if ($resultVerify) {
// 验重
$p = Paylist::where('tradeno', '=', $data['out_trade_no'])->first();
$money = $p->total;
if ($p->status != 1) {
$this->postPayment($data['out_trade_no'], '微信支付');
echo 'SUCCESS';
} else {
echo 'ERROR';
}
} else {
echo 'FAIL2';
}
} else {
echo 'FAIL1';
}
}
public function refund($merchantTradeNo)
{
$data['payjs_order_id'] = $merchantTradeNo;
$params = $this->prepareSign($data);
$data['sign'] = $this->sign($params);
return $this->post($data, 'refund');
}
public function getPurchaseHTML()
{
return 1;
}
public function getReturnHTML($request, $response, $args)
{
$pid = $_GET['merchantTradeNo'];
$p = Paylist::where('tradeno', '=', $pid)->first();
$money = $p->total;
if ($p->status == 1) {
$success = 1;
} else {
$data = $_POST;
$in_sign = $data['sign'];
unset($data['sign']);
$data = array_filter($data);
ksort($data);
$sign = strtoupper(md5(urldecode(http_build_query($data) . '&key=' . $this->appSecret)));
$resultVerify = $sign ? true : false;
if ($resultVerify) {
$this->postPayment($data['out_trade_no'], '微信支付');
$success = 1;
} else {
$success = 0;
}
}
return View::getSmarty()->assign('money', $money)->assign('success', $success)->fetch('user/pay_success.tpl');
}
public function getStatus($request, $response, $args)
{
$return = [];
$p = Paylist::where('tradeno', $_POST['pid'])->first();
$return['ret'] = 1;
$return['result'] = $p->status;
return json_encode($return);
}
}

@ -23,6 +23,10 @@ class StripePay extends AbstractPayment
{
$price = $request->getParam('price');
$type = $request->getParam('type');
$shopid = $request->getParam('shopid');
if ($shopid == null) {
$shopid = 0;
}
$user = Auth::getUser();
if ($type != 'alipay' and $type != 'wechat') {
return json_encode(['errcode' => -1, 'errmsg' => 'wrong payment.']);
@ -55,16 +59,27 @@ class StripePay extends AbstractPayment
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = $source['id'];
if ($shopid != 0) {
$pl->shopid = $shopid;
}
$pl->save();
if ($type == 'alipay') {
return json_encode(array('url' => $source['redirect']['url'], 'errcode' => 0, 'pid' => $pl->id));
return json_encode(array('url' => $source['redirect']['url'], 'errcode' => 0, 'pid' => $pl->id, 'tradeno' => $source['id']));
} else {
return json_encode(array('url' => $source['wechat']['qr_code_url'], 'errcode' => 0, 'pid' => $pl->id));
if (MalioConfig::get('payment_v2') == true) {
return json_encode(array('url' => '/user/qrcode?type=alipay'
.'&qrcode='.rawurlencode($source['wechat']['qr_code_url'])
.'&tradeno='.$pl->tradeno
.'&price='.$price,
'errcode' => 0, 'pid' => $pl->id, 'tradeno' => $source['id']));
} else {
return json_encode(array('url' => $source['wechat']['qr_code_url'], 'errcode' => 0, 'pid' => $pl->id, 'tradeno' => $source['id']));
}
}
}
public function purchase_maliopay($type, $price)
public function purchase_maliopay($type, $price, $shopid=0)
{
$user = Auth::getUser();
if ($type != 'alipay' and $type != 'wechat') {
@ -98,6 +113,9 @@ class StripePay extends AbstractPayment
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = $source['id'];
if ($shopid != 0) {
$pl->shopid = $shopid;
}
$pl->save();
if ($type == 'alipay') {

@ -20,13 +20,16 @@ class Wolfpay extends AbstractPayment {
return '';
}
public function purchase_maliopay($type, $price) {
public function purchase_maliopay($type, $price, $shopid=0) {
$user = Auth::getUser();
$settings = Config::get("wolfpay")['config'];
$pl = new Paylist();
$pl->userid = $user->id;
$pl->total = $price;
$pl->tradeno = self::generateGuid();
if ($shopid != 0) {
$pl->shopid = $shopid;
}
$pl->save();
//支付方式

@ -9,7 +9,7 @@
namespace App\Services;
use App\Services\Gateway\{
AopF2F, Codepay, DoiAMPay, PaymentWall, ChenPay, SPay, TrimePay, BitPayX, TomatoPay, flyfoxpay, PAYJS, F2Fpay_PAYJS, StripePay, Payssion, YftPay, MalioPay, IDtPay
AopF2F, Codepay, DoiAMPay, PaymentWall, ChenPay, SPay, TrimePay, BitPayX, TomatoPay, flyfoxpay, PAYJS, F2Fpay_PAYJS, StripePay, Payssion, YftPay, MalioPay, IDtPay, CustomPay
};
class Payment
@ -48,6 +48,8 @@ class Payment
return new MalioPay();
case ("idtpay"):
return new IDtPay();
case ("custompay"):
return new CustomPay();
default:
return null;
}

@ -1,537 +0,0 @@
<?php
//注释里请勿使用英文方括号、分号、单引号,否则迁移Config时会出错
//config迁移附注(由开发者填写本次config迁移后需要注意的地方,站长勿动)
//如需换行,直接换行即可,无需换行符
//【新增/删除】config无需写入迁移附注
$_ENV['config_migrate_notice']=
'enable_geetest_* 已变更为 enable_*_captcha
crisp已被替换为mylivechat
telegrma_qrcode被重命名为qrcode
';
$_ENV['version'] = '1'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
//基本设置--------------------------------------------------------------------------------------------
$_ENV['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$_ENV['debug'] = false; //正式环境请确保为 false
$_ENV['appName'] = 'Malio'; //站点名称
$_ENV['baseUrl'] = 'http://url.com'; //站点地址
$_ENV['subUrl'] = $_ENV['baseUrl'] . '/link/'; //订阅地址,如需和站点名称相同,请不要修改
$_ENV['muKey'] = 'default_mu_key'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作!
$_ENV['db_driver'] = 'mysql'; //数据库程序
$_ENV['db_host'] = 'localhost'; //数据库地址
$_ENV['db_database'] = 'sspanel'; //数据库名
$_ENV['db_username'] = 'root'; //数据库用户名
$_ENV['db_password'] = 'sspanel'; //用户名对应的密码
// 新旧首页设置--------------------------------------------------------------------------------------------
$_ENV['newIndex'] = true; //使用新的 Node.js 开发的首页请填写 true,其他值为使用先前的首页,如您使用其他主题请保持 true
$_ENV['checkNodeIp'] = true; //是否webapi验证节点ip
// 订阅中的公告信息
// 使用数组形式,将会添加在订阅列表的顶端
// 可用于为用户推送最新地址等信息,尽可能简短且数量不宜太多
$_ENV['sub_message'] = [];
$_ENV['enable_sub_extend'] = true; // 是否开启订阅中默认显示流量剩余以及账户到期时间以及 sub_message 中的信息
$_ENV['disable_sub_mu_port'] = false; // 将订阅中单端口的信息去除
//邮件设置--------------------------------------------------------------------------------------------
$_ENV['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid
$_ENV['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题
# mailgun
$_ENV['mailgun_key'] = '';
$_ENV['mailgun_domain'] = '';
$_ENV['mailgun_sender'] = '';
# smtp
$_ENV['smtp_host'] = '';
$_ENV['smtp_username'] = '';
$_ENV['smtp_port'] = 465;
$_ENV['smtp_name'] = '';
$_ENV['smtp_sender'] = '';
$_ENV['smtp_passsword'] = '';
$_ENV['smtp_ssl'] = true;
# sendgrid
$_ENV['sendgrid_key'] = '';
$_ENV['sendgrid_sender'] = '';
//备份设置--------------------------------------------------------------------------------------------
$_ENV['auto_backup_email'] = ''; //接收备份的邮箱
$_ENV['auto_backup_passwd'] = ''; //备份的压缩密码
$_ENV['backup_notify'] = false; //备份通知到TG群中
//用户注册设置-----------------------------------------------------------------------------------------
$_ENV['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码
$_ENV['defaultTraffic'] = 1; //用户初始流量 单位GB
$_ENV['user_expire_in_default'] = 3650; //用户账户过期时间,在注册时设置。(天)
$_ENV['user_class_default'] = 0; //用户注册等级,在注册时设置。
$_ENV['user_class_expire_default'] = 24; //用户等级过期时间,在注册时设置。(小时)
$_ENV['user_conn'] = 0; //用户注册客户端数量限制,0为不限制
$_ENV['user_speedlimit'] = 0; //用户注册速度默认限制,0为不限制
$_ENV['reg_auto_reset_day'] = 0; //注册时的流量重置日,0为不重置
$_ENV['reg_auto_reset_bandwidth'] = 0; //需要重置的流量,0为不重置
$_ENV['ramdom_group'] = 0; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$_ENV['reg_method'] = 'chacha20-ietf'; //注册时默认加密方式
$_ENV['reg_protocol'] = 'auth_aes128_sha1'; //注册时默认协议
$_ENV['reg_protocol_param'] = ''; //注册时默认协议参数
$_ENV['reg_obfs'] = 'http_simple'; //注册时默认混淆方式
$_ENV['reg_obfs_param'] = ''; //注册时默认混淆参数 设置单端口后 这边必须配置!填写www.jd.hk就行
$_ENV['reg_forbidden_ip'] = '127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$_ENV['min_port'] = 10000; //用户端口池最小值
$_ENV['max_port'] = 65535; //用户端口池最大值
$_ENV['reg_forbidden_port'] = ''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$_ENV['mu_suffix'] = 'microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致
$_ENV['mu_regex'] = '%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
#邀请链接
$_ENV['inviteNum'] = 10; //注册后的邀请链接可用次数
$_ENV['invite_get_money'] = 1; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
$_ENV['invite_price'] = -1; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买
$_ENV['custom_invite_price'] = -1; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买
#邮箱验证
$_ENV['enable_email_verify'] = false; //是否启用注册邮箱验证码
$_ENV['email_verify_ttl'] = 3600; //邮箱验证码有效期
$_ENV['email_verify_iplimit'] = 10; //验证码有效期内,单IP可请求验证码次数
//已注册用户设置---------------------------------------------------------------------------------------
#基础
$_ENV['checkinMin'] = 1; //用户签到最少流量 单位MB
$_ENV['checkinMax'] = 50; //用户签到最多流量
$_ENV['auto_clean_uncheck_days'] = -1; //自动清理多少天没签到的0级用户,小于等于0时关闭
$_ENV['auto_clean_unused_days'] = -1; //自动清理多少天没使用的0级用户,小于等于0时关闭
$_ENV['auto_clean_min_money'] = 1; //余额低于多少的0级用户可以被清理
$_ENV['code_payback'] = 20; //充值返利百分比
$_ENV['invite_gift'] = 2; //邀请新用户获得流量奖励,单位G
$_ENV['enable_bought_reset'] = true; //购买时是否重置流量
$_ENV['enable_bought_extend'] = true; //购买时是否延长等级期限(同等级配套)
$_ENV['port_price'] = -1; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买
$_ENV['port_price_specify'] = -1; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买
#高级
$_ENV['class_expire_reset_traffic'] = 0; //等级到期时重置为的流量值,单位GB,小于0时不重置
$_ENV['account_expire_delete_days'] = -1; //账户到期几天之后会删除账户,小于0时不删除
$_ENV['enable_kill'] = true; //是否允许用户注销账户
$_ENV['notify_limit_mode'] = false; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
$_ENV['notify_limit_value'] = 20; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
$_ENV['mergeSub'] = true; //合并订阅设置 可选项 false / true
$_ENV['protocol_specify'] = true; //允许用户自行切换加密、协议、混淆,允许请填写 true,禁止用户自行修改将使用下方配置的方案
$_ENV['keep_connect'] = false; //是否开启用户流量耗尽后降低速率至 1Mbps 而不断网
#加密、协议、混淆切换方案
$_ENV['user_agreement_scheme'] = [
['id'=>1,'name'=>'SS 推荐配置','method'=>'chacha20-ietf-poly1305','protocol'=>'origin','obfs'=>'plain'],
['id'=>2,'name'=>'SSR 推荐配置','method'=>'chacha20-ietf','protocol'=>'auth_aes128_sha1','obfs'=>'http_simple_compatible'],
['id'=>3,'name'=>'SS/SSR 兼容配置','method'=>'chacha20-ietf','protocol'=>'auth_aes128_sha1_compatible','obfs'=>'plain']
];
$_ENV['subscribeLog'] = false; //是否记录用户订阅日志
$_ENV['subscribeLog_keep_days'] = 7; //订阅记录保留天数
//Bot 设置--------------------------------------------------------------------------------------------
#通用
$_ENV['finance_public'] = false; //财务报告是否向群公开
$_ENV['enable_welcome_message'] = true; //机器人发送欢迎消息
# Telegram BOT
$_ENV['use_new_telegram_bot'] = true; //是否使用新的 Telegram Bot
$_ENV['enable_telegram'] = false; //是否开启Telegram Bot
$_ENV['telegram_token'] = ''; //Telegram Bot 的 Token,跟 Father Bot 申请
$_ENV['telegram_bot'] = ''; //Telegram Bot 用户名
$_ENV['telegram_group_quiet'] = false; //Telegram Bot 在群组中不回应
$_ENV['telegram_chatid'] = ''; //Telegram 群组会话 ID,把 Bot 拉进群里之后跟他 /ping 一下即可得到。
$_ENV['telegram_request_token'] = ''; //Telegram 机器人请求验证 Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
$_ENV['enable_tuling'] = false; //是否开启图灵机器人
$_ENV['tuling_apikey'] = ''; //图灵机器人 API Key
$_ENV['tuling_apisecert'] = ''; //图灵机器人密钥
# Telegram BOT 其他选项
$_ENV['show_group_link'] = false; //在 Bot 菜单中显示加入用户群
$_ENV['telegram_group_link'] = ''; //用户群的链接
$_ENV['group_bound_user'] = false; //仅允许已绑定 Telegram 账户的用户加入 telegram_chatid 设定的群组
$_ENV['allow_to_join_new_groups'] = true; //允许 Bot 加入下方配置之外的群组
$_ENV['group_id_allowed_to_join'] = []; //允许加入的群组 ID,格式为 PHP 数组
$_ENV['telegram_admins'] = []; //Telegram 管理员 ID,格式为 PHP 数组
$_ENV['unbind_kick_member'] = false; //用户解绑 Telegram 账户后自动踢出群组
$_ENV['enable_not_admin_reply'] = true; //非管理员操作管理员功能是否回复
$_ENV['not_admin_reply_msg'] = '!'; //非管理员操作管理员功能的回复内容
$_ENV['no_user_found'] = '!'; //管理员操作时,找不到用户的回复
$_ENV['no_search_value_provided'] = '!'; //管理员操作时,没有提供用户搜索值的回复
$_ENV['data_method_not_found'] = '!'; //管理员操作时,修改数据的字段没有找到的回复
$_ENV['delete_message_time'] = 180; //在以下时间后删除用户命令触发的 bot 回复,单位:秒,删除时间可能会因为定时任务而有差异,为 0 代表不开启此功能
$_ENV['delete_admin_message_time'] = 86400; //在以下时间后删除管理命令触发的 bot 回复,单位:秒,删除时间可能会因为定时任务而有差异,为 0 代表不开启此功能
$_ENV['enable_delete_user_cmd'] = false; //自动删除群组中用户发送的命令,使用 delete_message_time 配置的时间,删除时间可能会因为定时任务而有差异
$_ENV['help_any_command'] = false; //允许任意未知的命令触发 /help 的回复
$_ENV['remark_user_search_email'] = ['邮箱']; //用户搜索字段 email 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_search_port'] = ['端口']; //用户搜索字段 port 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_is_admin'] = ['管理员']; //用户搜索字段 is_admin 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_enable'] = ['用户启用']; //用户搜索字段 enable 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_money'] = ['金钱', '余额']; //用户搜索字段 money 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_port'] = ['端口']; //用户搜索字段 port 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_transfer_enable'] = ['流量']; //用户搜索字段 transfer_enable 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_passwd'] = ['连接密码']; //用户搜索字段 passwd 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_method'] = ['加密']; //用户搜索字段 method 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_protocol'] = ['协议']; //用户搜索字段 protocol 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_protocol_param'] = ['协参', '协议参数']; //用户搜索字段 protocol_param 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_obfs'] = ['混淆']; //用户搜索字段 obfs 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_obfs_param'] = ['混参', '混淆参数']; //用户搜索字段 obfs_param 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_invite_num'] = ['邀请数量']; //用户搜索字段 invite_num 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_node_group'] = ['用户组', '用户分组']; //用户搜索字段 node_group 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_class'] = ['等级']; //用户搜索字段 class 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_class_expire'] = ['等级过期时间']; //用户搜索字段 class_expire 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_expire_in'] = ['账号过期时间']; //用户搜索字段 expire_in 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_node_speedlimit'] = ['限速']; //用户搜索字段 node_speedlimit 的别名,可多个,格式为 PHP 数组
$_ENV['remark_user_option_node_connector'] = ['连接数', '客户端']; //用户搜索字段 node_connector 的别名,可多个,格式为 PHP 数组
$_ENV['enable_user_email_group_show'] = false; //开启在群组搜寻用户信息时显示用户完整邮箱,关闭则会对邮箱中间内容打码,如 g****@gmail.com
$_ENV['user_not_bind_reply'] = '您未绑定本站账号,您可以进入网站的 **资料编辑**,在右下方绑定您的账号.'; //未绑定账户的回复
$_ENV['telegram_general_pricing'] = '产品介绍.'; //面向游客的产品介绍
$_ENV['telegram_general_terms'] = '服务条款.'; //面向游客的服务条款
//沟通设置--------------------------------------------------------------------------------------------
#客服系统设置,注册地址 https://www.mylivechat.com
#此项在 malio 主题中已被废弃
$_ENV['enable_mylivechat'] = false; //是否开启客服系统
$_ENV['mylivechat_id'] = ''; //客服系统ID
# PushBear 基于微信模板的向关注了二维码的用户以微信方式推送消息 https://pushbear.ftqq.com/
$_ENV['usePushBear'] = false; // true 启用 false 禁用
$_ENV['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错
#工单系统设置
$_ENV['enable_ticket'] = true; //是否开启工单系统
$_ENV['mail_ticket'] = true; //是否开启工单邮件提醒
# Server酱 用户提交新工单或者回复工单时用微信提醒机场主 http://sc.ftqq.com/
$_ENV['useScFtqq'] = false; //是否开启工单Server酱提醒
$_ENV['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错
#管理员联系方式设置
#此项在 malio 主题中已被废弃,即时通讯请用客服系统
$_ENV['enable_admin_contact']=false; //是否开启管理员联系方式
$_ENV['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例
$_ENV['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式
$_ENV['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空
//验证码设置------------------------------------------------------------------------------------------
$_ENV['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验)
$_ENV['recaptcha_sitekey'] = '';
$_ENV['recaptcha_secret'] = '';
$_ENV['geetest_id'] = '';
$_ENV['geetest_key'] = '';
$_ENV['enable_reg_captcha'] = false; //启用注册验证码
$_ENV['enable_login_captcha'] = false; //启用登录验证码
$_ENV['enable_checkin_captcha'] = false; //启用签到验证码
//支付系统设置----------------------------------------------------------------------------------------
#取值 none | codepay | trimepay | f2fpay | chenAlipay | paymentwall | spay | tomatopay | bitpayx | flyfoxpay | payjs | f2fpay_payjs | stripe | payssion | yftpay
# 当此项设置为 malio 时即可使用malio聚合支付系统
$_ENV['payment_system']='none';
# Stripe
$_ENV['stripe_key'] = '';
$_ENV['stripe_webhook_endpoint_secret'] = '';
# wolfpay 以下内容可以在用户中心首页下方取得 (仅在malio聚合支付系统下生效)
$_ENV['wolfpay']=['config'=>[
'hid'=>'商户ID',
'key'=>'商户KEY',
'url'=>'商户API网址'
]];
# payssion
$_ENV['payssion_api_key'] = '';
$_ENV['payssion_secret_key'] = '';
#yft支付设置
$_ENV['yft_secret']='';
$_ENV['yft_accesskey']='';
#codepay码支付
#wiki地址:https://goo.gl/dRwRDi http://t.cn/RnsWjtB
$_ENV['codepay_id'] = ''; //码支付ID
$_ENV['codepay_key'] = ''; //码支付通信密钥
#alipay,f2fpay
$_ENV['f2fpay_app_id'] = '';
$_ENV['f2fpay_p_id'] = '';
$_ENV['alipay_public_key'] = '';
$_ENV['merchant_private_key'] = '';
$_ENV['f2fNotifyUrl'] = null; //自定义当面付回调地址
#PaymentWall
#此项在 malio 主题中暂未支持
$_ENV['pmw_publickey']='';
$_ENV['pmw_privatekey']='';
$_ENV['pmw_widget']='m2_1';
$_ENV['pmw_height']='350px';
#alipay,spay
$_ENV['alipay_id'] = '';
$_ENV['alipay_key'] = '';
$_ENV['amount'] = [2, 23, 233, 2333, 23333]; //充值金额选项设定
#alipay,zfbjk.com
#此项在 malio 主题中暂未支持
$_ENV['zfbjk_pid']='';
$_ENV['zfbjk_key']='';
$_ENV['zfbjk_qrcodeurl']='';
# BitPay 数字货币支付(比特币、以太坊、EOS等) 商户后台获取授权码 https://merchants.mugglepay.com/
# 客服和技术 24x7 在线支持: https://t.me/joinchat/GLKSKhUnE4GvEAPgqtChAQ
$_ENV['bitpay_secret'] = '';
# materialpay
$_ENV['materialpay_appid']=''; //AppID
$_ENV['materialpay_secret']=''; //AppSecret
#PayJs
$_ENV['payjs_mchid'] = '';
$_ENV['payjs_key'] = '';
$_ENV['idtpay']=[
'partner'=>"", //商户号
'key' =>"", //商户key
'sign_type'=>strtoupper('MD5'),
'input_charset'=>strtolower('utf-8'),
'subjects'=>["内存",'手抓饼'], //商品名称
'transport'=>'https' ,//访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
'apiurl'=>'https://pay.idt.xyz/', //http开头
'appname'=>$_ENV['appName'],
];
#tomatopay番茄云支付
#使用教程:https://swapidc.fanqieui.com/?t/329.html tg群 https://t.me/fanqiepay
$_ENV['tomatopay'] = [
'wxpay'=>[
'mchid' => '', // 商户号
'account' => '', //您在番茄云支付的登录邮箱
'token' => "" // 安全验证码
],
'alipay'=>[
'mchid' => '', // 商户号
'account' => '', //您在番茄云支付的登录邮箱
'token' => "" // 安全验证码
],
];
# flyfox
$_ENV['flyfoxpay'] = [
'config' => [
'hid'=>'******',
'key'=>'********',
'mail'=>'*******@****.***'
]
];
//其他面板显示设置------------------------------------------------------------------------------------------
#用户文档
#此项在 malio 主题中未被支持
$_ENV['enable_documents'] = false; //是否允许未登陆用户查看文档中心
$_ENV['documents_name'] = $_ENV['appName'] . ' 文档中心'; //文档中心名称
$_ENV['remote_documents'] = true; //是否从远程加载文档中心,否的话请执行 php xcat initdocuments
$_ENV['documents_source'] = 'https://raw.githubusercontent.com/GeekQu/PANEL_DOC/master/GeekQu'; //远程文档加载地址
#后台商品列表 销量统计
$_ENV['sales_period'] = 30; //统计指定周期内的销量,值为【expire/任意大于0的整数】
#国旗
#此项在 malio 主题中已被废弃
$_ENV['enable_flag'] = true; //启用该项之前务必先仔细阅读教程
$_ENV['flag_regex'] = '/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版)
#捐赠
#此项在 malio 主题中已被废弃
$_ENV['enable_donate'] = true; //是否显示用户捐赠(所有收入将被公开)
#iOS账户显示
#此项在 malio 主题中已被废弃
$_ENV['display_ios_class'] = -1; //至少等级为多少的用户可以看见,小于0时关闭此功能
$_ENV['display_ios_topup'] = 0; //满足等级要求后,累计充值高于多少的用户可以看见
$_ENV['ios_account'] = ''; //iOS账户
$_ENV['ios_password'] = ''; //iOS密码
//节点检测-----------------------------------------------------------------------------------------------
#GFW检测,请通过crontab进行【开启/关闭】
$_ENV['detect_gfw_interval'] = 3600; //检测间隔,单位:秒,低于推荐值会爆炸
$_ENV['detect_gfw_port'] = 22; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口)
$_ENV['detect_gfw_url'] = 'https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL
$_ENV['detect_gfw_judge'] = '$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组
$_ENV['detect_gfw_count'] = '3'; //尝试次数
#离线检测
$_ENV['enable_detect_offline'] = true;
#离线检测是否推送到Server酱 请配置好上文的Server配置
$_ENV['enable_detect_offline_useScFtqq'] = false;
//V2Ray相关设置------------------------------------------------------------------------------------------
$_ENV['v2ray_port'] = 443; //V2Ray端口
$_ENV['v2ray_protocol'] = 'HTTP/2 + TLS'; //V2Ray协议
$_ENV['v2ray_alter_id'] = 32;
$_ENV['v2ray_level'] = '0';
//以下所有均为高级设置(一般用不上,不用改---------------------------------------------------------------------
#杂项
$_ENV['enable_login_bind_ip'] = true; //是否将登陆线程和IP绑定
$_ENV['rememberMeDuration'] = 7; //登录时记住账号时长天数
$_ENV['authDriver'] = 'cookie'; //不能更改此项
$_ENV['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
$_ENV['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项
$_ENV['sessionDriver'] = 'cookie'; //可选: cookie,redis
$_ENV['cacheDriver'] = 'cookie'; //可选: cookie,redis
$_ENV['tokenDriver'] = 'db'; //可选: db,redis
$_ENV['jump_delay'] = 1200; //跳转延时,单位ms,不建议太长
$_ENV['theme'] = 'malio'; //主题
$_ENV['pacp_offset'] = -20000; //VPN 端口偏移
$_ENV['pacpp_offset'] = -20000;
$_ENV['Speedtest_duration'] = 6; //显示多长时间的测速记录
$_ENV['login_warn'] = true; //异地登陆提示
$_ENV['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$_ENV['db_charset'] = 'utf8';
$_ENV['db_collation'] = 'utf8_general_ci';
$_ENV['db_prefix'] = '';
$_ENV['muKeyList'] = []; //多 key 列表
$_ENV['subscribe_client'] = false; //下载协议客户端时附带节点和订阅信息
$_ENV['subscribe_client_url'] = ''; //使用独立的服务器提供附带节点和订阅信息的协议客户端下载,为空表示不使用
$_ENV['mu_port_migration'] = false; //为后端直接下发偏移后的端口
$_ENV['add_emoji_to_node_name'] = false; //为部分订阅中默认添加 emoji
$_ENV['add_appName_to_ss_uri'] = true; //为 SS 节点名称中添加站点名
$_ENV['enable_sub_cache'] = false; //订阅信息缓存
$_ENV['sub_cache_time'] = 360; //订阅信息缓存有效时间 (分钟)
$_ENV['sub_cache_max_quantity'] = 15; //每个用户订阅缓存最大数量,请基于磁盘空间考虑
// 审计自动封禁开关
$_ENV['enable_auto_detect_ban'] = false;
// 管理员不受审计限制
$_ENV['auto_detect_ban_allow_admin'] = true;
// 审计封禁的例外用户 ID
$_ENV['auto_detect_ban_allow_users'] = [];
// 审计封禁判断类型:
// - 1 = 仁慈模式,每触碰多少次封禁一次
// - 2 = 疯狂模式,累计触碰次数按阶梯进行不同时长的封禁
$_ENV['auto_detect_ban_type'] = 1;
// 仁慈模式每次执行封禁所需的触发次数
$_ENV['auto_detect_ban_number'] = 30;
// 仁慈模式每次封禁的时长 (分钟)
$_ENV['auto_detect_ban_time'] = 60;
// 疯狂模式阶梯
// key 为触发次数
// - type:可选 time 按时间 或 kill 删号
// - time:时间,单位分钟
$_ENV['auto_detect_ban'] = [
100 => [
'type' => 'time',
'time' => 120
],
300 => [
'type' => 'time',
'time' => 720
],
600 => [
'type' => 'time',
'time' => 4320
],
1000 => [
'type' => 'kill',
'time' => 0
]
];
#aws
$_ENV['aws_access_key_id'] = '';
$_ENV['aws_secret_access_key'] = '';
#redis
$_ENV['redis_scheme'] = 'tcp';
$_ENV['redis_host'] = '127.0.0.1';
$_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'] = 'user@example.com'; //Cloudflare 邮箱地址
$_ENV['cloudflare_key'] = 'c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key
$_ENV['cloudflare_name'] = 'example.com'; //域名
#不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转
$_ENV['relay_insecure_mode'] = false; //强烈推荐不开启
#是否夹带统计代码,自己在 resources/views/{主题名} 下创建一个 analytics.tpl ,如果有必要就用 literal 界定符
$_ENV['enable_analytics_code'] = false;
$_ENV['sspanelAnalysis'] = true;
#在套了CDN之后获取用户真实ip,如果您不知道这是什么,请不要乱动
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
$list = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $list[0];
}
// make replace _ENV with env
function findKeyName($name) {
global $_ENV;
foreach($_ENV as $configKey => $configValue) {
if (strtoupper($configKey) == $name) {
return $configKey;
}
}
return NULL;
}
foreach(getenv() as $envKey => $envValue) {
global $_ENV;
$envUpKey = strtoupper($envKey);
// Key starts with UIM_
if (substr($envUpKey, 0 , 4) == "UIM_") {
// Vaild env key, set to _ENV
$configKey = substr($envUpKey, 4);
$realKey = findKeyName($configKey);
if ($realKey != NULL) {
$_ENV[$realKey] = $envValue;
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,269 +0,0 @@
<?php
/*
__ __ ______ __ __ ______
/\ '-./ \ /\ __ \ /\ \ /\ \ /\ __ \
\ \ \-./\ \ \ \ __ \ \ \ \____ \ \ \ \ \ \/\ \
\ \_\ \ \_\ \ \_\ \_\ \ \_____\ \ \_\ \ \_____\
\/_/ \/_/ \/_/\/_/ \/_____/ \/_/ \/_____/
made by @editXY
*/
####### 版本信息说明(请勿更改) #######
$Malio_Config['config_migrate_notice'] = '';
$Malio_Config['version'] = '1';
####### 通用设置 #######
$Malio_Config['theme_color'] = 'purple'; // 主题颜色,可选值为 purple, blue, darkblue, orange, pink TODO:(此功能尚在开发中)
$Malio_Config['google_analytics_code'] = 'UA-123456789-1'; // Google 统计代码,留空为不开启,code格式为 'UA-123456789-1'
$Malio_Config['login_style'] = 'wallpaper'; // 登录页面的样式,可选 simple 和 wallpaper
$Malio_Config['enable_landing_page'] = true; // 是否启用着陆页用于介绍本站
$Malio_Config['malio_js_version'] = 'v1'; // 可以随便写,每次更新 malio.js 文件就要改变这个值,用户浏览器就会请求最新的js授权文件,就不会出现缓存的问题
$Malio_Config['small_brand'] = 'ML'; // 侧边栏在缩小状态下显示的 logo 名称,建议写两个英文字母或一个中文汉字
####### 面板设置 #######
$Malio_Config['enable_webapi_ip_verification'] = false; // (此项已废弃,可使用.config.php里面的checkNodeIp) 当节点通过 webapi 连接时,不验证节点IP是否与数据库中的IP相同。关闭此选项会降低安全性。设置为 true 为开启 IP 验证
$Malio_Config['enable_webapi_email_hash'] = true; // 启用后,当节点通过 webapi 连接时,传出去的邮件地址会经过md5加密。
$Malio_Config['reset_bandwidth_and_expire_date_when_change_class'] = false; // 设置为true时,当用户购买与用户当前等级不同的套餐时,重置流量和过期时间。(定制功能)
$Malio_Config['force_user_to_bind_tg_when_join_group'] = true; // 设置为true时,限制只有绑定了tg的用户才能加入群组,如未绑定将会被踢出群组。.config.php 需要设置群组id,机器人在群组中不回应设为false才能用。机器人需要在群里组设定为管理员才能踢人。(定制功能)
$Malio_Config['ip_database'] = 'QQWry'; // IP归属地数据库,可选 QQWry | GeoIP2
$Malio_Config['enable_i18n'] = true; // 是否显示切换语言的按钮
$Malio_Config['default_lang'] = 'zh-cn'; // 面板默认的语言,支持 en | zh-cn
$Malio_Config['only_one_lang'] = 'none'; // 强制使用某种语言,支持 en | zh-cn | none
####### 支付系统 #######
// 支付系统写 none 意味着不启用此收款方式
// 支付宝目前支持 bitpayx | stripe | tomatopay | f2fpay | wolfpay | materialpay
$Malio_Config['mups_alipay'] = 'bitpayx'; // Malio 聚合支付系统里面的 支付宝 要用的支付平台
// 微信支付目前支持 bitpayx | stripe | materialpay
$Malio_Config['mups_wechat'] = 'bitpayx'; // Malio 聚合支付系统里面的 微信支付 要用的支付平台
$Malio_Config['mups_minimum_amount'] = 0; // Malio 聚合支付系统限制最低的充值金额
// 下面的选项在 Malio 聚合支付系统无效
$Malio_Config['stripe_minimum_amount'] = 4; // Stripe 支付接口可充值的最低金额
$Malio_Config['stripe_currency'] = 'usd'; // Stripe 支付接口的默认货币,可以写 hkd usd等,stripe限制了收款货币只能是账号注册地区的货币
$Malio_Config['bitpyax_alipay_type'] = 'ALIPAY'; // bitpayx 支付宝充值的类似,ALIPAY是国内支付宝,ALIGLOBAL是国际支付宝
####### 注册 #######
$Malio_Config['code_required'] = false; // 设置为true时,注册时邀请码是必须的。设置为false时,有无邀请码都可以注册,但是可以填邀请码(aff专用)
$Malio_Config['enable_register_email_restrict'] = true; // 设置为true时,会限制注册时使用的邮箱后缀
$Malio_Config['register_email_white_list'] = ['@gmail.com','@qq.com','@outlook.com','@163.com','@126.com','@yeah.net','@foxmail.com']; // 注册时的邮箱后缀白白白白白白名单,仅在上面的设置为true时生效
$Malio_Config['register_email_black_list'] = ['@bcaoo.com','@chacuo.net','@tmpmail.net','@tmail.ws','@tmpmail.org','@moimoi.re','@bccto.me','@027168.com','@disbox.org','@linshiyouxiang.net','@t.odmail.cn','@tmails.net','@moakt.co','@moakt.ws','@disbox.net','@bareed.ws']; // 注册时的邮箱后缀黑黑黑黑黑黑名单
$Malio_Config['enable_sms_verify'] = false; // 是否启用注册时的短信验证码
$Malio_Config['sms_verify_iplimit'] = '5'; // 单IP限制发送短信验证码的次数
$Malio_Config['globalsent_access_key'] = ''; // GlobalSent 的 api key, https://globalsent.com
$Malio_Config['phone_area_code'] = [ // 发送短信支持的手机区号
'86' => '中国 +86',
'1' => '美国 +1',
'852' => '香港 +852',
'81' => '日本 +81',
'44' => '英国 +44',
'61' => '澳大利亚 +61'
];
####### 订阅设置 #######
$Malio_Config['support_sub_type'] = ['ss','ssr','v2ray']; // 选择网站支持的代理协议,会影响复制订阅链接和一键导入按钮的显示。比如删除这个参数里的ss,则 Surge 订阅按钮不会显示再首页上,教程里也不会显示Surge教程
$Malio_Config['quantumult_mode'] = 'single'; // quantumult 一键导入按钮的模式,可选 "single"或"all"。选择single的话只能导入一种订阅(比如只能导入SSR订阅)。选择all的话可以一次性导入全部订阅类型(SS+SSR+V2RAY),但是导入后需要用户手动更新订阅才会出现节点。
$Malio_Config['quantumult_sub_type'] = 'v2ray'; // quanmutult 的一键导入的订阅类型,可选 ss、ssr、v2ray (仅在quantumult_mode设置为single时生效)
$Malio_Config['enable_copy_urls_to_clipboard'] = true; // 设置为 true 时,首页会显示 批量复制XX链接到剪贴板 的按钮,不建议启用。
$Malio_Config['enable_sub_extend'] = false; // 设置为true时,订阅将包含等级过期时间和流量信息
####### 在线客服系统 #######
// Crisp 设置
$Malio_Config['enable_crisp'] = false; // 是否启用 Crisp 在线客服系统 https://crisp.chat
$Malio_Config['enable_crisp_outside'] = true; // 是否对未登录的用户也启用 Crisp,设置为 false 的话,着陆页和登录/注册等页面不会显示 Crisp,同时对 Chatra 也是生效的
$Malio_Config['crisp_wesite_id'] = '18b46e92-eb21-76d3-bfb7-8f2ae9adba64'; // Crisp 的网站ID,格式为 '18b46e92-eb21-76d3-bfb7-8f2ae9adba64'
// Chatra 设置
$Malio_Config['enable_chatra'] = true; // 是否启用 Chatra 在线客服系统 https://chatra.io
$Malio_Config['chatra_id'] = ''; // Chatra 的 ChatraID,可以在 Chatra 提供的网站代码里找到
####### 侧边栏 #######
$Malio_Config['enable_relay'] = true; // 是否显示中转规则
$Malio_Config['enable_ticket'] = true; // 是否显示工单系统
$Malio_Config['enable_detect'] = true; // 是否显示审计系统
$Malio_Config['enable_invite'] = true; // 是否显示邀请注册
$Malio_Config['enable_wallet'] = true; // 是否显示我的钱包
$Malio_Config['enable_user_sub_log'] = true; // 是否显示用户订阅记录页面
$Malio_Config['enable_share_account_page'] = true; // 是否在侧边栏显示共享账号页面 (定制功能)
$Malio_Config['enable_sidebar_button'] = true; // 是否显示底部 Telegram 按钮
$Malio_Config['telegram_group'] = 'https://t.me/SSUnion'; // Telegram 按钮的链接
$Malio_Config['telegram_group_class'] = 0; // 显示底部 Telegram 按钮的用户最低等级,用户等级小于这个数字的将不会显示 Telegram 按钮
####### 首页 #######
$Malio_Config['enable_index_subinfo'] = true; // 是否在首页显示订阅链接复制或一键导入等按钮
$Malio_Config['index_subinfo_buttons_align'] = false; // 是否开启首页订阅链接按钮的对齐
$Malio_Config['index_show_alert_to_tutorial'] = false; // 首页是否一直显示进入教程的横幅 (此项设置为false后,新用户的首页依旧会显示引导进入教程的横幅)
$Malio_Config['enable_index_popup_ann'] = false; // 是否在用户登录后弹出重要公告
$Malio_Config['enable_index_popup_ann_time'] = false; // 重要公告弹窗是否24小时只弹一次
$Malio_Config['index_popup_ann_content'] = '仅在有重大通知时使用,否则会降低用户体验,可以使用HTML标签'; // 重要公告的内容
// 不在首页显示的一键导入按钮,clash | kitsunebi | quantumult | shadowrocket | v2ray | ss | ssr | ssd | surge | surfboard | copy-ss | copy-ssr | copy-vmess
$Malio_Config['index_hidden_import_buttons'] = ['copy-ss','copy-ssr','ssd','copy-vmess'];
$Malio_Config['enable_share'] = true; // 是否显示共享账号
$Malio_Config['share_account'] = [ // 一个array为一个共享账号
'Netflix' => [ // 这个是账号分类
array(
'name' => 'Netflix 1', // 账号的名字
'account' => 'malio@nintendo.jp', // 账号的登录邮箱啥的
'passwd' => 'yahaha~', // 账号的密码
'class' => 2 // 大于等于此等级的用户才能看到此共享账号
),
array(
'name' => 'Netflix 2',
'account' => 'malio22222@nintendo.jp',
'passwd' => 'yahaha~',
'class' => 2
)
],
'HBO' => [
array(
'name' => 'HBO 1',
'account' => 'malio@nintendo.jp',
'passwd' => 'yahaha~',
'class' => 2
)
],
'Hulu' => [
array(
'name' => 'Hulu 1',
'account' => 'malio@nintendo.jp',
'passwd' => 'yahaha~',
'class' => 1,
)
],
];
$Malio_Config['daily_bonus_mode'] = 'sspanel'; // 签到的模式,填写 sspanel 为原版模式,填写 malio 为不同等级给不同的签到流量
$Malio_Config['daily_bonus_settings'] = array( // 为不同等级给不同的签到流量,仅在 daily_bonus_mode 为 malio 时生效
1 => array( // 用户等级
'min' => 100, // 最低流量,单位为MB
'max' => 200 // 最高流量,单位为MB
),
2 => array(
'min' => 1000,
'max' => 2000
),
3 => array(
'min' => 10000,
'max' => 20000
),
);
####### 商店 #######
$Malio_Config['shop_style'] = 'plans'; // 商店的显示风格, legacy为SSPANEL原版,plans为新版
$Malio_Config['shop_enable_autorenew'] = true; // 商店是否显示自动续费的选项
$Malio_Config['shop_enable_coupon'] = true; // 商店是否显示试用优惠券选项
$Malio_Config['shop_enable_trail_plan'] = true; // 商店是否显示新用户试用选项
$Malio_Config['shop_trail_plan_shopid'] = '12'; // 新用户试用的商品ID
$Malio_Config['index_one_row_plans'] = '3'; // 首页里每行显示多少个会员计划,可以写 3 或 4
$Malio_Config['shop_one_row_plans'] = '3'; // 商店里每行显示多少个会员计划,可以写 3 或 4
// 每个会员计划不同时长所对应的商品ID(商品ID可以在管理面板的商品列表里找到),此项必须设置,不然商店购买功能无法正常工作
// 可以复制 array 增加会员计划,比如增加第四个会员计划,使用 'plan_4' => array(...) 这样的格式
$Malio_Config['plan_shop_id'] = array(
'plan_1' => array(
'1month' => 1,
'3month' => 2,
'6month' => 3,
'12month' => 4,
),
'plan_2' => array(
'1month' => 5,
'3month' => 6,
'6month' => 7,
'12month' => 8,
),
'plan_3' => array(
'1month' => 9,
'3month' => 10,
'6month' => 11,
'12month' => 12,
),
);
$Malio_Config['shop_enable_traffic_package'] = true; // 商店是否显示流量叠加包的选项(仅在用户购买会员计划后才会显示)
$Malio_Config['shop_traffic_packages'] = [ // 商店流量叠加包的详细信息,一个array为一个流量叠加包。在商品列表添加流量包时只需要填写名称、价格、流量,其他参数默认即可
array(
'shopid' => 13, // 流量叠加包的商品ID
'traffic' => 10, // 单位为GB
'price' => 5
),
array(
'shopid' => 14,
'traffic' => 20,
'price' => 9
),
array(
'shopid' => 15,
'traffic' => 30,
'price' => 15
),
];
####### 我的钱包 #######
$Malio_Config['enable_topup_code'] = true; // 是否在我的钱包页面显示充值码充值按钮
$Malio_Config['topup_amount_input_mode'] = 'input'; // 充值金额的输入方式,input 是用户手动输入, select 是用户选择站长设定的固定值进行充值
$Malio_Config['topup_select_list'] = [9.9, 19.9, 29.9]; // 用户只能在这个列表里选择充值金额,只有在 topup_amount_input_mode 设置为 select 的时候有效
####### 我的账号 #######
$Malio_Config['enable_2fa'] = true; // 是否显示二步验证的选项
$Malio_Config['enable_delete'] = true; // 是否显示删除账号的选项
$Malio_Config['enable_telegram'] = true; // 是否显示绑定 Telegram 账号的选项,禁用后登录页面的 “使用 Telegram 登录” 按钮会隐藏
####### 节点列表 #######
$Malio_Config['enable_node_load'] = true; // 是否显示节点的负载
$Malio_Config['enable_online_user'] = true; // 是否显示节点的在线人数
$Malio_Config['enable_node_traffic_rate'] = true; // 是否显示节点的流量倍率
$Malio_Config['enable_node_speedlimit'] = true; // 是否显示节点的限速
$Malio_Config['flag_mode'] = 'node-name'; // 节点列表的国旗取值方式。node-name 为从节点名字前两个字取值(比如美国Vultr取值为美国)。node-info 为从节点状态取值,在节点列表里编辑节点,填写节点状态为 us 则显示美国国旗。us这个是国家ISO 3166码,不懂就谷歌。
$Malio_Config['taiwan_flag'] = 'cn'; // 台湾的旗显示方式,cn为中国国旗,tw为台湾区旗
####### 节点设置 -> 连接设置 #######
$Malio_Config['enable_protocol'] = true; // 是否显示自定义混淆和协议设置
$Malio_Config['enable_method'] = true; // 是否显示自定义加密方式设置
$Malio_Config['enable_reset_port'] = true; // 是否显示重置端口设置,.config.php 里的 port_price (重置端口价格) 为负数的话是不会显示的。
####### 下载和使用 #######
$Malio_Config['display_more_app_button'] = true; // 教程页面是否显示”其他客户端按钮“
$Malio_Config['windows_client'] = 'cfw'; // Windows 教程的首选客户端,可选 cfw, ssr
$Malio_Config['ios_client'] = 'quantumult'; // iOS 教程的首选客户端,可选 quantumult, shadowrocket, kitsunebi
$Malio_Config['ios_sub_type'] = 'v2ray'; // iOS 客户端的一键导入的订阅类型,可选ssr、v2ray
$Malio_Config['enable_ios_apple_id'] = true; // 是否在 iOS 教程页面显示 Apple ID
$Malio_Config['ios_apple_id'] = 'malio@icloud.com'; // iOS 教程页面的 Apple ID 账号
$Malio_Config['ios_apple_id_password'] = '1UPBOY~~'; // iOS 教程页面的 Apple ID 密码
$Malio_Config['android_client'] = 'clash'; // Android 教程的首选客户端,可选 ssr, kitsunebi, v2rayng, surfboard, clash
$Malio_Config['mac_client'] = 'clashx'; // Mac 教程的首选客户端,可选 clashx, shadowsocksx-ng-r
$Malio_Config['linux_client'] = 'clash'; // Linux 教程的首选客户端,可选 clash, electron-ssr
$Malio_Config['enable_faq'] = true; // 是否显示 FAQ 常见问题页面
$Malio_Config['enable_windows_gaming_tutorial'] = true; // 是否启用 Windows 游戏教程 (netch教程)
####### 着陆页设置 #######
// 着陆页文本可以在 .i18n.php 更改
$Malio_Config['index_enable_promotion'] = true; // 着陆页是否显示促销活动提示
$Malio_Config['index_statistics_1_data'] = '100+'; // 着陆页的第1个统计数据(国际节点)
$Malio_Config['index_statistics_2_data'] = '25+'; // 着陆页的第2个统计数据(国家地区)
$Malio_Config['index_statistics_3_data'] = '6500+'; // 着陆页的第3个统计数据(满意用户)

@ -1,40 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>页面无法找到哦 - 网站名称</title>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<meta charset="utf-8" />
<link rel="shortcut icon" href="/favicon.ico"/>
<link rel="bookmark" href="/favicon.ico" type="image/x-icon"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<link rel="shortcut icon" type="image/ico" href="images/ssr.ico">
<link rel="stylesheet" href="/assets/css/main.css" />
<noscript>
<link rel="stylesheet" href="/assets/css/noscript.css" />
</noscript>
</head>
<body>
<div id="wrapper">
<header id="header">
<div class="logo">
<span class="icon fa-rocket"></span></div>
<div class="content">
<div class="inner">
<h1>404错误</h1>
<p>您的页面查找不到咯</p></div></div>
<nav>
<ul>
<li><a href="./#">返回首页</a></li>
</ul>
</nav>
</header>
<footer id="footer"><p class="copyright">&copy;2015-2017 网站名称</p></footer>
</div>
<div id="bg"></div>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.11.3"></script>
<script src="https://cdn.jsdelivr.net/gh/ajlkn/skel@3.0.1/dist/skel.min.js"></script>
<script src="/assets/js/util.js"></script>
<script src="/assets/js/main.js"></script>
</body></html>

@ -1,17 +0,0 @@
可以使用download.sh脚本自动下载的客户端:
Clash-Windows.7z
ClashX.dmg
ss-android.apk
ss-win.zip
ss-mac.zip
ssd-android.apk
ssd-win.7z
ssrr-android.apk
v2rayng.apk
需要手动下载的客户端:
kitsunebi.apk
surfboard.apk
ssr.7z
netch.7z
clash-for-android.apk

@ -1,166 +0,0 @@
#!/bin/bash
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
git clone https://github.com/xcxnig/ssr-download.git deploy
# Clash for Windows
echo "==========================================================================="
echo "* Clash for Windows"
echo "https://github.com/Fndroid/clash_for_windows_pkg"
clash_for_windows_pkg_version=$(get_latest_release "Fndroid/clash_for_windows_pkg")
echo "Latest Verison: $clash_for_windows_pkg_version"
mkdir -p Clash-Windows
wget -o /dev/null -O Clash-Windows/Clash.for.Windows.Setup.$clash_for_windows_pkg_version.exe "https://github.com/Fndroid/clash_for_windows_pkg/releases/download/$clash_for_windows_pkg_version/Clash.for.Windows.Setup.$clash_for_windows_pkg_version.exe"
7za a Clash-Windows.7z ./Clash-Windows/*
[ -d "Clash-Windows.7z" ] && mv -f Clash-Windows.7z ./deploy/Clash-Windows.7z
rm -rf Clash-Windows
sleep 35
# clashX(macOS)
echo "==========================================================================="
echo "* ClashX (for macOS)"
echo "https://github.com/yichengchen/clashX"
clashx_version=$(get_latest_release "yichengchen/clashX")
echo "Latest Verison: $clashx_version"
wget -o /dev/null -O ClashX.dmg "https://github.com/yichengchen/clashX/releases/download/$clashx_version/ClashX.dmg"
[ -d "ClashX.dmg" ] && mv -f ClashX.dmg ./deploy/ClashX.dmg
sleep 35
# Shadowsocks Android
echo "==========================================================================="
echo "* Shadowsocks Android"
echo "https://github.com/shadowsocks/shadowsocks-android"
ss_android_version=$(get_latest_release "shadowsocks/shadowsocks-android" | sed 's|v||g')
echo "Latest Verison: $ss_android_version"
wget -o /dev/null -O ss-android.apk "https://github.com/shadowsocks/shadowsocks-android/releases/download/v$ss_android_version/shadowsocks--universal-$ss_android_version.apk"
[ -d "ss-android.apk" ] && mv -f ss-android.apk ./deploy/ss-android.apk
sleep 35
# Shadowsocks Windows
echo "==========================================================================="
echo "* Shadowsocks Windows"
echo "https://github.com/shadowsocks/shadowsocks-windows"
ss_windows_version=$(get_latest_release "shadowsocks/shadowsocks-windows")
echo "Latest Verison: $ss_windows_version"
wget -o /dev/null -O ss-win.zip "https://github.com/shadowsocks/shadowsocks-windows/releases/download/$ss_windows_version/Shadowsocks-$ss_windows_version.zip"
[ -d "ss-win.zip" ] && mv -f ss-win.zip ./deploy/ss-win.zip
sleep 35
# ShadowsocksX-NG
echo "==========================================================================="
echo "* ShadowsocksX-NG (macOS)"
echo "https://github.com/shadowsocks/ShadowsocksX-NG"
ss_mac_version=$(get_latest_release "shadowsocks/ShadowsocksX-NG" | sed 's|v||g')
echo "Latest Verison: $ss_mac_version"
wget -o /dev/null -O ss-mac.zip "https://github.com/shadowsocks/ShadowsocksX-NG/releases/download/v$ss_mac_version/ShadowsocksX-NG.app.$ss_mac_version.zip"
[ -d "ss-mac.zip" ] && mv -f ss-mac.zip ./deploy/ss-mac.zip
sleep 35
# ShadowsocksD Android
echo "==========================================================================="
echo "* ShadowsocksD Android"
echo "https://github.com/TheCGDF/SSD-Android"
ssd_android_version=$(get_latest_release "TheCGDF/SSD-Android")
echo "Latest Verison: $ssd_android_version"
wget -o /dev/null -O ssd-android.apk "https://github.com/TheCGDF/SSD-Android/releases/download/$ssd_android_version/shadowsocksd_$ssd_android_version.apk"
[ -d "ssd-android.apk" ] && mv -f ssd-android.apk ./deploy/ssd-android.apk
sleep 35
# ShadowsocksD Windows
echo "==========================================================================="
echo "* ShadowsocksD Windows"
echo "https://github.com/TheCGDF/SSD-Windows"
ssd_windows_version=$(get_latest_release "TheCGDF/SSD-Windows")
echo "Latest Verison: $ssd_windows_version"
mkdir -p SSD-Windows
wget -o /dev/null -O ssd-win.zip "https://github.com/TheCGDF/SSD-Windows/releases/download/$ssd_windows_version/Shadowsocks-$ssd_windows_version.zip"
unzip ssd-win.zip
rm -rf ssd-win.zip
7za a ssd-win.7z ShadowsocksD.exe
[ -d "ssd-win.7z" ] && mv -f ssd-win.7z ./deploy/ssd-win.7z
sleep 35
# ShadowsocksRR Android
echo "==========================================================================="
echo "* ShadowsocksRR Android"
echo "https://github.com/shadowsocksrr/shadowsocksr-android"
ssrr_android_version=$(get_latest_release "shadowsocksrr/shadowsocksr-android")
echo "Latest Verison: $ssrr_android_version"
wget -o /dev/null -O ssrr-android.apk "https://github.com/shadowsocksrr/shadowsocksr-android/releases/download/$ssrr_android_version/shadowsocksr-android-$ssrr_android_version.apk"
[ -d "ssrr-android.apk" ] && mv -f ssrr-android.apk ./deploy/ssrr-android.apk
sleep 35
# V2RayNG
echo "==========================================================================="
echo "* V2RayNG (Android)"
echo "https://github.com/2dust/v2rayNG"
v2rayng_android_version=$(get_latest_release "2dust/v2rayNG")
echo "Latest Verison: $v2rayng_android_version"
wget -o /dev/null -O v2rayng.apk "https://github.com/2dust/v2rayNG/releases/download/$v2rayng_android_version/app-universal-release.apk"
[ -d "v2rayng.apk" ] && mv -f v2rayng.apk ./deploy/v2rayng.apk

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 837 B

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 567 B

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 925 B

Before

Width:  |  Height:  |  Size: 983 B

After

Width:  |  Height:  |  Size: 983 B

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 396 B

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 471 B

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 677 B

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 267 B

Before

Width:  |  Height:  |  Size: 518 B

After

Width:  |  Height:  |  Size: 518 B

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 437 B

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 834 B

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 433 B

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

Before

Width:  |  Height:  |  Size: 623 B

After

Width:  |  Height:  |  Size: 623 B

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 268 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save