Skip to content

Commit

Permalink
September update
Browse files Browse the repository at this point in the history
  • Loading branch information
Anankke committed Sep 2, 2019
2 parents b309016 + b012608 commit f9284e6
Show file tree
Hide file tree
Showing 102 changed files with 2,376 additions and 2,708 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
uim-index-dev/
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:
- echo $(whoami)
- sudo adduser www-data travis
- echo "==========================================================="
- echo "Upgrade linux packages"
- echo "Install & upgrade linux packages"
- echo "==========================================================="
- sudo apt-get clean
- sudo add-apt-repository ppa:ondrej/php -y
Expand Down Expand Up @@ -44,14 +44,16 @@ before_install:
- sudo ls /etc/nginx/sites-available/
- sudo cat /etc/nginx/sites-enabled/sspanel.test.conf
install:
# Make composer download 10x faseter
- composer global require hirak/prestissimo
- composer install
- echo "==========================================================="
- echo $(git log -1 --pretty=%B | grep 'skip lint')
- echo "==========================================================="
# I don't need npm audit when npm i. I will do it myself.
- npm set audit false
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
npm i -g phplint;
npm i -g npm@latest && npm i -g phplint;
fi
- cd uim-index-dev
- npm i
Expand Down
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM indexyz/php
LABEL maintainer="Indexyz <indexyz@protonmail.com>"

COPY . /var/www
WORKDIR /var/www

RUN cp config/.config.example.php config/.config.php && \
chmod -R 755 storage && \
chmod -R 777 /var/www/storage/framework/smarty/compile/ && \
curl -SL https://getcomposer.org/installer -o composer-setup.php && \
php composer-setup.php && \
php composer.phar install && \
php xcat initQQWry && \
php xcat initdownload && \
crontab -l | { cat; echo "30 22 * * * php /var/www/xcat sendDiaryMail"; } | crontab - && \
crontab -l | { cat; echo "0 0 * * * php /var/www/xcat dailyjob"; } | crontab - && \
crontab -l | { cat; echo "*/1 * * * * php /var/www/xcat checkjob"; } | crontab - && \
crontab -l | { cat; echo "*/1 * * * * php /var/www/xcat syncnode"; } | crontab - && \
{ \
echo '[program:crond]'; \
echo 'command=cron -f'; \
echo 'autostart=true'; \
echo 'autorestart=true'; \
echo 'killasgroup=true'; \
echo 'stopasgroup=true'; \
} | tee /etc/supervisor/crond.conf
125 changes: 87 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,97 @@
# 欢迎使用 SSPanel V3 魔改再次修改版
<img src="https://cdn.jsdelivr.net/npm/skx@0.1.3/img/uim-logo-round.png" alt="logo" width="130" height="130" align="left" />

**ss-panel-v3-mod**是一款专为 Shadowsocks/ShadowsocksR 设计的管理面板,再次感谢 ss-panel-v3-mod 的制作者,修改后的功能简介:
<h1>SSPanel UIM</h1>

- **支付系统集成**:集成 支付宝当面付 易付通 码支付 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)
> Across the Great Wall we can reach every corner in the world
<br/>

[![License](https://img.shields.io/github/license/Anankke/SSPanel-Uim?style=flat-square)](https://github.com/Anankke/SSPanel-Uim/blob/dev/LICENSE)
[![Travis Build Status](https://img.shields.io/travis/Anankke/SSPanel-UIM/master.svg?style=flat-square)](https://travis-ci.org/Anankke/SSPanel-Uim)
![GitHub repo size](https://img.shields.io/github/repo-size/anankke/sspanel-uim?style=flat-square&color=328657)
[![Telegram Channel](https://img.shields.io/badge/news-t.me%2Fsspanel_uim-0d86d7?style=flat-square)](https://t.me/sspanel_uim)
[![Telegram Chat](https://img.shields.io/badge/chat-t.me%2Fssunion-0d86d7?style=flat-square)](https://t.me/ssunion)

[演示站点](https://sspanel.host) | [使用文档](https://wiki.sspanel.host) | [更新日志](https://github.com/Anankke/SSPanel-Uim/releases) | [Telegram 频道](https://t.me/sspanel_uim) | [Telegram 水群](https://t.me/ssunion)

## 简介

SSPanel UIM 是一款专为 Shadowsocks / ShadowsocksR / V2Ray 设计的多用户管理面板,基于 ss-panel-v3-mod 开发。

## 特性

- 集成超过 8 种支付系统
- 重构面板首页、节点列表、商品列表;新增 SPA(Single Page Apps)版 UI
- 商品增加同时连接设备数,用户限速属性
- 新用户注册现金奖励、用户常规端口切换与指定
- 公共库文件加载使用 jsDelivr
- 支持 V2Ray
- 巨量性能优化
- 更多新功能写不下了。(确信)
- 更多新功能写不下了

Telegram 频道 :https://t.me/sspanel_Uim
## 安装

Telegram ~~可能是个官方~~水群 :https://t.me/SSUnion
SSPanel UIM 的需要以下程序才能正常的安装和运行:

记得点小星星!
- Git
- MySQL
- PHP 7.2+
- Composer

演示站: [sspanel.host](https://sspanel.host) 账号和密码都是 `admin` 对接节点的 `mukey=NimaQu`
SSPanel UIM 支持安装在 LNMP、宝塔面板、Plesk 面板、oneinstack 等集成环境中。安装教程请参阅 [文档](https://wiki.sspanel.host)

**原作者** [galaxychuck](https://github.com/galaxychuck)
## 演示

[支持开发者请点我](https://github.com/Anankke/SSPanel-Uim#%E5%85%B3%E4%BA%8E%E6%8D%90%E8%B5%A0)
[演示站](https://sspanel.host) 每天更新 `dev` 分支最新源码。

## Wiki
```
账号:admin
密码:admin
mukey=NimaQu
```

https://wiki.sspanel.host
## 文档

#### 鸣谢
> 我们安装,我们更新,我们开发
##### [Anankke](https://github.com/galaxychuck)
[SSPanel UIM 的文档](https://wiki.sspanel.host),在这里你可以找到大部分问题的解答。

- 面板现 **维护者**
## 贡献

##### [galaxychuck](https://github.com/galaxychuck)
[提出新想法 & 提交 Bug](https://github.com/Anankke/SSPanel-Uim/issues/new) | [改善文档 & 投稿](https://github.com/sspanel-uim/Wiki) | [Fork & Pull Request](https://github.com/Anankke/SSPanel-Uim/fork)

SSPanel UIM 欢迎各种贡献,包括但不限于改进,新功能,文档和代码改进,问题和错误报告。

## 协议

SSPanel UIM 使用 MIT License 开源、不提供任何担保。使用 SSPanel UIM 即表明,您知情并同意:

- 您在使用 SSPanel UIM 时,必须保留 Staff 页面(该页面包含了 MIT License)和页脚的 Staff 入口
- SSPanel UIM 不会对您的任何损失负责,包括但不限于服务中断、Kernel Panic、机器无法开机或正常使用、数据丢失或硬件损坏、原子弹爆炸、第三次世界大战、SCP 基金会无法阻止 SCP-3125 引发的全球 MK 级现实重构等

- 面板 **原作者**

##### [hkserversolution](https://www.hkserversolution.com/cart.php)
## 鸣谢

- Demo 演示站服务器赞助
### [HKServerSolution](https://www.hkserversolution.com/cart.php)

##### [dumplin](https://github.com/dumplin233)
Demo 演示站服务器赞助。

### [贡献者](https://github.com/Anankke/SSPanel-Uim/graphs/contributors)

SSPanel UIM 离不开所有 [贡献代码](https://github.com/Anankke/SSPanel-Uim/graphs/contributors) 和提交 Issue 的人。

<details>
<summary>查看贡献者</summary>

#### [Anankke](https://github.com/Anankke)

- 面板现 **维护者**

#### [galaxychuck](https://github.com/galaxychuck)

- 面板 **原作者**

##### [dumplin](https://github.com/dumplin233)

- 码支付对接 + 码支付当面付二合一
- 为面板加入 AFF 链接功能
Expand Down Expand Up @@ -75,8 +125,8 @@ https://wiki.sspanel.host

[**CGDF**](https://github.com/CGDF-GitHub)

- xcat一键update
- 适配SSD
- xcat 一键 update
- 适配 SSD
- 用户列表分页加载

[**CHEN**](https://github.com/ChenSee)
Expand All @@ -89,35 +139,34 @@ https://wiki.sspanel.host
- 新版 Vue(SPA) 版界面
- 重写节点列表,支持分级显示所有级别节点

[**sukka**](https://skk.moe)
[**Sukka**](https://github.com/SukkaW)

- Travis CI 持续集成
- 单元测试
- 全站 JavaScript 的重写
- 全站 JavaScript 重写
- 新版 Wiki 的搭建和维护

#### 还有所有被引用过代码的同学,以及所有提交过 pr/issue 的同学。
</details>

#### 关于捐赠
## 捐赠

您对我们的帮助将是支持我们做下去的动力,只需您在购买部分产品或向他人推荐产品时从我们的返利链接购买,这就是对我们很大的支持了。~~没有钱了,肯定要做啊,不做没有钱用啊,打工是不可能打工的,这辈子不可能打工的~~
您对我们的帮助将是支持我们做下去的动力。您可以直接进行捐赠,也可以在购买部分产品或向他人推荐产品时从我们的返利链接购买。

##### Anankke
#### Anankke

- [Anankke 很可爱请给 Anankke 钱](https://t.me/anankke/5)

##### dumplin
#### dumplin

- [码支付-微信收款功能开通](https://codepay.fateqq.com/i/39756)

##### galaxychuck
#### 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)
#### laurieryayoi

## 免责声明
[laurieryayoi 的前端课程报名](https://t.me/kinokonominoco)

本程序由 MIT License 授权。**不提供任何担保**。使用本程序即表明,您知情并同意:程序开发者不对此程序导致的任何服务中断、数据损失或任何少见未列出的事故负责。
33 changes: 7 additions & 26 deletions app/Command/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,34 +226,15 @@ public static function DailyJob()
}
}


#https://github.com/shuax/QQWryUpdate/blob/master/update.php

$copywrite = file_get_contents('http://update.cz88.net/ip/copywrite.rar');

$adminUser = User::where('is_admin', '=', '1')->get();

$newmd5 = md5($copywrite);
$oldmd5 = file_get_contents(BASE_PATH . '/storage/qqwry.md5');

if ($newmd5 != $oldmd5) {
file_put_contents(BASE_PATH . '/storage/qqwry.md5', $newmd5);
$qqwry = file_get_contents('http://update.cz88.net/ip/qqwry.rar');
if ($qqwry != '') {
$key = unpack('V6', $copywrite)[6];
for ($i = 0; $i < 0x200; $i++) {
$key *= 0x805;
$key++;
$key &= 0xFF;
$qqwry[$i] = chr(ord($qqwry[$i]) ^ $key);
}
$qqwry = gzuncompress($qqwry);
rename(BASE_PATH . '/storage/qqwry.dat', BASE_PATH . '/storage/qqwry.dat.bak');
$fp = fopen(BASE_PATH . '/storage/qqwry.dat', 'wb');
if ($fp) {
fwrite($fp, $qqwry);
fclose($fp);
}
$qqwry = file_get_contents('https://qqwry.mirror.noc.one/QQWry.Dat?from=sspanel_uim');
if ($qqwry != '') {
rename(BASE_PATH . '/storage/qqwry.dat', BASE_PATH . '/storage/qqwry.dat.bak');
$fp = fopen(BASE_PATH . '/storage/qqwry.dat', 'wb');
if ($fp) {
fwrite($fp, $qqwry);
fclose($fp);
}
}

Expand Down
8 changes: 4 additions & 4 deletions app/Command/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public static function update($xcat)

echo(PHP_EOL);

echo('开始升级ssrdownload...' . PHP_EOL);
echo('开始升级客户端...' . PHP_EOL);
Job::updatedownload();
echo('升级ssrdownload结束' . PHP_EOL);
echo('客户端升级结束' . PHP_EOL);

echo('开始升级QQWry...' . PHP_EOL);
echo('开始升级 QQWry...' . PHP_EOL);
$xcat->initQQWry();
echo('升级QQWry结束' . PHP_EOL);
echo('升级 QQWry结束' . PHP_EOL);

echo(PHP_EOL);

Expand Down
20 changes: 15 additions & 5 deletions app/Command/XCat.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function cleanRelayRule()

public function initdownload()
{
system('git clone https://github.com/xcxnig/ssr-download.git ' . BASE_PATH . '/public/ssr-download/', $ret);
system('git clone --depth=3 https://github.com/xcxnig/ssr-download.git ' . BASE_PATH . '/public/ssr-download/ && git gc', $ret);
echo $ret;
}

Expand Down Expand Up @@ -258,22 +258,32 @@ public function resetTraffic()
public function setTelegram()
{
$bot = new BotApi(Config::get('telegram_token'));
if ($bot->setWebhook(Config::get('baseUrl') . '/telegram_callback?token=' . Config::get('telegram_request_token')) == 1) {
$ch= curl_init();
curl_setopt ($ch, CURLOPT_URL, sprintf('https://api.telegram.org/bot%s/deleteWebhook', Config::get('telegram_token')));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
$deleteWebhookReturn = json_decode(curl_exec($ch));
curl_close($ch);
if ($deleteWebhookReturn->ok && $deleteWebhookReturn->result && $bot->setWebhook(Config::get('baseUrl') . '/telegram_callback?token=' . Config::get('telegram_request_token')) == 1) {
echo('设置成功!' . PHP_EOL);
}
}

public function initQQWry()
{
echo('downloading....');
$qqwry = file_get_contents('https://qqwry.mirror.noc.one/QQWry.Dat');
echo('开始下载纯真 IP 数据库....');
$qqwry = file_get_contents('https://qqwry.mirror.noc.one/QQWry.Dat?from=sspanel_uim');
if ($qqwry != '') {
$fp = fopen(BASE_PATH . '/storage/qqwry.dat', 'wb');
if ($fp) {
fwrite($fp, $qqwry);
fclose($fp);
echo('纯真 IP 数据库下载成功!');
} else {
echo('纯真 IP 数据库保存失败!');
}
echo('finish....');
} else {
echo('下载失败!请重试,或在 https://github.com/SukkaW/qqwry-mirror/issues/new 反馈!');
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public function node($request, $response, $args)
$onlineLogs = $db->query('SELECT * FROM ( SELECT * FROM `ss_node_online_log` WHERE log_time > ' . (time() - 300) . ' ORDER BY id DESC LIMIT 999999999999 ) t GROUP BY node_id ORDER BY id DESC');

foreach ($nodes as $node) {
if ($node->node_group != $user->node_group && $node->node_group != 0) {
if ($user->is_admin == 0 && $node->node_group != $user->node_group && $node->node_group != 0) {
continue;
}
if ($node->sort == 9) {
Expand Down
Loading

0 comments on commit f9284e6

Please sign in to comment.