Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f2d67937d | ||
|
|
45f9756b68 | ||
|
|
0548a9b13e | ||
|
|
6c2873e453 | ||
|
|
de243149a9 | ||
|
|
dfb22fa148 | ||
|
|
3b77ecddb9 | ||
|
|
5b7962d727 | ||
|
|
9c5ad7aa72 | ||
|
|
c7c58a806d | ||
|
|
8c14727fba | ||
|
|
f2005b3e74 | ||
|
|
4569165993 | ||
|
|
fc1ba4eb1a | ||
|
|
5a7ac41911 | ||
|
|
6c6506c677 | ||
|
|
4afd300c92 | ||
|
|
55f85861cf | ||
|
|
1698e944ee | ||
|
|
8842ae2899 | ||
|
|
4eb04e6f0f | ||
|
|
a16fba4b03 | ||
|
|
726f38c332 | ||
|
|
09f934bdd0 | ||
|
|
d54c4644cf | ||
|
|
4232be546a | ||
|
|
b5b82e0b80 | ||
|
|
0eaad35379 | ||
|
|
b754dd5456 | ||
|
|
035db05e70 | ||
|
|
f7c3e5b76b | ||
|
|
85d86e15c2 | ||
|
|
eea06908f9 | ||
|
|
7fc339e6c1 | ||
|
|
97714e02c5 | ||
|
|
d8d5cc61ab | ||
|
|
67bcbb4383 | ||
|
|
c8207097c1 | ||
|
|
8a89786a41 | ||
|
|
c9b501f334 | ||
|
|
e90bc0f10a | ||
|
|
66d98711bf | ||
|
|
de0ac5b500 | ||
|
|
1dffa1d921 | ||
|
|
42dedf03e1 | ||
|
|
f1ebc47f51 | ||
|
|
4ca43572a0 | ||
|
|
116f3d7b36 | ||
|
|
265699c3dc | ||
|
|
c644128552 | ||
|
|
fa63ec71a5 | ||
|
|
07d5c9f5e4 | ||
|
|
cb9aa5da81 | ||
|
|
03a9d2e971 | ||
|
|
52d96157a4 | ||
|
|
c998512549 | ||
|
|
ac0487432d | ||
|
|
530b0e2ef9 | ||
|
|
311b4a266d | ||
|
|
94fea242e1 | ||
|
|
65f6d23eda | ||
|
|
635544b66d | ||
|
|
52cc45901e | ||
|
|
66898bded2 | ||
|
|
914813c904 | ||
|
|
1dd00f09a8 | ||
|
|
8b564cb2f5 |
@@ -0,0 +1,87 @@
|
||||
name: Build linux and mac native image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# see: https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job
|
||||
# os: ['ubuntu-20.04', 'macos-12']
|
||||
os: ['ubuntu-20.04']
|
||||
name: build - ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: setup node v13.12.0
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 13.12.0
|
||||
# cache: 'npm' # 使用缓存需要把 package-lock.json 也上传到 git 上
|
||||
- name: build neutrino-proxy-admin
|
||||
run: |
|
||||
cd neutrino-proxy-admin
|
||||
npm install
|
||||
npm run build:docker·
|
||||
cp -rf ./dist/ ./../neutrino-proxy-server/src/main/resources/static/
|
||||
- name: GitHub Action for GraalVM JDK 17
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21.0.1' # for a specific JDK 17; or '17' for the latest JDK 17
|
||||
distribution: 'graalvm' # New 'distribution' option
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: Build with Maven (neutrino-proxy-server)
|
||||
run: |
|
||||
mvn clean install -pl neutrino-proxy-core -am -DskipTests --no-transfer-progress
|
||||
cd neutrino-proxy-server
|
||||
mvn clean native:compile -P native --file pom.xml --no-transfer-progress
|
||||
chmod +x target/neutrino-proxy-server
|
||||
cp target/neutrino-proxy-server ./../neutrino-proxy-server-${{ github.ref_name }}
|
||||
cp target/classes/app-copy.yml ./../neutrino-proxy-server-${{ github.ref_name }}/app.yml
|
||||
- name: Archive zip (neutrino-proxy-server)
|
||||
uses: thedoctor0/zip-release@master
|
||||
with:
|
||||
type: 'zip'
|
||||
path: 'neutrino-proxy-server-${{ github.ref_name }}'
|
||||
filename: neutrino-proxy-server-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
- name: Build with Maven (neutrino-proxy-client)
|
||||
run: |
|
||||
cd neutrino-proxy-client
|
||||
mvn clean package --file pom.xml --no-transfer-progress
|
||||
mvn clean native:compile -P native --file pom.xml --no-transfer-progress
|
||||
chmod +x target/neutrino-proxy-client
|
||||
cp target/neutrino-proxy-client ./../neutrino-proxy-client-${{ github.ref_name }}
|
||||
cp target/classes/app-copy.yml ./../neutrino-proxy-client-${{ github.ref_name }}/app.yml
|
||||
- name: Archive zip (neutrino-proxy-client)
|
||||
uses: thedoctor0/zip-release@master
|
||||
with:
|
||||
type: 'zip'
|
||||
path: 'neutrino-proxy-client-${{ github.ref_name }}'
|
||||
filename: neutrino-proxy-client-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
# GitHub 上创建 release
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: |
|
||||
neutrino-proxy-server/target/neutrino-proxy-server.jar
|
||||
neutrino-proxy-client/target/neutrino-proxy-client.jar
|
||||
neutrino-proxy-server-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
neutrino-proxy-client-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
prerelease: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,84 @@
|
||||
name: Build windows native image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# see: https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job
|
||||
os: ['windows-2022']
|
||||
name: build - ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: setup node v13.12.0
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 13.12.0
|
||||
# cache: 'npm' # 使用缓存需要把 package-lock.json 也上传到 git 上
|
||||
- name: build neutrino-proxy-admin
|
||||
run: |
|
||||
cd neutrino-proxy-admin
|
||||
npm install
|
||||
npm run build:docker
|
||||
cp -r ./dist/ ./../neutrino-proxy-server/src/main/resources/static/
|
||||
- name: GitHub Action for GraalVM JDK 17
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21.0.1' # for a specific JDK 17; or '17' for the latest JDK 17
|
||||
distribution: 'graalvm' # New 'distribution' option
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: Build with Maven (neutrino-proxy-server)
|
||||
run: |
|
||||
set MAVEN_OPTS="-Duser.language=UTF-8 -Dfile.encoding=UTF-8"
|
||||
mvn clean install -pl neutrino-proxy-core -am -DskipTests --no-transfer-progress
|
||||
cd neutrino-proxy-server
|
||||
mvn clean native:compile -P native --file pom.xml --no-transfer-progress
|
||||
cp target/neutrino-proxy-server.exe ./../neutrino-proxy-server.exe
|
||||
- name: Archive zip (neutrino-proxy-server)
|
||||
uses: thedoctor0/zip-release@master
|
||||
with:
|
||||
type: 'zip'
|
||||
path: 'neutrino-proxy-server.exe'
|
||||
filename: neutrino-proxy-server-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
- name: Build with Maven (neutrino-proxy-client)
|
||||
run: |
|
||||
set MAVEN_OPTS="-Duser.language=UTF-8 -Dfile.encoding=UTF-8"
|
||||
cd neutrino-proxy-client
|
||||
mvn clean package --file pom.xml --no-transfer-progress
|
||||
mvn clean native:compile -P native --file pom.xml --no-transfer-progress
|
||||
cp target/neutrino-proxy-client.exe ./../neutrino-proxy-client.exe
|
||||
- name: Archive zip (neutrino-proxy-client)
|
||||
uses: thedoctor0/zip-release@master
|
||||
with:
|
||||
type: 'zip'
|
||||
path: 'neutrino-proxy-client.exe'
|
||||
filename: neutrino-proxy-client-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
# GitHub 上创建 release
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: |
|
||||
neutrino-proxy-server/target/neutrino-proxy-server.jar
|
||||
neutrino-proxy-client/target/neutrino-proxy-client.jar
|
||||
neutrino-proxy-server-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
neutrino-proxy-client-${{ matrix.os }}-${{ github.ref_name }}.zip
|
||||
prerelease: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,52 +0,0 @@
|
||||
# 基础
|
||||
- [x] 服务端编译、启动成功
|
||||
- [x] 客户端编译、启动成功
|
||||
- [x] 配置
|
||||
- [x] 启动参数
|
||||
- [x] 外部配置文件
|
||||
- [x] 环境变量
|
||||
- [ ] 日志
|
||||
- [x] 控制台输出
|
||||
- [x] debug启动有netty错误日志
|
||||
- [x] 文件输出
|
||||
- [x] 修改日志级别
|
||||
- [x] 心跳日志
|
||||
- [x] 传输报文日志
|
||||
- [x] 连接
|
||||
- [x] 隧道SSL连接
|
||||
- [x] 隧道非SSL连接
|
||||
- [x] 隧道SSL连接自定义证书
|
||||
|
||||
# 服务端管理后台
|
||||
- [x] 登录成功
|
||||
- [x] 首页统计
|
||||
- [x] 代理配置
|
||||
- [x] license管理
|
||||
- [x] 端口映射
|
||||
- [x] 系统管理
|
||||
- [x] 用户管理
|
||||
- [x] 端口分组管理
|
||||
- [x] 端口池管理
|
||||
- [x] 协议管理
|
||||
- [x] 调度管理
|
||||
- [x] 报表管理
|
||||
- [x] 用户流量报表
|
||||
- [x] License流量报表
|
||||
- [x] 用户流量月度明细
|
||||
- [x] License流量月度明细
|
||||
- [x] 日志管理
|
||||
- [x] 调度日志
|
||||
- [x] 登录日志
|
||||
- [x] 客户端连接日志
|
||||
|
||||
|
||||
# 客户端
|
||||
- [x] 重连机制
|
||||
|
||||
# 代理
|
||||
- [x] TCP代理
|
||||
- [x] HTTP(S)代理
|
||||
- [x] 端口访问
|
||||
- [x] HTTP域名访问
|
||||
- [x] HTTPS域名访问
|
||||
- [x] UDP代理
|
||||
|
After Width: | Height: | Size: 262 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 502 KiB |
@@ -0,0 +1,60 @@
|
||||
# 中微子代理(NeutrinoProxy)2.0.0重磅发布
|
||||
|
||||
## 项目简介
|
||||
- [中微子代理(neutrino-proxy)](https://gitee.com/asgc/neutrino-proxy) 是一款基于netty的内网穿透神器。该项目采用最为宽松的MIT协议,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||
- 市面上基于内网穿透的常见产品有:花生壳、TeamView、cpolar等。
|
||||
- 常见的使用场景:
|
||||
- 本地开发调试第三方回调
|
||||
- 本地开发异地接口连调
|
||||
- 远程登录内网windows机器
|
||||
- 将本地服务映射到外网,用于演示
|
||||
- Gitee仓库:https://gitee.com/dromara/neutrino-proxy
|
||||
- Github仓库:https://github.com/dromara/neutrino-proxy
|
||||
- 官网地址1: https://neutrino-proxy.dromara.org
|
||||
- 官网地址2: https://dromara.gitee.io/neutrino-proxy
|
||||
|
||||
## 主要特点:
|
||||
- 1、流量监控:首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
||||
- 2、用户/License:支持多用户、多客户端使用。后台禁用实时生效。
|
||||
- 3、端口池:对外端口统一管理,支持用户、License独占端口。
|
||||
- 4、端口映射:新增、编辑、删除、禁用实时生效。
|
||||
- 5、Docker:服务端/客户端支持Docker一键部署。
|
||||
- 6、SSL证书:隧道通信支持SSL加密,保护您的数据安全。
|
||||
- 7、域名映射:支持绑定子域名,方便本地调试三方回调
|
||||
- 8、多种协议:支持代理TCP、HTTP、HTTPS、UDP协议
|
||||
- 9、原生部署:支持编译为原生可执行文件,更低部署门槛、更少内存占用
|
||||
- 10、采用最为宽松的MIT协议,免去你的后顾之忧
|
||||
|
||||
## 本次更新内容
|
||||
- solon版本升级为`2.5.12-M1`
|
||||
- jdk版本升级为17
|
||||
- 支持原生编译改造
|
||||
- 默认支持的数据库由sqlite改为h2
|
||||
- 官方默认使用的docker镜像仓库从阿里云改为dockerhub
|
||||
|
||||
## 安装使用说明
|
||||
- 快速上手:[点击这里](https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/)
|
||||
- 升级须知:
|
||||
- jdk版本升级为了jdk17,jar部署时请注意
|
||||
- 去掉了默认的sqlite数据库,改为了h2。如果之前使用sqlite,请自行处理数据迁移
|
||||
- 配置文件做了较大调整,请参照官网使用须知中的`服务端配置`、`客户端配置`进行更新
|
||||
|
||||
## 运行示例
|
||||
#### 本地原生启动截图
|
||||
<img src="./run1.png" width="100%"/>
|
||||
|
||||
#### 管理后台首页
|
||||
<img src="./home.png" width="100%"/>
|
||||
|
||||
#### 端口映射
|
||||
<img src="./port-mapping2.png" width="100%"/>
|
||||
|
||||
## 联系我们
|
||||
笔者时间、能力有限,且开源项目非一朝一夕之事,存在众多问题亦在所难免。使用、学习过程中有任何问题欢迎大家与我联系。
|
||||
|
||||
对项目有什么想法或者建议,可以加我微信拉交流群,或者创建[issues](https://gitee.com/dromara/neutrino-proxy/issues),一起完善项目
|
||||
|
||||
- 微信号:yuyunshize
|
||||
- Email: aoshiguchen@dromara.org
|
||||
- 微信二维码(添加时请备注"中微子进群"):
|
||||
<img src="MyWeChatQRCode.jpeg" width="100%"/>
|
||||
|
After Width: | Height: | Size: 262 KiB |
|
After Width: | Height: | Size: 2.3 MiB |
|
After Width: | Height: | Size: 458 KiB |
@@ -0,0 +1,86 @@
|
||||
# 从Neutrino-Proxy(中微子代理)到Solon Native
|
||||
|
||||
## Neutrino-Proxy(中微子代理)是啥
|
||||
#### 项目简介
|
||||
- [中微子代理(neutrino-proxy)](https://gitee.com/asgc/neutrino-proxy) 是一款基于netty的内网穿透神器。该项目采用最为宽松的MIT协议,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||
- 市面上基于内网穿透的常见产品有:花生壳、TeamView、cpolar等。
|
||||
- 常见的使用场景:
|
||||
- 本地开发调试第三方回调
|
||||
- 本地开发异地接口连调
|
||||
- 远程登录内网windows机器
|
||||
- 将本地服务映射到外网,用于演示
|
||||
- Gitee仓库:https://gitee.com/dromara/neutrino-proxy
|
||||
- Github仓库:https://github.com/dromara/neutrino-proxy
|
||||
- 官网地址1: https://neutrino-proxy.dromara.org
|
||||
- 官网地址2: https://dromara.gitee.io/neutrino-proxy
|
||||
|
||||
#### 主要特点:
|
||||
- 1、流量监控:首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
||||
- 2、用户/License:支持多用户、多客户端使用。后台禁用实时生效。
|
||||
- 3、端口池:对外端口统一管理,支持用户、License独占端口。
|
||||
- 4、端口映射:新增、编辑、删除、禁用实时生效。
|
||||
- 5、Docker:服务端/客户端支持Docker一键部署。
|
||||
- 6、SSL证书:隧道通信支持SSL加密,保护您的数据安全。
|
||||
- 7、域名映射:支持绑定子域名,方便本地调试三方回调
|
||||
- 8、多种协议:支持代理TCP、HTTP、HTTPS、UDP协议
|
||||
- 9、原生部署:支持编译为原生可执行文件,更低部署门槛、更少内存占用
|
||||
- 10、采用最为宽松的MIT协议,免去你的后顾之忧
|
||||
|
||||
## 为什么开发Neutrino-Proxy(中微子代理)
|
||||
2022年4月份左右,因工作原因需要用到内网穿透。此前一段时间使用的`coplar`,由于公司担心带来安全隐患,
|
||||
因此决定自己研究一下这一块。
|
||||
|
||||
对于常年写业务代码的一介码农来说,内网穿透就是一个黑盒。为了打开这个黑盒,我开始到处找相关的开源项目,其中包括lanproxy、ngrok、nps、frp等。
|
||||
|
||||
经过一翻努力,2022年6月份,实现了中微子代理1.0.0。此版本纯粹为了练手, 所以是基于自己手写的一套底层框架(包含Ioc、Aop、SqlMaper(简易版本的mybatis)、xxljob等),
|
||||
实现了客户端/服务端+纯配置文件版本的TCP代理。
|
||||
|
||||
千里之行,始于足下。1.0.0版本发布后,经过不断的迭代,如今2.0.0版本终于和大家见面了。
|
||||
|
||||
## 为什么选择Solon
|
||||
中微子1.0.0版本发布之后,大约7~8个月的时间,进行了大量的更新,主要围绕在底层基础框架、
|
||||
管理后台这一块。
|
||||
|
||||
此时中微子陆陆续续开始有了一些用户,开始迫切的需要加快代理相关功能的迭代进度。而此时自己手写
|
||||
的底层框架成为了最大的掣肘,单单底层框架各种细节优化、测试、参考借鉴其他框架源码这些就足以耗光
|
||||
我为数不多的业余时间,更别提在这个尚不成熟的框架上开发代理功能了。任何一次底层的优化调整,可能带来的
|
||||
是上层代理功能的大量重构。
|
||||
|
||||
于是,我开始搜寻其它替代框架。因日常工作一直都在用Spring体系,我始终相信多种技术两相印证之后学到的东西更为深刻,所以自己的开源项目始终将Spring体系作为优先级最低
|
||||
的选项。最终一个或偶然、或必然的机会,我了解到了Solon。
|
||||
|
||||
经过对Solon项目源码、官网文档、项目更新频率、生态完善度的深入了解,最终决定选择Solon作为中微子代理的底层框架。
|
||||
|
||||
2023年3月12日,中微子代理1.7.0版本发布,开始正式基于Solon框架。
|
||||
2023年10月30日,中微子代理2.0.0版本发布,基于Solon Native实现原生部署。
|
||||
|
||||
## Solon简介
|
||||
#### 项目简介
|
||||
- Solon是一个全新的java生态体系,给人带来一种与众不同的开发体验,让你能更快的构建自己的应用、更小的打包产出、更快的启动速度。
|
||||
- Gitee仓库:https://gitee.com/noear/solon
|
||||
- Github仓库:https://github.com/noear/solon
|
||||
- 官网地址:https://solon.noear.org/
|
||||
|
||||
#### 主要特性
|
||||
> 启动快 5 ~ 10 倍;qps 高 2~ 3 倍;运行时内存节省 1/3 ~ 1/2;打包可以缩到 1/2 ~ 1/10
|
||||
- 克制、简洁、高效、开放、生态
|
||||
- 支持 JDK8、JDK11、JDK17、JDK21
|
||||
- Http、WebSocket、Socket 三种信号统一的开发体验(俗称:三源合一)
|
||||
- 支持“注解”与“手动”两种模式,按需自由操控
|
||||
- Not Servlet,可以适配任何基础通讯框架(最小 0.3m 运行rpc架构)
|
||||
- 独特的 IOC/AOP 容器设计。不会因为插件变多而启动变很慢
|
||||
- 支持 Web、Data、Job、Remoting、Cloud 等任何开发场景
|
||||
- 兼顾 Handler + Context 和 Listener + Message 两种架构模式
|
||||
- 强调插件式扩展,可扩展可切换;适应不同的应用场景
|
||||
- 支持 GraalVm Native Image 打包
|
||||
- 允许业务插件“热插”、“热拔”、“热管理”
|
||||
|
||||
## 最后说点什么
|
||||
开源实属不易,开源国产生态型基础框架更是举步维艰。不仅需要长时间、持续、稳定的投入迭代、测试、文档撰写、bug修复、发版、推广,
|
||||
还经常需要面对来自四面八方汹涌如潮的质疑。
|
||||
|
||||
时光无言,它磨灭了一切、也证明着一切。
|
||||
|
||||
一千八百多个日日夜夜、五年的风雨兼程,Solon生态已经初具规模,社区汇聚了一大批开源爱好者。
|
||||
|
||||
大鹏一日通风起,扶摇直上九万里。我相信国产开源在大家的努力下,一定会越来越好!
|
||||
@@ -0,0 +1,88 @@
|
||||
# 客户端与服务器端采用不加密、SM2+AES加密、SSL加密方式进行的性能测试比较
|
||||
|
||||
* 本测试不作为性能测试参考,仅作为三种数据加密方式的性能比较使用
|
||||
* 本测试使用的操作系统为windows10,
|
||||
* 本测试使用的测试环境配置:内存:16G,CPU:i716核
|
||||
|
||||
## 1、测试程序准备情况
|
||||
* 将程序分别打包为`server`和`client`的`jar`包,在本地运行一个`server`端
|
||||
* 拷贝三个客户端配置文件,配置文件名称为`app.yml`、`app-sm2-aes.yml`、`app-ssl.yml`,并修改相应配置,适配不加密、SM2+AES加密和SSL加密
|
||||
|
||||
## 2、测试思路和实现
|
||||
(1)准备1KB、10KB、20KB、50KB、100KB、1MB、2MB、5MB、10MB、20MB、100MB、500MB的文件
|
||||
|
||||
(2)使用Nodejs实现的anywhere工具,在本地运行简单http服务
|
||||
|
||||
(3)在server端生成3个licenseKey,分别对应不加密、SM2+AES加密和SSL加密通道,端口分别为9101,9102和9103,并同时映射到anywhere的8000端口
|
||||
|
||||
(4)使用Hutool里的HttpUtil工具包,对每个文件进行下载,记录下载使用时间,重复执行10次
|
||||
|
||||
## 3、测试结果
|
||||
|
||||
序号| 加密方式 | 文件大小 |响应时间(ms)
|
||||
---|---|---|---
|
||||
1| 不加密 | 1KB |4
|
||||
2| SM2+AES | 1KB |21
|
||||
3| SSL | 1KB |67
|
||||
4| 不加密 | 10KB |3
|
||||
5| SM2+AES | 10KB |7
|
||||
6| SSL | 10KB |4
|
||||
7| 不加密 | 20KB |4
|
||||
8| SM2+AES | 20KB |6
|
||||
9| SSL | 20KB |5
|
||||
10| 不加密 | 50KB |4
|
||||
11| SM2+AES | 50KB |7
|
||||
12| SSL | 50KB |6
|
||||
13| 不加密 | 100KB |6
|
||||
14| SM2+AES | 100KB |8
|
||||
15| SSL | 100KB |6
|
||||
16| 不加密 | 1MB |19
|
||||
17| SM2+AES | 1MB |30
|
||||
18| SSL | 1MB |19
|
||||
19| 不加密 | 2MB |21
|
||||
20| SM2+AES | 2MB |40
|
||||
21| SSL | 2MB |24
|
||||
22| 不加密 | 5MB |31
|
||||
23| SM2+AES | 5MB |51
|
||||
24| SSL | 5MB |36
|
||||
25| 不加密 | 10MB |44
|
||||
26| SM2+AES | 10MB |85
|
||||
27| SSL | 10MB |47
|
||||
28| 不加密 | 20MB |63
|
||||
29| SM2+AES | 20MB |139
|
||||
30| SSL | 20MB |92
|
||||
31| 不加密 | 100MB |323
|
||||
32| SM2+AES | 100MB |590
|
||||
33| SSL | 100MB |322
|
||||
34| 不加密 | 500MB |1414
|
||||
35| SM2+AES | 500MB |2797
|
||||
36| SSL | 500MB |1561
|
||||
|
||||
## 4、测试结论
|
||||
|
||||
从测试结果可以看出,SSL加密的方式在大部分情况下比SM2+AES的加密方式效率高。
|
||||
|
||||
## 5、测试使用的代码
|
||||
```java
|
||||
public static void main(String[] args) {
|
||||
int serialNumber = 1;
|
||||
int[] ports = new int[]{9101, 9102, 9103};
|
||||
Map<Integer, String> portMap = new HashMap<>();
|
||||
portMap.put(9101, "不加密");
|
||||
portMap.put(9102, "SM2+AES");
|
||||
portMap.put(9103, "SSL");
|
||||
HttpUtil.downloadBytes("http://127.0.0.1:9101/1KB"); // 使用不加密通道做一下测试,避免初始化时耗时过高
|
||||
String[] fileNames = "1KB,10KB,20KB,50KB,100KB,1MB,2MB,5MB,10MB,20MB,100MB,500MB".split(",");
|
||||
for (String fileName : fileNames) {
|
||||
for (int port : ports) {
|
||||
String url = String.format("http://127.0.0.1:%s/%s", port, fileName);
|
||||
long startTime = System.currentTimeMillis();
|
||||
HttpUtil.downloadBytes(url);
|
||||
long endTime = System.currentTimeMillis();
|
||||
long resTimeMs = endTime - startTime;
|
||||
String record = String.format("%s|%s|%s|%s", serialNumber++, portMap.get(port), fileName, resTimeMs);
|
||||
System.out.println(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"',
|
||||
ENV_CONFIG: '"prod"',
|
||||
BASE_API: '"https://api-prod"'
|
||||
BASE_API: '""'
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"friendly-errors-webpack-plugin": "1.6.1",
|
||||
"html-webpack-plugin": "2.30.1",
|
||||
"node-notifier": "5.1.2",
|
||||
"node-sass": "^4.7.2",
|
||||
"node-sass": "^9.0.0",
|
||||
"optimize-css-assets-webpack-plugin": "3.2.0",
|
||||
"ora": "1.3.0",
|
||||
"portfinder": "1.0.13",
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
FROM openjdk:17-jdk-alpine
|
||||
FROM openjdk:21-jdk-oracle
|
||||
#同步时间
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
apk update && apk add wget unzip vim && apk add -U tzdata && \
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
|
||||
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
# apk update && apk add wget unzip vim && apk add -U tzdata && \
|
||||
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
|
||||
# 设置时区为北京时间
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN mkdir -p /root/neutrino-proxy/config
|
||||
WORKDIR /root/neutrino-proxy
|
||||
COPY ./target/neutrino-proxy-client.jar /root/neutrino-proxy/neutrino-proxy-client.jar
|
||||
COPY ./src/main/resources/app.yml /root/neutrino-proxy/config
|
||||
COPY ./src/main/resources/app-copy.yml /root/neutrino-proxy/config/app.yml
|
||||
#VOLUME ["/root/neutrino-proxy"]
|
||||
ENTRYPOINT ["java","-jar","neutrino-proxy-client.jar","config=./config/app.yml"]
|
||||
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.dromara.neutrinoproxy.client;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.Utils;
|
||||
import org.noear.solon.annotation.SolonMain;
|
||||
|
||||
/**
|
||||
@@ -16,8 +17,14 @@ public class ProxyClient {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Solon.start(ProxyClient.class, args, app -> {
|
||||
String loglevel = System.getenv("LOG_LEVEL");
|
||||
if (Utils.isNotEmpty(loglevel)) {
|
||||
app.cfg().put("solon.logging.logger.root.level", loglevel);
|
||||
}
|
||||
|
||||
setAlias("neutrino.proxy.tunnel.server-ip", "serverIp");
|
||||
setAlias("neutrino.proxy.tunnel.server-port", "serverPort");
|
||||
setAlias("neutrino.proxy.tunnel.sm2-encrypt-enable", "sm2EncryptEnable");
|
||||
setAlias("neutrino.proxy.tunnel.ssl-enable", "sslEnable");
|
||||
setAlias("neutrino.proxy.tunnel.jks-path", "jksPath");
|
||||
setAlias("neutrino.proxy.tunnel.key-store-password", "keyStorePassword");
|
||||
|
||||
@@ -37,6 +37,7 @@ public class ProxyConfig {
|
||||
private String jksPath;
|
||||
private String serverIp;
|
||||
private Integer serverPort;
|
||||
private Boolean sm2EncryptEnable;
|
||||
private Boolean sslEnable;
|
||||
private Integer obtainLicenseInterval;
|
||||
private String licenseKey;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.Attribute;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.client.config.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
@@ -8,6 +9,7 @@ import org.dromara.neutrinoproxy.core.ExceptionEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
import org.noear.snack.ONode;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -29,7 +31,7 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
String info = proxyMessage.getInfo();
|
||||
ONode load = ONode.load(info);
|
||||
Integer code = load.get("code").getInt();
|
||||
log.info("Auth result:{}", info);
|
||||
log.info("Auth result: {}", load.get("msg").getString());
|
||||
if (ExceptionEnum.AUTH_FAILED.getCode().equals(code)) {
|
||||
// 客户端认证失败,直接停止服务
|
||||
log.info("client auth failed , client stop.");
|
||||
@@ -42,5 +44,26 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
){
|
||||
context.channel().close();
|
||||
}
|
||||
|
||||
// 是否进行通道加密
|
||||
if (!proxyConfig.getTunnel().getSm2EncryptEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 默认设置为非安全链路,需要服务端确认后,再设置为安全链路
|
||||
Attribute<Boolean> booleanAttribute = context.attr(Constants.IS_SECURITY);
|
||||
booleanAttribute.set(false);
|
||||
|
||||
// 获取认证成功的后的公钥信息,并生成随机密码,加密发到服务端确认
|
||||
String publicKey = load.get("publicKey").getString();
|
||||
byte[] secureKey = EncryptUtil.generateAesKey();
|
||||
// 存储密码
|
||||
Attribute<byte[]> secureKeyAttr = context.attr(Constants.SECURE_KEY);
|
||||
secureKeyAttr.set(secureKey);
|
||||
|
||||
// 使用SM2算法对密钥进行加密并发送到服务端
|
||||
byte[] encryptSecureKey = EncryptUtil.encryptBySm2(publicKey, secureKey);
|
||||
context.writeAndFlush(ProxyMessage.buildSecureKeyMessage(encryptSecureKey));
|
||||
context.flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,12 +56,15 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
||||
channel.attr(Constants.NEXT_CHANNEL).set(realServerChannel);
|
||||
realServerChannel.attr(Constants.NEXT_CHANNEL).set(channel);
|
||||
|
||||
// 远程绑定
|
||||
// 通知服务端进行远程绑定,此绑定信息不加密,该条消息为身份标识
|
||||
channel.writeAndFlush(ProxyMessage.buildConnectMessage(visitorId + "@" + proxyConfig.getTunnel().getLicenseKey()));
|
||||
|
||||
realServerChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||
ProxyUtil.addRealServerChannel(visitorId, realServerChannel);
|
||||
ProxyUtil.setRealServerChannelVisitorId(realServerChannel, visitorId);
|
||||
|
||||
// 连接信息发送后,将该通道设置为加密
|
||||
ProxyUtil.setChannelSecurity(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.Attribute;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.client.config.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
|
||||
@Slf4j
|
||||
@Match(type = Constants.ProxyDataTypeName.SECURE_KEY)
|
||||
@Component
|
||||
public class ProxyMessageSecureKeyHandler implements ProxyMessageHandler {
|
||||
|
||||
@Inject
|
||||
private ProxyConfig proxyConfig;
|
||||
@Override
|
||||
public void handle(ChannelHandlerContext ctx, ProxyMessage proxyMessage) {
|
||||
if (!proxyConfig.getTunnel().getSm2EncryptEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
log.info("收到服务端的加密确认");
|
||||
|
||||
Attribute<byte[]> secureKeyAttr = ctx.attr(Constants.SECURE_KEY);
|
||||
byte[] secureKey = secureKeyAttr.get();
|
||||
byte[] data = proxyMessage.getData();
|
||||
byte[] decryptedData = EncryptUtil.decryptByAes(secureKey, data);
|
||||
String m = new String(decryptedData);
|
||||
if ("ok".equals(m)) {
|
||||
// 设置当前cmd通道为安全,之后使用该通道传输的消息均会加密
|
||||
Attribute<Boolean> booleanAttribute = ctx.attr(Constants.IS_SECURITY);
|
||||
booleanAttribute.set(true);
|
||||
|
||||
// 全局存储密钥
|
||||
ProxyUtil.setSecureKey(secureKey);
|
||||
|
||||
log.info("Encrypted link established successfully");
|
||||
} else {
|
||||
ctx.channel().close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,9 @@ public class UdpProxyMessageConnectHandler implements ProxyMessageHandler {
|
||||
.setTargetIp(udpBaseInfo.getTargetIp())
|
||||
.setTargetPort(udpBaseInfo.getTargetPort())
|
||||
).setData(proxyConfig.getTunnel().getLicenseKey().getBytes()));
|
||||
|
||||
// connect类型的消息不加密,用于标识身份,发送标识消息后,再将通道设置加密标识
|
||||
ProxyUtil.setChannelSecurity(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,6 +72,8 @@ public class ProxyUtil {
|
||||
private static String clientId;
|
||||
private static final String CLIENT_ID_FILE = ".NEUTRINO_PROXY_CLIENT_ID";
|
||||
|
||||
private static byte[] secureKey = null;
|
||||
|
||||
public static void borrowTcpProxyChanel(Bootstrap tcpProxyTunnelBootstrap, final ProxyChannelBorrowListener borrowListener) {
|
||||
Channel channel = tcpProxyChannelPool.poll();
|
||||
if (null != channel) {
|
||||
@@ -89,6 +91,10 @@ public class ProxyUtil {
|
||||
}
|
||||
|
||||
public static void returnTcpProxyChanel(Channel proxyChanel) {
|
||||
if (proxyChanel != null) {
|
||||
proxyChanel.attr(Constants.IS_SECURITY).set(null);
|
||||
proxyChanel.attr(Constants.SECURE_KEY).set(null);
|
||||
}
|
||||
if (tcpProxyChannelPool.size() > MAX_POOL_SIZE) {
|
||||
proxyChanel.close();
|
||||
} else {
|
||||
@@ -121,6 +127,10 @@ public class ProxyUtil {
|
||||
}
|
||||
|
||||
public static void returnUdpProxyChanel(Channel proxyChanel) {
|
||||
if (proxyChanel != null) {
|
||||
proxyChanel.attr(Constants.IS_SECURITY).set(null);
|
||||
proxyChanel.attr(Constants.SECURE_KEY).set(null);
|
||||
}
|
||||
if (udpProxyChannelPool.size() > MAX_POOL_SIZE) {
|
||||
proxyChanel.close();
|
||||
} else {
|
||||
@@ -223,4 +233,16 @@ public class ProxyUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setSecureKey(byte[] key) {
|
||||
secureKey = key;
|
||||
}
|
||||
|
||||
public static void setChannelSecurity(Channel channel) {
|
||||
if (null == secureKey) {
|
||||
return;
|
||||
}
|
||||
channel.attr(Constants.IS_SECURITY).set(true);
|
||||
channel.attr(Constants.SECURE_KEY).set(secureKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
solon.logging.logger:
|
||||
"root":
|
||||
level: info
|
||||
|
||||
neutrino:
|
||||
proxy:
|
||||
tunnel:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
thread-count: 50
|
||||
# 隧道SSL证书配置
|
||||
key-store-password: ${STORE_PASS:123456}
|
||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||
# 服务端IP
|
||||
server-ip: ${SERVER_IP:localhost}
|
||||
# 服务端端口(对应服务端app.yml中的tunnel.port、tunnel.ssl-port)
|
||||
server-port: ${SERVER_PORT:9002}
|
||||
# 是否启用SSL(注意:该配置必须和server-port对应上)
|
||||
ssl-enable: ${SSL_ENABLE:true}
|
||||
# 客户端连接唯一凭证
|
||||
license-key: ${LICENSE_KEY:}
|
||||
# 客户端唯一身份标识(可忽略,若不设置首次启动会自动生成)
|
||||
client-id: ${CLIENT_ID:}
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${CLIENT_LOG:false}
|
||||
# 是否开启心跳日志
|
||||
heartbeat-log-enable: ${HEARTBEAT_LOG:false}
|
||||
# 重连设置
|
||||
reconnection:
|
||||
# 重连间隔(秒)
|
||||
interval-seconds: 10
|
||||
# 是否开启无限重连(未开启时,客户端license不合法会自动停止应用,开启了则不会,请谨慎开启)
|
||||
unlimited: false
|
||||
client:
|
||||
udp:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
boss-thread-count: 5
|
||||
work-thread-count: 20
|
||||
# udp傀儡端口范围
|
||||
puppet-port-range: 10000-10500
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${CLIENT_LOG:false}
|
||||
@@ -1,3 +1,9 @@
|
||||
solon:
|
||||
config:
|
||||
add: ./app.yml
|
||||
app:
|
||||
name: neutrino-proxy-client
|
||||
version: @revision@
|
||||
# 日志级别
|
||||
solon.logging.appender:
|
||||
console:
|
||||
@@ -9,15 +15,15 @@ solon.logging.appender:
|
||||
rolling: "logs/${neutrino.application.name}_%d{yyyy-MM-dd}_%i.log.gz"
|
||||
solon.logging.logger:
|
||||
"root":
|
||||
# level: ${LOG_LEVEL:info}
|
||||
level: info
|
||||
|
||||
neutrino:
|
||||
application:
|
||||
name: neutrino-proxy-client
|
||||
|
||||
proxy:
|
||||
protocol:
|
||||
max-frame-length: 2097152
|
||||
max-frame-length: 1048576000
|
||||
length-field-offset: 0
|
||||
length-field-length: 4
|
||||
initial-bytes-to-strip: 0
|
||||
@@ -28,17 +34,18 @@ neutrino:
|
||||
tunnel:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
thread-count: 50
|
||||
sm2-encrypt-enable: ${SM2_ENCRYPT_ENABLE:true}
|
||||
# 隧道SSL证书配置
|
||||
key-store-password: ${STORE_PASS:123456}
|
||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||
# 服务端IP
|
||||
server-ip: ${SERVER_IP:localhost}
|
||||
# 服务端端口(对应服务端app.yml中的tunnel.port、tunnel.ssl-port)
|
||||
server-port: ${SERVER_PORT:9002}
|
||||
server-port: ${SERVER_PORT:9000}
|
||||
# 是否启用SSL(注意:该配置必须和server-port对应上)
|
||||
ssl-enable: ${SSL_ENABLE:true}
|
||||
ssl-enable: ${SSL_ENABLE:false}
|
||||
# 客户端连接唯一凭证
|
||||
license-key: ${LICENSE_KEY:}
|
||||
license-key: ${LICENSE_KEY:b0a907332b474b25897c4dcb31fc7eb6}
|
||||
# 客户端唯一身份标识(可忽略,若不设置首次启动会自动生成)
|
||||
client-id: ${CLIENT_ID:}
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
|
||||
@@ -24,16 +24,22 @@
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15to18</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--hutool -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<!--lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@ public interface Constants {
|
||||
|
||||
AttributeKey<String> VISITOR_ID = AttributeKey.newInstance("visitor_id");
|
||||
|
||||
AttributeKey<String> SECURE_PRIVATE_KEY = AttributeKey.newInstance("secure_private_key");
|
||||
|
||||
AttributeKey<byte[]> SECURE_KEY = AttributeKey.newInstance("secure_key");
|
||||
|
||||
AttributeKey<Boolean> IS_SECURITY = AttributeKey.newInstance("is_security");
|
||||
|
||||
AttributeKey<Integer> LICENSE_ID = AttributeKey.newInstance("license_id");
|
||||
|
||||
AttributeKey<String> TARGET_IP = AttributeKey.newInstance("targetIp");
|
||||
@@ -57,6 +63,7 @@ public interface Constants {
|
||||
|
||||
interface ProxyDataTypeName {
|
||||
String HEARTBEAT = "HEARTBEAT";
|
||||
String SECURE_KEY = "SECURE_KEY";
|
||||
String AUTH = "AUTH";
|
||||
String CONNECT = "CONNECT";
|
||||
String DISCONNECT = "DISCONNECT";
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Copyright (c) 2022 aoshiguchen
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
/**
|
||||
* 存储公钥和私钥
|
||||
* @param privateKey
|
||||
* @param publicKey
|
||||
*/
|
||||
public record KeyPairRecord(String privateKey, String publicKey) {
|
||||
}
|
||||
@@ -47,7 +47,9 @@ public enum ProxyDataTypeEnum {
|
||||
PORT_MAPPING_SYNC(0x07, Constants.ProxyDataTypeName.PORT_MAPPING_SYNC, "PORT_MAPPING_SYNC"),
|
||||
UDP_CONNECT(0x08, Constants.ProxyDataTypeName.UDP_CONNECT,"UDP_CONNECT"),
|
||||
UDP_DISCONNECT(0x09, Constants.ProxyDataTypeName.UDP_DISCONNECT,"UDP_DISCONNECT"),
|
||||
UDP_TRANSFER(0x10, Constants.ProxyDataTypeName.UDP_TRANSFER,"UDP_TRANSFER");
|
||||
UDP_TRANSFER(0x10, Constants.ProxyDataTypeName.UDP_TRANSFER,"UDP_TRANSFER"),
|
||||
SECURE_KEY(0x11, Constants.ProxyDataTypeName.SECURE_KEY, "SECURE_KEY"),
|
||||
;
|
||||
private static Map<Integer,ProxyDataTypeEnum> cache = Stream.of(values()).collect(Collectors.toMap(ProxyDataTypeEnum::getType, Function.identity()));
|
||||
|
||||
private int type;
|
||||
|
||||
@@ -24,6 +24,7 @@ package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
import org.noear.snack.ONode;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -79,6 +80,11 @@ public class ProxyMessage {
|
||||
*/
|
||||
public static final byte TYPE_UDP_TRANSFER = 0x10;
|
||||
|
||||
/**
|
||||
* 安全密钥协商
|
||||
*/
|
||||
public static final byte TYPE_SECURE_KEY = 0x11;
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
@@ -117,11 +123,12 @@ public class ProxyMessage {
|
||||
.setInfo(info + "," + clientId);
|
||||
}
|
||||
|
||||
public static ProxyMessage buildAuthResultMessage(Integer code, String msg, String licenseKey) {
|
||||
public static ProxyMessage buildAuthResultMessage(Integer code, String msg, String licenseKey, String publicKey) {
|
||||
ONode data = ONode.newObject();
|
||||
data.set("code", code);
|
||||
data.set("msg", msg);
|
||||
data.set("licenseKey", licenseKey);
|
||||
data.set("publicKey", publicKey);
|
||||
return create().setType(TYPE_AUTH)
|
||||
.setInfo(data.toJson());
|
||||
}
|
||||
@@ -136,6 +143,17 @@ public class ProxyMessage {
|
||||
.setInfo(info);
|
||||
}
|
||||
|
||||
public static ProxyMessage buildSecureKeyMessage(byte[] secureKey) {
|
||||
return create().setType(TYPE_SECURE_KEY)
|
||||
.setInfo(EncryptUtil.digestBySm3(secureKey))
|
||||
.setData(secureKey);
|
||||
}
|
||||
|
||||
public static ProxyMessage buildSecureKeyReturnMessage(byte[] content) {
|
||||
return create().setType(TYPE_SECURE_KEY)
|
||||
.setData(content);
|
||||
}
|
||||
|
||||
public static ProxyMessage buildTransferMessage(String visitorId, byte[] data) {
|
||||
return create().setType(TYPE_TRANSFER)
|
||||
.setInfo(visitorId)
|
||||
|
||||
@@ -22,11 +22,18 @@
|
||||
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
|
||||
import io.netty.util.Attribute;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
|
||||
import static org.dromara.neutrinoproxy.core.Constants.*;
|
||||
|
||||
@Slf4j
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
@@ -70,28 +77,52 @@ public class ProxyMessageDecoder extends LengthFieldBasedFrameDecoder {
|
||||
return null;
|
||||
}
|
||||
|
||||
int frameLength = in.readInt();
|
||||
if (in.readableBytes() < frameLength) {
|
||||
return null;
|
||||
Attribute<Boolean> booleanAttribute = ctx.attr(Constants.IS_SECURITY);
|
||||
Boolean isSecurity = booleanAttribute.get();
|
||||
|
||||
ByteBuf buf;
|
||||
|
||||
// 考虑isSecurity为null的情况,null的情况也为false
|
||||
if (isSecurity != null && isSecurity) {
|
||||
int packageLength = in.readInt();
|
||||
if (in.readableBytes() < packageLength) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 获取加密数据
|
||||
byte[] encryptedBytes = new byte[packageLength];
|
||||
in.readBytes(encryptedBytes);
|
||||
in.release();
|
||||
|
||||
// 获取解密密钥
|
||||
Attribute<byte[]> secureKeyAttr = ctx.attr(SECURE_KEY);
|
||||
byte[] secureKey = secureKeyAttr.get();
|
||||
// 解密
|
||||
byte[] decryptedData = EncryptUtil.decryptByAes(secureKey, encryptedBytes);
|
||||
|
||||
buf = Unpooled.wrappedBuffer(decryptedData);
|
||||
} else {
|
||||
buf = in;
|
||||
}
|
||||
|
||||
ProxyMessage proxyMessage = new ProxyMessage();
|
||||
byte type = in.readByte();
|
||||
long sn = in.readLong();
|
||||
int frameLength = buf.readInt();
|
||||
byte type = buf.readByte();
|
||||
long sn = buf.readLong();
|
||||
|
||||
proxyMessage.setSerialNumber(sn);
|
||||
|
||||
proxyMessage.setType(type);
|
||||
|
||||
int infoLength = in.readInt();
|
||||
int infoLength = buf.readInt();
|
||||
byte[] infoBytes = new byte[infoLength];
|
||||
in.readBytes(infoBytes);
|
||||
buf.readBytes(infoBytes);
|
||||
proxyMessage.setInfo(new String(infoBytes));
|
||||
|
||||
byte[] data = new byte[frameLength - TYPE_SIZE - SERIAL_NUMBER_SIZE - INFO_LENGTH_SIZE - infoLength];
|
||||
in.readBytes(data);
|
||||
buf.readBytes(data);
|
||||
proxyMessage.setData(data);
|
||||
|
||||
in.release();
|
||||
buf.release();
|
||||
|
||||
return proxyMessage;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,15 @@
|
||||
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.MessageToByteEncoder;
|
||||
import io.netty.util.Attribute;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
|
||||
import static org.dromara.neutrinoproxy.core.Constants.*;
|
||||
|
||||
/**
|
||||
@@ -32,6 +38,7 @@ import static org.dromara.neutrinoproxy.core.Constants.*;
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/6/16
|
||||
*/
|
||||
@Slf4j
|
||||
public class ProxyMessageEncoder extends MessageToByteEncoder<ProxyMessage> {
|
||||
|
||||
public ProxyMessageEncoder() {
|
||||
@@ -40,6 +47,7 @@ public class ProxyMessageEncoder extends MessageToByteEncoder<ProxyMessage> {
|
||||
|
||||
@Override
|
||||
protected void encode(ChannelHandlerContext ctx, ProxyMessage msg, ByteBuf out) throws Exception {
|
||||
|
||||
int bodyLength = TYPE_SIZE + SERIAL_NUMBER_SIZE + INFO_LENGTH_SIZE;
|
||||
byte[] infoBytes = null;
|
||||
if (msg.getInfo() != null) {
|
||||
@@ -51,21 +59,50 @@ public class ProxyMessageEncoder extends MessageToByteEncoder<ProxyMessage> {
|
||||
bodyLength += msg.getData().length;
|
||||
}
|
||||
|
||||
// write the total packet length but without length field's length.
|
||||
out.writeInt(bodyLength);
|
||||
Attribute<Boolean> booleanAttribute = ctx.attr(Constants.IS_SECURITY);
|
||||
Boolean isSecurity = booleanAttribute.get();
|
||||
|
||||
out.writeByte(msg.getType());
|
||||
out.writeLong(msg.getSerialNumber());
|
||||
ByteBuf buf;
|
||||
|
||||
// 考虑isSecurity为null的情况,null的情况也为false
|
||||
if (isSecurity != null && isSecurity) {
|
||||
buf = Unpooled.directBuffer(bodyLength);
|
||||
} else {
|
||||
buf = out;
|
||||
}
|
||||
|
||||
// write the total packet length but without length field's length.
|
||||
buf.writeInt(bodyLength);
|
||||
|
||||
buf.writeByte(msg.getType());
|
||||
buf.writeLong(msg.getSerialNumber());
|
||||
|
||||
if (infoBytes != null) {
|
||||
out.writeInt(infoBytes.length);
|
||||
out.writeBytes(infoBytes);
|
||||
buf.writeInt(infoBytes.length);
|
||||
buf.writeBytes(infoBytes);
|
||||
} else {
|
||||
out.writeInt(0x00);
|
||||
buf.writeInt(0x00);
|
||||
}
|
||||
|
||||
if (msg.getData() != null) {
|
||||
out.writeBytes(msg.getData());
|
||||
buf.writeBytes(msg.getData());
|
||||
}
|
||||
|
||||
// 考虑isSecurity为null的情况,null的情况也为false
|
||||
if (isSecurity != null && isSecurity) {
|
||||
// 执行加密
|
||||
byte[] data = new byte[buf.writerIndex()];
|
||||
buf.readBytes(data);
|
||||
|
||||
// 获取加密密钥
|
||||
Attribute<byte[]> secureKeyAttr = ctx.attr(SECURE_KEY);
|
||||
byte[] secureKey = secureKeyAttr.get();
|
||||
// 执行加密
|
||||
byte[] encryptedData = EncryptUtil.encryptByAes(secureKey, data);
|
||||
out.writeInt(encryptedData.length);
|
||||
out.writeBytes(encryptedData);
|
||||
buf.release();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ public class NeutrinoCoreRuntimeNativeRegistrar implements RuntimeNativeRegistra
|
||||
metadata.registerReflection(ProxyMessage.class, MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
|
||||
metadata.registerReflection(ProxyMessage.UdpBaseInfo.class, MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
|
||||
|
||||
metadata.registerArg("--add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED -march=compatibility");
|
||||
metadata.registerArg("-J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED");
|
||||
metadata.registerArg("-J--add-opens=java.base/java.nio=ALL-UNNAMED");
|
||||
metadata.registerArg("-J--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED");
|
||||
|
||||
metadata.registerArg("-march=compatibility");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* AES工具
|
||||
*/
|
||||
public class AesUtil {
|
||||
|
||||
public static byte[] generateKey() {
|
||||
byte[] keyBytes = new byte[16];
|
||||
Random random = RandomUtil.getRandom(true);
|
||||
random.nextBytes(keyBytes);
|
||||
return keyBytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* AES解密
|
||||
* @param decryptKey 秘钥,16位
|
||||
* @param encryptBytes 密文
|
||||
* @return 明文
|
||||
* @throws Exception
|
||||
*/
|
||||
public static byte[] decrypt(byte[] decryptKey, byte[] encryptBytes) {
|
||||
try{
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptKey, "AES"));
|
||||
return cipher.doFinal(encryptBytes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* AES加密
|
||||
* @param encryptKey 秘钥,必须为16个字符组成
|
||||
* @param data 明文
|
||||
* @return 密文
|
||||
* @throws Exception
|
||||
*/
|
||||
public static byte[] encrypt(byte[] encryptKey, byte[] data) {
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey, "AES"));
|
||||
return cipher.doFinal(data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/**
|
||||
* Copyright (c) 2022 aoshiguchen
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.SmUtil;
|
||||
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
||||
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
||||
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey;
|
||||
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey;
|
||||
import org.bouncycastle.util.encoders.Hex;
|
||||
import org.dromara.neutrinoproxy.core.KeyPairRecord;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
import java.security.KeyPair;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
|
||||
/**
|
||||
* 国密算法加解密工具
|
||||
* @author: az
|
||||
* @date: 2023/11/07
|
||||
*/
|
||||
public class EncryptUtil {
|
||||
|
||||
/**
|
||||
* 生成SM2密钥对
|
||||
* @return
|
||||
*/
|
||||
public static KeyPairRecord generateSm2KeyPair() {
|
||||
|
||||
String privateKeyHex = null;
|
||||
String publicKeyHex = null;
|
||||
|
||||
KeyPair keyPair = Sm2Util.createECKeyPair();
|
||||
|
||||
PrivateKey privateKey = keyPair.getPrivate();
|
||||
if (privateKey instanceof BCECPrivateKey) {
|
||||
//获取32字节十六进制私钥串
|
||||
privateKeyHex = ((BCECPrivateKey) privateKey).getD().toString(16);
|
||||
}
|
||||
|
||||
PublicKey publicKey = keyPair.getPublic();
|
||||
if (publicKey instanceof BCECPublicKey) {
|
||||
//获取65字节非压缩缩的十六进制公钥串(0x04)
|
||||
publicKeyHex = Hex.toHexString(((BCECPublicKey) publicKey).getQ().getEncoded(false));
|
||||
}
|
||||
|
||||
return new KeyPairRecord(privateKeyHex, publicKeyHex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SM2算法对数据进行加密
|
||||
* @param publicKey 加密所需的公钥
|
||||
* @param data 需要加密的数据
|
||||
* @return 加密后的字节数组
|
||||
*/
|
||||
public static byte[] encryptBySm2(String publicKey, byte[] data) {
|
||||
return Sm2Util.encrypt(publicKey, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SM2算法对数据进行解密
|
||||
* @param privateKey 解密所需私钥
|
||||
* @param data 需要解密的数据
|
||||
* @return 解密后的字节数组
|
||||
*/
|
||||
public static byte[] decryptBySm2(String privateKey, byte[] data) {
|
||||
return Sm2Util.decrypt(privateKey, data);
|
||||
}
|
||||
|
||||
public static byte[] generateSm4Key() {
|
||||
return SecureUtil.generateKey("AES", 128).getEncoded();
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SM4算法加密数据
|
||||
* @param key 密钥
|
||||
* @param data 待加密的数据
|
||||
* @return 已加密的数据
|
||||
*/
|
||||
public static byte[] encryptBySm4(byte[] key, byte[] data) {
|
||||
return SmUtil.sm4(key).encrypt(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SM4算法解密数据
|
||||
* @param key 密钥
|
||||
* @param encryptedData 已加密数据
|
||||
* @return 解密后的数据
|
||||
*/
|
||||
public static byte[] decryptBySm4(byte[] key, byte[] encryptedData) {
|
||||
return SmUtil.sm4(key).decrypt(encryptedData);
|
||||
}
|
||||
|
||||
public static byte[] generateAesKey() {
|
||||
return AesUtil.generateKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES算法加密数据
|
||||
* @param key 密钥
|
||||
* @param data 被加密数据
|
||||
* @return 加密后的数据
|
||||
*/
|
||||
public static byte[] encryptByAes(byte[] key, byte[] data) {
|
||||
return AesUtil.encrypt(key, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES法解密数据
|
||||
* @param key 密钥
|
||||
* @param encryptedData 已加密数据
|
||||
* @return 解密后的数据
|
||||
*/
|
||||
public static byte[] decryptByAes(byte[] key, byte[] encryptedData) {
|
||||
return AesUtil.decrypt(key, encryptedData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用SM3算法对内容生成摘要
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static String digestBySm3(byte[] data) {
|
||||
return SmUtil.sm3().digestHex(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import org.dromara.neutrinoproxy.core.base.MetaDataConstant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarEntry;
|
||||
@@ -56,7 +57,7 @@ public class FileUtil {
|
||||
* @throws IOException
|
||||
*/
|
||||
public static String readContentAsString(String path) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(getInputStream(path)))){
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(getInputStream(path), StandardCharsets.UTF_8))){
|
||||
return br.lines().collect(Collectors.joining("\n"));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
@@ -70,7 +71,7 @@ public class FileUtil {
|
||||
* @throws IOException
|
||||
*/
|
||||
public static String readContentAsString(InputStream in) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(in))){
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))){
|
||||
return br.lines().collect(Collectors.joining("\n"));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
@@ -84,7 +85,7 @@ public class FileUtil {
|
||||
* @throws IOException
|
||||
*/
|
||||
public static List<String> readContentAsStringList(String path) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(getInputStream(path)))){
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(getInputStream(path), StandardCharsets.UTF_8))){
|
||||
return br.lines().collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import org.noear.solon.Solon;
|
||||
|
||||
/**
|
||||
* @author songyinyin
|
||||
* @since 2023/10/31 11:48
|
||||
*/
|
||||
public class NeutrinoProxyVersion {
|
||||
|
||||
/**
|
||||
* 获取 NeutrinoProxy 版本号
|
||||
*/
|
||||
public static String getVersion() {
|
||||
return Solon.cfg().get("solon.app.version");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import org.bouncycastle.asn1.gm.GMNamedCurves;
|
||||
import org.bouncycastle.asn1.x9.X9ECParameters;
|
||||
import org.bouncycastle.crypto.engines.SM2Engine;
|
||||
import org.bouncycastle.crypto.params.ECDomainParameters;
|
||||
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
|
||||
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
|
||||
import org.bouncycastle.crypto.params.ParametersWithRandom;
|
||||
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey;
|
||||
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.bouncycastle.jce.spec.ECParameterSpec;
|
||||
import org.bouncycastle.jce.spec.ECPrivateKeySpec;
|
||||
import org.bouncycastle.jce.spec.ECPublicKeySpec;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.KeyPair;
|
||||
import java.security.KeyPairGenerator;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.spec.ECGenParameterSpec;
|
||||
|
||||
/**
|
||||
* @ClassName SM2Utils
|
||||
* @Description SM2算法工具类
|
||||
*/
|
||||
public class Sm2Util {
|
||||
|
||||
/**
|
||||
* @Description 生成秘钥对
|
||||
* @return KeyPair
|
||||
*/
|
||||
public static KeyPair createECKeyPair() {
|
||||
//使用标准名称创建EC参数生成的参数规范
|
||||
final ECGenParameterSpec sm2Spec = new ECGenParameterSpec("sm2p256v1");
|
||||
|
||||
// 获取一个椭圆曲线类型的密钥对生成器
|
||||
final KeyPairGenerator kpg;
|
||||
try {
|
||||
kpg = KeyPairGenerator.getInstance("EC", new BouncyCastleProvider());
|
||||
// 使用SM2算法域参数集初始化密钥生成器(默认使用以最高优先级安装的提供者的 SecureRandom 的实现作为随机源)
|
||||
// kpg.initialize(sm2Spec);
|
||||
|
||||
// 使用SM2的算法域参数集和指定的随机源初始化密钥生成器
|
||||
kpg.initialize(sm2Spec, new SecureRandom());
|
||||
|
||||
// 通过密钥生成器生成密钥对
|
||||
return kpg.generateKeyPair();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 公钥加密
|
||||
* @param publicKeyHex SM2十六进制公钥
|
||||
* @param data 明文数据
|
||||
* @return String
|
||||
*/
|
||||
public static byte[] encrypt(String publicKeyHex, byte[] data) {
|
||||
return encrypt(getECPublicKeyByPublicKeyHex(publicKeyHex), data, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 公钥加密
|
||||
* @param publicKey SM2公钥
|
||||
* @param data 明文数据
|
||||
* @param modeType 加密模式
|
||||
* @return String
|
||||
*/
|
||||
public static byte[] encrypt(BCECPublicKey publicKey, byte[] data, int modeType) {
|
||||
//加密模式
|
||||
SM2Engine.Mode mode = SM2Engine.Mode.C1C3C2;
|
||||
if (modeType != 1) {
|
||||
mode = SM2Engine.Mode.C1C2C3;
|
||||
}
|
||||
//通过公钥对象获取公钥的基本域参数。
|
||||
ECParameterSpec ecParameterSpec = publicKey.getParameters();
|
||||
ECDomainParameters ecDomainParameters = new ECDomainParameters(ecParameterSpec.getCurve(),
|
||||
ecParameterSpec.getG(), ecParameterSpec.getN());
|
||||
//通过公钥值和公钥基本参数创建公钥参数对象
|
||||
ECPublicKeyParameters ecPublicKeyParameters = new ECPublicKeyParameters(publicKey.getQ(), ecDomainParameters);
|
||||
//根据加密模式实例化SM2公钥加密引擎
|
||||
SM2Engine sm2Engine = new SM2Engine(mode);
|
||||
//初始化加密引擎
|
||||
sm2Engine.init(true, new ParametersWithRandom(ecPublicKeyParameters, new SecureRandom()));
|
||||
byte[] arrayOfBytes = null;
|
||||
try {
|
||||
//将明文字符串转换为指定编码的字节串
|
||||
//通过加密引擎对字节数串行加密
|
||||
arrayOfBytes = sm2Engine.processBlock(data, 0, data.length);
|
||||
} catch (Exception e) {
|
||||
System.out.println("SM2加密时出现异常:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
//将加密后的字节串转换为十六进制字符串
|
||||
return arrayOfBytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 私钥解密
|
||||
* @param privateKeyHex SM2十六进制私钥
|
||||
* @param cipherData 密文数据
|
||||
* @return String
|
||||
*/
|
||||
public static byte[] decrypt(String privateKeyHex, byte[] cipherData) {
|
||||
return decrypt(getBCECPrivateKeyByPrivateKeyHex(privateKeyHex), cipherData, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 私钥解密
|
||||
* @param privateKey SM私钥
|
||||
* @param cipherDataByte 密文数据
|
||||
* @param modeType 解密模式
|
||||
* @return
|
||||
*/
|
||||
public static byte[] decrypt(BCECPrivateKey privateKey, byte[] cipherDataByte, int modeType) {
|
||||
//解密模式
|
||||
SM2Engine.Mode mode = SM2Engine.Mode.C1C3C2;
|
||||
if (modeType != 1)
|
||||
mode = SM2Engine.Mode.C1C2C3;
|
||||
//通过私钥对象获取私钥的基本域参数。
|
||||
ECParameterSpec ecParameterSpec = privateKey.getParameters();
|
||||
ECDomainParameters ecDomainParameters = new ECDomainParameters(ecParameterSpec.getCurve(),
|
||||
ecParameterSpec.getG(), ecParameterSpec.getN());
|
||||
//通过私钥值和私钥钥基本参数创建私钥参数对象
|
||||
ECPrivateKeyParameters ecPrivateKeyParameters = new ECPrivateKeyParameters(privateKey.getD(),
|
||||
ecDomainParameters);
|
||||
//通过解密模式创建解密引擎并初始化
|
||||
SM2Engine sm2Engine = new SM2Engine(mode);
|
||||
sm2Engine.init(false, ecPrivateKeyParameters);
|
||||
try {
|
||||
//通过解密引擎对密文字节串进行解密
|
||||
return sm2Engine.processBlock(cipherDataByte, 0, cipherDataByte.length);
|
||||
} catch (Exception e) {
|
||||
System.out.println("SM2解密时出现异常" + e.getMessage());
|
||||
}
|
||||
return new byte[0];
|
||||
}
|
||||
//椭圆曲线ECParameters ASN.1 结构
|
||||
private static X9ECParameters x9ECParameters = GMNamedCurves.getByName("sm2p256v1");
|
||||
//椭圆曲线公钥或私钥的基本域参数。
|
||||
private static ECParameterSpec ecDomainParameters = new ECParameterSpec(x9ECParameters.getCurve(), x9ECParameters.getG(), x9ECParameters.getN());
|
||||
|
||||
/**
|
||||
* @Description 公钥字符串转换为 BCECPublicKey 公钥对象
|
||||
* @param pubKeyHex 64字节十六进制公钥字符串(如果公钥字符串为65字节首个字节为0x04:表示该公钥为非压缩格式,操作时需要删除)
|
||||
* @return BCECPublicKey SM2公钥对象
|
||||
*/
|
||||
public static BCECPublicKey getECPublicKeyByPublicKeyHex(String pubKeyHex) {
|
||||
//截取64字节有效的SM2公钥(如果公钥首个字节为0x04)
|
||||
if (pubKeyHex.length() > 128) {
|
||||
pubKeyHex = pubKeyHex.substring(pubKeyHex.length() - 128);
|
||||
}
|
||||
//将公钥拆分为x,y分量(各32字节)
|
||||
String stringX = pubKeyHex.substring(0, 64);
|
||||
String stringY = pubKeyHex.substring(stringX.length());
|
||||
//将公钥x、y分量转换为BigInteger类型
|
||||
BigInteger x = new BigInteger(stringX, 16);
|
||||
BigInteger y = new BigInteger(stringY, 16);
|
||||
//通过公钥x、y分量创建椭圆曲线公钥规范
|
||||
ECPublicKeySpec ecPublicKeySpec = new ECPublicKeySpec(x9ECParameters.getCurve().createPoint(x, y), ecDomainParameters);
|
||||
//通过椭圆曲线公钥规范,创建出椭圆曲线公钥对象(可用于SM2加密及验签)
|
||||
return new BCECPublicKey("EC", ecPublicKeySpec, BouncyCastleProvider.CONFIGURATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 私钥字符串转换为 BCECPrivateKey 私钥对象
|
||||
* @param privateKeyHex 32字节十六进制私钥字符串
|
||||
* @return BCECPrivateKey SM2私钥对象
|
||||
*/
|
||||
public static BCECPrivateKey getBCECPrivateKeyByPrivateKeyHex(String privateKeyHex) {
|
||||
//将十六进制私钥字符串转换为BigInteger对象
|
||||
BigInteger d = new BigInteger(privateKeyHex, 16);
|
||||
//通过私钥和私钥域参数集创建椭圆曲线私钥规范
|
||||
ECPrivateKeySpec ecPrivateKeySpec = new ECPrivateKeySpec(d, ecDomainParameters);
|
||||
//通过椭圆曲线私钥规范,创建出椭圆曲线私钥对象(可用于SM2解密和签名)
|
||||
return new BCECPrivateKey("EC", ecPrivateKeySpec, BouncyCastleProvider.CONFIGURATION);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/*String publicKeyHex = null;
|
||||
String privateKeyHex = null;*/
|
||||
/*KeyPair keyPair = createECKeyPair();
|
||||
PublicKey publicKey = keyPair.getPublic();
|
||||
if (publicKey instanceof BCECPublicKey) {
|
||||
//获取65字节非压缩缩的十六进制公钥串(0x04)
|
||||
publicKeyHex = Hex.toHexString(((BCECPublicKey) publicKey).getQ().getEncoded(false));
|
||||
System.out.println("---->SM2公钥:" + publicKeyHex);
|
||||
}
|
||||
PrivateKey privateKey = keyPair.getPrivate();
|
||||
if (privateKey instanceof BCECPrivateKey) {
|
||||
//获取32字节十六进制私钥串
|
||||
privateKeyHex = ((BCECPrivateKey) privateKey).getD().toString(16);
|
||||
System.out.println("---->SM2私钥:" + privateKeyHex);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 公钥加密
|
||||
*/
|
||||
// String data = "az";
|
||||
|
||||
//将十六进制公钥串转换为 BCECPublicKey 公钥对象
|
||||
/*String encryptData = encrypt(publicKeyHex, data);
|
||||
System.out.println("---->加密结果:" + encryptData);*/
|
||||
|
||||
/**
|
||||
* 私钥解密
|
||||
*/
|
||||
//将十六进制私钥串转换为 BCECPrivateKey 私钥对象
|
||||
/*data = decrypt("xx", "xx");
|
||||
System.out.println("---->解密结果:" + data);*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
FROM openjdk:17-jdk-alpine
|
||||
FROM openjdk:21-jdk-oracle
|
||||
#同步时间
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
apk update && apk add wget unzip vim && apk add -U tzdata && \
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
|
||||
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
# apk update && apk add wget unzip vim && apk add -U tzdata && \
|
||||
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
|
||||
# 设置时区为北京时间
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN mkdir -p /root/neutrino-proxy/config
|
||||
WORKDIR /root/neutrino-proxy
|
||||
COPY ./target/neutrino-proxy-server.jar /root/neutrino-proxy/neutrino-proxy-server.jar
|
||||
COPY ./src/main/resources/app.yml /root/neutrino-proxy/config
|
||||
COPY ./src/main/resources/app-copy.yml /root/neutrino-proxy/config/app.yml
|
||||
#VOLUME ["/root/neutrino-proxy"]
|
||||
ENTRYPOINT ["java","-jar","neutrino-proxy-server.jar","config=./config/app.yml"]
|
||||
|
||||
|
||||
@@ -61,6 +61,13 @@
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
|
||||
@@ -2,7 +2,9 @@ package org.dromara.neutrinoproxy.server;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.solonplugins.job.annotation.EnableJob;
|
||||
import org.noear.snack.core.utils.StringUtil;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.Utils;
|
||||
import org.noear.solon.annotation.SolonMain;
|
||||
import org.noear.solon.web.cors.CrossFilter;
|
||||
|
||||
@@ -20,6 +22,10 @@ public class ProxyServer {
|
||||
Solon.start(ProxyServer.class, args, app -> {
|
||||
// 跨域支持。加-1 优先级更高
|
||||
app.filter(-1, new CrossFilter().allowedOrigins("*"));
|
||||
String loglevel = System.getenv("LOG_LEVEL");
|
||||
if (Utils.isNotEmpty(loglevel)) {
|
||||
app.cfg().put("solon.logging.logger.root.level", loglevel);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.event.AppLoadEndEvent;
|
||||
import org.noear.solon.core.event.EventListener;
|
||||
import org.noear.solon.core.runtime.NativeDetector;
|
||||
import org.noear.wood.DbContext;
|
||||
import org.noear.wood.annotation.Db;
|
||||
|
||||
@@ -57,6 +58,10 @@ public class DBInitialize implements EventListener<AppLoadEndEvent> {
|
||||
|
||||
@Init
|
||||
public void init() throws Throwable {
|
||||
// aot 阶段,不初始化数据库
|
||||
if (NativeDetector.isAotRuntime()) {
|
||||
return;
|
||||
}
|
||||
Assert.notNull(dbConfig.getType(), "neutrino.data.db.type不能为空!");
|
||||
dbTypeEnum = DbTypeEnum.of(dbConfig.getType());
|
||||
Assert.notNull(dbTypeEnum, "neutrino.data.db.type取值异常!");
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import io.netty.util.Attribute;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.server.constant.ClientConnectTypeEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
@@ -90,7 +91,7 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
|
||||
if (StrUtil.isEmpty(licenseKey)) {
|
||||
log.warn("[client connection] license cannot empty info:{} ", info);
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "license不能为空!", licenseKey));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "license不能为空!", licenseKey, null));
|
||||
ctx.channel().close();
|
||||
clientConnectRecordService.add(new ClientConnectRecordDO()
|
||||
.setIp(ip)
|
||||
@@ -104,22 +105,22 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
}
|
||||
LicenseDO licenseDO = licenseService.findByKey(licenseKey);
|
||||
if (null == licenseDO) {
|
||||
log.warn("[client connection] license notfound info:{} ", info);
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "license不存在!", licenseKey));
|
||||
log.warn("[client connection] license not found info:{} ", info);
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "license不存在!", licenseKey, null));
|
||||
ctx.channel().close();
|
||||
clientConnectRecordService.add(new ClientConnectRecordDO()
|
||||
.setIp(ip)
|
||||
.setType(ClientConnectTypeEnum.CONNECT.getType())
|
||||
.setMsg(licenseKey)
|
||||
.setCode(SuccessCodeEnum.FAIL.getCode())
|
||||
.setErr("license notfound!")
|
||||
.setErr("license not found!")
|
||||
.setCreateTime(now)
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (EnableStatusEnum.DISABLE.getStatus().equals(licenseDO.getEnable())) {
|
||||
log.warn("[client connection] the license disabled info:{} ", info);
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "the license disabled!", licenseKey));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "the license disabled!", licenseKey, null));
|
||||
ctx.channel().close();
|
||||
clientConnectRecordService.add(new ClientConnectRecordDO()
|
||||
.setIp(ip)
|
||||
@@ -134,7 +135,7 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
UserDO userDO = userService.findById(licenseDO.getUserId());
|
||||
if (null == userDO || EnableStatusEnum.DISABLE.getStatus().equals(userDO.getEnable())) {
|
||||
log.warn("[client connection] the license invalid info:{} ", info);
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "the license invalid!", licenseKey));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "the license invalid!", licenseKey, null));
|
||||
ctx.channel().close();
|
||||
clientConnectRecordService.add(new ClientConnectRecordDO()
|
||||
.setIp(ip)
|
||||
@@ -151,7 +152,7 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
String _clientId = ProxyUtil.getClientIdByLicenseId(licenseDO.getId());
|
||||
if (!clientId.equals(_clientId)) {
|
||||
log.warn("[client connection] the license on another no used info:{} _clientId:{}", info, _clientId);
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "the license on another no used!", licenseKey));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.AUTH_FAILED.getCode(), "the license on another no used!", licenseKey, null));
|
||||
ctx.channel().close();
|
||||
clientConnectRecordService.add(new ClientConnectRecordDO()
|
||||
.setIp(ip)
|
||||
@@ -164,8 +165,22 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 存储状态为非安全,如果客户端响应以下的公钥信息,则在响应中设置为安全
|
||||
Attribute<Boolean> booleanAttribute = ctx.attr(Constants.IS_SECURITY);
|
||||
booleanAttribute.set(false);
|
||||
|
||||
// 生成获取SM2密钥对,私钥存入ctx,公钥拼装参数随Auth数据包返回
|
||||
KeyPairRecord record = EncryptUtil.generateSm2KeyPair();
|
||||
|
||||
// 私钥存入ctx
|
||||
ctx.attr(Constants.SECURE_PRIVATE_KEY).set(record.privateKey());
|
||||
|
||||
// 存储licenseId
|
||||
ctx.attr(Constants.LICENSE_ID).set(licenseDO.getId());
|
||||
|
||||
// 发送认证成功消息
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.SUCCESS.getCode(), "auth success!", licenseKey));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildAuthResultMessage(ExceptionEnum.SUCCESS.getCode(), "auth success!", licenseKey, record.publicKey()));
|
||||
|
||||
clientConnectRecordService.add(new ClientConnectRecordDO()
|
||||
.setIp(ip)
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
||||
|
||||
LicenseDO licenseDO = licenseService.findByKey(licenseKey);
|
||||
if (null == licenseDO) {
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildErrMessage(ExceptionEnum.CONNECT_FAILED, "the license notfound!"));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildErrMessage(ExceptionEnum.CONNECT_FAILED, "the license not found!"));
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
||||
Channel cmdChannel = ProxyUtil.getCmdChannelByLicenseId(licenseDO.getId());
|
||||
|
||||
if (null == cmdChannel) {
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildErrMessage(ExceptionEnum.CONNECT_FAILED, "server error,cmd channel notfound!"));
|
||||
ctx.channel().writeAndFlush(ProxyMessage.buildErrMessage(ExceptionEnum.CONNECT_FAILED, "server error,cmd channel not found!"));
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
@@ -92,6 +92,9 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
||||
ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
||||
proxyAttachment.execute();
|
||||
}
|
||||
|
||||
// 设置加密
|
||||
ProxyUtil.setChannelSecurity(licenseDO.getId(), ctx.channel());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.Attribute;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.util.EncryptUtil;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import org.noear.solon.annotation.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Match(type= Constants.ProxyDataTypeName.SECURE_KEY)
|
||||
@Component
|
||||
public class ProxyMessageSecureKeyHandler implements ProxyMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handle(ChannelHandlerContext ctx, ProxyMessage proxyMessage) {
|
||||
|
||||
log.info("收到客户端的加密信息");
|
||||
|
||||
// data为加密后的密码,info为加密密码的摘要
|
||||
byte[] data = proxyMessage.getData();
|
||||
String receivedDigest = proxyMessage.getInfo();
|
||||
|
||||
String digest = EncryptUtil.digestBySm3(data);
|
||||
if (!digest.equals(receivedDigest)) {
|
||||
// 获取加密信息失败
|
||||
log.warn("密码协商失败");
|
||||
// TODO 应该断开连接
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取私钥
|
||||
Attribute<String> privateKeyAttr = ctx.attr(Constants.SECURE_PRIVATE_KEY);
|
||||
String privateKey = privateKeyAttr.get();
|
||||
if (StrUtil.isEmpty(privateKey)) {
|
||||
// 获取私钥失败
|
||||
log.warn("获取私钥失败");
|
||||
// TODO 应该断开连接
|
||||
return;
|
||||
}
|
||||
|
||||
// 解密传输密码
|
||||
byte[] secureKey = EncryptUtil.decryptBySm2(privateKey, data);
|
||||
|
||||
// 传输密码存储ctx中
|
||||
Attribute<byte[]> secureKeyAttr = ctx.attr(Constants.SECURE_KEY);
|
||||
secureKeyAttr.setIfAbsent(secureKey);
|
||||
|
||||
// 使用密码加密success给客户端表示密码已确认
|
||||
byte[] encryptedSuccessInfoData = EncryptUtil.encryptByAes(secureKey, "ok".getBytes());
|
||||
|
||||
// 发送回去,以示确认
|
||||
ctx.writeAndFlush(ProxyMessage.buildSecureKeyReturnMessage(encryptedSuccessInfoData));
|
||||
ctx.flush();
|
||||
|
||||
// 设置该链路以及相关链路状态为安全,之后使用链路传输的数据均会加密
|
||||
Integer licenseId = ctx.attr(Constants.LICENSE_ID).get();
|
||||
ProxyUtil.setSecureKey(licenseId, secureKey);
|
||||
ProxyUtil.setChannelSecurity(licenseId, ctx.channel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return ProxyDataTypeEnum.SECURE_KEY.getDesc();
|
||||
}
|
||||
}
|
||||
@@ -35,11 +35,9 @@ import org.noear.solon.Solon;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.runtime.NativeDetector;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -67,6 +65,10 @@ public class JobInfoService implements IJobSource {
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
// aot 阶段,不初始化
|
||||
if (NativeDetector.isAotRuntime()) {
|
||||
return;
|
||||
}
|
||||
jobHandlerMap.put("DataCleanJob", dataCleanJob);
|
||||
jobHandlerMap.put("DemoJob", demoJob);
|
||||
jobHandlerMap.put("FlowReportForDayJob", flowReportForDayJob);
|
||||
@@ -107,6 +109,10 @@ public class JobInfoService implements IJobSource {
|
||||
|
||||
@Override
|
||||
public List<JobInfo> sourceList() {
|
||||
// aot 阶段,不查数据库
|
||||
if (NativeDetector.isAotRuntime()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<JobInfo> jobInfoList = Lists.newArrayList();
|
||||
List<JobInfoDO> jobInfoDOList = jobInfoMapper.findList();
|
||||
if (CollectionUtil.isEmpty(jobInfoDOList)) {
|
||||
|
||||
@@ -35,7 +35,9 @@ import org.dromara.neutrinoproxy.server.dal.entity.JobLogDO;
|
||||
import org.dromara.solonplugins.job.IJobCallback;
|
||||
import org.dromara.solonplugins.job.JobInfo;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.core.runtime.NativeDetector;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -53,6 +55,10 @@ public class JobLogService implements IJobCallback {
|
||||
|
||||
@Override
|
||||
public void executeLog(JobInfo jobInfo, String param, Throwable throwable) {
|
||||
// aot 阶段,不查数据库
|
||||
if (NativeDetector.isAotRuntime()) {
|
||||
return;
|
||||
}
|
||||
Integer code = 0;
|
||||
String msg = "";
|
||||
if (null == throwable) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.bean.LifecycleBean;
|
||||
import org.noear.solon.core.runtime.NativeDetector;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -238,6 +239,10 @@ public class LicenseService implements LifecycleBean {
|
||||
*/
|
||||
@Init
|
||||
public void init() {
|
||||
// aot 阶段,不初始化
|
||||
if (NativeDetector.isAotRuntime()) {
|
||||
return;
|
||||
}
|
||||
licenseMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.bean.LifecycleBean;
|
||||
import org.noear.solon.core.runtime.NativeDetector;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
@@ -295,6 +296,10 @@ public class PortMappingService implements LifecycleBean {
|
||||
*/
|
||||
@Init
|
||||
public void init() {
|
||||
// aot 阶段,不初始化
|
||||
if (NativeDetector.isAotRuntime()) {
|
||||
return;
|
||||
}
|
||||
portMappingMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||
|
||||
// 未配置域名,则不需要处理域名映射逻辑
|
||||
|
||||
@@ -38,15 +38,15 @@ public class ProxyUtil {
|
||||
/**
|
||||
* 服务端口 -> 指令通道映射
|
||||
*/
|
||||
private static Map<Integer, Channel> serverPortToCmdChannelMap = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, Channel> serverPortToCmdChannelMap = new ConcurrentHashMap<>();
|
||||
/**
|
||||
* license -> 指令通道映射
|
||||
*/
|
||||
private static Map<Integer, Channel> licenseToCmdChannelMap = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, Channel> licenseToCmdChannelMap = new ConcurrentHashMap<>();
|
||||
/**
|
||||
* 服务端口 -> 访问通道映射
|
||||
*/
|
||||
private static Map<Integer, Channel> serverPortToVisitorChannel = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, Channel> serverPortToVisitorChannel = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* cmdChannelAttachInfo.getUserChannelMap() 读写锁
|
||||
@@ -55,19 +55,21 @@ public class ProxyUtil {
|
||||
/**
|
||||
* 访问者ID生成器
|
||||
*/
|
||||
private static AtomicLong visitorIdProducer = new AtomicLong(0);
|
||||
private static final AtomicLong visitorIdProducer = new AtomicLong(0);
|
||||
/**
|
||||
* 代理 - connect附加映射
|
||||
*/
|
||||
private static Map<String, ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
||||
private static final Map<String, ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
||||
/**
|
||||
* 子域名 - 服务端端口映射
|
||||
*/
|
||||
private static Map<String, Integer> subdomainToServerPort = new HashMap<>();
|
||||
private static final Map<String, Integer> subdomainToServerPort = new HashMap<>();
|
||||
/**
|
||||
* licenseId - 客户端Id映射
|
||||
*/
|
||||
private static Map<Integer, String> licenseIdToClientIdMap = new HashMap<>();
|
||||
private static final Map<Integer, String> licenseIdToClientIdMap = new HashMap<>();
|
||||
|
||||
private static final Map<Integer, byte[]> licenseIdToSecureKeyMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 初始化代理信息
|
||||
@@ -421,4 +423,22 @@ public class ProxyUtil {
|
||||
public static void removeClientIdByLicenseId(Integer licenseId) {
|
||||
licenseIdToClientIdMap.remove(licenseId);
|
||||
}
|
||||
|
||||
public static void setSecureKey(Integer licenseId, byte[] key) {
|
||||
licenseIdToSecureKeyMap.put(licenseId, key);
|
||||
}
|
||||
|
||||
public static void setLicenseIdRelativeProxyChannelSecurity(Integer licenseId) {
|
||||
Set<Integer> portSet = licenseToServerPortMap.get(licenseId);
|
||||
for(Integer port : portSet) {
|
||||
// TODO 代理客户端
|
||||
}
|
||||
}
|
||||
|
||||
public static void setChannelSecurity(Integer licenseId, Channel channel) {
|
||||
if (channel != null && licenseIdToSecureKeyMap.containsKey(licenseId)) {
|
||||
channel.attr(Constants.IS_SECURITY).set(true);
|
||||
channel.attr(Constants.SECURE_KEY).set(licenseIdToSecureKeyMap.get(licenseId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
server:
|
||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||
port: 8888
|
||||
# 日志级别
|
||||
solon.logging.logger:
|
||||
"root":
|
||||
level: info
|
||||
|
||||
neutrino:
|
||||
proxy:
|
||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||
tunnel:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
boss-thread-count: 2
|
||||
work-thread-count: 10
|
||||
# 隧道非SSL端口
|
||||
port: ${OPEN_PORT:9000}
|
||||
# 隧道SSL端口
|
||||
ssl-port: ${SSL_PORT:9002}
|
||||
# 隧道SSL证书配置
|
||||
key-store-password: ${STORE_PASS:123456}
|
||||
key-manager-password: ${MGR_PASS:123456}
|
||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${TUNNEL_LOG:false}
|
||||
# 是否开启心跳日志
|
||||
heartbeat-log-enable: ${HEARTBEAT_LOG:false}
|
||||
server:
|
||||
tcp:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
boss-thread-count: 5
|
||||
work-thread-count: 20
|
||||
# http代理端口,默认80
|
||||
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
||||
# https代理端口,默认443 (需要配置域名、证书)
|
||||
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
||||
# 如果不配置,则不支持域名映射
|
||||
domain-name: ${DOMAIN_NAME:}
|
||||
# https证书配置
|
||||
key-store-password: ${HTTPS_STORE_PASS:}
|
||||
jks-path: ${HTTPS_JKS_PATH:}
|
||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${SERVER_LOG:false}
|
||||
udp:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
boss-thread-count: 5
|
||||
work-thread-count: 20
|
||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${SERVER_LOG:false}
|
||||
data:
|
||||
db:
|
||||
# 数据库类型,目前支持h2、mysql、mariadb
|
||||
type: ${DB_TYPE:h2}
|
||||
# 数据库连接URL
|
||||
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
||||
# 数据库用户名
|
||||
username: ${DB_USER:}
|
||||
# 数据库密码
|
||||
password: ${DB_PASSWORD:}
|
||||
@@ -5,8 +5,9 @@ server:
|
||||
solon:
|
||||
app:
|
||||
name: neutrino-proxy-server
|
||||
# aot:
|
||||
# jvmArguments: --add-opens java.base/java.lang=ALL-UNNAMED
|
||||
version: @revision@
|
||||
config:
|
||||
add: ./app.yml
|
||||
# 日志级别
|
||||
solon.logging.appender:
|
||||
console:
|
||||
@@ -18,14 +19,12 @@ solon.logging.appender:
|
||||
rolling: "logs/${solon.app.name}_%d{yyyy-MM-dd}_%i.log"
|
||||
solon.logging.logger:
|
||||
"root":
|
||||
# level: ${LOG_LEVEL:info}
|
||||
level: info
|
||||
|
||||
|
||||
neutrino:
|
||||
proxy:
|
||||
protocol:
|
||||
max-frame-length: ${MAX_FRAME_LENGTH:2097152}
|
||||
max-frame-length: ${MAX_FRAME_LENGTH:1048576000}
|
||||
length-field-offset: 0
|
||||
length-field-length: 4
|
||||
initial-bytes-to-strip: 0
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.dromara.neutrinoproxy.server;
|
||||
|
||||
import org.dromara.neutrinoproxy.core.util.NeutrinoProxyVersion;
|
||||
import org.dromara.neutrinoproxy.server.app.AppBaseTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author songyinyin
|
||||
* @since 2023/10/31 11:51
|
||||
*/
|
||||
public class VersionTest extends AppBaseTest {
|
||||
|
||||
@Test
|
||||
public void testVersion() {
|
||||
Assert.assertNotNull(NeutrinoProxyVersion.getVersion());
|
||||
System.out.println("version: " + NeutrinoProxyVersion.getVersion());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.neutrinoproxy.server.app;
|
||||
|
||||
import org.dromara.neutrinoproxy.server.ProxyServer;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.noear.solon.test.SolonJUnit4ClassRunner;
|
||||
import org.noear.solon.test.SolonTest;
|
||||
|
||||
/**
|
||||
* @author songyinyin
|
||||
* @since 2023/10/31 11:56
|
||||
*/
|
||||
@SolonTest(value = ProxyServer.class, properties = "server.port=18888")
|
||||
@RunWith(SolonJUnit4ClassRunner.class)
|
||||
public class AppBaseTest {
|
||||
}
|
||||
@@ -30,7 +30,9 @@ module.exports = {
|
||||
{text: '后台操作指南', link: '/pages/793dcc/'},
|
||||
]
|
||||
},
|
||||
{text: '支持', link: '/pages/a3f096/'},
|
||||
{text: '案例', link: '/pages/5d571c/'},
|
||||
{text: '支持', link: '/pages/1ab20b/'},
|
||||
{text: '更新记录', link: '/pages/ff3519/'},
|
||||
{text: 'Gitee', link: 'https://gitee.com/dromara/neutrino-proxy'},
|
||||
],
|
||||
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: 快速上手
|
||||
date: 2023-03-28 20:30:00
|
||||
permalink: /pages/793dcb
|
||||
article: false
|
||||
---
|
||||
|
||||
::: tip
|
||||
当前最新版本为2.0.0,如果从之前的版本升级而来,请注意以下变更
|
||||
|
||||
1、jdk版本升级为了jdk17,jar部署时请注意
|
||||
|
||||
2、去掉了默认的sqlite数据库,改为了h2。如果之前使用sqlite,请自行处理数据迁移
|
||||
|
||||
3、配置文件做了较大调整,请参照使用须知中的`服务端配置`、`客户端配置`进行更新
|
||||
:::
|
||||
|
||||
## 1、快速上手须知
|
||||
- 所谓快速上手,就是针对从来没用过的新手编写的、快速完成从安装部署到首次使用的最简化流程
|
||||
- 该流程中请严格按照说明步骤执行,不要靠猜测自作聪明的修改配置
|
||||
- 如果的确需要修改,请先把安装部署、使用须知、常见问题全部仔细读一遍
|
||||
- 快速上手中涉及到的配置,仅仅是快速体验所必须的配置,完整的配置请参照使用须知中的`服务端配置`、`客户端配置`
|
||||
|
||||
## 2、部署服务
|
||||
- 根据需要自行选择jar、docker、原生部署任意一种完成部署
|
||||
- 三种方式分别参见对应的文档
|
||||
- 任何一种部署方式,不要求客户端与服务端一致。如:服务端采用docker部署,客户端可以用docker部署、也可以用jar、原生部署
|
||||
- 管理后台说明
|
||||
- 服务端部署成功后,访问http://{服务端IP}:8888打开后台管理页面。使用默认的管理员帐号登录:admin/123456
|
||||
- 打开代理配置>License管理页面,可以看到系统已经自动为管理员初始化了一条License记录,复制该LicenseKey备用,后续客户端配置需要。
|
||||
- 客户端说明
|
||||
- 客户端启动后,查看服务端License管理,刷新页面,对应的License在线状态为`在线`,则表明客户端已正常连接。
|
||||
|
||||
## 3、代理验证
|
||||
- 本地启动被代理服务,如:redis、本地web项目、本地mysql等等,假设被代理服务端口为:8080
|
||||
- 先确保本地能正常访问被代理服务,如果本地都不能访问,不用想代理更不可能!!!
|
||||
- 服务端管理后台端口映射管理,使用默认的licesne创建一条端口映射,如:9101 -> 127.0.0.1:8080
|
||||
- 通过服务端IP+9101(上面License配置的端口映射重的服务端端口)访问本地被代理服务
|
||||
|
||||
访问成功,至此首次完整的内网穿透体验完成。开源不易,请速至[Gitee仓库](https://gitee.com/dromara/neutrino-proxy)一键三连🤝
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
title: 使用jar部署
|
||||
date: 2023-10-26 13:50:45
|
||||
permalink: /pages/eebea1/
|
||||
---
|
||||
|
||||
## 1、环境准备
|
||||
- 首先确保已安装Java17运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server-jar.zip`、`neutrino-proxy-client-jar.zip`
|
||||
|
||||
|
||||
## 2、部署服务端
|
||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||
- 将`neutrino-proxy-server-jar.zip`上传至服务器部署目录,并解压
|
||||
- 执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用h2数据库。
|
||||
- 若需要指定自己的mysql数据库,则需要在当前目录下的`app.yml`文件中,修改数据库配置如下:
|
||||
|
||||
```yml
|
||||
neutrino:
|
||||
data:
|
||||
db:
|
||||
type: mysql
|
||||
# 自己的数据库实例,创建一个空的名为'neutrino-proxy'的数据库即可,首次启动服务端会自动初始化
|
||||
url: jdbc:mysql://xxxx:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
||||
driver-class: com.mysql.jdbc.Driver
|
||||
# 数据库帐号
|
||||
username: xxx
|
||||
# 数据库密码
|
||||
password: xxx
|
||||
```
|
||||
|
||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/scripts/unix/server_start.sh 使用shell脚本启动服务端。
|
||||
|
||||
## 3、部署客户端
|
||||
- 本地解压`neutrino-proxy-client-jar.zip`文件
|
||||
- 修改`app.yml`文件中的server-ip为服务器公网ip,并配置license-key,以下是相关的部分配置:
|
||||
```yml
|
||||
neutrino:
|
||||
proxy:
|
||||
tunnel:
|
||||
# ssl证书密钥(使用jjar包内自带的证书,则此处无需修改)
|
||||
key-store-password: 123456
|
||||
# ssl证书管理密钥(使用jjar包内自带的证书,则此处无需修改。自定义证书,则此处配置对应的路径)
|
||||
jks-path: classpath:/test.jks
|
||||
# 代理服务端IP
|
||||
server-ip: xxxx
|
||||
# 代理服务端IP, 若是非ssl端口,则ssl-enable需要配置为false
|
||||
server-port: 9002
|
||||
# 是否启用ssl
|
||||
ssl-enable: true
|
||||
# licenseKey,客户端凭证。此处需要配置刚刚从管理后台复制的LicenseKey
|
||||
license-key: xxxx
|
||||
```
|
||||
- 执行命令`java -jar neutrino-proxy-client.jar`启动客户端
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: 使用docker容器化部署
|
||||
date: 2023-10-26 13:51:29
|
||||
permalink: /pages/5b9bef/
|
||||
---
|
||||
|
||||
## 1、 部署服务端
|
||||
### 使用默认h2数据库一键部署
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-d --restart=always --name neutrino-proxy \
|
||||
-v /root/neutrino-proxy-server/config:/root/neutrino-proxy/config \
|
||||
-v /root/neutrino-proxy-server/data:/root/neutrino-proxy/data \
|
||||
-v /root/neutrino-proxy-server/logs:/root/neutrino-proxy/logs \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
||||
```
|
||||
|
||||
### 指定自己的mysql数据库
|
||||
- 在服务器上创建目录:/root/neutrino-proxy/config
|
||||
- 在该目录下创建`app.yml`文本文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
data:
|
||||
db:
|
||||
type: mysql
|
||||
# 自己的数据库实例,创建一个空的名为'neutrino-proxy'的数据库即可,首次启动服务端会自动初始化
|
||||
url: jdbc:mysql://xxxx:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
||||
driver-class: com.mysql.jdbc.Driver
|
||||
# 数据库帐号
|
||||
username: xxx
|
||||
# 数据库密码
|
||||
password: xxx
|
||||
```
|
||||
- 然后再执行上面的docker一键部署命令即可
|
||||
|
||||
## 2、部署客户端
|
||||
- 命令中的服务端ip、license请自行补充
|
||||
- 若是首次使用,请仔细阅读快速上手,以确定license从哪里取得
|
||||
```shell
|
||||
docker run -it -d --restart=always --name npclient -e SERVER_IP=xxxx -e LICENSE_KEY=xxxx \
|
||||
aoshiguchen/neutrino-proxy-client:latest
|
||||
```
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: 原生部署
|
||||
date: 2023-10-26 13:51:44
|
||||
permalink: /pages/69699a/
|
||||
---
|
||||
|
||||
::: tip
|
||||
1、目前的原生部署包支持mac、linux、windows三个平台
|
||||
|
||||
2、这三个平台的部署包均由作者分别测试通过
|
||||
|
||||
3、尽管如此,仍然可能存在有的机器不支持的情况,可自行拉取仓库源码编译出目标平台可执行文件、或换成其它部署方式
|
||||
|
||||
4、若linux/mac下提示文件没有执行权限,可执行`chmod +x {文件路径}`解决
|
||||
|
||||
5、若mac下运行提示移到废纸篓,可执行`sudo xattr -rd com.apple.quarantine {文件路径}`解决
|
||||
:::
|
||||
|
||||
## 1、安装包下载
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载所需的最新的release包:
|
||||
- 比如服务器为linux则可下载`neutrino-proxy-server-ubuntu-20.04-native.zip`文件,客户端为windows则可下载`neutrino-proxy-client-windows-2022-native.zip`
|
||||
|
||||
## 2、部署服务端
|
||||
- 将服务端安装包上传至服务器,并解压
|
||||
- 服务端默认使用h2数据库,若需要改为mysql,则可修改安装包`app.yml`内的数据库配置,如下:
|
||||
```yml
|
||||
neutrino:
|
||||
data:
|
||||
db:
|
||||
type: mysql
|
||||
# 自己的数据库实例,创建一个空的名为'neutrino-proxy'的数据库即可,首次启动服务端会自动初始化
|
||||
url: jdbc:mysql://xxxx:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
||||
driver-class: com.mysql.jdbc.Driver
|
||||
# 数据库帐号
|
||||
username: xxx
|
||||
# 数据库密码
|
||||
password: xxx
|
||||
```
|
||||
- 然后直接启动服务端可执行程序即可
|
||||
|
||||
## 3、部署客户端
|
||||
- 本地解压客户端安装包
|
||||
- 修改`app.yml`文件中的server-ip为服务器公网ip,并配置license-key,以下是相关的部分配置:
|
||||
```yml
|
||||
neutrino:
|
||||
proxy:
|
||||
tunnel:
|
||||
# ssl证书密钥(使用jjar包内自带的证书,则此处无需修改)
|
||||
key-store-password: 123456
|
||||
# ssl证书管理密钥(使用jjar包内自带的证书,则此处无需修改。自定义证书,则此处配置对应的路径)
|
||||
jks-path: classpath:/test.jks
|
||||
# 代理服务端IP
|
||||
server-ip: xxxx
|
||||
# 代理服务端IP, 若是非ssl端口,则ssl-enable需要配置为false
|
||||
server-port: 9002
|
||||
# 是否启用ssl
|
||||
ssl-enable: true
|
||||
# licenseKey,客户端凭证。此处需要配置刚刚从管理后台复制的LicenseKey
|
||||
license-key: xxxx
|
||||
```
|
||||
- 然后直接启动客户端可执行程序即可
|
||||
@@ -1,123 +0,0 @@
|
||||
---
|
||||
title: 快速上手
|
||||
date: 2023-03-28 20:30:00
|
||||
permalink: /pages/793dcb
|
||||
article: false
|
||||
---
|
||||
|
||||
## 1、 部署服务端
|
||||
### 1.1、 Docker一键部署
|
||||
> 当前最新版本为1.9.0,下面的脚本中,可以使用:`registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:1.9.0` 指定版本安装,推荐使用`latest`直接安装最新版。
|
||||
|
||||
#### 使用默认sqlite数据库
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-d --restart=always --name neutrino-proxy \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
||||
```
|
||||
|
||||
#### 指定自己的mysql数据库
|
||||
- 在服务器上创建目录:/root/neutrino-proxy/config
|
||||
- 在该目录下创建`app.yml`文本文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
data:
|
||||
db:
|
||||
type: mysql
|
||||
# 自己的数据库实例,创建一个空的名为'neutrino-proxy'的数据库即可,首次启动服务端会自动初始化
|
||||
url: jdbc:mysql://xxxx:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
||||
driver-class: com.mysql.jdbc.Driver
|
||||
# 数据库帐号
|
||||
username: xxx
|
||||
# 数据库密码
|
||||
password: xxx
|
||||
```
|
||||
- 然后执行如下命令:
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-v /root/neutrino-proxy/config:/root/neutrino-proxy/config \
|
||||
-d --restart=always --name neutrino \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
||||
```
|
||||
|
||||
### 1.2、使用jar包自行部署
|
||||
- 首先确保服务器上已安装java8运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`
|
||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||
- 将` neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`上传至服务器部署目录。
|
||||
- 解压`neutrino-proxy-admin.zip`文件
|
||||
- 执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用sqlite数据库。
|
||||
- 若需要指定自己的mysql数据库,同样的需要在当前目录下新建`app.yml`文件,文件内容同上。执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar config=app.yml`启动服务端完成部署
|
||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/scripts/unix/server_start.sh 使用shell脚本启动服务端。
|
||||
|
||||
## 2、管理后台配置
|
||||
- 服务端部署成功后,访问`http://{服务端IP}:8888`打开后台管理页面。
|
||||
- 使用默认的管理员帐号登录:admin/123456
|
||||
- 打开`代理配置>License管理`页面,可以看到系统已经自动为管理员初始化了一条License记录,复制该`LicenseKey`备用,后续客户端配置需要。
|
||||
- 打开`代理配置>端口映射`页面,可以看到系统已经自动为初始化了几条端口映射。可根据需要自行添加、修改。这里我们以`9101 -> 127.0.0.1:8080`映射为例
|
||||
|
||||
## 3、启动客户端
|
||||
- 首先确保本地已安装java8运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-client.jar`
|
||||
- 在本地`neutrino-proxy-client.jar`同级别目录下新建`app.yml`文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
proxy:
|
||||
tunnel:
|
||||
# ssl证书密钥(使用jjar包内自带的证书,则此处无需修改)
|
||||
key-store-password: 123456
|
||||
# ssl证书管理密钥(使用jjar包内自带的证书,则此处无需修改。自定义证书,则此处配置对应的路径)
|
||||
jks-path: classpath:/test.jks
|
||||
# 代理服务端IP
|
||||
server-ip: localhost
|
||||
# 代理服务端IP, 若是非ssl端口,则ssl-enable需要配置为false
|
||||
server-port: 9002
|
||||
# 是否启用ssl
|
||||
ssl-enable: true
|
||||
# licenseKey,客户端凭证。此处需要配置刚刚从管理后台复制的LicenseKey
|
||||
license-key: xxxx
|
||||
```
|
||||
- 执行命令`java -jar neutrino-proxy-client.jar config=app.yml`启动客户端
|
||||
- 查看服务端License管理,刷新页面,对应的License在线状态为`在线`,则表明客户端已正常连接。
|
||||
|
||||
## 4、代理验证
|
||||
- 本地启动被代理服务,如:redis、本地web项目、本地mysql等等
|
||||
- 先确保本地能正常访问被代理服务,如果本地都不能访问,不用想代理更不可能!!!
|
||||
- 通过服务端IP+9101(上面License配置的端口映射重的服务端端口)访问本地被代理服务
|
||||
|
||||
访问成功,至此首次完整的内网穿透体验完成。开源不易,请速至[Gitee仓库](https://gitee.com/dromara/neutrino-proxy)一键三连🤝
|
||||
|
||||
## 5、客户端Docker部署
|
||||
> 因为一些原因,官方不推荐客户端使用Docker方式部署,但有不少朋友希望采用这种方式,因此从1.9.0版本开始维护了客户端镜像,版本号同服务端,也可使用`latest`直接安装最新版。
|
||||
- 客户端镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy-client:latest
|
||||
- 注意:客户端采用docker部署时,服务端端口映射客户端ip请不要配置127.0.0.1应该配置为容器访问宿主机的ip或者hostname,具体请自行百度
|
||||
|
||||
<!--
|
||||
## 4.开发&调试
|
||||
|
||||
::: tip
|
||||
1. 不建议在原默认vuepress项目上单独安装使用本主题包,而是clone我的整个项目再替换你自己的内容即可。
|
||||
2. 修改`config.js`配置后需要重新启动项目才会生效。
|
||||
3. 更多关于项目上手的问题,请查阅 [问答](/pages/9cc27d/)。
|
||||
:::
|
||||
|
||||
|
||||
## 版本升级
|
||||
|
||||
主题的版本会不定期更新,你只需更新npm主题包即可:
|
||||
```sh
|
||||
npm update vuepress-theme-vdoing
|
||||
```
|
||||
|
||||
::: tip
|
||||
1. 如更新后没起作用或报错,尝试把`node_modules`文件夹删除再`npm i`重新安装。
|
||||
2. 在.vuepress/config.js中,设置`theme: 'vdoing'`才是使用npm主题依赖包:
|
||||
```js
|
||||
// config.js
|
||||
module.exports = {
|
||||
theme: 'vdoing', // npm主题依赖包
|
||||
// theme: require.resolve('../../vdoing'), // 使用本地主题包
|
||||
}
|
||||
```
|
||||
:::
|
||||
-->
|
||||
@@ -16,12 +16,13 @@ permalink: /pages/f2d0f1/
|
||||
server:
|
||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||
port: ${WEB_PORT:8888}
|
||||
# 日志级别
|
||||
solon.logging.logger:
|
||||
"root":
|
||||
level: info
|
||||
|
||||
neutrino:
|
||||
proxy:
|
||||
logger:
|
||||
# 日志级别
|
||||
level: ${LOG_LEVEL:info}
|
||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||
tunnel:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
@@ -37,6 +38,8 @@ neutrino:
|
||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${TUNNEL_LOG:false}
|
||||
# 是否开启心跳日志
|
||||
heartbeat-log-enable: ${HEARTBEAT_LOG:false}
|
||||
server:
|
||||
tcp:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
@@ -61,10 +64,10 @@ neutrino:
|
||||
transfer-log-enable: ${SERVER_LOG:false}
|
||||
data:
|
||||
db:
|
||||
# 数据库类型,目前支持sqlite、mysql、mariadb
|
||||
type: ${DB_TYPE:sqlite}
|
||||
# 数据库类型,目前支持h2、mysql、mariadb
|
||||
type: ${DB_TYPE:h2}
|
||||
# 数据库连接URL
|
||||
url: ${DB_URL:jdbc:sqlite:data.db}
|
||||
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
||||
# 数据库用户名
|
||||
username: ${DB_USER:}
|
||||
# 数据库密码
|
||||
@@ -12,11 +12,13 @@ permalink: /pages/50ce10/
|
||||
|
||||
# 以下是最新的客户端配置格式(app.yml)
|
||||
```yml
|
||||
# 日志级别
|
||||
solon.logging.logger:
|
||||
"root":
|
||||
level: info
|
||||
|
||||
neutrino:
|
||||
proxy:
|
||||
logger:
|
||||
# 日志级别
|
||||
level: ${LOG_LEVEL:info}
|
||||
tunnel:
|
||||
# 线程池相关配置,用于技术调优,可忽略
|
||||
thread-count: 50
|
||||
@@ -35,6 +37,8 @@ neutrino:
|
||||
client-id: ${CLIENT_ID:}
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${CLIENT_LOG:false}
|
||||
# 是否开启心跳日志
|
||||
heartbeat-log-enable: ${HEARTBEAT_LOG:false}
|
||||
# 重连设置
|
||||
reconnection:
|
||||
# 重连间隔(秒)
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
title: 项目结构
|
||||
date: 2020-05-11 13:54:56
|
||||
permalink: /pages/2f674a
|
||||
article: false
|
||||
---
|
||||
|
||||
# 主要目录、文件
|
||||
|
||||
```
|
||||
├── data.db (为配置mysql时,项目启动默认初始化生成的本地sqlite数据库文件)
|
||||
├── docs (项目相关的一些文档)
|
||||
├── neutrino-proxy-admin (管理后台前端项目,基于vue-element-admin)
|
||||
├── neutrino-proxy-client (基于netty的代理客户端,用于和服务端交互、转发内网数据)
|
||||
├── neutrino-proxy-core (代理相关的公共代码(协议、常量))
|
||||
├── neutrino-proxy-server (基于netty的代理服务端,用于和客户段交互,将客户端转发的内网数据转发至外网端口)
|
||||
└── todolist.MD (近期的开发计划)
|
||||
```
|
||||
|
||||
# 代理服务端 `neutrino-proxy-server`
|
||||
- base:基础的配置、初始化代码
|
||||
- constant:服务端常量、枚举定义
|
||||
- dal:持久层mapper、实体
|
||||
- job:定时任务执行入口
|
||||
- proxy:代理核心实现
|
||||
- service:基础业务
|
||||
- util:基础工具封装
|
||||
- resource/mapper:mybatis SQL文件
|
||||
- resource/sql:维护mysql/sqlite的初始化SQL、SQL变更记录
|
||||
- resource/app.yml:项目默认配置
|
||||
- resource/test.jks:默认的SSL证书
|
||||
|
||||
# 代理客户端 `neutrino-proxy-client`
|
||||
- config:基础配置
|
||||
- core:客户端代理核心入口
|
||||
- handler:客户端代理数据处理逻辑
|
||||
- util:基础工具封装
|
||||
- resource/app.yml:项目默认配置
|
||||
- resource/test.jks:默认的SSL证书
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: 个人赞赏
|
||||
date: 2023-10-26 13:08:02
|
||||
permalink: /pages/1ab20b/
|
||||
---
|
||||
|
||||
## 个人赞赏说明
|
||||
随着用户增加,需要协助解决的问题也多种多样,为了能给用户提供 `更优质`、`更准确` 的 疑难问题 解答我们推出赞赏咨询服务
|
||||
|
||||
| 赞赏金额 | 服务时长 | 服务说明 |
|
||||
|:-----|:-----|:----------------------|
|
||||
| 任意金额 | - | 您将获得赞助者列表的永久留名。 |
|
||||
| 30 | 一个月 | 您在群内反馈的问题将优先得到作者响应 |
|
||||
| 80 | 三个月 | 获得微信一对一的咨询服务 |
|
||||
| 180 | 三个月 | 获得官网首页特别赞助席位一个,一次远程协助 |
|
||||
| 更多金额 |-| 您将获得私人定制服务 |
|
||||
|
||||
> 注意1:服务项目是逐级叠加:如,您赞赏的金额是 80 员那么您将享受:任意金额、一个月、三个月的服务内容
|
||||
|
||||
> 注意2:二开问题不在个人赞赏支持服务范畴内,如需咨询二开问题或者二开方案请找作者协商
|
||||
|
||||
## 赞赏途径
|
||||
> 除4以外,赞赏后请及时通过官网首页微信二维码与作者取得联系
|
||||
|
||||
- 1、微信赞赏
|
||||
- 2、支付宝转账
|
||||
- 3、Gitee项目捐赠:[点击这里](https://gitee.com/dromara/neutrino-proxy)打开后拉到最底部点击捐赠
|
||||
- 4、微信好友转账
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center">微信赞赏</td><td align="center">支付宝转账</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img width="300px" src="./a1.png"></td><td><img width="300px" src="./a2.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -36,8 +36,8 @@ permalink: /pages/a3f096/
|
||||
- 注释完备,尤其每个新增的方法应按照Java文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
|
||||
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
||||
- 对现有代码的优化,请在注释中说明原因。
|
||||
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
||||
- sqlite、mysql下均测试通过
|
||||
- 如果涉及到数据库的变更,则至少需要做到以下几点:
|
||||
- h2、mysql下均测试通过
|
||||
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
||||
- 对于新增的表,维护必要的初始化数据
|
||||
- 在对应的mysql、sqlite的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||
- 在对应的mysql、h2的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: 项目结构
|
||||
date: 2020-05-11 13:54:56
|
||||
permalink: /pages/2f674a
|
||||
article: false
|
||||
---
|
||||
|
||||
# 主要目录、文件
|
||||
|
||||
```
|
||||
├── assets (资源文件)
|
||||
├── docs (项目相关的一些文档)
|
||||
├── neutrino-proxy-admin (管理后台前端项目,基于vue-element-admin)
|
||||
├── neutrino-proxy-client (基于netty的代理客户端,用于和服务端交互、转发内网数据)
|
||||
├── neutrino-proxy-core (代理相关的公共代码(协议、常量))
|
||||
├── neutrino-proxy-server (基于netty的代理服务端,用于和客户段交互,将客户端转发的内网数据转发至外网端口)
|
||||
├── neutrino-proxy-vuepress (中微子代理官网文档)
|
||||
├── scripts (常用的编译、打包脚本)
|
||||
├── Milestone.md (里程碑事件节点)
|
||||
├── VLog.md (版本变更记录)
|
||||
└── todolist.MD (近期的开发计划)
|
||||
```
|
||||
|
||||
# 代码分支说明
|
||||
- dev:常规开发分支,日常的开发、Bug修复、提交PR都在此分支
|
||||
- feature/xxx:特征分支,一些试验性开发、提交PR都在此分支,xxx可自行取一个有意义的名称
|
||||
- release/xxx:发行版分支,作为阶段性成果、重大更新的版本固化分支。受保护,不允许任何提交。
|
||||
- master:主分支,定期同步最新代码,目前仅支持本人(傲世孤尘/雨韵诗泽)提交。
|
||||
@@ -6,6 +6,9 @@ permalink: /pages/cded59/
|
||||
|
||||
| 日期 | 渠道 | 金额 |昵称| 备注 |
|
||||
|:-----------|:---|:-----|:-|:-----------------|
|
||||
|2023-11-01|微信红包|20|Sun|感谢大佬,请你喝杯奶茶[微笑]|
|
||||
|2023-10-30|微信赞赏|50|杨娃娃||
|
||||
|2023-10-16|微信转账|50|Mark Isaac赵方丈|金额不大,开源感恩。|
|
||||
|2023-10-11|微信红包|50|喜鸽小宝||
|
||||
|2023-10-10|微信红包|20|海洋||
|
||||
| 2023-07-31 |Gitee捐助| 50 |失败女神| 感谢您的开源项目! |
|
||||
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 296 KiB |
@@ -1,428 +0,0 @@
|
||||
---
|
||||
title: 案例
|
||||
date: 2020-05-14 11:39:45
|
||||
permalink: /pages/5d571c
|
||||
# sidebar: false
|
||||
article: false
|
||||
---
|
||||
## 特别用户
|
||||
::: cardImgList 3
|
||||
```yaml
|
||||
config:
|
||||
imgHeight: 140px
|
||||
|
||||
data:
|
||||
# - img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/[email protected]
|
||||
# link: https://docs.openharmony.cn/pages/000000/
|
||||
# name: OpenHarmony
|
||||
# desc: 开放原子开源基金会
|
||||
# author: OpenHarmony
|
||||
# avatar: https://www.openharmony.cn/static/img/core-card-item2.a72a0d10.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/QQ20211215-144040.hgt2875r2zc.webp
|
||||
link: https://baomidou.com/
|
||||
name: MyBatis-Plus官网
|
||||
desc: 🚀为简化开发而生
|
||||
author: 青苗
|
||||
avatar: https://baomidou.com/img/logo.svg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/[email protected]
|
||||
link: https://docs.deepin.org
|
||||
name: Deepin 社区文档
|
||||
desc: Deepin 应用开发技术分享、DTK开发经验等
|
||||
author: Deepin
|
||||
avatar: https://fastly.jsdelivr.net/gh/xmuli/xmuliPic@pic/2021/deepin.png
|
||||
- img: https://ks3-cn-beijing.ksyuncs.com/vform-static/img/vform_website.png
|
||||
link: http://www.vform666.com
|
||||
name: VForm官网
|
||||
desc: 低代码表单优选方案,拖拽式设计,一键生成源码
|
||||
author: vformAdmin
|
||||
avatar: https://www.vform666.com/vform-logo.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/blog-gitalk-comment@master/img/xxx.7feub7n1y0g0.png
|
||||
link: https://liteflow.yomahub.com
|
||||
name: LiteFlow官网
|
||||
desc: 轻量,快速,稳定可编排的组件式规则引擎
|
||||
author: 铂赛东
|
||||
avatar: https://portrait.gitee.com/uploads/avatars/user/367/1102362_bryan31_1578940308.png!avatar60
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/blog-gitalk-comment@master/img/176866696-743faf44-4afd-4c12-9728-f982ea885836.2205nb3vf5mo.webp
|
||||
link: https://easy-es.cn/
|
||||
name: Easy-Es官网
|
||||
desc: 傻瓜级ElasticSearch搜索引擎ORM框架
|
||||
author: 老汉
|
||||
avatar: https://iknow.hs.net/9fa0407f-30ff-4d8b-82da-a4990e41a04b.png
|
||||
```
|
||||
:::
|
||||
|
||||
## 知识库兼博客
|
||||
::: cardImgList 4
|
||||
```yaml
|
||||
config:
|
||||
imgHeight: 140px
|
||||
|
||||
data:
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530114033.png
|
||||
link: https://xugaoyi.com/
|
||||
name: Evan's blog
|
||||
desc: Web前端技术博客,积跬步以至千里,致敬每个爱学习的你。
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200727170555.jpg
|
||||
link: https://miluluyo.github.io/vdoingBlog/
|
||||
name: 麋鹿鲁哟
|
||||
desc: 运气交给锦鲤,</br>你只管努力就好。 (●ˇ∀ˇ●)
|
||||
author: 麋鹿鲁哟
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200122153807.jpg
|
||||
- img: https://i.loli.net/2020/07/26/BUCplirGIq9YTNA.png
|
||||
link: https://lingze.xyz/
|
||||
name: Lingze's blog
|
||||
desc: 少侠, 别来无恙?
|
||||
author: 令则
|
||||
avatar: https://i.loli.net/2020/07/11/XhqR7Idnk5LD8bC.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/[email protected]
|
||||
link: https://www.xswsym.online/
|
||||
name: summer's blog
|
||||
desc: Devops运维技术博客,分享运维技术
|
||||
author: 夏苏文
|
||||
avatar: https://fastly.jsdelivr.net/gh/summerking1/image@main/tx.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20201110221457.png
|
||||
link: https://gocifer.github.io
|
||||
name: Gocifer's DB & Blog
|
||||
desc: 一个中二少年,专注于计算机基础架构、云原生、网络、云计算的所学、所思、所行、所想。
|
||||
author: gocifer.jay
|
||||
avatar: https://gocifer.github.io/img/avatar/gocifer.png
|
||||
- img: https://dra-m.com/images/thumbnail.png
|
||||
link: https://dra-m.com/
|
||||
name: Dra-M
|
||||
desc: JAVA后端
|
||||
author: 莫小龙
|
||||
avatar: https://q1.qlogo.cn/g?b=qq&nk=975425198&s=640
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200905142134.png
|
||||
link: https://www.coder163.com/
|
||||
name: 跟着老侯玩编程
|
||||
desc: 一个乐于编程知识分享的站点
|
||||
author: 舞动的代码
|
||||
avatar: https://www.coder163.com/img/qun.png
|
||||
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20210119213748.jpg
|
||||
link: https://haijunit.top/
|
||||
name: 学习笔记
|
||||
desc: 平时的技术积累|分享交流技术心得|温故而知新
|
||||
author: 爱做梦的奋斗青年
|
||||
avatar: https://haijunit.top/images/avatar.png
|
||||
- img: https://fastly.jsdelivr.net/gh/yxw839841231/images/studying-icu/20210120110320.png
|
||||
link: https://www.studying.icu/
|
||||
name: 研究院
|
||||
desc: 一万年太久,只争朝夕
|
||||
author: xwyang
|
||||
avatar: https://avatars1.githubusercontent.com/u/13757119?s=80&v=4
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/[email protected]
|
||||
link: https://blog.kimen.com.cn/
|
||||
name: Kimen's Blog
|
||||
desc: 全沾攻城狮
|
||||
author: Kimen
|
||||
avatar: https://avatars.githubusercontent.com/u/25970284?s=460&u=69b419ad6de33eaa1d6b73d7f065f710076d6c55&v=4
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/QQ20211101-165045-(1).4b4axinii160.png
|
||||
link: https://lixianglong3210.gitee.io/xlong-vdoing/
|
||||
name: XLONG's blog
|
||||
desc: 蒸汽波、咖啡
|
||||
author: lixianglong3210
|
||||
avatar: http://www.lixianglong.cn/bg_store/img/avatar/default.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/Awrtiger/mirrorfile/img/web.png
|
||||
link: https://www.ool.cool/
|
||||
name: 偷吃了鸡蛋的梨
|
||||
desc: 捣鼓这,捣鼓那。
|
||||
author: Awrtiger
|
||||
avatar: https://fastly.jsdelivr.net/gh/Awrtiger/mirrorfile/img/avatar.jpg
|
||||
- img: https://image-1302577725.cos.ap-beijing.myqcloud.com/img/20210402183053.png
|
||||
link: https://f4de-bak.github.io/
|
||||
name: Xinghai's Blog
|
||||
desc: Web Security | Java Security
|
||||
author: Xinghai
|
||||
avatar: https://image-1302577725.cos.ap-beijing.myqcloud.com/img/20210328234543.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/eyjf.png
|
||||
link: https://wiki.eryajf.net
|
||||
name: 二丫讲梵
|
||||
desc: 学习,记录,分享。(运维生活编程)
|
||||
author: 二丫讲梵
|
||||
avatar: https://wiki.eryajf.net/img/logo.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/ss.2tev477ruza0.png
|
||||
link: https://masongsong.cn
|
||||
name: 松松的一尺三分地
|
||||
desc: 记录工作和学习中的所得
|
||||
author: masongsong
|
||||
avatar: https://fastly.jsdelivr.net/gh/MssText/learn@master/images/49203535.35emn5vryma0.png
|
||||
- img: https://fastly.jsdelivr.net/gh/Kele-Bingtang/static/user/20211218235045.png
|
||||
link: https://notes.youngkbt.cn/
|
||||
name: Young Kbt Blog
|
||||
desc: 记录学习Java, Web, 框架, 工具, 前端等相关知识, 记录生活和技术路程, 分享编程技巧。
|
||||
author: Ship Liu
|
||||
avatar: https://fastly.jsdelivr.net/gh/Kele-Bingtang/static/user/avatar2.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/123.57gcfayi85k0.webp
|
||||
link: https://blog.dragon1573.wang/
|
||||
name: 断桥烟雨の学习笔记
|
||||
desc: 学习爱我,我爱学习~
|
||||
author: べ断桥烟雨ミ
|
||||
avatar: https://avatars.githubusercontent.com/u/49941141
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/blog-gitalk-comment@master/img/20220210094650.3q09d26tigc0.webp
|
||||
link: https://chuck6.github.io/blog/
|
||||
name: 梵一的博客
|
||||
desc: 个人博客和知识分享
|
||||
author: 梵一
|
||||
avatar: https://chuck6.github.io/blog/img/paizhao.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/niumoo/cdn-assets/2021/20220316145528.png
|
||||
link: https://www.wdbyte.com
|
||||
name: 未读代码
|
||||
desc: Java 开发知识库,分享原创文章
|
||||
author: 程序猿阿朗
|
||||
avatar: https://avatars.githubusercontent.com/u/26371673?v=4
|
||||
- img: https://fastly.jsdelivr.net/gh/simonzhangs/image-hosting@master/vue-plugin-example/blog.qg2buhe5h4g.webp
|
||||
link: https://simonzhangs.github.io/
|
||||
name: 松本松的博客儿
|
||||
desc: Web前端技术博客,积跬步以至千里。
|
||||
author: simonzhangs
|
||||
avatar: https://fastly.jsdelivr.net/gh/simonzhangs/image-hosting@master/20220319/image.4x708q9wzse0.webp
|
||||
- img: https://fastly.jsdelivr.net/gh/terwer/upload/img/image-20220422000045653.png
|
||||
link: http://terwergreen.com
|
||||
name: 远方的灯塔
|
||||
desc: 专注于服务端技术分享
|
||||
author: terwer
|
||||
avatar: https://fastly.jsdelivr.net/gh/terwer/upload/img/photo.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/nksuya/image_store@main/suyablog_home.5iou2ogjrm80.webp
|
||||
link: https://suyaspace.com/
|
||||
name: Suya's blog
|
||||
desc: 个人博客,分享技术文章,学习笔记,植物相关知识等。
|
||||
author: Suya
|
||||
avatar: https://fastly.jsdelivr.net/gh/nksuya/image_store@master/tech/avatar.2tycyyc1ebr4.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store2@master/img/[email protected]
|
||||
link: https://colorpanda.aifan.jp/
|
||||
name: ColorPanda
|
||||
desc: 日语中文英文学习网站
|
||||
author: ColorPanda
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store2@master/img/image.3qr8m501tl20.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/blog-gitalk-comment@master/img/asdf.23jsekfejla8.jpeg
|
||||
link: https://inannan423.github.io/
|
||||
name: Zihanio
|
||||
desc: Zihan的学习博客
|
||||
author: Zihan
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/blog-gitalk-comment@master/img/xxx.67b3ygadagk0.jpeg
|
||||
- img: https://user-images.githubusercontent.com/866409/175853573-28ded198-2348-4a82-8ddd-05088161e3fe.png
|
||||
link: https://xingcxb.com
|
||||
name: 不器小窝
|
||||
desc: 但知行好事,莫要问前程
|
||||
author: 不器
|
||||
avatar: https://avatars.githubusercontent.com/u/866409?v=4
|
||||
- img: https://cdn.staticaly.com/gh/xugaoyi/blog-gitalk-comment@master/img/QQ20220722-141037.22uk9ow7ary.png
|
||||
link: https://eryajf.github.io/vdoing-template/
|
||||
name: Vdoing主题博客模板
|
||||
desc: Vdoing主题博客模板
|
||||
author: eryajf
|
||||
avatar: https://cdn.staticaly.com/gh/xugaoyi/blog-gitalk-comment@master/img/33259379.277tur21ir40.jpeg
|
||||
- img: https://cdn.jsdelivr.net/gh/FireHH/github_img_repository/logo/微信截图_20220810164903.png
|
||||
link: https://javaessay.cn/
|
||||
name: Java essay
|
||||
desc: Java散文知识库,Spring全家桶,SpringCloud全家桶,高可用高并发架构,面试等
|
||||
author: Mr.Fire
|
||||
avatar: https://cdn.jsdelivr.net/gh/FireHH/github_img_repository/logo/huge.jpg
|
||||
- img: https://chendapeng.cn/images/about/blog_image.png
|
||||
link: https://chendapeng.cn
|
||||
name: 行百里er
|
||||
desc: Java,个人技术博客,后端开发,技术架构,分布式技术,Spring Cloud Alibaba,Elasticsearch,Redis,算法,数据结构,Git
|
||||
author: 行百里er
|
||||
avatar: https://chendapeng.cn/images/about/avatar.png
|
||||
- img: http://xyhwh-nav.cn/img/index.png
|
||||
link: http://xyhwh-nav.cn
|
||||
name: Captain
|
||||
desc: 学习技术,Java基础、面试知识点、项目经验总结和一些学习笔记
|
||||
author: Captain
|
||||
avatar: http://xyhwh-nav.cn/img/logo.png
|
||||
- img: https://xiaoxue-images.oss-cn-shenzhen.aliyuncs.com/blog/202212271108541.jpg
|
||||
link: https://blog.xueqimiao.com/
|
||||
name: 小薛博客
|
||||
desc: 小薛博客,专注IT技术分享,助力人人成为架构师
|
||||
author: xueqimiao
|
||||
avatar: https://xiaoxue-images.oss-cn-shenzhen.aliyuncs.com/blog/202212271110209.png
|
||||
- img: https://cdn.jsdelivr.net/gh/su-dd/cdn/博客/202301311644669.png
|
||||
link: https://blog.addai.cn/
|
||||
name: 呆呆的博客
|
||||
desc: 个人博客
|
||||
author: 呆呆
|
||||
avatar: https://cdn.addai.cn/博客/网站使用/呆呆.webp
|
||||
- img: https://raw.githubusercontent.com/jorgen-zhao/blog/master/images/snapshot.png
|
||||
link: https://jorgen.website
|
||||
name: Jorgen's blog
|
||||
desc: 🚀个人知识库兼博客🚀
|
||||
author: jorgen
|
||||
avatar: https://jorgen.website/img/avatar.jpg
|
||||
```
|
||||
:::
|
||||
|
||||
## 知识库
|
||||
::: cardImgList 4
|
||||
```yaml
|
||||
config:
|
||||
imgHeight: 150px
|
||||
|
||||
data:
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530114035.png
|
||||
link: https://xugaoyi.github.io/vdoing-demo-repository/
|
||||
name: 知识库演示
|
||||
desc: Vdoing主题演示-知识库
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20201219205536.jpg
|
||||
link: https://wiki.router86.com/
|
||||
name: X86软路由和NAS
|
||||
desc: 记录X86软路由和NAS的一些知识
|
||||
author: MonoLogueChi
|
||||
avatar: https://blog.xxwhite.com/assets/img/avatar.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20201219205318.jpg
|
||||
link: https://blog.northword.cn/dft-learning
|
||||
name: 计算模拟学习笔记
|
||||
desc: 《能源环境材料计算模拟方法》学习笔记,涉及密度泛函理论、第一性原理等和Materials Studio、VASP等的使用。
|
||||
author: Northword
|
||||
avatar: https://storage.live.com/items/28C1032A24A9C53B!25785?authkey=AHAx3GOYEKGqm8I
|
||||
- img: https://singerwimg-1300001977.cos.accelerate.myqcloud.com/20211008/WccSrJ0s.png
|
||||
link: https://repository.singerw.com
|
||||
name: Singerw's Repository
|
||||
desc: 技术的风花雪月之事,有个存档的地方,对于复盘,回忆,都是一个极好的方谭。
|
||||
author: Singerw
|
||||
avatar: https://singerwimg-1300001977.cos.accelerate.myqcloud.com/2021/09/20/76f29482ffc9b.png
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/QQ20220113-114927.5oha7j06c580.webp
|
||||
link: https://hippox.cn
|
||||
name: hippo4j
|
||||
desc: 🔥 动态线程池框架,附带监控报警功能,轻量级的运维监控平台
|
||||
author: Acmenlt
|
||||
avatar: https://hippox.cn/img/web.png
|
||||
- img: https://pics.landcover100.com/pics/624e63f4c82b8.png
|
||||
link: https://www.gisrsdata.com
|
||||
name: 地信遥感数据汇
|
||||
desc: 解决目前地信遥感方向数据混杂,资源难以寻找的问题,构建一个地信遥感学习、讨论、交流的平台。
|
||||
author: 锐多宝
|
||||
avatar: https://pics.landcover100.com/pics/624e6469cbb8a.jpg
|
||||
- img: https://img.de7v.com/img/site-pic.jpg
|
||||
link: https://www.de7v.com
|
||||
name: De7v
|
||||
desc: 专注于安卓领域的技术传播
|
||||
author: wresource
|
||||
avatar: https://img.de7v.com/img/wresource.png
|
||||
- img: https://cdn.staticaly.com/gh/xugaoyi/blog-gitalk-comment@master/img/11123.1aljpnjyr074.png
|
||||
link: https://eryajf.github.io/HowToStartOpenSource/
|
||||
name: HowToStartOpenSource
|
||||
desc: GitHub开源项目维护协作指南
|
||||
author: eryajf
|
||||
avatar: https://cdn.staticaly.com/gh/xugaoyi/blog-gitalk-comment@master/img/33259379.277tur21ir40.jpeg
|
||||
```
|
||||
:::
|
||||
## 社区类
|
||||
:::cardImgList
|
||||
```yaml
|
||||
config:
|
||||
imgHeight: 150px
|
||||
|
||||
data:
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200921220111.png
|
||||
link: https://course.yiwiz.com/
|
||||
name: 奕维投资教程站
|
||||
desc: 股票投资
|
||||
author: 奕维
|
||||
avatar: https://course.yiwiz.com/img/logo.png
|
||||
```
|
||||
:::
|
||||
|
||||
## 博客类
|
||||
::: cardImgList
|
||||
```yaml
|
||||
config:
|
||||
imgHeight: 150px
|
||||
|
||||
data:
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530114034.png
|
||||
link: https://xugaoyi.github.io/vdoing-demo-blog/
|
||||
name: Vdoing's blog
|
||||
desc: Vdoing主题演示-博客
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
- img: https://s4.ax1x.com/2022/02/25/bAjINF.png
|
||||
link: https://fangweilong.github.io/
|
||||
name: Teler的日常
|
||||
desc: 好好学习,天天向上
|
||||
author: Teler
|
||||
avatar: https://s4.ax1x.com/2022/02/25/bAva8J.jpg
|
||||
- img: https://user-images.githubusercontent.com/53399655/163007243-1b99b96b-cac3-49ca-9950-03a1e877a6d8.png
|
||||
link: https://xustudyxu.github.io/
|
||||
name: xustudyxu's Blog
|
||||
desc: 一起学习编程!
|
||||
author: xustudyxu
|
||||
avatar: https://xustudyxu.github.io/img/01.png
|
||||
```
|
||||
:::
|
||||
|
||||
## 文档类
|
||||
::: cardImgList 4
|
||||
```yaml
|
||||
config:
|
||||
imgHeight: 150px
|
||||
|
||||
data:
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530114036.png
|
||||
link: https://xugaoyi.github.io/vuepress-theme-vdoing-doc/
|
||||
name: vdoing(本站)
|
||||
desc: 🚀一款简洁高效的VuePress 知识管理&博客 主题
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/QQ20210925-124836@2x (1).6ogvf85maog0.png
|
||||
link: https://justauth.plus/
|
||||
name: JA Plus 开发者文档
|
||||
desc: 一款开源的登录认证中间件
|
||||
author: yadong,zhang
|
||||
avatar: https://portrait.gitee.com/uploads/avatars/user/261/784199_yadong.zhang_1578932767.png!avatar200
|
||||
- img: https://assets.imgradeone.com/docsdokimod-pv.png
|
||||
link: https://docs.dokimod.cn
|
||||
name: DokiMod 开发文档
|
||||
desc: 为 DDLC Mod 开发提供的完善文档
|
||||
author: imgradeone
|
||||
avatar: https://docs.dokimod.cn/logo_128x128.png
|
||||
# - img: http://yogoyun.oss-cn-beijing.aliyuncs.com/help/public/other/20200630125515.png
|
||||
# link: http://help.yogoyun.com/
|
||||
# name: 柚果云服务
|
||||
# desc: 智能商业应用程序服务商。
|
||||
# author: 柚果云服务
|
||||
# avatar: http://yogoyun.oss-cn-beijing.aliyuncs.com/admin/console/logo.png
|
||||
- img: https://jeesite.com/docs/img/docs.png
|
||||
link: http://docs.jeesite.com
|
||||
name: JeeSite 在线文档
|
||||
desc: JeeSite 快速开发平台 - 在线文档
|
||||
author: ThinkGem
|
||||
avatar: https://jeesite.com/docs/img/logo.png
|
||||
- img: https://fastly.jsdelivr.net/gh/dreamncn/picBed@master/uPic/2022_05_12_20_40_04_1652359204_1652359204449_9mVkaR.png
|
||||
link: https://cleanphp.ankio.net/
|
||||
name: CleanPHP
|
||||
desc: CleanPHP开发者文档
|
||||
author: ankio
|
||||
avatar: https://fastly.jsdelivr.net/gh/dreamncn/picBed@master/uPic/2022_04_04_19_48_51_1649072931_1649072931346_h4BGpQ.jpg
|
||||
- img: https://cdn.staticaly.com/gh/xugaoyi/blog-gitalk-comment@master/img/28284d.56bkx9qvhc00.webp
|
||||
link: https://jpom-docs.keepbx.cn/
|
||||
name: Jpom
|
||||
desc: 简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件
|
||||
author: 不忘初心
|
||||
avatar: https://jpom-docs.keepbx.cn/images/jpom_logo.png
|
||||
- img: https://wumei.live/kerwincui/document/raw/branch/master/images/img.png
|
||||
link: https://wumei.live/doc/
|
||||
name: 物美智能
|
||||
desc: 物美智能开源物联网平台,简单易用,可用于搭建物联网平台以及二次开发和学习。适用于智能家居、智慧办公、智慧社区、农业监测、水利监测、工业控制等。
|
||||
author: 随遇而安 / kerwincui
|
||||
avatar: https://portrait.gitee.com/uploads/avatars/user/611/1834441_kerwincui_1581523162.png!avatar200
|
||||
- img: https://pic.imgdb.cn/item/637c92ef16f2c2beb11293c7.jpg
|
||||
link: https://trace-recorder.xusc.cn
|
||||
name: trace-recorder官网
|
||||
desc: 简单的, 可伸缩的, 高性能的跟踪记录仪
|
||||
author: 蔡旺
|
||||
avatar: https://pic.imgdb.cn/item/637c933516f2c2beb112ed43.jpg
|
||||
```
|
||||
:::
|
||||
|
||||
</br></br>
|
||||
|
||||
## 申请加入案例
|
||||
|
||||
::: tip 你想在这个页面展示你的站点吗?
|
||||
欢迎使用Vdoing主题的小伙伴到 [**这里**](https://github.com/xugaoyi/vuepress-theme-vdoing/issues/new?assignees=&labels=&template=+join_case.md) 留下你的站点信息,你的站点将有机会出现在这个页面里~
|
||||
:::
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: 企业登记案例
|
||||
date: 2020-05-14 11:39:45
|
||||
permalink: /pages/5d571c
|
||||
---
|
||||
|
||||
## 企业登记
|
||||
如果您所在的企业使用到了中微子代理,麻烦抽出宝贵的时间[点击这里](https://gitee.com/dromara/neutrino-proxy/issues/I6WC71)进行登记,这将会助力中微子代理走得更远。
|
||||
|
||||
## 案例展示
|
||||
|企业名称| logo | 官网地址 | 使用人数 |用途|
|
||||
|:-|:-----------------------------------------------------------------------------------------------------------|:-------------------------|:-----|:-|
|
||||
|北京吉威空间信息股份有限公司|  | http://www.geoway.com.cn | 10 |开发环境的session会话同步与开发环境的对接测试华为云与微信等云端回调接口|
|
||||
|悦邻供应链科技有限公司|| https://yinghecloud.com | 10 |开发及生产环境内网服务器VPN搭建,本地开发服务端口调试|
|
||||
|阿依瓦(北京)技术有限公司|| https://www.alva.com.cn | 50 |开发及生产环境内网服务器VPN搭建,本地开发服务端口调试,云端同步数据等|
|
||||
|常州裕景信息科技有限公司|| 无 | 5 |远程管理虚拟机,接口、数据库等功能调试|
|
||||
|湖北楚商联盟金融信息服务有限公司|| http://www.chually.cn | 10 |开发及生产环境内网服务器VPN搭建,本地开发服务端口调试,云端同步数据等|
|
||||
|中科元景智能(深圳)有限公司|| https://yjupi.com | 20 |本地开发连接测试环境及生产环境内网服务器,包含数据库、redis、模块服务等|
|
||||
|长沙小蜂科技有限公司|| 无 | 1~3人 |主要用于测试环境内网服务器,包含数据库,远程桌面等|
|
||||
|江西六湛科技|| http://www.liuzhankj.com | 12 |主要用于部署一些使用时长较短的项目|
|
||||
|杭州艾佳智能科技有限公司|| http://www.ajaiot.com | 12-16人 |公司部分设备是通过udp通信的,对接调试设备,搭建测试环境服务网关的时候需要|
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: 2.x
|
||||
date: 2023-10-26 17:43:43
|
||||
permalink: /pages/ff3519/
|
||||
---
|
||||
|
||||
## 2.0.0
|
||||
- solon版本升级为`2.5.11`
|
||||
- jdk版本升级为17
|
||||
- 支持原生编译改造
|
||||
- 默认支持的数据库由sqlite改为h2
|
||||
- 升级须知:
|
||||
- jdk版本升级为了jdk17,jar部署时请注意
|
||||
- 去掉了默认的sqlite数据库,改为了h2。如果之前使用sqlite,请自行处理数据迁移
|
||||
- 配置文件做了较大调整,请参照官网使用须知中的`服务端配置`、`客户端配置`进行更新
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: 1.x
|
||||
date: 2023-10-26 17:43:34
|
||||
permalink: /pages/dda8e5/
|
||||
---
|
||||
|
||||
## 1.9.0
|
||||
- 端口映射支持UDP协议
|
||||
- 端口映射HTTP(S)新增打开网页按钮,优先使用域名打开
|
||||
- 新增/编辑端口映射时端口占用检测功能屏蔽,解决docker下使用的各种问题
|
||||
|
||||
## 1.8.6
|
||||
- 端口映射选择端口支持分页
|
||||
- 新增/更新端口映射,增加端口占用检测(端口映射编辑时,如果端口号没有变动,则不验证。避免出现端口映射正在使用时,无法更新端口映射其他信息的问题)
|
||||
- 下拉搜索license,支持模糊搜索
|
||||
- license下拉用户搜索,支持模糊搜索
|
||||
- 端口映射HTTP(S)新增打开网页按钮
|
||||
- 客户端断开连接时,记录日志空指针异常问题修复
|
||||
|
||||
## 1.8.5
|
||||
- 后台端口池管理支持批量删除
|
||||
- 端口映射下拉选择端口支持搜索
|
||||
- 客户端/服务端配置增加心跳日志开关,有需要时开启,方便排查问题
|
||||
- 客户端/服务端读写超时逻辑微调
|
||||
|
||||
## 1.8.4
|
||||
- 增加对mariadb的支持
|
||||
- 服务端/客户端,支持配置文件、启动参数指定日志级别
|
||||
- 客户端支持配置文件指定重连间隔,是否开启无限重连
|
||||
|
||||
## 1.8.3
|
||||
- 客户端重连优化
|
||||
- 服务端验证客户端身份逻辑优化
|
||||
|
||||
## 1.8.2
|
||||
- 增加HTTPS的支持。
|
||||
|
||||
## 1.8.0
|
||||
- 端口映射支持选择协议
|
||||
- HTTP协议下映射支持配置子域名(前提是server端配置了域名)
|
||||
|
||||
## 1.7.1
|
||||
- 针对管理后台各页面的排序、搜索条件的优化
|
||||
- 增加端口池分组、相关的端口映射优化
|
||||
- 增加了报表管理模块:用户流量报表、license流量报表、用户流量月度明细、license流量月度明细
|
||||
- 完成首页图表展示:license统计、端口映射统计、今日流量统计、汇总流量统计、最近15日流量折线图
|
||||
|
||||
## 1.7.0
|
||||
- 底层框架更换为Solon + MybatisPlus
|
||||
|
||||
## 1.6.4
|
||||
- 支持代理服务端用户(删除/禁用)、端口池(删除/禁用/启用)、License(删除/禁用/启用)、端口映射(新增/删除/禁用/启用)实时生效
|
||||
- 启动参数优化
|
||||
- 服务端静态资源服务支持缓存、gzip压缩,提升响应速度
|
||||
|
||||
## 1.6.0
|
||||
- 新增日志管理模块,调度日志迁移至日志管理
|
||||
- 管理后台新增登录日志
|
||||
- 新增首页流量统计
|
||||
|
||||
## 1.5.0
|
||||
- 管理后台新增用户管理、License管理、端口映射、调度管理、客户端连接日志、调度日志
|
||||
- 支持默认sqlite数据库
|
||||
- 底层框架Aop、Banner、SqlMapper、Ioc、@Value注解、Yml配置加载、静态资源服务等优化
|
||||
- 底层框架新增@Async、@Singleton等注解
|
||||
- 新增AsgcCompiler、ApplicationEvent机制封装
|
||||
|
||||
## 1.0.0
|
||||
> 第一个基本可用版本
|
||||
- 基于自研底层应用框架、Netty
|
||||
- 纯配置实现、无管理后台
|
||||
- 支持TCP代理
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: 里程碑
|
||||
date: 2023-10-26 17:41:26
|
||||
permalink: /pages/e406dd/
|
||||
---
|
||||
|
||||
- 2023-10-31 2.0.0版本发布,升级jdk版本至jdk17、支持原生编译、去掉sqlite改为默认H2数据库
|
||||
- 2023-09-25 中微子代理Gitee Star数突破1000
|
||||
- 2023-09-22 1.9.0版本发布,端口映射支持UDP协议
|
||||
- 2023-09-07 1.8.6版本发布,后台若干细节优化
|
||||
- 2023-07-04 1.8.5版本发布,后台若干细节优化、配置文件优化
|
||||
- 2023-06-08 1.8.4版本发布,增加对mariadb的支持、配置文件支持指定日志级别、重连参数
|
||||
- 2023-06-03 1.8.3版本发布,客户端重连优化、服务端验证客户端身份逻辑优化
|
||||
- 2023-05-27 1.8.2版本发布,增加HTTPS支持
|
||||
- 2023-04-03 1.8.0版本发布,端口映射支持选择协议,HTTP映射支持子域名
|
||||
- 2023-03-26 1.7.1版本发布,新增端口池分组、新增报表管理模块、首页图表优化
|
||||
- 2023-03-12 1.7.0版本发布,底层框架更换为Solon + MybatisPlus
|
||||
- 2023-02-23 1.6.4版本发布,管理后台增、删、改、禁用实时生效,启动参数、GZip优化
|
||||
- 2023-01-16 加入Dromara组织
|
||||
- 2023-01-08 中微子代理Gitee Star突破100
|
||||
- 2022-11-23 1.6.0版本发布,新增日志管理模块,新增首页流量统计
|
||||
- 2022-10-12 1.5.0版本发布,底层框架优化,新增管理后台
|
||||
- 2022-06-16 1.0.0版本发布,基于自研应用框架、纯配置无管理后台
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
title: 最近更新
|
||||
date: 2020-05-25 12:01:52
|
||||
permalink: /pages/9cc27d
|
||||
# sidebar: false
|
||||
article: false
|
||||
---
|
||||
|
||||
# TODO
|
||||
|
||||
### 1.x剩余规划
|
||||
- [ ] 参考鹊桥,增加对域名的支持
|
||||
- [ ] 官网上线
|
||||
|
||||
#### Bug
|
||||
- windows环境下直接运行发布版的jar包,日志输出乱码
|
||||
- 代理mysql时,使用未开启远程访问的账号走代理访问mysql,代理客户端出现断开现象
|
||||
|
||||
### 2.x规划
|
||||
- 插件开发
|
||||
- [ ] neutrino-proxy-solon-plugin
|
||||
- [ ] neutrino-proxy-jetbrains-plugin
|
||||
- [ ] neutrino-proxy-starter (SpringBoot)
|
||||
- 基础优化
|
||||
- [ ] 支持批量端口映射
|
||||
- [ ] 代理协议规范化,方便后续更好扩展、支持不同语言客户端接入
|
||||
- 监控运维
|
||||
- [ ] 监控服务端状态
|
||||
- [ ] 支持调整服务端端口、证书
|
||||
- [ ] 服务端版本、协议版本、客户端版本管理
|
||||
- [ ] 服务端日志
|
||||
- client+计划启动
|
||||
- [ ] 安卓客户端
|
||||
- [ ] 基于electron-egg的多平台客户端
|
||||
|
||||
### 3.x规划
|
||||
- [ ] 支持针对用户限速、限流
|
||||
- [ ] 支持P2P穿透
|
||||
- [ ] 支持原生编译
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
title: 如何贡献
|
||||
date: 2023-03-29 12:55:44
|
||||
permalink: /pages/69a632/
|
||||
---
|
||||
# 🎋代码分支说明
|
||||
- dev:常规开发分支,日常的开发、Bug修复、提交PR都在此分支
|
||||
- feature/xxx:特征分支,一些试验性开发、提交PR都在此分支,xxx可自行取一个有意义的名称
|
||||
- release/xxx:发行版分支,作为阶段性成果、重大更新的版本固化分支。受保护,不允许任何提交。
|
||||
- master:主分支,定期同步最新代码,目前仅支持本人(傲世孤尘/雨韵诗泽)提交。
|
||||
|
||||
|
||||
# ✊贡献的方式
|
||||
包括,但不限于以下形式:
|
||||
- 提交[issues](https://gitee.com/dromara/neutrino-proxy/issues)
|
||||
- 参与[issues](https://gitee.com/dromara/neutrino-proxy/issues)解决的必要性、解决方案的讨论、给出建设性的意见
|
||||
- 领取[issues](https://gitee.com/dromara/neutrino-proxy/issues) 并完成开发、提交PR
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)完善代码注释
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)增加测试代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化现有代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化操作体验
|
||||
- 通过公众号、博客、贴吧、论坛等形式分享/宣传中微子代理
|
||||
- 丰富项目文档,包括使用过程中踩过的坑、需要优化的点、具体问题的解决方法等
|
||||
|
||||
# 🧬贡献代码的步骤
|
||||
- 在Gitee或者Github上fork项目到自己的repo,fork,一定要把项目fork一份。
|
||||
- 把fork过去的项目也就是你的项目clone到你的本地
|
||||
- 同步feature/1.7.1最新代码
|
||||
- 修改代码
|
||||
- 开发完成后,不忙着提PR,再拉一遍最新代码,如果有冲突、解决冲突
|
||||
- commit后push到自己的库
|
||||
- 登录Gitee在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
- 等待维护者合并
|
||||
|
||||
# 📐PR的规范
|
||||
> 你可能发现有的代码并不符合这个规范,但我们后续都会朝着这个方向迈进。后续我们会逐步全面规范化,请先保证新提交的代码满足以下要求:
|
||||
|
||||
- 注释完备,尤其每个新增的方法应按照Java文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
|
||||
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
||||
- 对现有代码的优化,请在注释中说明原因。
|
||||
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
||||
- sqlite、mysql下均测试通过
|
||||
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
||||
- 对于新增的表,维护必要的初始化数据
|
||||
- 在对应的mysql、sqlite的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||
@@ -20,7 +20,7 @@ features: # 可选的
|
||||
- title: 端口映射
|
||||
details: 新增、编辑、删除、禁用实时生效。
|
||||
- title: Docker
|
||||
details: 服务端支持Docker一键部署。
|
||||
details: 服务端/客户端支持Docker一键部署。
|
||||
- title: 隧道SSL加密
|
||||
details: 隧道通信支持SSL,保护您的数据安全
|
||||
- title: 多种协议
|
||||
@@ -137,7 +137,7 @@ postList: none
|
||||
或者加入我们的交流群:
|
||||
<div align="center">
|
||||
<img :src="$withBase('/img/qrcode/wxq.png')" class="no-zoom" style="width:200px;margin: 10px;">
|
||||
<p>中微子 微信群(添加我微信备注"进群")</p>
|
||||
<p>中微子 微信群(添加我微信备注"中微子进群")</p>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
|
||||
@@ -1,261 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-parent</artifactId>
|
||||
<version>2.5.11</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<artifactId>neutrino-proxy</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
<modules>
|
||||
<module>neutrino-proxy-core</module>
|
||||
<module>neutrino-proxy-client</module>
|
||||
<module>neutrino-proxy-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||
<revision>1.1-SNAPSHOT</revision>
|
||||
|
||||
<native.version>0.9.28</native.version>
|
||||
|
||||
<java.version>17</java.version>
|
||||
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
|
||||
<maven-flatten.version>1.1.0</maven-flatten.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.1.100.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>1.33</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>28.0-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>2.2.224</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>2.7.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara.solon-plugins</groupId>
|
||||
<artifactId>job-solon-plugin</artifactId>
|
||||
<version>0.1.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon.logging.logback</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- 添加flatten-maven-plugin插件 -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<version>${maven-flatten.version}</version>
|
||||
<configuration>
|
||||
<updatePomFile>true</updatePomFile>
|
||||
<flattenMode>resolveCiFriendliesOnly</flattenMode>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>flatten.clean</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>tencent</id>
|
||||
<url>https://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<name>Sonatype Nexus Snapshots</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<name>Sonatype Nexus Snapshots</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-maven-plugin</artifactId>
|
||||
<version>${solon-maven-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>process-aot</id>
|
||||
<goals>
|
||||
<goal>process-aot</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
<version>${native.version}</version>
|
||||
<!-- 使用graalvm提供的可达性元数据,很多第三方库就直接可以构建成可执行文件了 -->
|
||||
<configuration>
|
||||
<metadataRepository>
|
||||
<enabled>true</enabled>
|
||||
</metadataRepository>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-reachability-metadata</id>
|
||||
<goals>
|
||||
<goal>add-reachability-metadata</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>␍<project xmlns="http://maven.apache.org/POM/4.0.0"␍ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"␍ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">␍ <modelVersion>4.0.0</modelVersion>␍␍ <parent>␍ <groupId>org.noear</groupId>␍ <artifactId>solon-parent</artifactId>␍ <version>2.5.12</version>␍ <relativePath />␍ </parent>␍␍ <groupId>org.dromara.neutrino-proxy</groupId>␍ <artifactId>neutrino-proxy</artifactId>␍ <packaging>pom</packaging>␍ <version>${revision}</version>␍␍ <modules>␍ <module>neutrino-proxy-core</module>␍ <module>neutrino-proxy-client</module>␍ <module>neutrino-proxy-server</module>␍ </modules>␍␍ <properties>␍ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>␍ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>␍ <maven.compiler.encoding>UTF-8</maven.compiler.encoding>␍ <revision>2.0.1-SNAPSHOT</revision>␍␍ <native.version>0.9.28</native.version>␍␍ <java.version>21</java.version>␍ <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>␍ <maven-flatten.version>1.1.0</maven-flatten.version>␍ </properties>␍␍ <dependencyManagement>␍ <dependencies>␍ <dependency>␍ <groupId>io.netty</groupId>␍ <artifactId>netty-all</artifactId>␍ <version>4.1.100.Final</version>␍ </dependency>␍ <dependency>␍ <groupId>org.yaml</groupId>␍ <artifactId>snakeyaml</artifactId>␍ <version>1.33</version>␍ </dependency>␍ <dependency>␍ <groupId>junit</groupId>␍ <artifactId>junit</artifactId>␍ <version>4.12</version>␍ <scope>test</scope>␍ </dependency>␍ <dependency>␍ <groupId>org.apache.commons</groupId>␍ <artifactId>commons-lang3</artifactId>␍ <version>3.9</version>␍ </dependency>␍ <dependency>␍ <groupId>com.google.guava</groupId>␍ <artifactId>guava</artifactId>␍ <version>28.0-jre</version>␍ </dependency>␍ <dependency>␍ <groupId>commons-fileupload</groupId>␍ <artifactId>commons-fileupload</artifactId>␍ <version>1.3.1</version>␍ </dependency>␍ <dependency>␍ <groupId>com.h2database</groupId>␍ <artifactId>h2</artifactId>␍ <version>2.2.224</version>␍ </dependency>␍ <dependency>␍ <groupId>mysql</groupId>␍ <artifactId>mysql-connector-java</artifactId>␍ <version>8.0.33</version>␍ </dependency>␍ <dependency>␍ <groupId>org.mariadb.jdbc</groupId>␍ <artifactId>mariadb-java-client</artifactId>␍ <version>2.7.4</version>␍ </dependency>␍ <dependency>␍ <groupId>com.zaxxer</groupId>␍ <artifactId>HikariCP</artifactId>␍ <version>4.0.3</version>␍ </dependency>␍ <dependency>␍ <groupId>org.bouncycastle</groupId>␍ <artifactId>bcprov-jdk15to18</artifactId>␍ <version>1.69</version>␍ </dependency>␍ <dependency>␍ <groupId>org.dromara.solon-plugins</groupId>␍ <artifactId>job-solon-plugin</artifactId>␍ <version>0.1.1</version>␍ <exclusions>␍ <exclusion>␍ <groupId>cn.hutool</groupId>␍ <artifactId>hutool-core</artifactId>␍ </exclusion>␍ </exclusions>␍ </dependency>␍ </dependencies>␍ </dependencyManagement>␍␍ <dependencies>␍ <dependency>␍ <groupId>org.noear</groupId>␍ <artifactId>solon.logging.logback</artifactId>␍ </dependency>␍ <dependency>␍ <groupId>org.projectlombok</groupId>␍ <artifactId>lombok</artifactId>␍ <scope>provided</scope>␍ </dependency>␍ <dependency>␍ <groupId>org.apache.commons</groupId>␍ <artifactId>commons-lang3</artifactId>␍ </dependency>␍ <dependency>␍ <groupId>com.google.guava</groupId>␍ <artifactId>guava</artifactId>␍ </dependency>␍␍ <dependency>␍ <groupId>org.noear</groupId>␍ <artifactId>solon-test</artifactId>␍ <scope>test</scope>␍ </dependency>␍ </dependencies>␍␍ <build>␍ <resources>␍ <resource>␍ <directory>src/main/resources</directory>␍ </resource>␍ </resources>␍ <plugins>␍ <plugin>␍ <groupId>org.apache.maven.plugins</groupId>␍ <artifactId>maven-compiler-plugin</artifactId>␍ <version>${maven-compiler-plugin.version}</version>␍ <configuration>␍ <source>${java.version}</source>␍ <target>${java.version}</target>␍ <encoding>UTF-8</encoding>␍ <annotationProcessorPaths>␍ <path>␍ <groupId>org.projectlombok</groupId>␍ <artifactId>lombok</artifactId>␍ <version>${lombok.version}</version>␍ </path>␍ </annotationProcessorPaths>␍ </configuration>␍ </plugin>␍ <!-- 添加flatten-maven-plugin插件 -->␍ <plugin>␍ <groupId>org.codehaus.mojo</groupId>␍ <artifactId>flatten-maven-plugin</artifactId>␍ <version>${maven-flatten.version}</version>␍ <configuration>␍ <updatePomFile>true</updatePomFile>␍ <flattenMode>resolveCiFriendliesOnly</flattenMode>␍ </configuration>␍ <executions>␍ <execution>␍ <id>flatten</id>␍ <phase>process-resources</phase>␍ <goals>␍ <goal>flatten</goal>␍ </goals>␍ </execution>␍ <execution>␍ <id>flatten.clean</id>␍ <phase>clean</phase>␍ <goals>␍ <goal>clean</goal>␍ </goals>␍ </execution>␍ </executions>␍ </plugin>␍ </plugins>␍ </build>␍␍ <repositories>␍ <repository>␍ <id>tencent</id>␍ <url>https://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>␍ <snapshots>␍ <enabled>false</enabled>␍ </snapshots>␍ </repository>␍ <repository>␍ <id>sonatype-nexus-snapshots</id>␍ <name>Sonatype Nexus Snapshots</name>␍ <url>https://oss.sonatype.org/content/repositories/snapshots</url>␍ <releases>␍ <enabled>false</enabled>␍ </releases>␍ </repository>␍ </repositories>␍ <pluginRepositories>␍ <pluginRepository>␍ <id>sonatype-nexus-snapshots</id>␍ <name>Sonatype Nexus Snapshots</name>␍ <url>https://oss.sonatype.org/content/repositories/snapshots</url>␍ <releases>␍ <enabled>false</enabled>␍ </releases>␍ </pluginRepository>␍ </pluginRepositories>␍␍ <profiles>␍ <profile>␍ <id>native</id>␍ <build>␍ <plugins>␍ <plugin>␍ <groupId>org.noear</groupId>␍ <artifactId>solon-maven-plugin</artifactId>␍ <version>${solon.version}</version>␍ <executions>␍ <execution>␍ <id>process-aot</id>␍ <goals>␍ <goal>process-aot</goal>␍ </goals>␍ </execution>␍ </executions>␍␍ <dependencies>␍ <dependency>␍ <groupId>org.codehaus.plexus</groupId>␍ <artifactId>plexus-utils</artifactId>␍ <version>3.5.1</version>␍ </dependency>␍ </dependencies>␍ </plugin>␍ <plugin>␍ <groupId>org.graalvm.buildtools</groupId>␍ <artifactId>native-maven-plugin</artifactId>␍ <version>${native.version}</version>␍ <!-- 使用graalvm提供的可达性元数据,很多第三方库就直接可以构建成可执行文件了 -->␍ <configuration>␍ <metadataRepository>␍ <enabled>true</enabled>␍ </metadataRepository>␍ </configuration>␍ <executions>␍ <execution>␍ <id>add-reachability-metadata</id>␍ <goals>␍ <goal>add-reachability-metadata</goal>␍ </goals>␍ </execution>␍ </executions>␍ </plugin>␍ </plugins>␍ </build>␍ </profile>␍ </profiles>␍</project>␍␍
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# 中微子代理客户端编译打包脚本,基础参数请自行修改
|
||||
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-17.0.8+7.1/Contents/Home
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-21.0.1+12.1/Contents/Home
|
||||
export MAVEN_HOME=/Users/yangwen/my/service/maven/apache-maven-3.8.1
|
||||
export PATH=:$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
|
||||
|
||||
@@ -11,15 +11,20 @@ clientDeployDir=$deployDir"/client"
|
||||
#切到项目根目录
|
||||
cd ../..
|
||||
#初始化文件夹
|
||||
#if [ ! -d "$deployDir" ];then
|
||||
# mkdir $deployDir
|
||||
#fi
|
||||
#if [ ! -d "$clientDeployDir" ];then
|
||||
# mkdir $clientDeployDir
|
||||
#fi
|
||||
mkdir -p $clientDeployDir
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client.jar
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-jar
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-jar.zip
|
||||
|
||||
#客户端打包
|
||||
mvn clean install -U -pl neutrino-proxy-client -am -Dmaven.test.skip=true
|
||||
# 拷贝到deploy目录下
|
||||
cp ./neutrino-proxy-client/target/neutrino-proxy-client.jar $clientDeployDir/neutrino-proxy-client.jar
|
||||
|
||||
#打zip包,用于发版
|
||||
cd $clientDeployDir
|
||||
mkdir neutrino-proxy-client-jar
|
||||
cp ../../neutrino-proxy-client/target/neutrino-proxy-client.jar ./neutrino-proxy-client-jar/neutrino-proxy-client.jar
|
||||
cp ../../neutrino-proxy-client/src/main/resources/app-copy.yml ./neutrino-proxy-client-jar/app.yml
|
||||
zip -r neutrino-proxy-client-jar.zip ./neutrino-proxy-client-jar
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-jar
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
# 中微子代理客户端编译打包脚本,基础参数请自行修改
|
||||
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-17.0.8+7.1/Contents/Home
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-21.0.1+12.1/Contents/Home
|
||||
export MAVEN_HOME=/Users/yangwen/my/service/maven/apache-maven-3.8.1
|
||||
export PATH=:$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
|
||||
|
||||
deployDir="deploy"
|
||||
clientDeployDir=$deployDir"/client"
|
||||
machine=macos
|
||||
|
||||
#切到项目根目录
|
||||
cd ../..
|
||||
@@ -16,6 +17,10 @@ mkdir -p $clientDeployDir
|
||||
# 删除原来的编译文件
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client.jar
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-jar
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-jar.zip
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-${machine}-native
|
||||
rm -rf $clientDeployDir/neutrino-proxy-client-${machine}-native.zip
|
||||
|
||||
#客户端打包
|
||||
mvn clean install -U -pl neutrino-proxy-client -am -Dmaven.test.skip=true
|
||||
@@ -23,7 +28,25 @@ cd neutrino-proxy-client
|
||||
mvn clean native:compile -P native -DskipTests
|
||||
cd ..
|
||||
|
||||
# 给执行权限
|
||||
chmod +x ./neutrino-proxy-client/target/neutrino-proxy-client
|
||||
|
||||
# 拷贝到deploy目录下
|
||||
cp ./neutrino-proxy-client/target/neutrino-proxy-client.jar $clientDeployDir/neutrino-proxy-client.jar
|
||||
cp ./neutrino-proxy-client/target/neutrino-proxy-client $clientDeployDir/neutrino-proxy-client
|
||||
|
||||
#打zip包,用于发版
|
||||
cd $clientDeployDir
|
||||
## jar
|
||||
mkdir neutrino-proxy-client-jar
|
||||
cp ../../neutrino-proxy-client/target/neutrino-proxy-client.jar ./neutrino-proxy-client-jar/neutrino-proxy-client.jar
|
||||
cp ../../neutrino-proxy-client/src/main/resources/app-copy.yml ./neutrino-proxy-client-jar/app.yml
|
||||
zip -r neutrino-proxy-client-jar.zip ./neutrino-proxy-client-jar
|
||||
rm -rf ./neutrino-proxy-client-jar
|
||||
|
||||
## native
|
||||
mkdir neutrino-proxy-client-${machine}-native
|
||||
cp ../../neutrino-proxy-client/target/neutrino-proxy-client ./neutrino-proxy-client-${machine}-native/neutrino-proxy-client
|
||||
cp ../../neutrino-proxy-client/src/main/resources/app-copy.yml ./neutrino-proxy-client-${machine}-native/app.yml
|
||||
zip -r neutrino-proxy-client-${machine}-native.zip ./neutrino-proxy-client-${machine}-native
|
||||
rm -rf ./neutrino-proxy-client-${machine}-native
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# 中微子代理客户端启动脚本,基础参数请自行修改
|
||||
|
||||
JAVA_OPS="-server -Xms256m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/work/$NAME/heapError/"
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-17.0.8+7.1/Contents/Home
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-21.0.1+12.1/Contents/Home
|
||||
export PATH=:$PATH:$JAVA_HOME/bin
|
||||
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||
mkdir -p /work/$NAME/heapError/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# 中微子代理服务端编译打包脚本,基础参数请自行修改
|
||||
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-17.0.8+7.1/Contents/Home
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-21.0.1+12.1/Contents/Home
|
||||
export MAVEN_HOME=/Users/yangwen/my/service/maven/apache-maven-3.8.1
|
||||
export PATH=:$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
|
||||
|
||||
@@ -11,16 +11,20 @@ serverDeployDir=$deployDir"/server"
|
||||
#切到项目根目录
|
||||
cd ../..
|
||||
#初始化文件夹
|
||||
#if [ ! -d "$deployDir" ];then
|
||||
# mkdir $deployDir
|
||||
#fi
|
||||
#if [ ! -d "$serverDeployDir" ];then
|
||||
# mkdir $serverDeployDir
|
||||
#fi
|
||||
mkdir -p $serverDeployDir
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server.jar
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-jar
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-jar.zip
|
||||
|
||||
#服务端打包
|
||||
mvn clean install -U -pl neutrino-proxy-server -am -Dmaven.test.skip=true
|
||||
# 拷贝到deploy目录下
|
||||
cp ./neutrino-proxy-server/target/neutrino-proxy-server.jar $serverDeployDir/neutrino-proxy-server.jar
|
||||
|
||||
#打zip包,用于发版
|
||||
cd $serverDeployDir
|
||||
mkdir neutrino-proxy-server-jar
|
||||
cp ../../neutrino-proxy-server/target/neutrino-proxy-server.jar ./neutrino-proxy-server-jar/neutrino-proxy-server.jar
|
||||
cp ../../neutrino-proxy-server/src/main/resources/app-copy.yml ./neutrino-proxy-server-jar/app.yml
|
||||
zip -r neutrino-proxy-server-jar.zip ./neutrino-proxy-server-jar
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-jar
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
# 中微子代理服务端编译打包脚本,基础参数请自行修改
|
||||
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-17.0.8+7.1/Contents/Home
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-21.0.1+12.1/Contents/Home
|
||||
export MAVEN_HOME=/Users/yangwen/my/service/maven/apache-maven-3.8.1
|
||||
export PATH=:$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
|
||||
|
||||
deployDir="deploy"
|
||||
serverDeployDir=$deployDir"/server"
|
||||
machine=macos
|
||||
|
||||
#切到项目根目录
|
||||
cd ../..
|
||||
@@ -16,6 +17,10 @@ mkdir -p $serverDeployDir
|
||||
# 删除原来的编译文件
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server.jar
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-jar
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-jar.zip
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-${machine}-native
|
||||
rm -rf $serverDeployDir/neutrino-proxy-server-${machine}-native.zip
|
||||
|
||||
# 不需要每次都重新编译一次前端代码,如果前端代码有变更,编译前需要手动执行`admin_build_docker.sh`
|
||||
##前端页面打包
|
||||
@@ -32,7 +37,25 @@ cd neutrino-proxy-server
|
||||
mvn clean native:compile -P native -DskipTests
|
||||
cd ..
|
||||
|
||||
# 给执行权限
|
||||
chmod +x ./neutrino-proxy-server/target/neutrino-proxy-server
|
||||
|
||||
# 拷贝到deploy目录下
|
||||
cp ./neutrino-proxy-server/target/neutrino-proxy-server.jar $serverDeployDir/neutrino-proxy-server.jar
|
||||
cp ./neutrino-proxy-server/target/neutrino-proxy-server $serverDeployDir/neutrino-proxy-server
|
||||
|
||||
#打zip包,用于发版
|
||||
cd $serverDeployDir
|
||||
## jar
|
||||
mkdir neutrino-proxy-server-jar
|
||||
cp ../../neutrino-proxy-server/target/neutrino-proxy-server.jar ./neutrino-proxy-server-jar/neutrino-proxy-server.jar
|
||||
cp ../../neutrino-proxy-server/src/main/resources/app-copy.yml ./neutrino-proxy-server-jar/app.yml
|
||||
zip -r neutrino-proxy-server-jar.zip ./neutrino-proxy-server-jar
|
||||
rm -rf ./neutrino-proxy-server-jar
|
||||
|
||||
## native
|
||||
mkdir neutrino-proxy-server-${machine}-native
|
||||
cp ../../neutrino-proxy-server/target/neutrino-proxy-server ./neutrino-proxy-server-${machine}-native/neutrino-proxy-server
|
||||
cp ../../neutrino-proxy-server/src/main/resources/app-copy.yml ./neutrino-proxy-server-${machine}-native/app.yml
|
||||
zip -r neutrino-proxy-server-${machine}-native.zip ./neutrino-proxy-server-${machine}-native
|
||||
rm -rf ./neutrino-proxy-server-${machine}-native
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# 中微子代理服务端启动脚本,基础参数请自行修改
|
||||
|
||||
JAVA_OPS="-server -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/work/$NAME/heapError/"
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-17.0.8+7.1/Contents/Home
|
||||
export JAVA_HOME=/Users/yangwen/my/service/graalvm/graalvm-community-openjdk-21.0.1+12.1/Contents/Home
|
||||
export PATH=:$PATH:$JAVA_HOME/bin
|
||||
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||
mkdir -p /work/$NAME/heapError/
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo 'hello'
|
||||
@@ -1,54 +1,21 @@
|
||||
# 1.x规划
|
||||
- Bug
|
||||
- 优化
|
||||
- 添加端口映射时,验证端口是否被其他服务占用
|
||||
- 拉下搜索license,支持模糊搜索
|
||||
- license下拉用户搜索,支持模糊搜索
|
||||
- UDP支持
|
||||
- 官网文档完善
|
||||
- HTTPS配置说明
|
||||
- 协议重构
|
||||
- 代码重构
|
||||
|
||||
# 1.8.6
|
||||
- [x] 端口映射选择端口支持分页
|
||||
- [x] 新增/更新端口映射,增加端口占用检测
|
||||
- [x] 拉下搜索license,支持模糊搜索
|
||||
- [x] license下拉用户搜索,支持模糊搜索
|
||||
- [x] 端口映射编辑时,如果端口号没有变动,则不验证。避免出现端口映射正在使用时,无法更新端口映射其他信息的问题
|
||||
- [x] 端口映射HTTP(S)新增打开网页按钮
|
||||
- [x] 客户端断开连接时,记录日志空指针异常问题修复
|
||||
|
||||
# 1.9.0
|
||||
- [x] 支持UDP
|
||||
- 服务端
|
||||
- 原`neutrino.proxy.server`配置移到`neutrino.proxy.server.tcp`下
|
||||
- 客户端
|
||||
- 原`neutrino.proxy.client`配置移到`neutrino.proxy.tunnel`下
|
||||
- [x] 端口映射HTTP(S)新增打开网页按钮,优先使用域名打开
|
||||
- [x] 新增/编辑端口映射时端口占用检测功能屏蔽,解决docker下使用的各种问题
|
||||
|
||||
# 1.9.1
|
||||
- [ ] 如果UDP映射服务端端口变动,流量统计似乎不准,转发功能或许也受到影响,需要评估、测试、思考如何优化
|
||||
- [ ] 增加服务端/客户端jar式一键部署脚本
|
||||
- [ ] 排查解决问题:https://gitee.com/dromara/neutrino-proxy/issues/I7LGLB
|
||||
- [ ] 访问白名单
|
||||
- [ ] 端口映射分组
|
||||
|
||||
# Bug
|
||||
- 指令通达被close的问题,org.dromara.neutrinoproxy.server.proxy.core.ProxyTunnelChannelHandler.channelInactive
|
||||
- windows环境下直接运行发布版的jar包,日志输出乱码
|
||||
- 代理mysql时,使用未开启远程访问的账号走代理访问mysql,代理客户端出现断开现象
|
||||
- 客户端连接映射某个端口以后,如果在服务器端禁用了,没有立刻反映出来,要灯客户端重连以后才会屏蔽被禁用的端口。
|
||||
|
||||
# 2.x规划
|
||||
- 插件开发
|
||||
- [ ] neutrino-proxy-solon-plugin
|
||||
- [ ] neutrino-proxy-jetbrains-plugin
|
||||
- [ ] neutrino-proxy-starter (SpringBoot)
|
||||
- 思考
|
||||
- 流量编排
|
||||
- 插件化定制
|
||||
- 重构
|
||||
- 代码重构
|
||||
- 多租户支持
|
||||
- 多个代理服务端节点支持
|
||||
- 协议重构
|
||||
- 支持多个隧道协议,支持扩展(TCP、KCP、QUIC)
|
||||
- 支持不同语言客户端、服务端接入
|
||||
- 基础优化
|
||||
- [ ] 访问白名单
|
||||
- [ ] 端口映射分组
|
||||
- [ ] 支持批量端口映射
|
||||
- [ ] 代理协议规范化,方便后续更好扩展、支持不同语言客户端接入
|
||||
- [ ] 如果UDP映射服务端端口变动,流量统计似乎不准,转发功能或许也受到影响,需要评估、测试、思考如何优化
|
||||
- [ ] 排查解决问题:https://gitee.com/dromara/neutrino-proxy/issues/I7LGLB
|
||||
- 监控运维
|
||||
- [ ] 监控服务端状态
|
||||
- [ ] 支持调整服务端端口、证书
|
||||
@@ -56,11 +23,14 @@
|
||||
- [ ] 服务端日志
|
||||
- [ ] 支持持管理后台动态调整日志级别。
|
||||
- [ ] 动态调整转发、报文、心跳输出
|
||||
- client+计划启动
|
||||
- [ ] 安卓客户端
|
||||
- [ ] 基于electron-egg的多平台客户端
|
||||
|
||||
# 3.x规划
|
||||
- [ ] 支持针对用户限速、限流
|
||||
- [ ] 支持P2P穿透
|
||||
- [ ] 支持原生编译
|
||||
- 插件开发
|
||||
- [ ] neutrino-proxy-solon-plugin
|
||||
- [ ] neutrino-proxy-jetbrains-plugin
|
||||
- [ ] neutrino-proxy-starter (SpringBoot)
|
||||
- client+计划启动
|
||||
- [ ] 安卓客户端
|
||||
- [ ] 基于electron-egg的多平台客户端
|
||||
|
||||