Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e75be739f4 | ||
|
|
f0a61a1d30 | ||
|
|
26ec45b3f9 | ||
|
|
550bc1cf9b | ||
|
|
d1b09eda64 | ||
|
|
446390743c | ||
|
|
e2c6490fae | ||
|
|
7fb5a91f2f | ||
|
|
9f82faee71 | ||
|
|
0b77b8ae1b | ||
|
|
d8f2e79d70 | ||
|
|
be4e3b4bae | ||
|
|
aca5fb847b | ||
|
|
6d26c58843 | ||
|
|
6f6a57eda5 | ||
|
|
3ffba1744f |
@@ -13,7 +13,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# see: https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job
|
# 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', 'macos-12']
|
||||||
os: ['ubuntu-latest']
|
os: ['ubuntu-20.04']
|
||||||
name: build - ${{ matrix.os }}
|
name: build - ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
|
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
distribution: 'graalvm' # New 'distribution' option
|
distribution: 'graalvm' # New 'distribution' option
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Cache local Maven repository
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
||||||
# 上传构建产物
|
# 上传构建产物
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v3.0.0
|
||||||
with:
|
with:
|
||||||
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
distribution: 'graalvm' # New 'distribution' option
|
distribution: 'graalvm' # New 'distribution' option
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Cache local Maven repository
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
||||||
# 上传构建产物
|
# 上传构建产物
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v3.0.0
|
||||||
with:
|
with:
|
||||||
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
@@ -61,3 +61,4 @@ logs
|
|||||||
data
|
data
|
||||||
**/cert/**
|
**/cert/**
|
||||||
neutrino-proxy-server/src/main/resources/static/**
|
neutrino-proxy-server/src/main/resources/static/**
|
||||||
|
/neutrino-proxy-server/src/main/resources/static/
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
version: '1.0'
|
|
||||||
name: pipeline-docs-build
|
|
||||||
displayName: 官网静态资源构建
|
|
||||||
triggers:
|
|
||||||
trigger: auto
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
precise:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
include:
|
|
||||||
- neutrino-proxy-vuepress.*
|
|
||||||
variables:
|
|
||||||
global:
|
|
||||||
- git_token
|
|
||||||
- username
|
|
||||||
commit_name: aoshiguchen
|
|
||||||
commit_email: [email protected]
|
|
||||||
repo_url: https://gitee.com/dromara/neutrino-proxy.git
|
|
||||||
target_branch: site
|
|
||||||
stages:
|
|
||||||
- name: stage-build
|
|
||||||
displayName: 构建
|
|
||||||
strategy: naturally
|
|
||||||
trigger: auto
|
|
||||||
executor:
|
|
||||||
- asgc
|
|
||||||
steps:
|
|
||||||
- step: build@nodejs
|
|
||||||
name: build_nodejs
|
|
||||||
displayName: Nodejs 构建
|
|
||||||
nodeVersion: 14.16.0
|
|
||||||
commands:
|
|
||||||
- '# 切换到工作目录'
|
|
||||||
- ''
|
|
||||||
- cd ./neutrino-proxy-vuepress
|
|
||||||
- '# 设置NPM源,提升安装速度'
|
|
||||||
- npm config set registry https://registry.npmmirror.com
|
|
||||||
- ''
|
|
||||||
- '# 执行编译命令'
|
|
||||||
- npm install && npm run build
|
|
||||||
- ''
|
|
||||||
- '# 初始化git仓库'
|
|
||||||
- cd docs/.vuepress/dist
|
|
||||||
- git init
|
|
||||||
- ''
|
|
||||||
- '# 设置Git信息'
|
|
||||||
- GIT_REPO_URL=$repo_url
|
|
||||||
- GIT_USERNAME=$username
|
|
||||||
- GIT_NAME=$commit_name
|
|
||||||
- GIT_EMAIL=$commit_email
|
|
||||||
- GIT_TOKEN=$git_token
|
|
||||||
- echo "https://${GIT_USERNAME}:${GIT_TOKEN}@${GIT_REPO_URL#https://}" > ~/.git-credentials
|
|
||||||
- git config --global credential.helper store
|
|
||||||
- git remote add origin ${GIT_REPO_URL}
|
|
||||||
- git config user.name ${GIT_NAME}
|
|
||||||
- git config user.email ${GIT_EMAIL}
|
|
||||||
- ''
|
|
||||||
- '# 将构建产物推送到目标分支'
|
|
||||||
- git add -A
|
|
||||||
- '# git commit -m $GITEE_COMMIT_MESSAGE'
|
|
||||||
- git commit -m "update"
|
|
||||||
- git checkout -b $target_branch
|
|
||||||
- git push -f origin $target_branch
|
|
||||||
artifacts:
|
|
||||||
- name: BUILD_ARTIFACT
|
|
||||||
path:
|
|
||||||
- ./neutrino-proxy-vuepress/docs/.vuepress/dist
|
|
||||||
caches:
|
|
||||||
- ~/.npm
|
|
||||||
- ~/.yarn
|
|
||||||
notify: []
|
|
||||||
strategy:
|
|
||||||
retry: '0'
|
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# what is new? 在原版的基础上新增了【域名解析】功能,域名解析【无需】绑定【本地端口】
|
||||||
|
<p>
|
||||||
|
<a href="https://gitee.com/zcans" target="_blank">
|
||||||
|
<img src="assets/run-example/domain.png" >
|
||||||
|
</a>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="assets/logo/logo-text-vertical.png" width="45%">
|
<img src="assets/logo/logo-text-vertical.png" width="45%">
|
||||||
</p>
|
</p>
|
||||||
@@ -13,18 +21,20 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
# 1、简介
|
# 1、简介
|
||||||
- 中微子代理(neutrino-proxy)是一个基于netty的、开源的java代理项目。
|
- 中微子代理(neutrino-proxy)是一个基于netty的、开源的java内网穿透项目。
|
||||||
- 技术栈:Solon、MybatisPlus、Netty
|
- 技术栈:Solon、MybatisPlus、Netty
|
||||||
- 遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
- 遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||||
- 官网地址1:https://neutrino-proxy.dromara.org
|
- 官网地址1:https://neutrino-proxy.dromara.org
|
||||||
- 快速上手请[点击这里](https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/)
|
- 官网地址2:https://dromara.gitee.io/neutrino-proxy
|
||||||
|
- 官网地址3:https://neutrino-proxy-docs.asgc.fun
|
||||||
|
- 快速上手请[点击这里](https://dromara.gitee.io/neutrino-proxy/pages/793dcb)
|
||||||
|
|
||||||
# 2、部署方式
|
# 2、名称由来
|
||||||
- 1、[使用宝塔面板](https://neutrino-proxy.dromara.org/pages/9e0fde/)
|
中微子,是轻子的一种,是组成自然界的最基本的粒子之一。它十分微小、不带电,可自由穿过地球,以接近光速运动,与其他物质的相互作用十分微弱,号称宇宙间的“隐身人”。
|
||||||
- 2、[使用jar文件](https://neutrino-proxy.dromara.org/pages/eebea1/)
|
|
||||||
- 3、[使用Docker](https://neutrino-proxy.dromara.org/pages/5b9bef/)
|
中微子是宇宙中穿透能力最强的物质,只有粒子之间的间隙小于10的负19次方米时,才能够阻挡住中微子。
|
||||||
- 4、[原生部署](https://neutrino-proxy.dromara.org/pages/69699a/)
|
|
||||||
- 5、[使用Docker-Compose](https://neutrino-proxy.dromara.org/pages/2d4123/)
|
因此以中微子命名,寓意着中微子代理拥有中微子"安全"、"快速"、"穿透力强"的特点。
|
||||||
|
|
||||||
# 3、运行示例
|
# 3、运行示例
|
||||||

|

|
||||||
@@ -38,9 +48,7 @@
|
|||||||
|
|
||||||
# 5、联系我们
|
# 5、联系我们
|
||||||
- 微信: yuyunshize
|
- 微信: yuyunshize
|
||||||
- GitCode:https://gitcode.com/dromara/neutrino-proxy
|
|
||||||
- Gitee: https://gitee.com/asgc/neutrino-proxy
|
- Gitee: https://gitee.com/asgc/neutrino-proxy
|
||||||
- Github仓库:https://github.com/dromara/neutrino-proxy
|
|
||||||
|
|
||||||
# 6、贡献者列表
|
# 6、贡献者列表
|
||||||
<p>
|
<p>
|
||||||
@@ -92,9 +100,6 @@
|
|||||||
<a href="https://gitee.com/nichenxyx" target="_blank">
|
<a href="https://gitee.com/nichenxyx" target="_blank">
|
||||||
<img src="assets/developer/NichenFly.jpg" width="11%">
|
<img src="assets/developer/NichenFly.jpg" width="11%">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://gitee.com/miracrl" target="_blank">
|
|
||||||
<img src="assets/developer/miracrl.png" width="11%">
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# ❤️ 感谢
|
# ❤️ 感谢
|
||||||
|
|||||||
@@ -79,18 +79,3 @@
|
|||||||
- 支持对用户、license限速
|
- 支持对用户、license限速
|
||||||
- 修复HTTP(S)映射时使用tcp端口访问正常,使用域名访问偶现一直loading的问题
|
- 修复HTTP(S)映射时使用tcp端口访问正常,使用域名访问偶现一直loading的问题
|
||||||
- 修复HTTP(S)映射时使用映射的域名上传文件时,连接中断的问题
|
- 修复HTTP(S)映射时使用映射的域名上传文件时,连接中断的问题
|
||||||
|
|
||||||
## 2.0.2
|
|
||||||
- 部分细节优化
|
|
||||||
- 解决客户端docker方式部署环境变量指定参数不生效的问题
|
|
||||||
- 服务端解决服务端native下,清理日志定时任务报错的问题
|
|
||||||
- 解决后台分页查询的已知问题
|
|
||||||
- 端口映射中的客户端ip字段加长,解决配置阿里云数据库域名字段不够的问题
|
|
||||||
- 管理后台新增域名管理
|
|
||||||
- [x] 支持设置一个默认域名
|
|
||||||
- [x] 删除、修改、禁用实时生效
|
|
||||||
- [x] 支持维护https证书
|
|
||||||
- 端口映射支持支持绑定多个子域名
|
|
||||||
- 选择择不同的主域名、子域名变更实时生效
|
|
||||||
## 2.0.3
|
|
||||||
- 解决http请求拆包情况下域名映射失效的问题
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 123 KiB |
@@ -1,81 +0,0 @@
|
|||||||
# NeutrinoProxy2.0.2发布,端口映射支持绑定多个域名
|
|
||||||
|
|
||||||
## 项目简介
|
|
||||||
- [中微子代理(neutrino-proxy)](https://gitee.com/dromara/neutrino-proxy) 是一款基于Solon、Netty的内网穿透神器。该项目采用最为宽松的MIT协议,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
|
||||||
- 市面上基于内网穿透的常见产品有:花生壳、TeamView、cpolar等。
|
|
||||||
- 常见的使用场景:
|
|
||||||
- 本地开发调试第三方回调
|
|
||||||
- 本地开发异地接口连调
|
|
||||||
- 远程登录内网windows机器
|
|
||||||
- 将本地服务映射到外网,用于演示
|
|
||||||
- GitCode:https://gitcode.com/dromara/neutrino-proxy
|
|
||||||
- Gitee仓库:https://gitee.com/dromara/neutrino-proxy
|
|
||||||
- Github仓库:https://github.com/dromara/neutrino-proxy
|
|
||||||
- 官网地址: https://neutrino-proxy.dromara.org
|
|
||||||
|
|
||||||
## 主要特点:
|
|
||||||
- 1、流量监控:首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
|
||||||
- 2、用户/License:支持多用户、多客户端使用。后台禁用实时生效。
|
|
||||||
- 3、端口池:对外端口统一管理,支持用户、License独占端口。
|
|
||||||
- 4、端口映射:新增、编辑、删除、禁用实时生效。
|
|
||||||
- 5、Docker:服务端/客户端支持Docker一键部署。
|
|
||||||
- 6、SSL证书:隧道通信支持SSL加密,保护您的数据安全。
|
|
||||||
- 7、域名映射:支持绑定多个子域名,方便本地调试三方回调
|
|
||||||
- 8、多种协议:支持代理TCP、HTTP、HTTPS、UDP协议
|
|
||||||
- 9、原生部署:支持编译为原生可执行文件,更低部署门槛、更少内存占用
|
|
||||||
- 10、安全组:支持黑/白名单IP访问限制
|
|
||||||
- 11、限速:支持对License、端口映射限制上传/下载速度
|
|
||||||
- 12、采用最为宽松的MIT协议,免去你的后顾之忧
|
|
||||||
|
|
||||||
## 本次更新内容
|
|
||||||
- bug修复
|
|
||||||
- 解决安全组在ipv6场景下误拦截导致域名映射访问不通的问题
|
|
||||||
- 解决native编译后,端口池批量删除报错的问题
|
|
||||||
- 解决客户端docker方式部署环境变量指定参数不生效的问题
|
|
||||||
- 服务端解决native下清理日志定时任务报错的问题
|
|
||||||
- 解决后台分页查询的已知问题
|
|
||||||
- 端口映射中的客户端ip字段加长一点,解决配置阿里云数据库域名字段不够的问题
|
|
||||||
- 解决服务端native部署时,访问后台用户列表,日志警告“you should use: nativeMetadata.registerField(field) at aot runtime”的问题
|
|
||||||
- 新增功能
|
|
||||||
- 新增后台域名管理,⽀持新增、修改、删除、禁⽤主域名,支持添加多级域名。
|
|
||||||
- 域名管理支持上传域名对应的SSL证书、⽀持设置强制HTTPS、⽀持域名映射⾃动加载对应的服务器证书。
|
|
||||||
- 端口映射支持选择切换不同的主域名,⽀持绑定多个⼦域名,单个端⼝⽀持绑定多个不同的主域名。
|
|
||||||
|
|
||||||
## 安装使用说明
|
|
||||||
- 快速上手:https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/
|
|
||||||
- 支持的部署方式
|
|
||||||
- 1、jar
|
|
||||||
- 2、docker
|
|
||||||
- 3、native
|
|
||||||
- windows
|
|
||||||
- linux
|
|
||||||
- mac
|
|
||||||
- 4、docker-compose
|
|
||||||
- 升级须知:
|
|
||||||
- **域名和SSL证书的配置由配置文件配置改为后台域名管理页面配置。**
|
|
||||||
- 去掉了配置文件声明服务器端域名和证书的方式,改为通过页面进行管理,请注意自行进行数据迁移。
|
|
||||||
- 数据库新增`域名表`和`域名映射中间表`,修改了`端口映射表`,涉及到表结构变更,执行[增量SQL](https://gitee.com/dromara/neutrino-proxy/blob/master/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20240808.SQL)
|
|
||||||
|
|
||||||
## 运行示例
|
|
||||||
#### License限速
|
|
||||||
<img src="./license2.png" width="100%"/>
|
|
||||||
|
|
||||||
#### 端口映射限速
|
|
||||||
<img src="./port-mapping2.png" width="100%"/>
|
|
||||||
|
|
||||||
#### 端口映射绑定多个域名
|
|
||||||
<img src="./port-mapping3.png" width="100%"/>
|
|
||||||
|
|
||||||
#### 安全组
|
|
||||||
<img src="./security-group1.png" width="100%"/>
|
|
||||||
<img src="./security-rule1.png" width="100%"/>
|
|
||||||
|
|
||||||
## 联系我们
|
|
||||||
笔者时间、能力有限,且开源项目非一朝一夕之事,存在众多问题亦在所难免。使用、学习过程中有任何问题欢迎大家与我联系。
|
|
||||||
|
|
||||||
对项目有什么想法或者建议,可以加我微信拉交流群,或者创建[issues](https://gitee.com/dromara/neutrino-proxy/issues),一起完善项目
|
|
||||||
|
|
||||||
- 微信号:yuyunshize
|
|
||||||
- Email: aoshiguchen@dromara.org
|
|
||||||
- 微信二维码(添加时请备注"中微子进群"):
|
|
||||||
<img src="MyWeChatQRCode.jpeg" width="100%"/>
|
|
||||||
|
Before Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 243 KiB |
|
Before Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 132 KiB |
@@ -31,7 +31,7 @@
|
|||||||
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
||||||
- 对现有代码的优化,请在注释中说明原因。
|
- 对现有代码的优化,请在注释中说明原因。
|
||||||
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
||||||
- h2、mysql下均测试通过
|
- sqlite、mysql下均测试通过
|
||||||
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
||||||
- 对于新增的表,维护必要的初始化数据
|
- 对于新增的表,维护必要的初始化数据
|
||||||
- 在对应的mysql、h2的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
- 在对应的mysql、sqlite的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||||
@@ -37,7 +37,7 @@ registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:1.7.1
|
|||||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||||
- 将` neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`上传至服务器部署目录。
|
- 将` neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`上传至服务器部署目录。
|
||||||
- 解压`neutrino-proxy-admin.zip`文件
|
- 解压`neutrino-proxy-admin.zip`文件
|
||||||
- 执行命令`java -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用h2数据库。
|
- 执行命令`java -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用sqlite数据库。
|
||||||
- 若需要指定自己的mysql数据库,同样的需要在当前目录下新建`app.yml`文件,文件内容同上。执行命令`java -jar neutrino-proxy-server.jar config=app.yml`启动服务端完成部署
|
- 若需要指定自己的mysql数据库,同样的需要在当前目录下新建`app.yml`文件,文件内容同上。执行命令`java -jar neutrino-proxy-server.jar config=app.yml`启动服务端完成部署
|
||||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/bin/server_start.sh 使用shell脚本启动服务端。
|
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/bin/server_start.sh 使用shell脚本启动服务端。
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
# 代理配置
|
# 代理配置
|
||||||
- License管理:License是客户端连接服务端的唯一合法凭证。一个License同时只能被一个客户端使用,一个License可以维护多条端口映射
|
- License管理:License是客户端连接服务端的唯一合法凭证。一个License同时只能被一个客户端使用,一个License可以维护多条端口映射
|
||||||
- 端口映射:服务端IP+端口 -> 客户端IP+端口的四元组映射(因目前服务端单节点只有一个公网IP,所以不体现出来),是内网穿透的基本单元。
|
- 端口映射:服务端IP+端口 -> 客户端IP+端口的四元组映射(因目前服务端单节点只有一个公网IP,所以不体现出来),是内网穿透的基本单元。
|
||||||
- 域名管理:用于统一管理服务器主域名和证书,支持多域名。
|
|
||||||
|
|
||||||
# 系统管理
|
# 系统管理
|
||||||
- 用户管理:支持多用户,一个用户可持有多个License。由于项目目前主推个人版,所以暂是没有权限这一套,管理员之外的所有用户都属于游客。对于绝大多数操作,游客仅有只读权限。
|
- 用户管理:支持多用户,一个用户可持有多个License。由于项目目前主推个人版,所以暂是没有权限这一套,管理员之外的所有用户都属于游客。对于绝大多数操作,游客仅有只读权限。
|
||||||
|
|||||||
@@ -1,36 +1,39 @@
|
|||||||
'use strict'
|
"use strict";
|
||||||
const path = require('path')
|
const path = require("path");
|
||||||
const utils = require('./utils')
|
const utils = require("./utils");
|
||||||
const webpack = require('webpack')
|
const webpack = require("webpack");
|
||||||
const config = require('../config')
|
const config = require("../config");
|
||||||
const merge = require('webpack-merge')
|
const merge = require("webpack-merge");
|
||||||
const baseWebpackConfig = require('./webpack.base.conf')
|
const baseWebpackConfig = require("./webpack.base.conf");
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin");
|
||||||
const portfinder = require('portfinder')
|
const portfinder = require("portfinder");
|
||||||
|
|
||||||
function resolve (dir) {
|
function resolve(dir) {
|
||||||
return path.join(__dirname, '..', dir)
|
return path.join(__dirname, "..", dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
const HOST = process.env.HOST
|
const HOST = process.env.HOST;
|
||||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
const PORT = process.env.PORT && Number(process.env.PORT);
|
||||||
|
|
||||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||||
module: {
|
module: {
|
||||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
rules: utils.styleLoaders({
|
||||||
|
sourceMap: config.dev.cssSourceMap,
|
||||||
|
usePostCSS: true
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// cheap-module-eval-source-map is faster for development
|
// cheap-module-eval-source-map is faster for development
|
||||||
devtool: config.dev.devtool,
|
devtool: config.dev.devtool,
|
||||||
|
|
||||||
// these devServer options should be customized in /config/index.js
|
// these devServer options should be customized in /config/index.js
|
||||||
devServer: {
|
devServer: {
|
||||||
clientLogLevel: 'warning',
|
clientLogLevel: "warning",
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
hot: true,
|
hot: true,
|
||||||
compress: true,
|
compress: true,
|
||||||
host: HOST || config.dev.host,
|
host: HOST || config.dev.host,
|
||||||
port: PORT || config.dev.port,
|
port: PORT || config.dev.port,
|
||||||
|
allowedHosts: ["localhost", "server.com", ".server.com"],
|
||||||
open: config.dev.autoOpenBrowser,
|
open: config.dev.autoOpenBrowser,
|
||||||
overlay: config.dev.errorOverlay
|
overlay: config.dev.errorOverlay
|
||||||
? { warnings: false, errors: true }
|
? { warnings: false, errors: true }
|
||||||
@@ -39,50 +42,54 @@ const devWebpackConfig = merge(baseWebpackConfig, {
|
|||||||
proxy: config.dev.proxyTable,
|
proxy: config.dev.proxyTable,
|
||||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
poll: config.dev.poll,
|
poll: config.dev.poll
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': require('../config/local.env')
|
"process.env": require("../config/local.env")
|
||||||
}),
|
}),
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||||
new webpack.NoEmitOnErrorsPlugin(),
|
new webpack.NoEmitOnErrorsPlugin(),
|
||||||
// https://github.com/ampedandwired/html-webpack-plugin
|
// https://github.com/ampedandwired/html-webpack-plugin
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
filename: 'index.html',
|
filename: "index.html",
|
||||||
template: 'index.html',
|
template: "index.html",
|
||||||
inject: true,
|
inject: true,
|
||||||
favicon: resolve('favicon.ico'),
|
favicon: resolve("favicon.ico"),
|
||||||
title: 'vue-element-admin',
|
title: "vue-element-admin",
|
||||||
path: config.dev.assetsPublicPath + config.dev.assetsSubDirectory
|
path: config.dev.assetsPublicPath + config.dev.assetsSubDirectory
|
||||||
}),
|
})
|
||||||
]
|
]
|
||||||
})
|
});
|
||||||
|
|
||||||
module.exports = new Promise((resolve, reject) => {
|
module.exports = new Promise((resolve, reject) => {
|
||||||
portfinder.basePort = process.env.PORT || config.dev.port
|
portfinder.basePort = process.env.PORT || config.dev.port;
|
||||||
portfinder.getPort((err, port) => {
|
portfinder.getPort((err, port) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err)
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
// publish the new Port, necessary for e2e tests
|
// publish the new Port, necessary for e2e tests
|
||||||
process.env.PORT = port
|
process.env.PORT = port;
|
||||||
// add port to devServer config
|
// add port to devServer config
|
||||||
devWebpackConfig.devServer.port = port
|
devWebpackConfig.devServer.port = port;
|
||||||
|
console.log('devWebpackConfig', devWebpackConfig)
|
||||||
// Add FriendlyErrorsPlugin
|
// Add FriendlyErrorsPlugin
|
||||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
devWebpackConfig.plugins.push(
|
||||||
compilationSuccessInfo: {
|
new FriendlyErrorsPlugin({
|
||||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
compilationSuccessInfo: {
|
||||||
},
|
messages: [
|
||||||
onErrors: config.dev.notifyOnErrors
|
`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`
|
||||||
? utils.createNotifierCallback()
|
]
|
||||||
: undefined
|
},
|
||||||
}))
|
onErrors: config.dev.notifyOnErrors
|
||||||
|
? utils.createNotifierCallback()
|
||||||
|
: undefined
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
resolve(devWebpackConfig)
|
resolve(devWebpackConfig);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"development"',
|
NODE_ENV: '"development"',
|
||||||
ENV_CONFIG: '"dev"',
|
ENV_CONFIG: '"dev"',
|
||||||
BASE_API: '"https://neutrino-proxy.asgc.fun/neutrino-proxy-server"',
|
BASE_API: '"http://localhost:8888/neutrino-proxy-server"',
|
||||||
USER_NAME: '"visitor"',
|
USER_NAME: '"visitor"',
|
||||||
USER_PWD: '"123456"'
|
USER_PWD: '"123456"'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ module.exports = {
|
|||||||
assetsSubDirectory: 'static',
|
assetsSubDirectory: 'static',
|
||||||
assetsPublicPath: '/',
|
assetsPublicPath: '/',
|
||||||
proxyTable: {},
|
proxyTable: {},
|
||||||
|
|
||||||
// Various Dev Server settings
|
// Various Dev Server settings
|
||||||
host: 'localhost', // can be overwritten by process.env.HOST
|
host: 'localhost', // can be overwritten by process.env.HOST
|
||||||
port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||||
@@ -56,8 +55,8 @@ module.exports = {
|
|||||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||||
assetsSubDirectory: 'static',
|
assetsSubDirectory: 'static',
|
||||||
|
|
||||||
// you can set by youself according to actual condition
|
// you can set by youself according to actual condition
|
||||||
assetsPublicPath: './',
|
assetsPublicPath: '/',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source Maps
|
* Source Maps
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
ENV_CONFIG: '"prod"',
|
ENV_CONFIG: '"prod"',
|
||||||
BASE_API: '"https://api-prod"'
|
BASE_API: '"http://np.myone.cc"' // 后端访问地址与 server配置一致
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
"showdown": "1.8.5",
|
"showdown": "1.8.5",
|
||||||
"simplemde": "1.11.2",
|
"simplemde": "1.11.2",
|
||||||
"sortablejs": "1.7.0",
|
"sortablejs": "1.7.0",
|
||||||
"vue": "2.5.10",
|
"vue": "2.5.17",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-i18n": "7.3.2",
|
"vue-i18n": "7.3.2",
|
||||||
"vue-multiselect": "2.0.8",
|
"vue-multiselect": "2.0.8",
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
"friendly-errors-webpack-plugin": "1.6.1",
|
"friendly-errors-webpack-plugin": "1.6.1",
|
||||||
"html-webpack-plugin": "2.30.1",
|
"html-webpack-plugin": "2.30.1",
|
||||||
"node-notifier": "5.1.2",
|
"node-notifier": "5.1.2",
|
||||||
"node-sass": "^9.0.0",
|
"node-sass": "4.13.1",
|
||||||
"optimize-css-assets-webpack-plugin": "3.2.0",
|
"optimize-css-assets-webpack-plugin": "3.2.0",
|
||||||
"ora": "1.3.0",
|
"ora": "1.3.0",
|
||||||
"portfinder": "1.0.13",
|
"portfinder": "1.0.13",
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
"url-loader": "0.6.2",
|
"url-loader": "0.6.2",
|
||||||
"vue-loader": "13.5.0",
|
"vue-loader": "13.5.0",
|
||||||
"vue-style-loader": "3.0.3",
|
"vue-style-loader": "3.0.3",
|
||||||
"vue-template-compiler": "2.5.10",
|
"vue-template-compiler": "2.5.17",
|
||||||
"webpack": "3.10.0",
|
"webpack": "3.10.0",
|
||||||
"webpack-bundle-analyzer": "2.9.1",
|
"webpack-bundle-analyzer": "2.9.1",
|
||||||
"webpack-dev-server": "2.9.7",
|
"webpack-dev-server": "2.9.7",
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function domainNameBindInfo(query) {
|
|
||||||
return request({
|
|
||||||
url: '/domain-name/bind-info',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function fetchList(query) {
|
export function fetchList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/domain/page',
|
url: '/domain/page',
|
||||||
@@ -15,61 +9,54 @@ export function fetchList(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchAvailableDomainList(query) {
|
export function mappingModify(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/domain/all',
|
url: '/domain/modify',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
params: query
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateEnableStatus(id, enable, domain) {
|
export function deleteMapping(id) {
|
||||||
|
return request({
|
||||||
|
url: '/domain/delete/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateEnableStatus(id, enable) {
|
||||||
return request({
|
return request({
|
||||||
url: '/domain/update/enable-status',
|
url: '/domain/update/enable-status',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
id: id,
|
id: id,
|
||||||
enable: enable,
|
enable: enable
|
||||||
domain: domain,
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createDomain(data) {
|
export function portMappingBindSecurityGroup(id, securityGroupId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/domain/create',
|
url: '/domain/bind/security-group',
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function updateDomain(data) {
|
|
||||||
return request({
|
|
||||||
url: '/domain/update',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function deleteDomain(id) {
|
|
||||||
return request({
|
|
||||||
url: '/domain/delete',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
id: id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function updateDefaultStatus(id, isDefault) {
|
|
||||||
return request({
|
|
||||||
url: '/domain/update/default-status',
|
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
id: id,
|
id: id,
|
||||||
isDefault: isDefault
|
securityGroupId: securityGroupId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function portMappingUnbindSecurityGroup(id) {
|
||||||
|
return request({
|
||||||
|
url: `/domain/unbind/security-group?id=${id}`,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function domainAvailable(query) {
|
||||||
|
return request({
|
||||||
|
url: '/domain/available',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,6 +54,24 @@
|
|||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: 'License',
|
label: 'License',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'isOnline',
|
||||||
|
label: 'isOnline',
|
||||||
|
align: 'center',
|
||||||
|
render: (h, params) => {
|
||||||
|
switch (params.row.isOnline) {
|
||||||
|
case 1:
|
||||||
|
return h('el-tag', {
|
||||||
|
props: {type: 'success'}
|
||||||
|
}, '在线')
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
return h('el-tag', {props:{type: 'danger'}}, '离线')
|
||||||
|
default:
|
||||||
|
return h('el-tag', {props:{type: 'danger'}}, '离线')
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
popVisible: false,
|
popVisible: false,
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default {
|
|||||||
proxy: '代理配置',
|
proxy: '代理配置',
|
||||||
license: 'License管理',
|
license: 'License管理',
|
||||||
portMapping: '端口映射',
|
portMapping: '端口映射',
|
||||||
domainManagement: '域名管理',
|
domainMapping: '域名解析',
|
||||||
jobManager: '调度管理',
|
jobManager: '调度管理',
|
||||||
jobLog: '调度日志',
|
jobLog: '调度日志',
|
||||||
log: '日志管理',
|
log: '日志管理',
|
||||||
@@ -129,7 +129,6 @@ export default {
|
|||||||
deleteBatch: '批量删除',
|
deleteBatch: '批量删除',
|
||||||
cancel: '取 消',
|
cancel: '取 消',
|
||||||
confirm: '确 定',
|
confirm: '确 定',
|
||||||
domain: '域名',
|
|
||||||
userId: '用户ID',
|
userId: '用户ID',
|
||||||
userName: '用户名',
|
userName: '用户名',
|
||||||
name: '名称',
|
name: '名称',
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const asyncRouterMap = [
|
|||||||
children: [
|
children: [
|
||||||
{ path: 'license', component: _import('proxy/license'), name: 'license', meta: { title: 'license' }},
|
{ path: 'license', component: _import('proxy/license'), name: 'license', meta: { title: 'license' }},
|
||||||
{ path: 'portMapping', component: _import('proxy/portMapping'), name: 'portMapping', meta: { title: 'portMapping' }},
|
{ path: 'portMapping', component: _import('proxy/portMapping'), name: 'portMapping', meta: { title: 'portMapping' }},
|
||||||
{ path: 'domainManagement', component: _import('proxy/domain'), name: 'domainManagement', meta: { title: 'domainManagement' }}
|
{ path: 'domainMapping', component: _import('proxy/domainMapping'), name: 'domainMapping', meta: { title: 'domainMapping' }}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ export const asyncRouterMap = [
|
|||||||
{ path: 'portGroup', component: _import('system/portGroup'), name: 'portGroup', meta: { title: 'portGroup' }},
|
{ path: 'portGroup', component: _import('system/portGroup'), name: 'portGroup', meta: { title: 'portGroup' }},
|
||||||
{ path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }},
|
{ path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }},
|
||||||
{ path: 'securityGroup', component: _import('system/securityGroup'), name: 'securityGroup', meta: { title: 'securityGroup' }},
|
{ path: 'securityGroup', component: _import('system/securityGroup'), name: 'securityGroup', meta: { title: 'securityGroup' }},
|
||||||
{ path: 'securityRule', component: _import('system/securityRule'), name: 'securityRule', meta: { title: 'securityRule' }, hidden: true },
|
{ path: 'securityRule', component: _import('system/securityRule'), name: 'securityRule', meta: { title: 'securityRule' }, hidden: true},
|
||||||
{ path: 'protocal', component: _import('system/protocal'), name: 'protocal', meta: { title: 'protocal' }},
|
{ path: 'protocal', component: _import('system/protocal'), name: 'protocal', meta: { title: 'protocal' }},
|
||||||
{ path: 'jobManager', component: _import('system/jobManager'), name: 'jobManager', meta: { title: 'jobManager' }}
|
{ path: 'jobManager', component: _import('system/jobManager'), name: 'jobManager', meta: { title: 'jobManager' }}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,467 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container calendar-list-container">
|
|
||||||
<div class="filter-container" style="display:flex">
|
|
||||||
<el-select v-model="listQuery.userId" placeholder="请选择用户" filterable clearable style="margin-right:10px;width: 120px;">
|
|
||||||
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"/>
|
|
||||||
</el-select>
|
|
||||||
<el-select v-model="listQuery.enable" placeholder="请选择启用状态" clearable style="width:145px;margin-right:10px">
|
|
||||||
<el-option v-for="item in selectObj.statusOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
|
||||||
</el-select>
|
|
||||||
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">{{$t('table.search')}}</el-button>
|
|
||||||
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">{{$t('table.add')}}</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row
|
|
||||||
style="width: 100%">
|
|
||||||
<el-table-column align="center" :label="$t('table.id')" width="50">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{scope.row.id}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" :label="$t('table.userName')" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{scope.row.userName}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" :label="$t('table.domain')" width="300">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{scope.row.domain}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column width="150px" align="center" :label="$t('table.createTime')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{scope.row.createTime | parseTime('{y}-{m}-{d} {h}:{i}')}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column width="150px" align="center" :label="$t('table.updateTime')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{scope.row.updateTime | parseTime('{y}-{m}-{d} {h}:{i}')}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column class-name="status-col" :label="$t('SSL证书状态')" width="110">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag :type="scope.row.sslStatus | statusFilter">{{scope.row.sslStatus | sslStatusName}}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column class-name="status-col" :label="$t('默认域名')" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag :type="scope.row.isDefault | statusFilter">{{scope.row.isDefault | httpStatusName}}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column class-name="status-col" :label="$t('强制HTTPS')" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag :type="scope.row.forceHttps | statusFilter">{{scope.row.forceHttps | httpStatusName}}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column class-name="status-col" :label="$t('table.enableStatus')" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag :type="scope.row.enable | statusFilter">{{scope.row.enable | statusName}}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" :label="$t('table.actions')" width="330" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button v-if="scope.row.isDefault !='1' && scope.row.enable == '1'" size="mini" type="primary" @click="handleDefaultStatus(scope.row)">{{$t('默认')}}</el-button>
|
|
||||||
|
|
||||||
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{$t('table.edit')}}</el-button>
|
|
||||||
<el-button v-if="scope.row.enable =='1'" size="mini" type="danger" @click="handleModifyStatus(scope.row,2)">{{$t('table.disable')}}</el-button>
|
|
||||||
<el-button v-if="scope.row.enable =='2'" size="mini" type="success" @click="handleModifyStatus(scope.row,1)">{{$t('table.enable')}}</el-button>
|
|
||||||
<!-- <el-button size="mini" type="danger" @click="handleDelete(scope.row,'deleted')">{{$t('table.delete')}}</el-button>-->
|
|
||||||
<ButtonPopover @handleCommitClick="handleDelete2(scope.row)" style="margin-left: 10px"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<div class="pagination-container">
|
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.current"
|
|
||||||
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.size" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
|
||||||
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="120px" style='width: 400px; margin-left:50px;'>
|
|
||||||
<el-form-item :label="$t('主域名')" prop="domain">
|
|
||||||
<el-input v-model="temp.domain"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('强制HTTPS')" prop="userId">
|
|
||||||
<el-select style="width: 280px" class="filter-item" v-model="temp.forceHttps" placeholder="请选择">
|
|
||||||
<el-option label="开启" :value="1"></el-option>
|
|
||||||
<el-option label="关闭" :value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('JKS文件上传')" prop="file">
|
|
||||||
<el-upload
|
|
||||||
ref="upload"
|
|
||||||
class="upload-demo"
|
|
||||||
action=""
|
|
||||||
:http-request="httpRequest"
|
|
||||||
:file-list="this.fileList"
|
|
||||||
:auto-upload="false"
|
|
||||||
:multiple="false"
|
|
||||||
accept=".jks"
|
|
||||||
:limit="1"
|
|
||||||
:on-change="handleChange"
|
|
||||||
>
|
|
||||||
<el-button slot="trigger" size="small" type="primary">选择文件</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="passWordInputStatus" :label="$t('JKS密码')" prop="filePassword">
|
|
||||||
<el-input type="password" v-model="temp.keyStorePassword"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">{{$t('table.cancel')}}</el-button>
|
|
||||||
<el-button v-if="dialogStatus=='create'" type="primary" @click="createData">{{$t('table.confirm')}}</el-button>
|
|
||||||
<el-button v-else type="primary" @click="updateData">{{$t('table.confirm')}}</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<!-- <el-dialog title="Reading statistics" :visible.sync="dialogPvVisible">-->
|
|
||||||
<!-- <el-table :data="pvData" border fit highlight-current-row style="width: 100%">-->
|
|
||||||
<!-- <el-table-column prop="key" label="Channel"> </el-table-column>-->
|
|
||||||
<!-- <el-table-column prop="pv" label="Pv"> </el-table-column>-->
|
|
||||||
<!-- </el-table>-->
|
|
||||||
<!-- <span slot="footer" class="dialog-footer">-->
|
|
||||||
<!-- <el-button type="primary" @click="dialogPvVisible = false">{{$t('table.confirm')}}</el-button>-->
|
|
||||||
<!-- </span>-->
|
|
||||||
<!-- </el-dialog>-->
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { fetchList, updateEnableStatus, createDomain, updateDomain, deleteDomain, updateDefaultStatus } from '@/api/domain'
|
|
||||||
import { userList } from '@/api/user'
|
|
||||||
import waves from '@/directive/waves' // 水波纹指令
|
|
||||||
import { parseTime } from '@/utils'
|
|
||||||
import ButtonPopover from '../../components/Button/buttonPopover'
|
|
||||||
|
|
||||||
const calendarTypeOptions = [
|
|
||||||
{ key: 'CN', display_name: 'China' },
|
|
||||||
{ key: 'US', display_name: 'USA' },
|
|
||||||
{ key: 'JP', display_name: 'Japan' },
|
|
||||||
{ key: 'EU', display_name: 'Eurozone' }
|
|
||||||
]
|
|
||||||
|
|
||||||
// arr to obj ,such as { CN : "China", US : "USA" }
|
|
||||||
const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
|
|
||||||
acc[cur.key] = cur.display_name
|
|
||||||
return acc
|
|
||||||
}, {})
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'complexTable',
|
|
||||||
directives: {
|
|
||||||
waves
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
ButtonPopover
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
fileList: [],
|
|
||||||
tableKey: 0,
|
|
||||||
list: null,
|
|
||||||
total: null,
|
|
||||||
listLoading: true,
|
|
||||||
listQuery: {
|
|
||||||
current: 1,
|
|
||||||
size: 10,
|
|
||||||
enable: undefined,
|
|
||||||
userId: null
|
|
||||||
},
|
|
||||||
importanceOptions: [1, 2, 3],
|
|
||||||
calendarTypeOptions,
|
|
||||||
userList: [],
|
|
||||||
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
|
||||||
statusOptions: ['published', 'draft', 'deleted'],
|
|
||||||
showReviewer: false,
|
|
||||||
temp: {
|
|
||||||
id: undefined,
|
|
||||||
importance: 1,
|
|
||||||
remark: '',
|
|
||||||
timestamp: new Date(),
|
|
||||||
title: '',
|
|
||||||
type: '',
|
|
||||||
status: 'published',
|
|
||||||
domain: '',
|
|
||||||
jks: undefined,
|
|
||||||
keyStorePassword: '',
|
|
||||||
forceHttps: ''
|
|
||||||
},
|
|
||||||
dialogFormVisible: false,
|
|
||||||
dialogStatus: '',
|
|
||||||
passWordInputStatus: false,
|
|
||||||
textMap: {
|
|
||||||
update: '编辑',
|
|
||||||
create: '新建'
|
|
||||||
},
|
|
||||||
dialogPvVisible: false,
|
|
||||||
pvData: [],
|
|
||||||
rules: {
|
|
||||||
domain: [
|
|
||||||
{ required: true, message: '主域名不能为空', trigger: 'blur' },
|
|
||||||
{ validator: this.validateDomain, trigger: 'blur' }
|
|
||||||
],
|
|
||||||
file: [
|
|
||||||
{ required: false, message: '请选择文件', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
filePassword: [
|
|
||||||
{ required: false, message: '密码不能为空', trigger: 'blur' }
|
|
||||||
]// TODO required改为true后,密码不为空,仍不能通过
|
|
||||||
},
|
|
||||||
downloadLoading: false,
|
|
||||||
selectObj: {
|
|
||||||
statusOptions: [{ label: '启用', value: 1 }, { label: '禁用', value: 2 }],
|
|
||||||
onlineOptions: [{ label: '在线', value: 1 }, { label: '离线', value: 2 }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
statusName(status) {
|
|
||||||
const statusMap = {
|
|
||||||
1: '启用',
|
|
||||||
2: '禁用'
|
|
||||||
}
|
|
||||||
return statusMap[status]
|
|
||||||
},
|
|
||||||
sslStatusName(status) {
|
|
||||||
const statusMap = {
|
|
||||||
1: '已上传',
|
|
||||||
2: '未上传',
|
|
||||||
3: '已验证'
|
|
||||||
}
|
|
||||||
return statusMap[status]
|
|
||||||
},
|
|
||||||
httpStatusName(status) {
|
|
||||||
const statusMap = {
|
|
||||||
1: '开启',
|
|
||||||
2: '关闭'
|
|
||||||
}
|
|
||||||
return statusMap[status]
|
|
||||||
},
|
|
||||||
statusFilter(status) {
|
|
||||||
const statusMap = {
|
|
||||||
1: 'success',
|
|
||||||
2: 'danger'
|
|
||||||
}
|
|
||||||
return statusMap[status]
|
|
||||||
},
|
|
||||||
typeFilter(type) {
|
|
||||||
return calendarTypeKeyValue[type]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getDataList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
httpRequest(param) {
|
|
||||||
this.temp.jks = param.file
|
|
||||||
},
|
|
||||||
validateDomain(rule, value, callback) {
|
|
||||||
// 匹配多级域名,例如:sub.example.com, sub.sub.example.com
|
|
||||||
const domainPattern = /^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,6}$/
|
|
||||||
|
|
||||||
if (!value) {
|
|
||||||
callback(new Error('主域名不能为空'));
|
|
||||||
} else if (!domainPattern.test(value)) {
|
|
||||||
callback(new Error('请输入正确的域名格式'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleChange(file) {
|
|
||||||
this.fileList = [file]
|
|
||||||
this.passWordInputStatus = true
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
this.listLoading = true
|
|
||||||
fetchList(this.listQuery).then(response => {
|
|
||||||
this.list = response.data.data.records
|
|
||||||
this.total = response.data.data.total
|
|
||||||
this.listLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserList() {
|
|
||||||
userList().then(response => {
|
|
||||||
this.userList = response.data.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDataList() {
|
|
||||||
const loginName = this.$store.state.user.loginName
|
|
||||||
userList().then(response => {
|
|
||||||
this.userList = response.data.data
|
|
||||||
const curUser = this.userList.find((val) => val.loginName === loginName)
|
|
||||||
if (curUser) {
|
|
||||||
this.listQuery.userId = curUser.id
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleFilter() {
|
|
||||||
this.listQuery.current = 1
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.listQuery.size = val
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.listQuery.current = val
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleDefaultStatus(row) {
|
|
||||||
updateDefaultStatus(row.id, 1).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleModifyStatus(row, enable) {
|
|
||||||
console.log('route', this.$route)
|
|
||||||
updateEnableStatus(row.id, enable, row.domain).then(response => {
|
|
||||||
if (response.data.data.code === 0) {
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
resetTemp() {
|
|
||||||
this.passWordInputStatus = false
|
|
||||||
this.fileList = []
|
|
||||||
this.temp = {
|
|
||||||
domain: undefined,
|
|
||||||
jks: undefined,
|
|
||||||
keyStorePassword: undefined,
|
|
||||||
forceHttps: undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleCreate() {
|
|
||||||
this.resetTemp()
|
|
||||||
this.dialogStatus = 'create'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
createData() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.$refs.upload.submit()
|
|
||||||
const formData = this.objectToFormData(this.temp)
|
|
||||||
createDomain(formData).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '创建成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.resetTemp()
|
|
||||||
this.temp = Object.assign({}, row) // copy obj
|
|
||||||
this.dialogStatus = 'update'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
console.log(this.temp)
|
|
||||||
if (valid) {
|
|
||||||
this.$refs.upload.submit()
|
|
||||||
const tempData = Object.assign({}, this.temp)
|
|
||||||
const formData = this.objectToFormData(tempData)
|
|
||||||
updateDomain(formData).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '创建成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
objectToFormData(obj) {
|
|
||||||
const formData = new FormData()
|
|
||||||
Object.keys(obj).forEach(key => {
|
|
||||||
if (obj[key] !== undefined) {
|
|
||||||
formData.append(key, obj[key])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return formData
|
|
||||||
},
|
|
||||||
handleDelete(row) {
|
|
||||||
this.$confirm('确定要删除吗?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
deleteDomain(row.id).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).catch(() => {})
|
|
||||||
},
|
|
||||||
handleDelete2(row) {
|
|
||||||
deleteDomain(row.id).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDownload() {
|
|
||||||
this.downloadLoading = true
|
|
||||||
import('@/vendor/Export2Excel').then(excel => {
|
|
||||||
const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
|
|
||||||
const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
|
|
||||||
const data = this.formatJson(filterVal, this.list)
|
|
||||||
excel.export_json_to_excel(tHeader, data, 'table-list')
|
|
||||||
this.downloadLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formatJson(filterVal, jsonData) {
|
|
||||||
return jsonData.map(v => filterVal.map(j => {
|
|
||||||
if (j === 'timestamp') {
|
|
||||||
return parseTime(v[j])
|
|
||||||
} else {
|
|
||||||
return v[j]
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -0,0 +1,408 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container calendar-list-container">
|
||||||
|
<div class="filter-container" style="display:flex">
|
||||||
|
<el-select v-model="listQuery.userId" placeholder="请选择用户" filterable clearable style="margin-right:10px;width: 120px;">
|
||||||
|
<el-option v-for="item in userList" :key="item.loginName" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="listQuery.licenseId" placeholder="请选择license" filterable clearable style="margin-right:10px;width: 135px;">
|
||||||
|
<el-option v-for="item in licenseList" :key="item.key" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-select v-model="listQuery.protocal" placeholder="请选择协议" clearable style="margin-right:10px;width: 120px;">
|
||||||
|
<el-option v-for="item in protocalList" :key="item.name" :label="item.name" :value="item.name" :disabled="!item.enable" />
|
||||||
|
</el-select> -->
|
||||||
|
<el-input v-model="listQuery.domain" type="text" style="width:145px;margin-right:10px" class="filter-item" placeholder="请输入域名关键词" />
|
||||||
|
<el-select v-model="listQuery.isOnline" placeholder="请选择在线状态" clearable style="width:145px;margin-right:10px">
|
||||||
|
<el-option v-for="(value, key) in onlineOptions" :key="key" :label="value" :value="key" />
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="listQuery.enable" placeholder="请选择启用状态" clearable style="width:145px;margin-right:10px">
|
||||||
|
<el-option v-for="(value, key) in statusOptions" :key="key" :label="value" :value="key" />
|
||||||
|
</el-select>
|
||||||
|
<el-input v-model="listQuery.description" type="text" style="width:145px;margin-right:10px" class="filter-item" placeholder="请输入描述详情" show-word-limit />
|
||||||
|
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">{{
|
||||||
|
$t('table.search') }}</el-button>
|
||||||
|
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">{{ $t('table.add') }}</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 100%">
|
||||||
|
<el-table-column align="center" :label="$t('table.id')" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.id }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('table.userName')" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.userName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('table.licenseName')" width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.licenseName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('table.protocalName')" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.protocal }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('table.desc')" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.description }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" :label="$t('table.domainName')" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link target="_blank" @click="handleOpenWebPage(scope.row)">http(s)://{{ scope.row.domain }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('目标路径')" width="240">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-html="scope.row.targetPath.replace(/(\n\r|\r\n|\r|\n)/g, '<br/>')"> </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('限速')" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.upLimitRate ? scope.row.upLimitRate : '--' }} / {{ scope.row.downLimitRate ? scope.row.downLimitRate : '--' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column width="150px" align="center" :label="$t('table.createTime')">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <span>{{ scope.row.createTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
<el-table-column width="150px" align="center" :label="$t('table.updateTime')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.updateTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column class-name="status-col" :label="$t('table.enableStatus')" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="colorOption[scope.row.enable]">{{ statusOptions[scope.row.enable] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column class-name="status-col" :label="$t('table.isOnline')" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="colorOption[scope.row.isOnline]">{{ onlineOptions[scope.row.isOnline] }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" :label="$t('table.actions')" width="320" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="toModify(scope.row)">{{ $t('table.edit') }}</el-button>
|
||||||
|
<el-button v-if="scope.row.enable == '1'" size="mini" type="danger" @click="handleModifyStatus(scope.row, 2)">{{ $t('table.disable') }}</el-button>
|
||||||
|
<el-button v-if="scope.row.enable == '2'" size="mini" type="success" @click="handleModifyStatus(scope.row, 1)">{{ $t('table.enable') }}</el-button>
|
||||||
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">{{ $t('table.delete') }}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div class="pagination-container">
|
||||||
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.current" :pageInfo-sizes="[10, 20, 30, 50]"
|
||||||
|
:pageInfo-size="listQuery.size" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog :title="textMap[dialogStatus]" :close-on-click-modal="false" :visible.sync="dialogFormVisible" top="20px">
|
||||||
|
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="right" label-width="110px">
|
||||||
|
<el-form-item :label="$t('License')" prop="licenseId">
|
||||||
|
<DropdownTable v-model="temp.licenseId" :name.sync="temp.licenseName" :tableData="licenseAuthList" @selectedData="selectedFeeItem" placeholder="请选择" :width="500" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('域名')" prop="domain">
|
||||||
|
<el-input v-model="temp.domain">
|
||||||
|
<template slot="prepend">http(s)://</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('目标地址')" prop="targetPath">
|
||||||
|
<el-input type="textarea" v-model="temp.targetPath" rows="3" placeholder="请输入目标地址,多个可实现负载均衡,如:
|
||||||
|
127.0.0.1:80
|
||||||
|
127.0.0.1:90"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('描述')" prop="description">
|
||||||
|
<el-input v-model="temp.description" type="textarea" placeholder="请输入描述"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('请求头部信息')" prop="requestHeader">
|
||||||
|
<el-input v-model="temp.requestHeader" type="textarea" placeholder="请输入请求头如:Cache-Control: no-cache"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.securityGroup')" prop="securityGroup">
|
||||||
|
<el-select style="width: 280px;" class="filter-item" v-model="temp.securityGroupId" clearable>
|
||||||
|
<el-option v-for="item in securityGroupList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('上传限速')" prop="upLimitRate">
|
||||||
|
<el-input v-model="temp.upLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('下载限速')" prop="downLimitRate">
|
||||||
|
<el-input v-model="temp.downLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
|
||||||
|
<el-button v-if="dialogStatus == 'create'" type="primary" @click="modifyData">{{ $t('table.confirm')
|
||||||
|
}}</el-button>
|
||||||
|
<el-button v-else type="primary" @click="modifyData">{{ $t('table.confirm') }}</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="Reading statistics" :visible.sync="dialogPvVisible">
|
||||||
|
<el-table :data="pvData" border fit highlight-current-row style="width: 100%">
|
||||||
|
<el-table-column prop="key" label="Channel"> </el-table-column>
|
||||||
|
<el-table-column prop="pv" label="Pv"> </el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="dialogPvVisible = false">{{ $t('table.confirm') }}</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { fetchList, mappingModify, updateEnableStatus, deleteMapping, domainAvailable } from '@/api/domain'
|
||||||
|
import { fetchGroupList } from '@/api/securityGroup'
|
||||||
|
import { licenseList, licenseAuthList } from '@/api/license'
|
||||||
|
import { userList } from '@/api/user'
|
||||||
|
import waves from '@/directive/waves' // 水波纹指令
|
||||||
|
import { parseTime } from '@/utils'
|
||||||
|
import ButtonPopover from '../../components/Button/buttonPopover'
|
||||||
|
import DropdownTable from '../../components/Dropdown/DropdownTable'
|
||||||
|
export default {
|
||||||
|
name: 'DmainMaping',
|
||||||
|
directives: {
|
||||||
|
waves
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
DropdownTable,
|
||||||
|
ButtonPopover
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableKey: 0,
|
||||||
|
list: null,
|
||||||
|
total: null,
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
domain: null,
|
||||||
|
title: undefined,
|
||||||
|
type: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
license: undefined,
|
||||||
|
port: undefined,
|
||||||
|
isOnline: undefined,
|
||||||
|
enable: undefined,
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
userList: [],
|
||||||
|
licenseList: [],
|
||||||
|
licenseAuthList: [],
|
||||||
|
showReviewer: false,
|
||||||
|
temp: {
|
||||||
|
id: undefined,
|
||||||
|
licenseId: undefined,
|
||||||
|
licenseName: undefined,
|
||||||
|
domain: undefined,
|
||||||
|
targetPath: undefined,
|
||||||
|
requestHeader: undefined
|
||||||
|
},
|
||||||
|
statusOptions: {
|
||||||
|
1: '启用',
|
||||||
|
2: '禁用',
|
||||||
|
},
|
||||||
|
onlineOptions: {
|
||||||
|
1: '在线',
|
||||||
|
2: '离线'
|
||||||
|
},
|
||||||
|
colorOption: {
|
||||||
|
1: 'success',
|
||||||
|
2: 'danger'
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
dialogStatus: '',
|
||||||
|
textMap: {
|
||||||
|
update: '编辑',
|
||||||
|
create: '新增'
|
||||||
|
},
|
||||||
|
dialogPvVisible: false,
|
||||||
|
pvData: [],
|
||||||
|
rules: {
|
||||||
|
licenseId: [{ required: true, message: '请选择License', trigger: 'blur,change' }],
|
||||||
|
domain: [{ required: true, message: '请输入域名', trigger: 'blur' },
|
||||||
|
{ pattern: '^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$', message: '域名格式不正确,请检查后重试', trigger: 'blur' },
|
||||||
|
{ validator: this.isDomainAvailable, trigger: 'blur' }
|
||||||
|
],
|
||||||
|
targetPath: [{ required: true, message: '请输入目标地址', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
more: true,
|
||||||
|
securityGroupList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// filters: {
|
||||||
|
// },
|
||||||
|
created() {
|
||||||
|
this.getDataList()
|
||||||
|
this.getLicenseList()
|
||||||
|
this.getLicenseAuthList()
|
||||||
|
this.fetchSecurityGroupList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isDomainAvailable(rule, value, callback) {
|
||||||
|
if (value != null) {
|
||||||
|
const param = { domain: value, id: this.temp.id }
|
||||||
|
domainAvailable(param).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
if (!res.data.data) {
|
||||||
|
return callback(new Error('域名已被占用'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true
|
||||||
|
fetchList(this.listQuery).then(response => {
|
||||||
|
this.list = response.data.data.records
|
||||||
|
this.total = response.data.data.total
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getDataList() {
|
||||||
|
const loginName = this.$store.state.user.loginName
|
||||||
|
userList().then(response => {
|
||||||
|
this.userList = response.data.data
|
||||||
|
const curUser = this.userList.find((val) => val.loginName === loginName)
|
||||||
|
if (curUser) {
|
||||||
|
this.listQuery.userId = curUser.id
|
||||||
|
}
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fetchSecurityGroupList() {
|
||||||
|
fetchGroupList().then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.securityGroupList = res.data.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAllUserList() {
|
||||||
|
userList().then(response => {
|
||||||
|
this.userList = response.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getLicenseList() {
|
||||||
|
licenseList().then(response => {
|
||||||
|
this.licenseList = response.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getLicenseAuthList() {
|
||||||
|
licenseAuthList().then(response => {
|
||||||
|
this.licenseAuthList = response.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.current = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.listQuery.size = val
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.listQuery.current = val
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleModifyStatus(row, enable) {
|
||||||
|
console.log('route', this.$route)
|
||||||
|
updateEnableStatus(row.id, enable).then(response => {
|
||||||
|
if (response.data.data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetTemp() {
|
||||||
|
this.temp = {
|
||||||
|
id: undefined,
|
||||||
|
licenseId: undefined,
|
||||||
|
licenseName: undefined,
|
||||||
|
clientIp: '127.0.0.1',
|
||||||
|
clientPort: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
proxyResponses: undefined,
|
||||||
|
proxyTimeoutMs: undefined
|
||||||
|
}
|
||||||
|
this.more = true;
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.resetTemp()
|
||||||
|
this.dialogStatus = 'create'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
modifyData() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
mappingModify(this.temp).then(response => {
|
||||||
|
if (response.data.code === 0) {
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.$notify({
|
||||||
|
title: '成功',
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleOpenWebPage(row) {
|
||||||
|
open(location.protocol + '//' + row.domain)
|
||||||
|
},
|
||||||
|
toModify(row) {
|
||||||
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
|
if (row.securityGroupId === 0) {
|
||||||
|
this.temp.securityGroupId = null
|
||||||
|
}
|
||||||
|
this.temp.timestamp = new Date(this.temp.timestamp)
|
||||||
|
this.dialogStatus = 'update'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectedFeeItem(row, list) {
|
||||||
|
if (this.temp.licenseId !== row.id) {
|
||||||
|
this.temp.licenseId = row.id
|
||||||
|
this.temp.licenseName = row.name
|
||||||
|
this.temp.serverPort = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
this.$confirm('确定要删除吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteMapping(row.id).then(response => {
|
||||||
|
if (response.data.code === 0) {
|
||||||
|
this.$notify({
|
||||||
|
title: '成功',
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => { })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container calendar-list-container">
|
<div class="app-container calendar-list-container">
|
||||||
<div class="filter-container">
|
<div class="filter-container">
|
||||||
<el-select v-model="listQuery.userId" placeholder="请选择用户" filterable clearable style="margin-right:10px;width: 120px;">
|
<el-select v-model="listQuery.userId" placeholder="请选择用户" filterable clearable>
|
||||||
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"/>
|
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="listQuery.isOnline" placeholder="请选择在线状态" clearable style="width:145px;margin-right:10px">
|
<el-select v-model="listQuery.isOnline" placeholder="请选择在线状态" clearable>
|
||||||
<el-option v-for="item in selectObj.onlineOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
<el-option v-for="item in selectObj.onlineOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="listQuery.enable" placeholder="请选择启用状态" clearable style="width:145px;margin-right:10px">
|
<el-select v-model="listQuery.enable" placeholder="请选择启用状态" clearable>
|
||||||
<el-option v-for="item in selectObj.statusOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
<el-option v-for="item in selectObj.statusOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">{{$t('table.search')}}</el-button>
|
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">{{$t('table.search')}}</el-button>
|
||||||
@@ -63,12 +63,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" :label="$t('table.actions')" width="330" class-name="small-padding fixed-width">
|
<el-table-column align="center" :label="$t('table.actions')" width="330" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<!-- v-if="scope.row.id != 1" -->
|
||||||
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{$t('table.edit')}}</el-button>
|
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{$t('table.edit')}}</el-button>
|
||||||
<el-button size="mini" type="primary" @click="handleReset(scope.row)">{{$t('table.resetKey')}}</el-button>
|
<el-button size="mini" type="primary" @click="handleReset(scope.row)">{{$t('table.resetKey')}}</el-button>
|
||||||
<el-button v-if="scope.row.enable =='1'" size="mini" type="danger" @click="handleModifyStatus(scope.row,2)">{{$t('table.disable')}}</el-button>
|
<el-button v-if="scope.row.enable =='1'" size="mini" type="danger" @click="handleModifyStatus(scope.row,2)">{{$t('table.disable')}}</el-button>
|
||||||
<el-button v-if="scope.row.enable =='2'" size="mini" type="success" @click="handleModifyStatus(scope.row,1)">{{$t('table.enable')}}</el-button>
|
<el-button v-if="scope.row.enable =='2'" size="mini" type="success" @click="handleModifyStatus(scope.row,1)">{{$t('table.enable')}}</el-button>
|
||||||
<!-- <el-button size="mini" type="danger" @click="handleDelete(scope.row,'deleted')">{{$t('table.delete')}}</el-button>-->
|
<!-- v-if="scope.row.id != 1" -->
|
||||||
<ButtonPopover @handleCommitClick="handleDelete2(scope.row)" style="margin-left: 10px"/>
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">{{$t('table.delete')}}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -122,20 +123,6 @@
|
|||||||
import { userList } from '@/api/user'
|
import { userList } from '@/api/user'
|
||||||
import waves from '@/directive/waves' // 水波纹指令
|
import waves from '@/directive/waves' // 水波纹指令
|
||||||
import { parseTime } from '@/utils'
|
import { parseTime } from '@/utils'
|
||||||
import ButtonPopover from '../../components/Button/buttonPopover'
|
|
||||||
|
|
||||||
const calendarTypeOptions = [
|
|
||||||
{ key: 'CN', display_name: 'China' },
|
|
||||||
{ key: 'US', display_name: 'USA' },
|
|
||||||
{ key: 'JP', display_name: 'Japan' },
|
|
||||||
{ key: 'EU', display_name: 'Eurozone' }
|
|
||||||
]
|
|
||||||
|
|
||||||
// arr to obj ,such as { CN : "China", US : "USA" }
|
|
||||||
const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
|
|
||||||
acc[cur.key] = cur.display_name
|
|
||||||
return acc
|
|
||||||
}, {})
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'complexTable',
|
name: 'complexTable',
|
||||||
@@ -143,7 +130,6 @@
|
|||||||
waves
|
waves
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
ButtonPopover
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -159,7 +145,6 @@
|
|||||||
userId: null
|
userId: null
|
||||||
},
|
},
|
||||||
importanceOptions: [1, 2, 3],
|
importanceOptions: [1, 2, 3],
|
||||||
calendarTypeOptions,
|
|
||||||
userList: [],
|
userList: [],
|
||||||
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
||||||
statusOptions: ['published', 'draft', 'deleted'],
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
@@ -214,9 +199,6 @@
|
|||||||
}
|
}
|
||||||
return statusMap[status]
|
return statusMap[status]
|
||||||
},
|
},
|
||||||
typeFilter(type) {
|
|
||||||
return calendarTypeKeyValue[type]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
@@ -368,19 +350,6 @@
|
|||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
handleDelete2(row) {
|
|
||||||
deleteLicense(row.id).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDownload() {
|
handleDownload() {
|
||||||
this.downloadLoading = true
|
this.downloadLoading = true
|
||||||
import('@/vendor/Export2Excel').then(excel => {
|
import('@/vendor/Export2Excel').then(excel => {
|
||||||
|
|||||||
@@ -49,13 +49,11 @@
|
|||||||
<span>{{ scope.row.protocal }}</span>
|
<span>{{ scope.row.protocal }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" :label="$t('table.domainName')" width="190">
|
<!-- <el-table-column align="center" :label="$t('table.domainName')" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="(domain, index) in scope.row.allFullDomainList" :key="index">
|
<span>{{ scope.row.domain }}</span>
|
||||||
<span>{{ domain }}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column align="center" :label="$t('table.serverPort')" width="80">
|
<el-table-column align="center" :label="$t('table.serverPort')" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.serverPort }}</span>
|
<span>{{ scope.row.serverPort }}</span>
|
||||||
@@ -107,9 +105,7 @@
|
|||||||
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{ $t('table.edit') }}</el-button>
|
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{ $t('table.edit') }}</el-button>
|
||||||
<el-button v-if="scope.row.enable == '1'" size="mini" type="danger" @click="handleModifyStatus(scope.row, 2)">{{$t('table.disable')}}</el-button>
|
<el-button v-if="scope.row.enable == '1'" size="mini" type="danger" @click="handleModifyStatus(scope.row, 2)">{{$t('table.disable')}}</el-button>
|
||||||
<el-button v-if="scope.row.enable == '2'" size="mini" type="success" @click="handleModifyStatus(scope.row, 1)">{{ $t('table.enable') }}</el-button>
|
<el-button v-if="scope.row.enable == '2'" size="mini" type="success" @click="handleModifyStatus(scope.row, 1)">{{ $t('table.enable') }}</el-button>
|
||||||
<!-- <el-button size="mini" type="danger" @click="handleDelete(scope.row,'deleted')">{{$t('table.delete')}}</el-button>-->
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">{{$t('table.delete')}}</el-button>
|
||||||
<ButtonPopover @handleCommitClick="handleDelete2(scope.row)" style="margin-left: 10px" />
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -121,107 +117,66 @@
|
|||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="800px">
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" top="20px">
|
||||||
<div style="height: 500px; overflow-y: auto;">
|
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="right" label-width="120px"
|
||||||
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="right" label-width="150px" inline>
|
style='width:500px;margin-left:50px;'>
|
||||||
<!-- <el-form-item :label="$t('License')" prop="licenseId">-->
|
<el-form-item :label="$t('License')" prop="licenseId">
|
||||||
<!-- <el-select style="width: 187px;" class="filter-item" v-model="temp.licenseId" placeholder="请选择" :disabled="dialogStatus=='update'">-->
|
<DropdownTable v-model="temp.licenseId" :name.sync="temp.licenseName" :tableData="licenseAuthList"
|
||||||
<!-- <el-option v-for="item in licenseList" :key="item.id" :label="item.name" :value="item.id">-->
|
@selectedData="selectedFeeItem" placeholder="请选择" :width="500" :disabled="dialogStatus === 'update'" />
|
||||||
<!-- </el-option>-->
|
</el-form-item>
|
||||||
<!-- </el-select>-->
|
<el-form-item :label="$t('协议')" prop="protocal">
|
||||||
<!-- </el-form-item>-->
|
<el-select style="width: 380px;" class="filter-item" v-model="temp.protocal" placeholder="请选择">
|
||||||
<el-form-item :label="$t('License')" prop="licenseId">
|
<el-option v-for="item in protocalList" :key="item.name" :label="item.name" :value="item.name"
|
||||||
<DropdownTable v-model="temp.licenseId" :name.sync="temp.licenseName" :tableData="licenseAuthList"
|
:disabled="!item.enable">
|
||||||
@selectedData="selectedFeeItem" placeholder="请选择" :width="280" :disabled="dialogStatus === 'update'" />
|
</el-option>
|
||||||
<!-- <DropdownTable
|
</el-select>
|
||||||
:columns="countryColumns"
|
</el-form-item>
|
||||||
:data="licenseList"
|
<el-form-item :label="$t('服务端端口')" prop="serverPort" >
|
||||||
v-model="temp.licenseId"
|
<load-select style="width: 380px;" class="filter-item"
|
||||||
:value="temp.licenseName"
|
v-model="temp.serverPort"
|
||||||
@rowClick="selectedFeeItem"
|
:data="serverPortList"
|
||||||
disabled
|
:page="loadServerPortQuery.page"
|
||||||
:disabled="dialogStatus==='update'"
|
:hasMore="more"
|
||||||
style="width: 280px"
|
:clearable="false"
|
||||||
/>-->
|
:dictLabel="'port'"
|
||||||
</el-form-item>
|
:dictValue="'port'"
|
||||||
<el-form-item :label="$t('协议')" prop="protocal">
|
:request="loadServerPort"/>
|
||||||
<el-select style="width: 187px;" class="filter-item" v-model="temp.protocal" placeholder="请选择">
|
</el-form-item>
|
||||||
<el-option v-for="item in protocalList" :key="item.name" :label="item.name" :value="item.name"
|
<el-form-item :label="$t('客户端IP')" prop="clientIp">
|
||||||
:disabled="!item.enable">
|
<el-input v-model="temp.clientIp"></el-input>
|
||||||
</el-option>
|
</el-form-item>
|
||||||
</el-select>
|
<el-form-item :label="$t('客户端端口')" prop="clientPort">
|
||||||
</el-form-item>
|
<el-input v-model="temp.clientPort" type="number" :step="1" controls-position="right" ></el-input>
|
||||||
<el-form-item :label="$t('服务端端口')" prop="serverPort" >
|
</el-form-item>
|
||||||
<load-select style="width: 187px;" class="filter-item"
|
<!-- <el-form-item :label="$t('域名')" prop="subdomain" v-if="(temp.protocal === 'HTTP' || temp.protocal === 'HTTP(S)') && domainName && domainName != ''">
|
||||||
v-model="temp.serverPort"
|
<el-input v-model="temp.subdomain">
|
||||||
:data="serverPortList"
|
<template slot="append">.{{ domainName }}</template>
|
||||||
:page="loadServerPortQuery.page"
|
</el-input>
|
||||||
:hasMore="more"
|
</el-form-item> -->
|
||||||
:clearable="false"
|
<el-form-item :label="$t('响应数量')" prop="proxyResponses" v-if="temp.protocal === 'UDP'">
|
||||||
:dictLabel="'port'"
|
<el-input v-model="temp.proxyResponses"></el-input>
|
||||||
:dictValue="'port'"
|
</el-form-item>
|
||||||
:request="loadServerPort"/>
|
<el-form-item :label="$t('超时时间')" prop="proxyTimeoutMs" v-if="temp.protocal === 'UDP'">
|
||||||
</el-form-item>
|
<el-input v-model="temp.proxyTimeoutMs">
|
||||||
<el-form-item :label="$t('客户端IP')" prop="clientIp">
|
<template slot="append">毫秒</template>
|
||||||
<el-input v-model="temp.clientIp"></el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('客户端端口')" prop="clientPort">
|
<el-form-item :label="$t('table.securityGroup')" prop="securityGroup">
|
||||||
<el-input v-model="temp.clientPort"></el-input>
|
<el-select style="width: 380px;" class="filter-item" v-model="temp.securityGroupId" clearable >
|
||||||
</el-form-item>
|
<el-option v-for="item in securityGroupList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
<el-form-item :label="$t('响应数量')" prop="proxyResponses" v-if="temp.protocal === 'UDP'">
|
</el-option>
|
||||||
<el-input v-model="temp.proxyResponses"></el-input>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('超时时间')" prop="proxyTimeoutMs" v-if="temp.protocal === 'UDP'">
|
<el-form-item :label="$t('上传限速')" prop="upLimitRate">
|
||||||
<el-input v-model="temp.proxyTimeoutMs">
|
<el-input v-model="temp.upLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
||||||
<template slot="append">毫秒</template>
|
</el-form-item>
|
||||||
</el-input>
|
<el-form-item :label="$t('下载限速')" prop="downLimitRate">
|
||||||
</el-form-item>
|
<el-input v-model="temp.downLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
||||||
<el-form-item :label="$t('table.securityGroup')" prop="securityGroup">
|
</el-form-item>
|
||||||
<el-select style="width: 187px;" class="filter-item" v-model="temp.securityGroupId" clearable >
|
<el-form-item :label="$t('描述')" prop="description">
|
||||||
<el-option v-for="item in securityGroupList" :key="item.id" :label="item.name" :value="item.id">
|
<el-input v-model="temp.description"></el-input>
|
||||||
</el-option>
|
</el-form-item>
|
||||||
</el-select>
|
</el-form>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('上传限速')" prop="upLimitRate">
|
|
||||||
<el-input v-model="temp.upLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('下载限速')" prop="downLimitRate">
|
|
||||||
<el-input v-model="temp.downLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('描述')" prop="description">
|
|
||||||
<el-input v-model="temp.description" style="width: 540px;"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('域名')" prop="domainMappings" v-if="(temp.protocal === 'HTTP' || temp.protocal === 'HTTP(S)') && domainList != null && domainList.length > 0" >
|
|
||||||
<div class="my-tag">
|
|
||||||
<el-tag
|
|
||||||
:key="index"
|
|
||||||
v-for="(domain, index) in temp.domainMappings"
|
|
||||||
closable
|
|
||||||
:disable-transitions="false"
|
|
||||||
@close="removeDomainMapping(index)"
|
|
||||||
class="my-tag_item"
|
|
||||||
>
|
|
||||||
<el-input v-model="domain.subdomain" class="my-input"></el-input>
|
|
||||||
<el-select v-model="domain.domainId" placeholder="请选择主域名" class="my-select">
|
|
||||||
<el-option v-for="tmp in domainList" :key="tmp.id" :label="'.'+tmp.domain" :value="tmp.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-tag>
|
|
||||||
<el-button v-if="!temp.domainMappings.length || temp.domainMappings[temp.domainMappings.length - 1].subdomain" class="button-new-tag" size="small" @click="addDomainMapping">+ 添加域名</el-button>
|
|
||||||
</div>
|
|
||||||
<!--<div v-for="(domain, index) in temp.domainMappings" :key="index" class="domain-mapping">
|
|
||||||
<el-input v-model="domain.subdomain">
|
|
||||||
<template slot="append">
|
|
||||||
<el-select v-model="domain.domainId" placeholder="请选择主域名" style="width: 187px;">
|
|
||||||
<el-option v-for="tmp in domainList" :key="tmp.id" :label="'.'+tmp.domain" :value="tmp.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
<el-button type="danger" @click="removeDomainMapping(index)" style="margin-left: 10px;">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
<el-button type="primary" @click="addDomainMapping" style="margin-top: 10px;">添加域名</el-button>-->
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="
|
<el-button @click="
|
||||||
dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
|
dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
|
||||||
@@ -257,21 +212,6 @@ import ButtonPopover from '../../components/Button/buttonPopover'
|
|||||||
import DropdownTable from '../../components/Dropdown/DropdownTable'
|
import DropdownTable from '../../components/Dropdown/DropdownTable'
|
||||||
// 下拉选择加载组件
|
// 下拉选择加载组件
|
||||||
import loadSelect from "@/components/Select/SelectLoadMore";
|
import loadSelect from "@/components/Select/SelectLoadMore";
|
||||||
import {fetchAvailableDomainList} from "../../api/domain";
|
|
||||||
|
|
||||||
const calendarTypeOptions = [
|
|
||||||
{ key: 'CN', display_name: 'China' },
|
|
||||||
{ key: 'US', display_name: 'USA' },
|
|
||||||
{ key: 'JP', display_name: 'Japan' },
|
|
||||||
{ key: 'EU', display_name: 'Eurozone' }
|
|
||||||
]
|
|
||||||
|
|
||||||
// arr to obj ,such as { CN : "China", US : "USA" }
|
|
||||||
const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
|
|
||||||
acc[cur.key] = cur.display_name
|
|
||||||
return acc
|
|
||||||
}, {})
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'complexTable',
|
name: 'complexTable',
|
||||||
directives: {
|
directives: {
|
||||||
@@ -303,7 +243,6 @@ export default {
|
|||||||
listQuery: {
|
listQuery: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
importance: undefined,
|
|
||||||
title: undefined,
|
title: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
@@ -314,8 +253,6 @@ export default {
|
|||||||
description: undefined
|
description: undefined
|
||||||
|
|
||||||
},
|
},
|
||||||
importanceOptions: [1, 2, 3],
|
|
||||||
calendarTypeOptions,
|
|
||||||
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
||||||
statusOptions: ['published', 'draft', 'deleted'],
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
userList: [],
|
userList: [],
|
||||||
@@ -323,7 +260,7 @@ export default {
|
|||||||
protocalList: [],
|
protocalList: [],
|
||||||
licenseAuthList: [],
|
licenseAuthList: [],
|
||||||
serverPortList: [],
|
serverPortList: [],
|
||||||
domainList: [{ 'name': 'link.com', 'id': '1' }],
|
domainName: '',
|
||||||
showReviewer: false,
|
showReviewer: false,
|
||||||
temp: {
|
temp: {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@@ -334,8 +271,7 @@ export default {
|
|||||||
clientPort: undefined,
|
clientPort: undefined,
|
||||||
protocal: undefined,
|
protocal: undefined,
|
||||||
proxyResponses: undefined,
|
proxyResponses: undefined,
|
||||||
proxyTimeoutMs: undefined,
|
proxyTimeoutMs: undefined
|
||||||
domainMappings: []
|
|
||||||
},
|
},
|
||||||
selectObj: {
|
selectObj: {
|
||||||
statusOptions: [{ label: '启用', value: 1 }, { label: '禁用', value: 2 }],
|
statusOptions: [{ label: '启用', value: 1 }, { label: '禁用', value: 2 }],
|
||||||
@@ -350,33 +286,14 @@ export default {
|
|||||||
dialogPvVisible: false,
|
dialogPvVisible: false,
|
||||||
pvData: [],
|
pvData: [],
|
||||||
rules: {
|
rules: {
|
||||||
domainMappings: [
|
|
||||||
{
|
|
||||||
validator: (rule, value, callback) => {
|
|
||||||
if (value && value.length > 0) {
|
|
||||||
for (let i = 0; i < value.length; i++) {
|
|
||||||
if (!value[i].subdomain || !value[i].domainId) {
|
|
||||||
return callback(new Error(`子域名和主域名都不能为空`))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const set = new Set()
|
|
||||||
value.forEach(i => {
|
|
||||||
const row = this.domainList.find(d => d.id === i.domainId)
|
|
||||||
set.add(i.subdomain + '.' + row.domain)
|
|
||||||
})
|
|
||||||
if (set.size !== value.length) return callback(new Error(`域名不能重复`))
|
|
||||||
}
|
|
||||||
callback() // 验证通过
|
|
||||||
},
|
|
||||||
trigger: ''
|
|
||||||
}
|
|
||||||
],
|
|
||||||
licenseId: [{ required: true, message: '请选择License', trigger: 'blur,change' }],
|
licenseId: [{ required: true, message: '请选择License', trigger: 'blur,change' }],
|
||||||
serverPort: [{ required: true, message: '请输入服务端端口', trigger: 'blur' },
|
serverPort: [{ required: true, message: '请输入服务端端口', trigger: 'blur' },
|
||||||
// { validator: isPortAvailable, trigger: 'change' }
|
// { validator: isPortAvailable, trigger: 'change' }
|
||||||
],
|
],
|
||||||
clientIp: [{ required: true, message: '请输入客户端IP', trigger: 'blur' }],
|
clientIp: [{ required: true, message: '请输入客户端IP', trigger: 'blur' }],
|
||||||
clientPort: [{ required: true, message: '请输入客户端端口', trigger: 'blur' }],
|
clientPort: [{ required: true, message: '请输入客户端端口', trigger: 'blur' },
|
||||||
|
{ pattern: /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,message: '端口号请选择0-65535间的数字',trigger: 'blur'}
|
||||||
|
],
|
||||||
protocal: [{ required: true, message: '请选择协议', trigger: 'blur' }]
|
protocal: [{ required: true, message: '请选择协议', trigger: 'blur' }]
|
||||||
},
|
},
|
||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
@@ -415,9 +332,6 @@ export default {
|
|||||||
}
|
}
|
||||||
return statusMap[status]
|
return statusMap[status]
|
||||||
},
|
},
|
||||||
typeFilter(type) {
|
|
||||||
return calendarTypeKeyValue[type]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
@@ -425,59 +339,12 @@ export default {
|
|||||||
this.getLicenseAuthList()
|
this.getLicenseAuthList()
|
||||||
this.getProtocalList()
|
this.getProtocalList()
|
||||||
this.fetchSecurityGroupList()
|
this.fetchSecurityGroupList()
|
||||||
this.getAvailableDomainList()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 添加新的域名映射
|
|
||||||
addDomainMapping() {
|
|
||||||
let defaultDomainId = this.domainList[0].id
|
|
||||||
this.domainList.forEach(item => {
|
|
||||||
if (item.isDefault === 1) {
|
|
||||||
defaultDomainId = item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.temp.domainMappings.push({
|
|
||||||
subdomain: undefined,
|
|
||||||
domain: undefined,
|
|
||||||
domainId: defaultDomainId
|
|
||||||
});
|
|
||||||
console.log(this.list)
|
|
||||||
},
|
|
||||||
// 删除指定的域名映射
|
|
||||||
removeDomainMapping(index) {
|
|
||||||
this.temp.domainMappings.splice(index, 1);
|
|
||||||
},
|
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true
|
this.listLoading = true
|
||||||
fetchList(this.listQuery).then(response => {
|
fetchList(this.listQuery).then(response => {
|
||||||
this.list = response.data.data.records.map(item => {
|
this.list = response.data.data.records
|
||||||
// 初始化 domainMappings 字段
|
|
||||||
item.domainMappings = [];
|
|
||||||
// 检查是否存在 subdomain 和 domain 字段
|
|
||||||
if (item.fullDomainMappings && Array.isArray(item.fullDomainMappings)) {
|
|
||||||
let allFullDomainList = []
|
|
||||||
for (const fullDomainMapping of item.fullDomainMappings) {
|
|
||||||
item.domainMappings.push({
|
|
||||||
id: fullDomainMapping.id || '',
|
|
||||||
subdomain: fullDomainMapping.subdomain || '', // 使用 || '' 保证字段非空
|
|
||||||
domainId: fullDomainMapping.domainNameId || '',
|
|
||||||
domain: fullDomainMapping.domain || ''
|
|
||||||
});
|
|
||||||
// 拼接完整的域名
|
|
||||||
let fullDomain = null;
|
|
||||||
if (fullDomainMapping.forceHttps == 1) {
|
|
||||||
fullDomain = `https://` + `${fullDomainMapping.subdomain}.${fullDomainMapping.domain}`;
|
|
||||||
} else {
|
|
||||||
fullDomain = `http://` + `${fullDomainMapping.subdomain}.${fullDomainMapping.domain}`;
|
|
||||||
}
|
|
||||||
// 将拼接后的域名添加到
|
|
||||||
allFullDomainList.push(fullDomain);
|
|
||||||
}
|
|
||||||
item.allFullDomainList = allFullDomainList
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
// console.log(this.list)
|
|
||||||
this.total = response.data.data.total
|
this.total = response.data.data.total
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
@@ -504,11 +371,6 @@ export default {
|
|||||||
this.loadServerPortQuery.licenseId = licenseId;
|
this.loadServerPortQuery.licenseId = licenseId;
|
||||||
this.serverPortList = []; //清掉数据
|
this.serverPortList = []; //清掉数据
|
||||||
},
|
},
|
||||||
getAvailableDomainList() {
|
|
||||||
fetchAvailableDomainList({}).then(response => {
|
|
||||||
this.domainList = response.data.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getAllUserList() {
|
getAllUserList() {
|
||||||
userList().then(response => {
|
userList().then(response => {
|
||||||
this.userList = response.data.data
|
this.userList = response.data.data
|
||||||
@@ -563,10 +425,9 @@ export default {
|
|||||||
clientPort: undefined,
|
clientPort: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
proxyResponses: undefined,
|
proxyResponses: undefined,
|
||||||
proxyTimeoutMs: undefined,
|
proxyTimeoutMs: undefined
|
||||||
domainMappings: []
|
}
|
||||||
};
|
this.serverPortList = []
|
||||||
this.serverPortList = [];
|
|
||||||
this.loadServerPortQuery.licenseId = null;
|
this.loadServerPortQuery.licenseId = null;
|
||||||
this.more = true;
|
this.more = true;
|
||||||
},
|
},
|
||||||
@@ -581,7 +442,6 @@ export default {
|
|||||||
createData() {
|
createData() {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// console.log(this.temp)
|
|
||||||
createUserPortMapping(this.temp).then(response => {
|
createUserPortMapping(this.temp).then(response => {
|
||||||
if (response.data.code === 0) {
|
if (response.data.code === 0) {
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
@@ -599,16 +459,13 @@ export default {
|
|||||||
},
|
},
|
||||||
handleOpenWebPage(row) {
|
handleOpenWebPage(row) {
|
||||||
let url = location.protocol + '//' + location.hostname + ':' + row.serverPort
|
let url = location.protocol + '//' + location.hostname + ':' + row.serverPort
|
||||||
if (row.allFullDomainList && row.allFullDomainList.length > 0) {
|
if (row.domain) {
|
||||||
url = row.allFullDomainList[0]
|
url = location.protocol + '//' + row.domain
|
||||||
}
|
}
|
||||||
open(url)
|
open(url)
|
||||||
},
|
},
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.resetTemp()
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
console.log(this.temp)
|
|
||||||
this.temp = JSON.parse(JSON.stringify(row))
|
|
||||||
console.log(this.temp)
|
|
||||||
if (row.securityGroupId === 0) {
|
if (row.securityGroupId === 0) {
|
||||||
this.temp.securityGroupId = null
|
this.temp.securityGroupId = null
|
||||||
}
|
}
|
||||||
@@ -670,29 +527,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}).catch(() => { })
|
}).catch(() => { })
|
||||||
},
|
},
|
||||||
handleDelete2(row) {
|
|
||||||
deletePortMapping(row.id).then(response => {
|
|
||||||
if (response.data.code === 0) {
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDownload() {
|
|
||||||
this.downloadLoading = true
|
|
||||||
import('@/vendor/Export2Excel').then(excel => {
|
|
||||||
const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
|
|
||||||
const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
|
|
||||||
const data = this.formatJson(filterVal, this.list)
|
|
||||||
excel.export_json_to_excel(tHeader, data, 'table-list')
|
|
||||||
this.downloadLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formatJson(filterVal, jsonData) {
|
formatJson(filterVal, jsonData) {
|
||||||
return jsonData.map(v => filterVal.map(j => {
|
return jsonData.map(v => filterVal.map(j => {
|
||||||
if (j === 'timestamp') {
|
if (j === 'timestamp') {
|
||||||
@@ -735,42 +569,3 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.my-tag {
|
|
||||||
width: 570px;
|
|
||||||
&_item {
|
|
||||||
height: 36px;
|
|
||||||
line-height: 35px;
|
|
||||||
padding: 0 7px;
|
|
||||||
.my-input, .my-select {
|
|
||||||
width: auto;
|
|
||||||
/deep/ input {
|
|
||||||
height: 32px;
|
|
||||||
line-height: 32px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.my-input {
|
|
||||||
/deep/ input {
|
|
||||||
width: 120px;
|
|
||||||
padding: 0 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.my-select {
|
|
||||||
/deep/ input {
|
|
||||||
width: 110px;
|
|
||||||
border-width: 0!important;
|
|
||||||
background: #ecf5ff!important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:first-child {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
& + & {
|
|
||||||
margin-right: 8px;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -63,7 +63,8 @@
|
|||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||||
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="70px" style='width: 400px; margin-left:50px;'>
|
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="70px" style='width: 400px; margin-left:50px;'>
|
||||||
<el-form-item :label="$t('table.port')" prop="port">
|
<el-form-item :label="$t('table.port')" prop="port">
|
||||||
<el-input :placeholder="$t('table.portOrRange')" v-model="temp.port" :disabled="dialogStatus=='update'"></el-input>
|
<!-- <el-input :placeholder="$t('table.portOrRange')" v-model="temp.port" :disabled="dialogStatus=='update'"></el-input> -->
|
||||||
|
<el-input :placeholder="$t('table.portOrRange')" type="number" v-model="temp.port" :step="1" controls-position="right" :disabled="dialogStatus=='update'"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item :label="$t('table.group')" prop="group">
|
<el-form-item :label="$t('table.group')" prop="group">
|
||||||
@@ -158,7 +159,10 @@ const calendarTypeOptions = [
|
|||||||
dialogPvVisible: false,
|
dialogPvVisible: false,
|
||||||
pvData: [],
|
pvData: [],
|
||||||
rules: {
|
rules: {
|
||||||
port: [{ required: true, message: '端口必填', trigger: 'blur' }]
|
port: [
|
||||||
|
{ required: true, message: '端口必填', trigger: 'blur' },
|
||||||
|
{ pattern: /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,message: '端口号请选择0-65535间的数字',trigger: 'blur'}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
checkBoxData:[], //表单勾选的行
|
checkBoxData:[], //表单勾选的行
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public class ProxyClient {
|
|||||||
setAlias("neutrino.proxy.tunnel.jks-path", "jksPath");
|
setAlias("neutrino.proxy.tunnel.jks-path", "jksPath");
|
||||||
setAlias("neutrino.proxy.tunnel.key-store-password", "keyStorePassword");
|
setAlias("neutrino.proxy.tunnel.key-store-password", "keyStorePassword");
|
||||||
setAlias("neutrino.proxy.tunnel.license-key", "licenseKey");
|
setAlias("neutrino.proxy.tunnel.license-key", "licenseKey");
|
||||||
|
|
||||||
|
log.info("NeutrinoProxy Client :{}", app.cfg().get("solon.app.version"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.client.config;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.noear.solon.Solon;
|
|
||||||
import org.noear.solon.annotation.Component;
|
|
||||||
import org.noear.solon.core.event.AppLoadEndEvent;
|
|
||||||
import org.noear.solon.core.event.EventListener;
|
|
||||||
import org.noear.solon.core.runtime.NativeDetector;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动成功后信息输出
|
|
||||||
* @author: aoshiguchen
|
|
||||||
* @date: 2024/10/16
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class AppLoadEndExecutor implements EventListener<AppLoadEndEvent> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
|
||||||
// aot 阶段,不执行
|
|
||||||
if (NativeDetector.isAotRuntime()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
System.out.printf("""
|
|
||||||
---------------------------------------------------------------
|
|
||||||
Neutrino Proxy Client %s
|
|
||||||
Gitee: https://gitee.com/dromara/neutrino-proxy
|
|
||||||
GitHub: https://github.com/dromara/neutrino-proxy
|
|
||||||
GitCode: https://gitcode.com/dromara/neutrino-proxy
|
|
||||||
---------------------------------------------------------------
|
|
||||||
%n""", Solon.app().cfg().get("solon.app.version"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -43,7 +43,6 @@ public class CmdChannelHandler extends SimpleChannelInboundHandler<ProxyMessage>
|
|||||||
if (realServerChannel != null) {
|
if (realServerChannel != null) {
|
||||||
realServerChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
|
realServerChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
|
||||||
}
|
}
|
||||||
|
|
||||||
super.channelWritabilityChanged(ctx);
|
super.channelWritabilityChanged(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -45,11 +67,18 @@ public class RealServerChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通道激活时触发,当客户端connect成功后,服务端就会接收到这个事件,从而可以把客户端的Channel记录下来,供后面复用
|
||||||
|
* @param ctx
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
super.channelActive(ctx);
|
super.channelActive(ctx);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 客户端 失去连接
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
Channel realServerChannel = ctx.channel();
|
Channel realServerChannel = ctx.channel();
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
|||||||
final Channel cmdChannel = ctx.channel();
|
final Channel cmdChannel = ctx.channel();
|
||||||
final String visitorId = proxyMessage.getInfo();
|
final String visitorId = proxyMessage.getInfo();
|
||||||
String[] serverInfo = new String(proxyMessage.getData()).split(":");
|
String[] serverInfo = new String(proxyMessage.getData()).split(":");
|
||||||
String ip = serverInfo[0];
|
// @todo 在这里 处理负载均恒
|
||||||
|
String ip = serverInfo[0];
|
||||||
int port = Integer.parseInt(serverInfo[1]);
|
int port = Integer.parseInt(serverInfo[1]);
|
||||||
// 连接真实的、被代理的服务
|
// 连接真实的、被代理的服务
|
||||||
realServerBootstrap.connect(ip, port).addListener(new ChannelFutureListener() {
|
realServerBootstrap.connect(ip, port).addListener(new ChannelFutureListener() {
|
||||||
@@ -44,7 +45,6 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
|||||||
// 连接后端服务器成功
|
// 连接后端服务器成功
|
||||||
if (future.isSuccess()) {
|
if (future.isSuccess()) {
|
||||||
final Channel realServerChannel = future.channel();
|
final Channel realServerChannel = future.channel();
|
||||||
|
|
||||||
realServerChannel.config().setOption(ChannelOption.AUTO_READ, false);
|
realServerChannel.config().setOption(ChannelOption.AUTO_READ, false);
|
||||||
|
|
||||||
// 获取连接
|
// 获取连接
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.client.util;
|
package org.dromara.neutrinoproxy.client.util;
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandler;
|
import io.netty.channel.ChannelHandler;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ solon:
|
|||||||
add: ./app.yml
|
add: ./app.yml
|
||||||
app:
|
app:
|
||||||
name: neutrino-proxy-client
|
name: neutrino-proxy-client
|
||||||
version: 2.0.2
|
version: 2.0.1
|
||||||
# 日志级别
|
# 日志级别
|
||||||
solon.logging.appender:
|
solon.logging.appender:
|
||||||
console:
|
console:
|
||||||
@@ -44,7 +44,7 @@ neutrino:
|
|||||||
# 是否启用SSL(注意:该配置必须和server-port对应上)
|
# 是否启用SSL(注意:该配置必须和server-port对应上)
|
||||||
ssl-enable: ${SSL_ENABLE:true}
|
ssl-enable: ${SSL_ENABLE:true}
|
||||||
# 客户端连接唯一凭证
|
# 客户端连接唯一凭证
|
||||||
license-key: ${LICENSE_KEY:}
|
license-key: ${LICENSE_KEY:ce554b47de80495b9d1996cd62084973}
|
||||||
# 客户端唯一身份标识(可忽略,若不设置首次启动会自动生成)
|
# 客户端唯一身份标识(可忽略,若不设置首次启动会自动生成)
|
||||||
client-id: ${CLIENT_ID:}
|
client-id: ${CLIENT_ID:}
|
||||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
@@ -28,6 +50,9 @@ public interface Constants {
|
|||||||
AttributeKey<InetSocketAddress> SENDER = AttributeKey.newInstance("sender");
|
AttributeKey<InetSocketAddress> SENDER = AttributeKey.newInstance("sender");
|
||||||
|
|
||||||
AttributeKey<Integer> SERVER_PORT = AttributeKey.newInstance("serverPort");
|
AttributeKey<Integer> SERVER_PORT = AttributeKey.newInstance("serverPort");
|
||||||
|
|
||||||
|
AttributeKey<String> DOMAIN = AttributeKey.newInstance("domain");
|
||||||
|
|
||||||
AttributeKey<String> REAL_REMOTE_IP = AttributeKey.newInstance("realRemoteIp");
|
AttributeKey<String> REAL_REMOTE_IP = AttributeKey.newInstance("realRemoteIp");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.base;
|
package org.dromara.neutrinoproxy.core.base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.base;
|
package org.dromara.neutrinoproxy.core.base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.dispatcher;
|
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.dispatcher;
|
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.dispatcher;
|
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.type;
|
package org.dromara.neutrinoproxy.core.type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class ProxyServer {
|
|||||||
if (Utils.isNotEmpty(loglevel)) {
|
if (Utils.isNotEmpty(loglevel)) {
|
||||||
app.cfg().put("solon.logging.logger.root.level", loglevel);
|
app.cfg().put("solon.logging.logger.root.level", loglevel);
|
||||||
}
|
}
|
||||||
|
log.info("NeutrinoProxy Server :{}", app.cfg().get("solon.app.version"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.base;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.noear.solon.Solon;
|
|
||||||
import org.noear.solon.annotation.Component;
|
|
||||||
import org.noear.solon.core.event.AppLoadEndEvent;
|
|
||||||
import org.noear.solon.core.event.EventListener;
|
|
||||||
import org.noear.solon.core.runtime.NativeDetector;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启动成功后信息输出
|
|
||||||
* @author: aoshiguchen
|
|
||||||
* @date: 2024/10/16
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class AppLoadEndExecutor implements EventListener<AppLoadEndEvent> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
|
||||||
// aot 阶段,不执行
|
|
||||||
if (NativeDetector.isAotRuntime()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
System.out.printf("""
|
|
||||||
---------------------------------------------------------------
|
|
||||||
Neutrino Proxy Server %s
|
|
||||||
admin: http://localhost:8888
|
|
||||||
account: admin/123456
|
|
||||||
Gitee: https://gitee.com/dromara/neutrino-proxy
|
|
||||||
GitHub: https://github.com/dromara/neutrino-proxy
|
|
||||||
GitCode: https://gitcode.com/dromara/neutrino-proxy
|
|
||||||
---------------------------------------------------------------
|
|
||||||
%n""", Solon.app().cfg().get("solon.app.version"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -3,11 +3,8 @@ package org.dromara.neutrinoproxy.server.base;
|
|||||||
import org.apache.ibatis.type.SimpleTypeRegistry;
|
import org.apache.ibatis.type.SimpleTypeRegistry;
|
||||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.server.base.rest.ResponseBody;
|
import org.dromara.neutrinoproxy.server.base.rest.ResponseBody;
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingCreateReq;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingUpdateReq;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.report.HomeDataView;
|
import org.dromara.neutrinoproxy.server.controller.res.report.HomeDataView;
|
||||||
import org.dromara.neutrinoproxy.server.dal.*;
|
import org.dromara.neutrinoproxy.server.dal.*;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.enhance.SslContextManager;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.*;
|
import org.dromara.neutrinoproxy.server.service.*;
|
||||||
import org.dromara.solonplugins.job.JobBean;
|
import org.dromara.solonplugins.job.JobBean;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
@@ -41,8 +38,7 @@ public class NeutrinoServerRuntimeNativeRegistrar implements RuntimeNativeRegist
|
|||||||
metadata.registerLambdaSerialization(UserLoginRecordService.class);
|
metadata.registerLambdaSerialization(UserLoginRecordService.class);
|
||||||
metadata.registerLambdaSerialization(UserService.class);
|
metadata.registerLambdaSerialization(UserService.class);
|
||||||
metadata.registerLambdaSerialization(SecurityGroupService.class);
|
metadata.registerLambdaSerialization(SecurityGroupService.class);
|
||||||
metadata.registerLambdaSerialization(DomainService.class);
|
|
||||||
metadata.registerLambdaSerialization(SslContextManager.class);
|
|
||||||
|
|
||||||
metadata.registerLambdaSerialization(LicenseMapper.class);
|
metadata.registerLambdaSerialization(LicenseMapper.class);
|
||||||
metadata.registerLambdaSerialization(ClientConnectRecordMapper.class);
|
metadata.registerLambdaSerialization(ClientConnectRecordMapper.class);
|
||||||
@@ -61,11 +57,7 @@ public class NeutrinoServerRuntimeNativeRegistrar implements RuntimeNativeRegist
|
|||||||
metadata.registerLambdaSerialization(UserTokenMapper.class);
|
metadata.registerLambdaSerialization(UserTokenMapper.class);
|
||||||
metadata.registerLambdaSerialization(SecurityGroupMapper.class);
|
metadata.registerLambdaSerialization(SecurityGroupMapper.class);
|
||||||
metadata.registerLambdaSerialization(SecurityRuleMapper.class);
|
metadata.registerLambdaSerialization(SecurityRuleMapper.class);
|
||||||
metadata.registerLambdaSerialization(DomainMapper.class);
|
|
||||||
metadata.registerLambdaSerialization(DomainPortMappingMapper.class);
|
|
||||||
|
|
||||||
metadata.registerReflection(PortMappingUpdateReq.DomainMapping.class, MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS);
|
|
||||||
metadata.registerReflection(PortMappingCreateReq.DomainMapping.class, MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS);
|
|
||||||
|
|
||||||
metadata.registerReflection(HomeDataView.class, MemberCategory.DECLARED_FIELDS);
|
metadata.registerReflection(HomeDataView.class, MemberCategory.DECLARED_FIELDS);
|
||||||
metadata.registerReflection(HomeDataView.Last7dFlow.class, MemberCategory.DECLARED_FIELDS);
|
metadata.registerReflection(HomeDataView.Last7dFlow.class, MemberCategory.DECLARED_FIELDS);
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.db;
|
package org.dromara.neutrinoproxy.server.base.db;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
@@ -88,7 +109,6 @@ public class DBInitialize implements EventListener<AppLoadEndEvent> {
|
|||||||
}
|
}
|
||||||
for (String tableName : initDataTableNameList) {
|
for (String tableName : initDataTableNameList) {
|
||||||
// 表里没有数据的时候,才进行初始化操作
|
// 表里没有数据的时候,才进行初始化操作
|
||||||
|
|
||||||
Object result = dbContext.exe(String.format("select count(1) from `%s`", tableName));
|
Object result = dbContext.exe(String.format("select count(1) from `%s`", tableName));
|
||||||
if (result != null && ((Number) result).intValue() > 0) {
|
if (result != null && ((Number) result).intValue() > 0) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.db;
|
package org.dromara.neutrinoproxy.server.base.db;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
|||||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.rest.*;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.core.handle.Action;
|
import org.noear.solon.core.handle.Action;
|
||||||
@@ -15,6 +16,7 @@ import org.noear.solon.core.handle.Context;
|
|||||||
import org.noear.solon.core.handle.Handler;
|
import org.noear.solon.core.handle.Handler;
|
||||||
import org.noear.solon.core.route.RouterInterceptor;
|
import org.noear.solon.core.route.RouterInterceptor;
|
||||||
import org.noear.solon.core.route.RouterInterceptorChain;
|
import org.noear.solon.core.route.RouterInterceptorChain;
|
||||||
|
import org.noear.solon.validation.ValidatorException;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -80,8 +82,12 @@ public class BaseAuthInterceptor implements RouterInterceptor {
|
|||||||
return new ResponseBody<>()
|
return new ResponseBody<>()
|
||||||
.setCode(exception.getCode())
|
.setCode(exception.getCode())
|
||||||
.setMsg(exception.getMsg());
|
.setMsg(exception.getMsg());
|
||||||
|
} else if (result instanceof ValidatorException) {
|
||||||
|
return new ResponseBody<>()
|
||||||
|
.setCode(ExceptionConstant.DONAME_PATTEN_ERROR.getCode())
|
||||||
|
.setMsg(ExceptionConstant.DONAME_PATTEN_ERROR.getMsg())
|
||||||
|
.setStack(ExceptionUtils.getStackTrace((Throwable) result));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ResponseBody<>()
|
return new ResponseBody<>()
|
||||||
.setCode(ExceptionConstant.SYSTEM_ERROR.getCode())
|
.setCode(ExceptionConstant.SYSTEM_ERROR.getCode())
|
||||||
.setMsg(ExceptionConstant.SYSTEM_ERROR.getMsg())
|
.setMsg(ExceptionConstant.SYSTEM_ERROR.getMsg())
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.noear.solon.annotation.Component;
|
|||||||
import org.noear.solon.core.handle.Context;
|
import org.noear.solon.core.handle.Context;
|
||||||
import org.noear.solon.core.handle.Filter;
|
import org.noear.solon.core.handle.Filter;
|
||||||
import org.noear.solon.core.handle.FilterChain;
|
import org.noear.solon.core.handle.FilterChain;
|
||||||
|
import org.noear.solon.validation.ValidatorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -22,9 +23,13 @@ public class GlobalExceptionFilter implements Filter {
|
|||||||
public void doFilter(Context ctx, FilterChain chain) throws Throwable {
|
public void doFilter(Context ctx, FilterChain chain) throws Throwable {
|
||||||
try {
|
try {
|
||||||
chain.doFilter(ctx);
|
chain.doFilter(ctx);
|
||||||
} catch (Throwable e) {
|
} catch(ValidatorException ve){
|
||||||
|
ctx.render(new ResponseBody<>()
|
||||||
|
.setCode(ExceptionConstant.DONAME_PATTEN_ERROR.getCode())
|
||||||
|
.setMsg(ExceptionConstant.DONAME_PATTEN_ERROR.getMsg())
|
||||||
|
.setStack(ExceptionUtils.getStackTrace(ve)));
|
||||||
|
} catch(Throwable e) {
|
||||||
log.error("global error", e);
|
log.error("global error", e);
|
||||||
|
|
||||||
if (e instanceof ServiceException) {
|
if (e instanceof ServiceException) {
|
||||||
ServiceException serviceException = (ServiceException) e;
|
ServiceException serviceException = (ServiceException) e;
|
||||||
ctx.render(new ResponseBody<>()
|
ctx.render(new ResponseBody<>()
|
||||||
@@ -32,7 +37,6 @@ public class GlobalExceptionFilter implements Filter {
|
|||||||
.setMsg(serviceException.getMsg()));
|
.setMsg(serviceException.getMsg()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.render(new ResponseBody<>()
|
ctx.render(new ResponseBody<>()
|
||||||
.setCode(ExceptionConstant.SYSTEM_ERROR.getCode())
|
.setCode(ExceptionConstant.SYSTEM_ERROR.getCode())
|
||||||
.setMsg(ExceptionConstant.SYSTEM_ERROR.getMsg())
|
.setMsg(ExceptionConstant.SYSTEM_ERROR.getMsg())
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.constant;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认域名状态枚举
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum DefaultDomainStatusEnum {
|
|
||||||
ENABLE(1, "默认域名"),
|
|
||||||
DISABLE(2, "关闭");
|
|
||||||
|
|
||||||
private Integer status;
|
|
||||||
private String desc;
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -38,6 +59,11 @@ public enum ExceptionConstant {
|
|||||||
PORT_MAPPING_NOT_EXIST(14000, "端口映射记录不存在"),
|
PORT_MAPPING_NOT_EXIST(14000, "端口映射记录不存在"),
|
||||||
PORT_CANNOT_REPEAT_MAPPING(14001, "服务端口[{}]不能重复映射"),
|
PORT_CANNOT_REPEAT_MAPPING(14001, "服务端口[{}]不能重复映射"),
|
||||||
AN_UNSUPPORTED_PROTOCOL(14002, "不支持的协议[{}]!"),
|
AN_UNSUPPORTED_PROTOCOL(14002, "不支持的协议[{}]!"),
|
||||||
|
PORT_MAPPING_SUBDONAME_CONNOT_REPEAT(14003, "子域名不能重复使用!"),
|
||||||
|
|
||||||
|
DONAME_CONNOT_REPEAT(14004, "域名不能重复解析!"),
|
||||||
|
|
||||||
|
DONAME_PATTEN_ERROR(14005, "域名格式不正确!"),
|
||||||
// 调度管理(15000)
|
// 调度管理(15000)
|
||||||
JOB_INFO_NOT_EXIST(15000, "调度管理记录不存在"),
|
JOB_INFO_NOT_EXIST(15000, "调度管理记录不存在"),
|
||||||
SYSTEM_ERROR(500, "系统异常"),
|
SYSTEM_ERROR(500, "系统异常"),
|
||||||
@@ -49,12 +75,7 @@ public enum ExceptionConstant {
|
|||||||
// 安全组管理(17000)
|
// 安全组管理(17000)
|
||||||
SECURITY_GROUP_NOT_EXIST(17000, "安全组不存在"),
|
SECURITY_GROUP_NOT_EXIST(17000, "安全组不存在"),
|
||||||
SECURITY_RULE_NOT_EXIST(17001, "安全规则不存在"),
|
SECURITY_RULE_NOT_EXIST(17001, "安全规则不存在"),
|
||||||
// 域名映射管理(18000)
|
|
||||||
DOMAIN_NAME_CANNOT_REPEAT(18000, "域名不能重复"),
|
|
||||||
DOMAIN_NAME_NOT_EXIST(18001, "域名不存在"),
|
|
||||||
DOMAIN_NAME_IS_DISABLE(18002, "当前域名[{}]被禁用"),
|
|
||||||
SUDOMAIN_NAME_CANNOT_REPEAT(18003, "子域名不能重复"),
|
|
||||||
DOMAIN_NAME_IS_USED(18002, "当前域名正在使用"),
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.constant;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仅Https状态枚举
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum HttpsStatusEnum {
|
|
||||||
ONLY_HTTPS(1, "仅HTTPS"),
|
|
||||||
DISABLE_ONLY_HTTPS(2, "关闭仅HTTPS");
|
|
||||||
private static Map<Integer, HttpsStatusEnum> CACHE = Stream.of(HttpsStatusEnum.values()).collect(Collectors.toMap(HttpsStatusEnum::getStatus, Function.identity()));
|
|
||||||
|
|
||||||
private Integer status;
|
|
||||||
private String desc;
|
|
||||||
|
|
||||||
public static HttpsStatusEnum of(Integer status) {
|
|
||||||
return CACHE.get(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.constant;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仅Https状态枚举
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum SslStatusEnum {
|
|
||||||
UPLOADED(1, "已上传"),
|
|
||||||
NOT_UPLOADED(2, "未上传"),
|
|
||||||
CERTIFIED(3, "已认证");//预留,用于证书验证
|
|
||||||
|
|
||||||
private Integer status;
|
|
||||||
private String desc;
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,91 +1,105 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.*;
|
import org.dromara.neutrinoproxy.server.controller.req.proxy.*;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainListRes;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainUpdateDefaultStatusRes;
|
import org.dromara.neutrinoproxy.server.dal.entity.DomainMappingDO;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainUpdateEnableStatusRes;
|
import org.dromara.neutrinoproxy.server.service.DomainMappingService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||||
import org.noear.solon.annotation.*;
|
import org.noear.solon.annotation.*;
|
||||||
import org.dromara.neutrinoproxy.server.service.DomainService;
|
import org.noear.solon.validation.annotation.NotBlank;
|
||||||
import org.noear.solon.core.handle.Context;
|
import org.noear.solon.validation.annotation.Valid;
|
||||||
import org.noear.solon.core.handle.UploadedFile;
|
import org.noear.solon.validation.annotation.Validated;
|
||||||
import org.noear.solon.lang.Nullable;
|
|
||||||
|
|
||||||
import javax.sound.midi.Soundbank;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mirac
|
* @author: aoshiguchen
|
||||||
* @date 21/7/2024
|
* @date: 2023/4/2
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Valid
|
||||||
@Mapping("/domain")
|
@Mapping("/domain")
|
||||||
@Controller
|
@Controller
|
||||||
public class DomainController {
|
public class DomainController {
|
||||||
@Inject
|
@Inject
|
||||||
private DomainService domainService;
|
private ProxyConfig proxyConfig;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private DomainMappingService domainMappingService;
|
||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public PageInfo<DomainListRes> page(PageQuery pageQuery, DomainListReq req) {
|
public PageInfo<DomainMappingDto> page(PageQuery pageQuery, DomainMappingDto req) {
|
||||||
return domainService.page(pageQuery, req);
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
return domainMappingService.page(pageQuery, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post
|
||||||
|
@Mapping("/modify")
|
||||||
|
public PortMappingCreateRes modify(@Validated DomainMappingDO req) {
|
||||||
|
if (StringUtils.isBlank(req.getTargetPath())) {// targetPath,默认为127.0.0.1
|
||||||
|
req.setTargetPath("127.0.0.1");
|
||||||
|
}
|
||||||
|
req.setProtocal(NetworkProtocolEnum.HTTP.getDesc());
|
||||||
|
if (null == req.getSecurityGroupId()) {
|
||||||
|
req.setSecurityGroupId(0);
|
||||||
|
}
|
||||||
|
return domainMappingService.modify(req);
|
||||||
|
}
|
||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/all")
|
@Mapping("/one/{id}")
|
||||||
public List<DomainListRes> all(DomainListReq req) {
|
public DomainMappingDto one(Integer id) {
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
return domainMappingService.one(id);
|
||||||
return domainService.all(req);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post
|
@Post
|
||||||
@Mapping(path = "/create")
|
@Mapping("/update/enable-status")
|
||||||
@Authorization(onlyAdmin = true)
|
public PortMappingUpdateEnableStatusRes updateEnableStatus(PortMappingUpdateEnableStatusReq req) {
|
||||||
public void create(DomainCreateReq req, UploadedFile jks) throws IOException {
|
return domainMappingService.updateEnableStatus(req);
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
|
||||||
ParamCheckUtil.checkNotEmpty(req.getDomain(), "domain");
|
|
||||||
domainService.create(req, jks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get
|
||||||
|
@Mapping("/delete/{id}")
|
||||||
|
public void delete(Integer id) {
|
||||||
|
domainMappingService.delete(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定安全组
|
||||||
|
* @param req portMappingId和securityGroupId
|
||||||
|
*/
|
||||||
@Post
|
@Post
|
||||||
@Mapping(path = "/update")
|
@Mapping("/bind/security-group")
|
||||||
@Authorization(onlyAdmin = true)
|
public void bindSecurityGroup(PortMappingBindSecurityGroupReq req) {
|
||||||
public void update(DomainUpdateReq req, UploadedFile jks) throws IOException {
|
domainMappingService.domainBindSecurityGroup(req.getId(), req.getSecurityGroupId());
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
|
||||||
ParamCheckUtil.checkNotEmpty(req.getDomain(), "domain");
|
|
||||||
domainService.update(req, jks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全组解绑
|
||||||
|
* @param id 端口映射Id
|
||||||
|
*/
|
||||||
@Post
|
@Post
|
||||||
@Mapping(path = "/update/enable-status")
|
@Mapping("/unbind/security-group")
|
||||||
@Authorization(onlyAdmin = true)
|
public void unbindSecurityGroup(Integer id) {
|
||||||
public DomainUpdateEnableStatusRes updateEnableStatus(DomainUpdateEnableStatusReq req){
|
domainMappingService.domainUnbindSecurityGroup(id);
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getId(), "id");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getEnable(), "enable");
|
|
||||||
return domainService.updateEnableStatus(req);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post
|
|
||||||
@Mapping(path = "/delete")
|
|
||||||
@Authorization(onlyAdmin = true)
|
|
||||||
public void delete(DomainDeleteReq req) {
|
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getId(), "id");
|
|
||||||
|
|
||||||
domainService.delete(req.getId());
|
|
||||||
|
/**
|
||||||
|
* 绑定安全组
|
||||||
|
* @param domain
|
||||||
|
*/
|
||||||
|
@Get
|
||||||
|
@Mapping("/available")
|
||||||
|
public boolean exitDomain(@NotBlank String domain, Integer id) {
|
||||||
|
return domainMappingService.exitDomain(domain, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post
|
|
||||||
@Mapping(path = "/update/default-status")
|
|
||||||
@Authorization(onlyAdmin = true)
|
|
||||||
public DomainUpdateDefaultStatusRes updateDefaultStatus(DomainUpdateDefaultStatusReq req){
|
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getId(), "id");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getIsDefault(), "isDefault");
|
|
||||||
return domainService.updateDefaultStatus(req.getId(), req.getIsDefault());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
@@ -10,6 +31,8 @@ import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
|||||||
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||||
import org.noear.solon.annotation.*;
|
import org.noear.solon.annotation.*;
|
||||||
|
import org.noear.solon.validation.annotation.Valid;
|
||||||
|
import org.noear.solon.validation.annotation.Validated;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -18,6 +41,8 @@ import java.util.List;
|
|||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/8/6
|
* @date: 2022/8/6
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Valid
|
||||||
@Mapping("/license")
|
@Mapping("/license")
|
||||||
@Controller
|
@Controller
|
||||||
public class LicenseController {
|
public class LicenseController {
|
||||||
@@ -80,18 +105,14 @@ public class LicenseController {
|
|||||||
@Post
|
@Post
|
||||||
@Mapping("/update/enable-status")
|
@Mapping("/update/enable-status")
|
||||||
@Authorization(onlyAdmin = true)
|
@Authorization(onlyAdmin = true)
|
||||||
public LicenseUpdateEnableStatusRes updateEnableStatus(LicenseUpdateEnableStatusReq req) {
|
public LicenseUpdateEnableStatusRes updateEnableStatus(@Validated LicenseUpdateEnableStatusReq req) {
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getId(), "id");
|
|
||||||
ParamCheckUtil.checkNotNull(req.getEnable(), "enable");
|
|
||||||
|
|
||||||
return licenseService.updateEnableStatus(req);
|
return licenseService.updateEnableStatus(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post
|
@Post
|
||||||
@Mapping("/delete")
|
@Mapping("/delete")
|
||||||
@Authorization(onlyAdmin = true)
|
@Authorization(onlyAdmin = true)
|
||||||
public void delete(LicenseDeleteReq req) {
|
public void delete(@Validated LicenseDeleteReq req) {
|
||||||
ParamCheckUtil.checkNotNull(req, "req");
|
ParamCheckUtil.checkNotNull(req, "req");
|
||||||
ParamCheckUtil.checkNotNull(req.getId(), "id");
|
ParamCheckUtil.checkNotNull(req.getId(), "id");
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class PortMappingController {
|
|||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public PageInfo<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
public PageInfo<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return portMappingService.page(pageQuery, req);
|
return portMappingService.page(pageQuery, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,10 +51,7 @@ public class PortMappingController {
|
|||||||
}
|
}
|
||||||
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
||||||
ParamCheckUtil.checkNotNull(networkProtocolEnum, ExceptionConstant.AN_UNSUPPORTED_PROTOCOL, req.getProtocal());
|
ParamCheckUtil.checkNotNull(networkProtocolEnum, ExceptionConstant.AN_UNSUPPORTED_PROTOCOL, req.getProtocal());
|
||||||
if (networkProtocolEnum != NetworkProtocolEnum.HTTP) {
|
|
||||||
// 目前仅HTTP支持绑定域名
|
|
||||||
req.setDomainMappings(null);
|
|
||||||
}
|
|
||||||
req.setProtocal(networkProtocolEnum.getDesc());
|
req.setProtocal(networkProtocolEnum.getDesc());
|
||||||
if (null == req.getProxyResponses()) {
|
if (null == req.getProxyResponses()) {
|
||||||
req.setProxyResponses(0);
|
req.setProxyResponses(0);
|
||||||
@@ -85,10 +83,7 @@ public class PortMappingController {
|
|||||||
}
|
}
|
||||||
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
||||||
ParamCheckUtil.checkNotNull(networkProtocolEnum, ExceptionConstant.AN_UNSUPPORTED_PROTOCOL, req.getProtocal());
|
ParamCheckUtil.checkNotNull(networkProtocolEnum, ExceptionConstant.AN_UNSUPPORTED_PROTOCOL, req.getProtocal());
|
||||||
if (networkProtocolEnum != NetworkProtocolEnum.HTTP) {
|
|
||||||
// 目前仅HTTP支持绑定域名
|
|
||||||
req.setDomainMappings(null);
|
|
||||||
}
|
|
||||||
req.setProtocal(networkProtocolEnum.getDesc());
|
req.setProtocal(networkProtocolEnum.getDesc());
|
||||||
if (null == req.getProxyResponses()) {
|
if (null == req.getProxyResponses()) {
|
||||||
req.setProxyResponses(0);
|
req.setProxyResponses(0);
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
@@ -7,11 +28,13 @@ import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
|||||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||||
import org.dromara.neutrinoproxy.server.util.Md5Util;
|
import org.dromara.neutrinoproxy.server.util.Md5Util;
|
||||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||||
import org.noear.solon.annotation.*;
|
import org.noear.solon.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.log;
|
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.log;
|
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.log;
|
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DomainCreateReq {
|
|
||||||
/**
|
|
||||||
* 主域名
|
|
||||||
*/
|
|
||||||
private String domain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyStore密码
|
|
||||||
*/
|
|
||||||
private String keyStorePassword;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 强制Https
|
|
||||||
*/
|
|
||||||
private Integer forceHttps;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 23/7/2024
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DomainDeleteReq {
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DomainListReq {
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private Integer userId;
|
|
||||||
/**
|
|
||||||
* 启用状态
|
|
||||||
* {@link EnableStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer enable;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.DefaultDomainStatusEnum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 23/7/2024
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DomainUpdateDefaultStatusReq {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启用状态 {@link DefaultDomainStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer isDefault;
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 23/7/2024
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DomainUpdateEnableStatusReq {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启用状态
|
|
||||||
*/
|
|
||||||
private Integer enable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 域名
|
|
||||||
*/
|
|
||||||
private String domain;
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DomainUpdateReq {
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主域名
|
|
||||||
*/
|
|
||||||
private String domain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyStore密码
|
|
||||||
*/
|
|
||||||
private String keyStorePassword;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 强制Https
|
|
||||||
*/
|
|
||||||
private Integer forceHttps;
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.noear.solon.validation.annotation.Min;
|
||||||
|
import org.noear.solon.validation.annotation.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* license删除请求
|
* license删除请求
|
||||||
@@ -9,5 +11,7 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class LicenseDeleteReq {
|
public class LicenseDeleteReq {
|
||||||
|
@NotNull
|
||||||
|
@Min(value=2, message="服务端禁止删除")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,7 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
import org.noear.solon.validation.annotation.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新启用状态请求
|
* 更新启用状态请求
|
||||||
@@ -10,13 +32,15 @@ import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class LicenseUpdateEnableStatusReq {
|
public class LicenseUpdateEnableStatusReq {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
@NotNull
|
||||||
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 启用状态
|
* 启用状态
|
||||||
* {@link EnableStatusEnum}
|
* {@link EnableStatusEnum}
|
||||||
*/
|
*/
|
||||||
private Integer enable;
|
@NotNull
|
||||||
|
private Integer enable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,9 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 端口映射创建请求
|
* 端口映射创建请求
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -57,15 +76,4 @@ public class PortMappingCreateReq {
|
|||||||
* 描述
|
* 描述
|
||||||
*/
|
*/
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
/**
|
|
||||||
* 域名映射列表
|
|
||||||
*/
|
|
||||||
private List<DomainMapping> domainMappings;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class DomainMapping {
|
|
||||||
private Integer domainId;
|
|
||||||
private String subdomain;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
|||||||
@@ -1,6 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 端口映射更新启用状态请求
|
* 端口映射更新启用状态请求
|
||||||
@@ -13,10 +35,12 @@ public class PortMappingUpdateEnableStatusReq {
|
|||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
|
@NonNull
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 启用状态
|
* 启用状态
|
||||||
*/
|
*/
|
||||||
|
@NonNull
|
||||||
private Integer enable;
|
private Integer enable;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 端口映射更新请求
|
* 端口映射更新请求
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -61,16 +80,4 @@ public class PortMappingUpdateReq {
|
|||||||
* 描述
|
* 描述
|
||||||
*/
|
*/
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
/**
|
|
||||||
* 域名映射列表
|
|
||||||
*/
|
|
||||||
private List<DomainMapping> domainMappings;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class DomainMapping {
|
|
||||||
private Integer id;
|
|
||||||
private Integer domainId;
|
|
||||||
private String subdomain;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,18 +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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户列表请求
|
* 用户列表请求
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/8/14
|
* @date: 2022/8/14
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
public class UserListReq {
|
public class UserListReq {
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户名
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.log;
|
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.log;
|
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.log;
|
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.DefaultDomainStatusEnum;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.HttpsStatusEnum;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.SslStatusEnum;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@Data
|
|
||||||
public class DomainListRes {
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主域名
|
|
||||||
*/
|
|
||||||
private String domain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户名
|
|
||||||
*/
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否是默认域名(1、是 2、否)
|
|
||||||
* {@link DefaultDomainStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer isDefault;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 强制使用HTTPS(1、是 2、否)
|
|
||||||
* {@link HttpsStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer forceHttps;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启用状态
|
|
||||||
* {@link EnableStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer enable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SSLStatusEnum
|
|
||||||
* {@link SslStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer sslStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private Date updateTime;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.DomainMappingDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xiaojie
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Data
|
||||||
|
public class DomainMappingDto extends DomainMappingDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* licenseId
|
||||||
|
*/
|
||||||
|
private String licenseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 23/7/2024
|
|
||||||
*/
|
|
||||||
public class DomainUpdateDefaultStatusRes {
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 23/7/2024
|
|
||||||
*/
|
|
||||||
public class DomainUpdateEnableStatusRes {
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,12 +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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 端口映射列表响应
|
* 端口映射列表响应
|
||||||
@@ -24,10 +43,10 @@ public class PortMappingListRes {
|
|||||||
* 协议
|
* 协议
|
||||||
*/
|
*/
|
||||||
private String protocal;
|
private String protocal;
|
||||||
/**
|
/**
|
||||||
* 完整域名映射
|
* 域名
|
||||||
*/
|
*/
|
||||||
private List<FullDomainNameBO> fullDomainMappings;
|
private String domain;
|
||||||
/**
|
/**
|
||||||
* license名称
|
* license名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.dal;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.DomainNameDO;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface DomainMapper extends BaseMapper<DomainNameDO> {
|
|
||||||
default DomainNameDO checkRepeat(String domain, Set<Integer> excludeIds) {
|
|
||||||
// 查询与输入域名相关的域名列表
|
|
||||||
List<DomainNameDO> domainList = this.selectList(new LambdaQueryWrapper<DomainNameDO>()
|
|
||||||
.notIn(excludeIds != null, DomainNameDO::getId, excludeIds)
|
|
||||||
);
|
|
||||||
|
|
||||||
// 遍历数据库中的域名,检查是否存在重复(包括子域名)
|
|
||||||
for (DomainNameDO domainNameDO : domainList) {
|
|
||||||
String existingDomain = domainNameDO.getDomain();
|
|
||||||
// 完全相等的情况
|
|
||||||
if (existingDomain.equals(domain)) {
|
|
||||||
return domainNameDO;
|
|
||||||
}
|
|
||||||
// // 是子域名关系
|
|
||||||
// if (isSubdomainOrEqual(existingDomain, domain)) {
|
|
||||||
// return domainNameDO;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果没有找到重复的,返回 null
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 辅助方法:判断 domain1 是否是 domain2 的子域名,或者两者相等
|
|
||||||
private boolean isSubdomainOrEqual(String domain1, String domain2) {
|
|
||||||
// 判断是否是子域名关系,例如 "proxy.asgc.fun" 是 "asgc.fun" 的子域名
|
|
||||||
return domain1.endsWith("." + domain2) || domain2.endsWith("." + domain1);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void updateEnableStatus(Integer id, Integer enable, Date updateTime) {
|
|
||||||
this.update(Wrappers.<DomainNameDO>lambdaUpdate()
|
|
||||||
.eq(DomainNameDO::getId, id)
|
|
||||||
.set(DomainNameDO::getEnable, enable)
|
|
||||||
.set(DomainNameDO::getUpdateTime, updateTime)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
List<FullDomainNameBO> selectFullDomainNameListByPortMappingIds(@Param("ids") Set<Integer> ids);
|
|
||||||
|
|
||||||
List<FullDomainNameBO> selectFullDomainNameListByDomainNameIds(@Param("ids") Set<Integer> ids);
|
|
||||||
|
|
||||||
List<FullDomainNameBO> selectFullDomainNameList();
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.dal;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingListReq;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainMappingDto;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.DomainMappingDO;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.DomainMappingDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2022/8/8
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DomainMappingMapper extends BaseMapper<DomainMappingDO> {
|
||||||
|
|
||||||
|
default DomainMappingDO findById(Integer id) {
|
||||||
|
return this.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void updateEnableStatus(Integer id, Integer enable, Date updateTime) {
|
||||||
|
this.update(null, new LambdaUpdateWrapper<DomainMappingDO>()
|
||||||
|
.eq(DomainMappingDO::getId, id)
|
||||||
|
.set(DomainMappingDO::getEnable, enable)
|
||||||
|
.set(DomainMappingDO::getUpdateTime, updateTime)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default DomainMappingDO findByDomain(String domain, Set<Integer> excludeIds) {
|
||||||
|
return this.selectOne(new LambdaQueryWrapper<DomainMappingDO>()
|
||||||
|
.eq(DomainMappingDO::getDomain, domain)
|
||||||
|
.notIn(!CollectionUtil.isEmpty(excludeIds), DomainMappingDO::getId, excludeIds)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
default List<DomainMappingDO> findEnableListByLicenseId(Integer licenseId) {
|
||||||
|
return this.selectList(new LambdaQueryWrapper<DomainMappingDO>()
|
||||||
|
.eq(DomainMappingDO::getLicenseId, licenseId)
|
||||||
|
.eq(DomainMappingDO::getEnable, EnableStatusEnum.ENABLE.getStatus())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<DomainMappingDO> findListByServerPort(String domain) {
|
||||||
|
return this.selectList(new LambdaQueryWrapper<DomainMappingDO>()
|
||||||
|
.eq(DomainMappingDO::getDomain, domain)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<DomainMappingDO> findListByLicenseId(Integer licenseId) {
|
||||||
|
return this.selectList(new LambdaQueryWrapper<DomainMappingDO>()
|
||||||
|
.eq(DomainMappingDO::getLicenseId, licenseId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
default DomainMappingDO findByLicenseIdAndServerPort(Integer licenseId, String domain) {
|
||||||
|
return this.selectOne(new LambdaQueryWrapper<DomainMappingDO>()
|
||||||
|
.eq(DomainMappingDO::getLicenseId, licenseId)
|
||||||
|
.eq(DomainMappingDO::getDomain, domain)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<DomainMappingDO> selectDomainMappingByCondition(IPage<DomainMappingDO> page, @Param("req") DomainMappingDto req);
|
||||||
|
}
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.dal;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.DomainPortMappingDO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author: Mirac
|
|
||||||
* @date: 2024/8/24
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface DomainPortMappingMapper extends BaseMapper<DomainPortMappingDO> {
|
|
||||||
default Boolean checkRepeatBySubdomain(String subdomain, Integer domainNameId, Integer id) {
|
|
||||||
return StringUtils.isEmpty(subdomain)? Boolean.FALSE : this.selectCount(new LambdaQueryWrapper<DomainPortMappingDO>()
|
|
||||||
.eq(DomainPortMappingDO::getSubdomain, subdomain)
|
|
||||||
.eq(DomainPortMappingDO::getDomainNameId, domainNameId)
|
|
||||||
.ne(id != null, DomainPortMappingDO::getId, id)
|
|
||||||
.last("limit 1")
|
|
||||||
).intValue() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
default List<DomainPortMappingDO> findByPortMappingId(Integer portMappingId) {
|
|
||||||
return this.selectList(Wrappers.<DomainPortMappingDO>lambdaQuery()
|
|
||||||
.eq(DomainPortMappingDO::getPortMappingId, portMappingId));
|
|
||||||
}
|
|
||||||
|
|
||||||
default void deleteByDomainNameId(Integer doomainNameId) {
|
|
||||||
this.delete(Wrappers.<DomainPortMappingDO>lambdaQuery()
|
|
||||||
.eq(DomainPortMappingDO::getDomainNameId, doomainNameId));
|
|
||||||
}
|
|
||||||
|
|
||||||
default boolean checkUsed(Integer domainNameId) {
|
|
||||||
return this.exists(Wrappers.<DomainPortMappingDO>lambdaQuery()
|
|
||||||
.eq(DomainPortMappingDO::getDomainNameId, domainNameId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -64,16 +65,18 @@ public interface LicenseMapper extends BaseMapper<LicenseDO> {
|
|||||||
|
|
||||||
default void updateOnlineStatus(Integer id, Integer isOnline, Date updateTime) {
|
default void updateOnlineStatus(Integer id, Integer isOnline, Date updateTime) {
|
||||||
this.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
this.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
||||||
.eq(LicenseDO::getId, id)
|
.eq(LicenseDO::getId, id)
|
||||||
.set(LicenseDO::getIsOnline, isOnline)
|
.set(LicenseDO::getIsOnline, isOnline)
|
||||||
.set(LicenseDO::getUpdateTime, updateTime)
|
.set(LicenseDO::getUpdateTime, updateTime)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// .ne(LicenseDO::getId, 1)
|
||||||
default void updateOnlineStatus(Integer isOnline, Date updateTime) {
|
default void updateOnlineStatus(Integer isOnline, Date updateTime) {
|
||||||
this.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
this.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
||||||
.set(LicenseDO::getIsOnline, isOnline)
|
.set(LicenseDO::getIsOnline, isOnline)
|
||||||
.set(LicenseDO::getUpdateTime, updateTime)
|
.set(LicenseDO::getUpdateTime, updateTime)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,4 +118,8 @@ public interface LicenseMapper extends BaseMapper<LicenseDO> {
|
|||||||
.eq(LicenseDO::getKey, licenseKey)
|
.eq(LicenseDO::getKey, licenseKey)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<ProxyMapping> findEnableProxyMappingListByLicenseId(Integer licenseId);
|
||||||
|
|
||||||
|
List<ProxyMapping> findAllProxyMappingListByLicenseId(Integer licenseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingListReq;
|
|||||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ package org.dromara.neutrinoproxy.server.dal.entity;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -30,35 +31,90 @@ import lombok.ToString;
|
|||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingListRes;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainMappingDto;
|
||||||
|
import org.noear.solon.validation.annotation.NotBlank;
|
||||||
|
import org.noear.solon.validation.annotation.NotNull;
|
||||||
|
import org.noear.solon.validation.annotation.Pattern;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: Mirac
|
* 端口映射
|
||||||
* @date: 2024/8/24
|
* @author: aoshiguchen
|
||||||
|
* @date: 2022/8/8
|
||||||
*/
|
*/
|
||||||
@ToString
|
@ToString
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@TableName("domain_port_mapping")
|
@TableName("domain_mapping")
|
||||||
public class DomainPortMappingDO {
|
public class DomainMappingDO {
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* licenseId
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private Integer licenseId;
|
||||||
|
/**
|
||||||
|
* 协议
|
||||||
|
*/
|
||||||
|
private String protocal;
|
||||||
|
/**
|
||||||
|
* 域名 /^(\w+\.{1}\w+)$/g
|
||||||
|
*/
|
||||||
|
@NotBlank
|
||||||
|
@Pattern("^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$")
|
||||||
|
private String domain;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 目标地址(licenseId客户端,ip:port)
|
||||||
|
*/
|
||||||
|
@NotBlank
|
||||||
|
private String targetPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 上传限速
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.AUTO)
|
private String upLimitRate;
|
||||||
private Integer id;
|
/**
|
||||||
|
* 下载限速
|
||||||
|
*/
|
||||||
|
private String downLimitRate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 端口映射id
|
* 是否在线
|
||||||
|
* {@link OnlineStatusEnum}
|
||||||
*/
|
*/
|
||||||
private Integer portMappingId;
|
@TableField(exist=false)
|
||||||
|
private Integer isOnline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 域名id
|
* 启用状态
|
||||||
|
* {@link EnableStatusEnum}
|
||||||
*/
|
*/
|
||||||
private Integer domainNameId;
|
private Integer enable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全组Id
|
||||||
|
*/
|
||||||
|
private Integer securityGroupId = 0; // 设置为null不生效,不知道为啥
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子域名
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private String subdomain;
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
public DomainMappingDto toRes() {
|
||||||
|
DomainMappingDto dto = new DomainMappingDto();
|
||||||
|
BeanUtil.copyProperties(this, dto);
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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.server.dal.entity;
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.*;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainListRes;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingListRes;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 域名
|
|
||||||
* @author: Mirac
|
|
||||||
* @date: 2024/7/21
|
|
||||||
*/
|
|
||||||
@ToString
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@Data
|
|
||||||
@TableName("domain_name")
|
|
||||||
public class DomainNameDO {
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主域名
|
|
||||||
*/
|
|
||||||
private String domain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SSL证书文件内容
|
|
||||||
*/
|
|
||||||
private byte[] jks;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyStore密码
|
|
||||||
*/
|
|
||||||
private String keyStorePassword;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否是默认域名(1、是 2、否)
|
|
||||||
* {@link DefaultDomainStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer isDefault;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 强制使用HTTPS(1、是 2、否)
|
|
||||||
* {@link HttpsStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer forceHttps;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启用状态
|
|
||||||
* {@link EnableStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer enable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
public DomainListRes toRes() {
|
|
||||||
DomainListRes res = new DomainListRes();
|
|
||||||
BeanUtil.copyProperties(this, res);
|
|
||||||
res.setSslStatus(this.getJks() == null ? SslStatusEnum.NOT_UPLOADED.getStatus() : SslStatusEnum.UPLOADED.getStatus());
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -87,6 +87,23 @@ public class LicenseDO {
|
|||||||
*/
|
*/
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
public LicenseDO() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public LicenseDO(Integer id, String name, String key, Integer userId, String upLimitRate, String downLimitRate, Integer isOnline, Integer enable, Date createTime, Date updateTime) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.key = key;
|
||||||
|
this.userId = userId;
|
||||||
|
this.upLimitRate = upLimitRate;
|
||||||
|
this.downLimitRate = downLimitRate;
|
||||||
|
this.isOnline = isOnline;
|
||||||
|
this.enable = enable;
|
||||||
|
this.createTime = createTime;
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
public LicenseListRes toRes() {
|
public LicenseListRes toRes() {
|
||||||
LicenseListRes res = new LicenseListRes();
|
LicenseListRes res = new LicenseListRes();
|
||||||
BeanUtil.copyProperties(this, res);
|
BeanUtil.copyProperties(this, res);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import lombok.Data;
|
|||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingListRes;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingListRes;
|
||||||
|
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -117,4 +118,5 @@ public class PortMappingDO {
|
|||||||
BeanUtil.copyProperties(this, res);
|
BeanUtil.copyProperties(this, res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.noear.solon.annotation.Component;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@JobHandler(name = "DemoJob", cron = "0/10 * * * * ?", param = "{\"a\":1}")
|
@JobHandler(name = "DemoJob", cron = "0/10 * * * * ?", param = "{\"a\":1}")
|
||||||
public class DemoJob implements IJobHandler {
|
public class DemoJob implements IJobHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(String param) throws Exception {
|
public void execute(String param) throws Exception {
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.job;
|
package org.dromara.neutrinoproxy.server.job;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.proxy.core;
|
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.MetricsCollector;
|
import org.dromara.neutrinoproxy.server.proxy.domain.MetricsCollector;
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.proxy.core;
|
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ public class ProxyTunnelServer implements EventListener<AppLoadEndEvent> {
|
|||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
bootstrap.bind(proxyConfig.getTunnel().getPort()).sync();
|
bootstrap.bind(proxyConfig.getTunnel().getPort()).sync();
|
||||||
log.info("proxy server started,port:{}", proxyConfig.getTunnel().getPort());
|
log.info("ProxyTunnelServer,port:{}", proxyConfig.getTunnel().getPort());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("proxy server error", e);
|
log.error("ProxyTunnelServer error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,9 +84,9 @@ public class ProxyTunnelServer implements EventListener<AppLoadEndEvent> {
|
|||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
bootstrap.bind(proxyConfig.getTunnel().getSslPort()).sync();
|
bootstrap.bind(proxyConfig.getTunnel().getSslPort()).sync();
|
||||||
log.info("proxy server started,SSL port: {}", proxyConfig.getTunnel().getSslPort());
|
log.info("ProxyTunnelServer,SSL port: {}", proxyConfig.getTunnel().getSslPort());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("proxy server error", e);
|
log.error("ProxyTunnelServer error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.proxy.domain;
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaojie
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DomainMapping {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* domainMapping 主键id
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* License
|
||||||
|
*/
|
||||||
|
private Integer licenseId;
|
||||||
|
/**
|
||||||
|
* 客户端信息 IP:port
|
||||||
|
*/
|
||||||
|
private String domain;
|
||||||
|
/**
|
||||||
|
* 目标地址(其中含有\n隔离多个 目标地址)
|
||||||
|
*/
|
||||||
|
private String targetPath;
|
||||||
|
|
||||||
|
|
||||||
|
public DomainMapping() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public DomainMapping(Integer id, Integer licenseId, String domain, String targetPath) {
|
||||||
|
this.id = id;
|
||||||
|
this.licenseId = licenseId;
|
||||||
|
this.domain = domain;
|
||||||
|
this.targetPath = targetPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.proxy.domain;
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ import java.util.List;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
public class ProxyMapping {
|
public class ProxyMapping {
|
||||||
|
/**
|
||||||
|
* licenseId
|
||||||
|
*/
|
||||||
|
private Integer licenseId;
|
||||||
/**
|
/**
|
||||||
* 服务端端口
|
* 服务端端口
|
||||||
*/
|
*/
|
||||||
@@ -24,8 +28,23 @@ public class ProxyMapping {
|
|||||||
* 客户端信息 IP:port
|
* 客户端信息 IP:port
|
||||||
*/
|
*/
|
||||||
private String lanInfo;
|
private String lanInfo;
|
||||||
|
/**
|
||||||
|
* 协议
|
||||||
|
*/
|
||||||
|
private String protocal;
|
||||||
|
|
||||||
public static List<ProxyMapping> buildList(List<PortMappingDO> portMappingList) {
|
|
||||||
|
public ProxyMapping() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProxyMapping(Integer licenseId, Integer serverPort, String lanInfo, String protocal) {
|
||||||
|
this.licenseId = licenseId;
|
||||||
|
this.serverPort = serverPort;
|
||||||
|
this.lanInfo = lanInfo;
|
||||||
|
this.protocal = protocal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ProxyMapping> buildList(List<PortMappingDO> portMappingList) {
|
||||||
List<ProxyMapping> list = new ArrayList<>();
|
List<ProxyMapping> list = new ArrayList<>();
|
||||||
if (CollectionUtil.isEmpty(portMappingList)) {
|
if (CollectionUtil.isEmpty(portMappingList)) {
|
||||||
return list;
|
return list;
|
||||||
@@ -38,8 +57,13 @@ public class ProxyMapping {
|
|||||||
|
|
||||||
public static ProxyMapping build(PortMappingDO portMappingDO) {
|
public static ProxyMapping build(PortMappingDO portMappingDO) {
|
||||||
return new ProxyMapping()
|
return new ProxyMapping()
|
||||||
.setServerPort(portMappingDO.getServerPort())
|
.setLicenseId(portMappingDO.getLicenseId())
|
||||||
.setLanInfo(String.format("%s:%s", portMappingDO.getClientIp(), portMappingDO.getClientPort()));
|
.setServerPort(portMappingDO.getServerPort())
|
||||||
|
.setLanInfo(String.format("%s:%s", portMappingDO.getClientIp(), portMappingDO.getClientPort()))
|
||||||
|
.setProtocal(portMappingDO.getProtocal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.proxy.domain;
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
||||||
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
|
import io.netty.channel.EventLoopGroup;
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||||
@@ -17,7 +19,8 @@ import org.noear.solon.core.event.AppLoadEndEvent;
|
|||||||
import org.noear.solon.core.event.EventListener;
|
import org.noear.solon.core.event.EventListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP代理
|
* 应用加载完成事件(即启动完成)- 判断是否配置域名-配置了域名则启动HTTP代理
|
||||||
|
* 默认端口 80
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2023/4/2
|
* @date: 2023/4/2
|
||||||
*/
|
*/
|
||||||
@@ -26,35 +29,55 @@ import org.noear.solon.core.event.EventListener;
|
|||||||
public class HttpProxy implements EventListener<AppLoadEndEvent> {
|
public class HttpProxy implements EventListener<AppLoadEndEvent> {
|
||||||
@Inject
|
@Inject
|
||||||
private ProxyConfig proxyConfig;
|
private ProxyConfig proxyConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NioServerSocketChannel对应的future
|
||||||
|
*/
|
||||||
|
protected ChannelFuture httpFuture;
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
||||||
if (null == proxyConfig.getServer().getTcp().getHttpProxyPort()) {
|
if (null == proxyConfig.getServer().getTcp().getHttpProxyPort()) {
|
||||||
log.info("no config http proxy port, nonsupport http proxy.");
|
log.info("no config domain name,nonsupport http proxy.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.start();
|
this.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void start() {
|
private void start() {
|
||||||
|
// 处理网络连接---接受请求
|
||||||
|
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
|
||||||
|
// 进行socketChannel的网络读写
|
||||||
|
EventLoopGroup workerGroup = new NioEventLoopGroup();
|
||||||
try {
|
try {
|
||||||
ServerBootstrap bootstrap = new ServerBootstrap();
|
ServerBootstrap bootstrap = new ServerBootstrap();
|
||||||
bootstrap.group(new NioEventLoopGroup(1), new NioEventLoopGroup())
|
bootstrap.group(bossGroup, workerGroup)
|
||||||
.channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {
|
.channel(NioServerSocketChannel.class)
|
||||||
@Override
|
.childHandler(new ChannelInitializer<SocketChannel>() {
|
||||||
public void initChannel(SocketChannel ch) throws Exception {
|
@Override
|
||||||
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
public void initChannel(SocketChannel ch) throws Exception {
|
||||||
ch.pipeline().addFirst(new LoggingHandler(HttpProxy.class));
|
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() &&
|
||||||
}
|
proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
||||||
ch.pipeline().addFirst(new BytesMetricsHandler());
|
ch.pipeline().addFirst(new LoggingHandler(HttpProxy.class));
|
||||||
ch.pipeline().addLast(new HttpVisitorSecurityChannelHandler(false));
|
}
|
||||||
ch.pipeline().addLast("flowLimiter",new VisitorFlowLimiterChannelHandler());
|
ch.pipeline().addFirst(new BytesMetricsHandler())
|
||||||
ch.pipeline().addLast(new HttpVisitorChannelHandler());
|
.addLast(new HttpVisitorSecurityChannelHandler())
|
||||||
}
|
.addLast("flowLimiter",new VisitorFlowLimiterChannelHandler())
|
||||||
});
|
.addLast(new HttpVisitorChannelHandler());
|
||||||
bootstrap.bind("0.0.0.0", proxyConfig.getServer().getTcp().getHttpProxyPort()).sync();
|
}
|
||||||
log.info("Http proxy server start success!port:{}", proxyConfig.getServer().getTcp().getHttpProxyPort());
|
});
|
||||||
|
httpFuture = bootstrap.bind("0.0.0.0", proxyConfig.getServer().getTcp().getHttpProxyPort()).sync();
|
||||||
|
log.info("Http proxy server started success!port:{}", proxyConfig.getServer().getTcp().getHttpProxyPort());
|
||||||
|
//添加关闭重启的监听器,3秒后尝试重启
|
||||||
|
// httpFuture.channel().closeFuture().addListener(genericFutureListener);
|
||||||
|
// httpFuture.channel().closeFuture().sync();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("http proxy start err!", e);
|
log.error("http proxy start err!", e);
|
||||||
|
} finally {
|
||||||
|
// bossGroup.shutdownGracefully();
|
||||||
|
// workerGroup.shutdownGracefully();
|
||||||
|
// httpFuture.channel().close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.noear.solon.Solon;
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* HTTP 访客处理器
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2023/5/27
|
* @date: 2023/5/27
|
||||||
*/
|
*/
|
||||||
@@ -30,6 +31,7 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
byte[] bytes = new byte[byteBuf.readableBytes()];
|
byte[] bytes = new byte[byteBuf.readableBytes()];
|
||||||
byteBuf.readBytes(bytes);
|
byteBuf.readBytes(bytes);
|
||||||
byteBuf.resetReaderIndex();
|
byteBuf.resetReaderIndex();
|
||||||
|
|
||||||
ProxyAttachment proxyAttachment = new ProxyAttachment(ctx.channel(), bytes, (channel, buf) -> {
|
ProxyAttachment proxyAttachment = new ProxyAttachment(ctx.channel(), bytes, (channel, buf) -> {
|
||||||
Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null == proxyChannel) {
|
if (null == proxyChannel) {
|
||||||
@@ -37,14 +39,11 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyChannel.writeAndFlush(ProxyMessage.buildTransferMessage(ProxyUtil.getVisitorIdByChannel(channel), bytes));
|
proxyChannel.writeAndFlush(ProxyMessage.buildTransferMessage(ProxyUtil.getVisitorIdByChannel(channel), bytes));
|
||||||
|
|
||||||
// 增加流量计数
|
// 增加流量计数
|
||||||
VisitorChannelAttachInfo visitorChannelAttachInfo = ProxyUtil.getAttachInfo(channel);
|
VisitorChannelAttachInfo visitorChannelAttachInfo = ProxyUtil.getAttachInfo(channel);
|
||||||
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
String visitorId = ProxyUtil.getVisitorIdByChannel(ctx.channel());
|
String visitorId = ProxyUtil.getVisitorIdByChannel(ctx.channel());
|
||||||
if (StringUtils.isNotBlank(visitorId)) {
|
if (StringUtils.isNotBlank(visitorId)) {
|
||||||
proxyAttachment.execute();
|
proxyAttachment.execute();
|
||||||
@@ -53,11 +52,10 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
|
|
||||||
// 用户连接到代理服务器时,设置用户连接不可读,等待代理后端服务器连接成功后再改变为可读状态
|
// 用户连接到代理服务器时,设置用户连接不可读,等待代理后端服务器连接成功后再改变为可读状态
|
||||||
ctx.channel().config().setOption(ChannelOption.AUTO_READ, false);
|
ctx.channel().config().setOption(ChannelOption.AUTO_READ, false);
|
||||||
|
|
||||||
|
|
||||||
// 根据域名拿到绑定的映射对应的cmdChannel
|
// 根据域名拿到绑定的映射对应的cmdChannel
|
||||||
Integer serverPort = ctx.channel().attr(Constants.SERVER_PORT).get();
|
Integer serverPort = ctx.channel().attr(Constants.SERVER_PORT).get();
|
||||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(serverPort);
|
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(serverPort);
|
||||||
|
|
||||||
if (null == cmdChannel) {
|
if (null == cmdChannel) {
|
||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
@@ -67,7 +65,6 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
visitorId = ProxyUtil.newVisitorId();
|
visitorId = ProxyUtil.newVisitorId();
|
||||||
ProxyUtil.addVisitorChannelToCmdChannel(NetworkProtocolEnum.HTTP, cmdChannel, visitorId, ctx.channel(), serverPort);
|
ProxyUtil.addVisitorChannelToCmdChannel(NetworkProtocolEnum.HTTP, cmdChannel, visitorId, ctx.channel(), serverPort);
|
||||||
ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
||||||
@@ -76,7 +73,6 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
|
||||||
// 通知代理客户端
|
// 通知代理客户端
|
||||||
Channel visitorChannel = ctx.channel();
|
Channel visitorChannel = ctx.channel();
|
||||||
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
@@ -86,7 +82,6 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
// 该端口还没有代理客户端
|
// 该端口还没有代理客户端
|
||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// 用户连接断开,从控制连接中移除
|
// 用户连接断开,从控制连接中移除
|
||||||
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
||||||
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
|
import io.netty.channel.ChannelFuture;
|
||||||
|
import io.netty.channel.ChannelHandler;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
|
import io.netty.channel.EventLoopGroup;
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
import io.netty.handler.ssl.SniHandler;
|
import io.netty.handler.ssl.SslHandler;
|
||||||
import io.netty.handler.ssl.SslContext;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.dromara.neutrinoproxy.core.util.FileUtil;
|
||||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.HttpVisitorSecurityChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.HttpVisitorSecurityChannelHandler;
|
||||||
@@ -18,8 +22,16 @@ import org.noear.solon.annotation.Inject;
|
|||||||
import org.noear.solon.core.event.AppLoadEndEvent;
|
import org.noear.solon.core.event.AppLoadEndEvent;
|
||||||
import org.noear.solon.core.event.EventListener;
|
import org.noear.solon.core.event.EventListener;
|
||||||
|
|
||||||
|
import javax.net.ssl.KeyManagerFactory;
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLEngine;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.security.KeyStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTPS代理
|
* 应用加载完成事件(即启动完成)- 判断是否配置域名-配置了域名则启动HTTPS代理
|
||||||
|
* 默认端口 443
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2023/4/2
|
* @date: 2023/4/2
|
||||||
*/
|
*/
|
||||||
@@ -28,55 +40,77 @@ import org.noear.solon.core.event.EventListener;
|
|||||||
public class HttpsProxy implements EventListener<AppLoadEndEvent> {
|
public class HttpsProxy implements EventListener<AppLoadEndEvent> {
|
||||||
@Inject
|
@Inject
|
||||||
private ProxyConfig proxyConfig;
|
private ProxyConfig proxyConfig;
|
||||||
@Inject
|
/**
|
||||||
private SslContextManager sslContextManager;
|
* NioServerSocketChannel对应的future
|
||||||
|
*/
|
||||||
|
private ChannelFuture httpsFuture;
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) {
|
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
||||||
if (null == proxyConfig.getServer().getTcp().getHttpsProxyPort()) {
|
if (null == proxyConfig.getServer().getTcp().getHttpsProxyPort() ||
|
||||||
log.info("no config https proxy port, nonsupport http proxy.");
|
StringUtils.isEmpty(proxyConfig.getServer().getTcp().getJksPath()) ||
|
||||||
|
StringUtils.isEmpty(proxyConfig.getServer().getTcp().getKeyStorePassword())) {
|
||||||
|
log.info("no config domain name,nonsupport https proxy.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.start();
|
this.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void start() {
|
private void start() {
|
||||||
|
// 处理网络连接---接受请求
|
||||||
|
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
|
||||||
|
// 进行socketChannel的网络读写
|
||||||
|
EventLoopGroup workerGroup = new NioEventLoopGroup();
|
||||||
try {
|
try {
|
||||||
ServerBootstrap bootstrap = new ServerBootstrap();
|
ServerBootstrap bootstrap = new ServerBootstrap();
|
||||||
bootstrap.group(new NioEventLoopGroup(1), new NioEventLoopGroup())
|
bootstrap.group(bossGroup, workerGroup);
|
||||||
.channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {
|
bootstrap.channel(NioServerSocketChannel.class);
|
||||||
@Override
|
bootstrap.childHandler(new ChannelInitializer<SocketChannel>() {
|
||||||
public void initChannel(SocketChannel ch) throws Exception {
|
@Override
|
||||||
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
public void initChannel(SocketChannel ch) throws Exception {
|
||||||
ch.pipeline().addFirst(new LoggingHandler(HttpsProxy.class));
|
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
||||||
}
|
ch.pipeline().addFirst(new LoggingHandler(HttpsProxy.class));
|
||||||
ch.pipeline().addLast(createSniHandler());
|
}
|
||||||
ch.pipeline().addFirst(new BytesMetricsHandler());
|
ch.pipeline().addLast(createSslHandler())
|
||||||
ch.pipeline().addLast(new HttpVisitorSecurityChannelHandler(true));
|
.addFirst(new BytesMetricsHandler())
|
||||||
ch.pipeline().addLast("flowLimiter",new VisitorFlowLimiterChannelHandler());
|
.addLast(new HttpVisitorSecurityChannelHandler())
|
||||||
ch.pipeline().addLast(new HttpVisitorChannelHandler());
|
.addLast("flowLimiter", new VisitorFlowLimiterChannelHandler())
|
||||||
}
|
.addLast(new HttpVisitorChannelHandler());
|
||||||
});
|
}
|
||||||
bootstrap.bind("0.0.0.0", proxyConfig.getServer().getTcp().getHttpsProxyPort()).sync();
|
});
|
||||||
|
httpsFuture = bootstrap.bind("0.0.0.0", proxyConfig.getServer().getTcp().getHttpsProxyPort()).sync();
|
||||||
log.info("Https proxy server started!port:{}", proxyConfig.getServer().getTcp().getHttpsProxyPort());
|
log.info("Https proxy server started!port:{}", proxyConfig.getServer().getTcp().getHttpsProxyPort());
|
||||||
|
//添加关闭重启的监听器,3秒后尝试重启
|
||||||
|
// httpsFuture.channel().closeFuture().addListener(genericFutureListener);
|
||||||
|
// httpsFuture.channel().closeFuture().sync();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("https proxy start err!", e);
|
log.error("https proxy start err!", e);
|
||||||
|
} finally {
|
||||||
|
// bossGroup.shutdownGracefully();
|
||||||
|
// workerGroup.shutdownGracefully();
|
||||||
|
// httpsFuture.channel().close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SniHandler createSniHandler() {
|
private ChannelHandler createSslHandler() {
|
||||||
try {
|
try {
|
||||||
return new SniHandler(domainName -> {
|
InputStream jksInputStream = FileUtil.getInputStream(proxyConfig.getServer().getTcp().getJksPath());
|
||||||
SslContext sslContext = sslContextManager.getSslContextByFullDomain(domainName);
|
SSLContext serverContext = SSLContext.getInstance("TLS");
|
||||||
if (sslContext != null) {
|
final KeyStore ks = KeyStore.getInstance("JKS");
|
||||||
return sslContext;
|
|
||||||
} else {
|
ks.load(jksInputStream, proxyConfig.getServer().getTcp().getKeyStorePassword().toCharArray());
|
||||||
log.info("No SSL context available for domain: {}", domainName);
|
final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
|
||||||
return null;
|
kmf.init(ks, proxyConfig.getServer().getTcp().getKeyStorePassword().toCharArray());
|
||||||
}
|
TrustManager[] trustManagers = null;
|
||||||
});
|
|
||||||
|
serverContext.init(kmf.getKeyManagers(), trustManagers, null);
|
||||||
|
|
||||||
|
SSLEngine sslEngine = serverContext.createSSLEngine();
|
||||||
|
sslEngine.setUseClientMode(false);
|
||||||
|
sslEngine.setNeedClientAuth(false);
|
||||||
|
|
||||||
|
return new SslHandler(sslEngine);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("create SSL handler failed", e);
|
log.error("create SSL handler failed", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import io.netty.handler.ssl.ClientAuth;
|
|
||||||
import io.netty.handler.ssl.SslContext;
|
|
||||||
import io.netty.handler.ssl.SslContextBuilder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.ibatis.solon.annotation.Db;
|
|
||||||
import org.dromara.neutrinoproxy.server.base.db.DBInitialize;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.DomainMapper;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.DomainNameDO;
|
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
|
||||||
import org.noear.solon.annotation.Component;
|
|
||||||
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 javax.net.ssl.KeyManagerFactory;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.security.KeyStore;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 域名到SSL上下文
|
|
||||||
* @author: Mirac
|
|
||||||
* @date: 2024/8/25
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@Data
|
|
||||||
public class SslContextManager implements EventListener<AppLoadEndEvent> {
|
|
||||||
|
|
||||||
@Db
|
|
||||||
private DomainMapper domainMapper;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private DBInitialize dbInitialize;
|
|
||||||
|
|
||||||
// 初始化时加载所有域名的 SSL 上下文
|
|
||||||
@Init
|
|
||||||
public void init() throws Throwable {
|
|
||||||
// aot 阶段,不初始化
|
|
||||||
if (NativeDetector.isAotRuntime()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
initializeSslContexts();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("initialize SSL handler failed", e);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 维护域名到 SslContext 的映射
|
|
||||||
private final ConcurrentHashMap<String, SslContext> domainSslContexts = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
// 初始化所有域名的 SSL 上下文
|
|
||||||
private void initializeSslContexts() throws Exception {
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectList(Wrappers.<DomainNameDO>lambdaQuery()
|
|
||||||
.isNotNull(DomainNameDO::getDomain)
|
|
||||||
.isNotNull(DomainNameDO::getJks)
|
|
||||||
.isNotNull(DomainNameDO::getKeyStorePassword));
|
|
||||||
|
|
||||||
for (DomainNameDO domainNameDO : domainNameDOS) {
|
|
||||||
if (domainNameDO.getDomain() != null && domainNameDO.getKeyStorePassword() != null && domainNameDO.getJks() != null) {
|
|
||||||
String domain = domainNameDO.getDomain();
|
|
||||||
byte[] jks = domainNameDO.getJks();// 假设数据库中存储了每个域名对应的 JKS 路径
|
|
||||||
String keyStorePassword = domainNameDO.getKeyStorePassword();
|
|
||||||
SslContext sslContext = loadSslContextFromJks(jks, keyStorePassword);
|
|
||||||
domainSslContexts.put(domain, sslContext);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 动态添加新的域名和证书
|
|
||||||
public void addDomainAndCert(String domain, byte[] jks, String keyStorePassword) throws Exception {
|
|
||||||
SslContext sslContext = loadSslContextFromJks(jks, keyStorePassword);
|
|
||||||
domainSslContexts.put(domain, sslContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用 JKS 文件加载 SSL 上下文,禁用客户端认证并设置为服务器模式
|
|
||||||
private SslContext loadSslContextFromJks(byte[] jks, String keyStorePassword) throws Exception {
|
|
||||||
InputStream jksInputStream = new ByteArrayInputStream(jks);
|
|
||||||
// 初始化 KeyStore
|
|
||||||
KeyStore keyStore = KeyStore.getInstance("JKS");
|
|
||||||
keyStore.load(jksInputStream, keyStorePassword.toCharArray());
|
|
||||||
|
|
||||||
// 初始化 KeyManagerFactory
|
|
||||||
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
|
|
||||||
kmf.init(keyStore, keyStorePassword.toCharArray());
|
|
||||||
|
|
||||||
// 创建 SslContext 并禁用客户端认证
|
|
||||||
return SslContextBuilder.forServer(kmf)
|
|
||||||
.clientAuth(ClientAuth.NONE) // 禁用客户端认证
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SslContext getSslContextByDomain(String domain) {
|
|
||||||
return domainSslContexts.get(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void removeSslContextByDomain(String domain) {
|
|
||||||
domainSslContexts.remove(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SslContext getSslContextByFullDomain(String fullDomain) {
|
|
||||||
String domain = ProxyUtil.getDomainNameByFullDomain(fullDomain);
|
|
||||||
if (StrUtil.isBlank(domain)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return domainSslContexts.get(domain);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.proxy.handler;
|
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.dromara.neutrinoproxy.core.*;
|
import org.dromara.neutrinoproxy.core.*;
|
||||||
import org.dromara.neutrinoproxy.core.*;
|
|
||||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.server.constant.ClientConnectTypeEnum;
|
import org.dromara.neutrinoproxy.server.constant.ClientConnectTypeEnum;
|
||||||
|
|||||||
@@ -1,112 +1,71 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.security;
|
package org.dromara.neutrinoproxy.server.proxy.security;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
import io.netty.util.CharsetUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.checkerframework.checker.i18nformatter.qual.I18nFormat;
|
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.util.HttpUtil;
|
import org.dromara.neutrinoproxy.core.util.HttpUtil;
|
||||||
import org.dromara.neutrinoproxy.core.util.IpUtil;
|
import org.dromara.neutrinoproxy.core.util.IpUtil;
|
||||||
import org.dromara.neutrinoproxy.server.service.DomainService;
|
import org.dromara.neutrinoproxy.server.proxy.domain.DomainMapping;
|
||||||
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
||||||
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* HTTP 访问安全检测
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2023/12/14
|
* @date: 2023/12/14
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdapter {
|
public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdapter {
|
||||||
private final SecurityGroupService securityGroupService = Solon.context().getBean(SecurityGroupService.class);
|
private SecurityGroupService securityGroupService = Solon.context().getBean(SecurityGroupService.class);
|
||||||
private final PortMappingService portMappingService = Solon.context().getBean(PortMappingService.class);
|
private PortMappingService portMappingService = Solon.context().getBean(PortMappingService.class);
|
||||||
private final DomainService domainService = Solon.context().getBean(DomainService.class);
|
|
||||||
/**
|
|
||||||
* 域名
|
|
||||||
*/
|
|
||||||
private Boolean isHttps;
|
|
||||||
|
|
||||||
// 拼接收到的 ByteBuf 内容
|
|
||||||
private ByteBuf cumulationBuf = Unpooled.buffer();
|
|
||||||
// private boolean initialized = false;
|
|
||||||
|
|
||||||
public HttpVisitorSecurityChannelHandler(Boolean isHttps) {
|
|
||||||
this.isHttps = isHttps;
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
// if (initialized) {
|
|
||||||
// // 已经初始化,直接透传
|
|
||||||
// ctx.fireChannelRead(msg);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 累加数据包
|
|
||||||
ByteBuf buf = (ByteBuf) msg;
|
ByteBuf buf = (ByteBuf) msg;
|
||||||
cumulationBuf.writeBytes(buf);
|
|
||||||
|
|
||||||
String dataStr = cumulationBuf.toString(CharsetUtil.UTF_8);
|
Integer domainId = ctx.channel().attr(Constants.SERVER_PORT).get();
|
||||||
int headerEndIndex = dataStr.indexOf("\r\n\r\n");
|
if (null == domainId) {
|
||||||
if (-1 == headerEndIndex) {
|
// 获取Host请求头
|
||||||
// 请求头还没读完,继续等
|
byte[] bytes = new byte[buf.readableBytes()];
|
||||||
return;
|
buf.readBytes(bytes);
|
||||||
}
|
String httpContent = new String(bytes);
|
||||||
|
String domain = HttpUtil.getHostIgnorePort(httpContent);
|
||||||
|
|
||||||
// 获取Host请求头
|
log.debug("HttpProxy host: {}", domain);
|
||||||
String headerPart = dataStr.substring(0, headerEndIndex + 4);
|
if (StringUtils.isBlank(domain)) {
|
||||||
String host = HttpUtil.getHostIgnorePort(headerPart); //test1.asgc.fun
|
|
||||||
|
|
||||||
log.debug("HttpProxy host: {}", host);
|
|
||||||
if (StringUtils.isBlank(host)) {
|
|
||||||
ctx.channel().close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 判断域名是否被禁用或删除
|
|
||||||
Integer domainNameId = ProxyUtil.getDomainNameIdByFullDomain(host);
|
|
||||||
if (domainNameId == null) {
|
|
||||||
ctx.channel().close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 域名映射强制https验证
|
|
||||||
if (!isHttps && domainService.isOnlyHttps(domainNameId)) {
|
|
||||||
ctx.channel().close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer serverPort = ctx.channel().attr(Constants.SERVER_PORT).get();
|
|
||||||
if (null == serverPort) {
|
|
||||||
// channel没有服务器端口信息,尝试根据完整域名拿到服务端端口
|
|
||||||
serverPort = ProxyUtil.getServerPortByFullDomain(host);
|
|
||||||
if (null == serverPort) {
|
|
||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 未配置域名解析,不再解析
|
||||||
|
if (!ProxyUtil.domainMapingMap.containsKey(domain)) {
|
||||||
|
ctx.channel().close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DomainMapping dm = ProxyUtil.domainMapingMap.get(domain);
|
||||||
|
|
||||||
// 判断IP是否在该端口绑定的安全组允许的规则内
|
// 判断IP是否在该端口绑定的安全组允许的规则内
|
||||||
String ip = IpUtil.getRealRemoteIp(headerPart);
|
String ip = IpUtil.getRealRemoteIp(httpContent);
|
||||||
if (ip == null) {
|
if (ip == null) {
|
||||||
ip = IpUtil.getRemoteIp(ctx);
|
ip = IpUtil.getRemoteIp(ctx);
|
||||||
}
|
}
|
||||||
if (!securityGroupService.judgeAllow(ip, portMappingService.getSecurityGroupIdByMappingPort(serverPort))) {
|
if (null==dm.getId() || !securityGroupService.judgeAllow(ip, portMappingService.getSecurityGroupIdByMappingPort(dm.getId()))) {
|
||||||
// 不在安全组规则放行范围内
|
// 不在安全组规则放行范围内
|
||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.channel().attr(Constants.REAL_REMOTE_IP).set(ip);
|
ctx.channel().attr(Constants.REAL_REMOTE_IP).set(ip);
|
||||||
ctx.channel().attr(Constants.SERVER_PORT).set(serverPort);
|
ctx.channel().attr(Constants.SERVER_PORT).set(dm.getId());
|
||||||
|
ctx.channel().attr(Constants.LICENSE_ID).set(dm.getLicenseId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从此之后所有的 in 都是“直接透传”。
|
|
||||||
// 否则,若请求体过长,数据包被拆分为多个,后续的数据包都无法解析出host,导致转发数据不完整。
|
|
||||||
ctx.pipeline().remove(this);
|
|
||||||
|
|
||||||
// 继续传播
|
// 继续传播
|
||||||
ctx.fireChannelRead(cumulationBuf);
|
buf.resetReaderIndex();
|
||||||
|
ctx.fireChannelRead(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public class UdpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdapt
|
|||||||
if (!securityGroupService.judgeAllow(datagramPacket.sender().getAddress().getHostAddress(), portMappingService.getSecurityGroupIdByMappingPort(sa.getPort()))) {
|
if (!securityGroupService.judgeAllow(datagramPacket.sender().getAddress().getHostAddress(), portMappingService.getSecurityGroupIdByMappingPort(sa.getPort()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 继续传播
|
// 继续传播
|
||||||
ctx.channel().attr(Constants.SERVER_PORT).set(sa.getPort());
|
ctx.channel().attr(Constants.SERVER_PORT).set(sa.getPort());
|
||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
|
|||||||
@@ -0,0 +1,298 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
|
import cn.hutool.cache.Cache;
|
||||||
|
import cn.hutool.cache.CacheUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
import org.apache.ibatis.solon.annotation.Db;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.db.DBInitialize;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||||
|
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingCreateReq;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingListReq;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingUpdateEnableStatusReq;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingUpdateReq;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.DomainMappingMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.PortPoolMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.*;
|
||||||
|
import org.dromara.neutrinoproxy.server.proxy.domain.DomainMapping;
|
||||||
|
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||||
|
import org.dromara.neutrinoproxy.server.service.bo.FlowLimitBO;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.PortAvailableUtil;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.StringUtil;
|
||||||
|
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 org.noear.solon.data.annotation.Tran;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 域名解析 service
|
||||||
|
* author xiaojie
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class DomainMappingService implements LifecycleBean {
|
||||||
|
@Db
|
||||||
|
private DomainMappingMapper domainMappingMapper;
|
||||||
|
@Db
|
||||||
|
private LicenseMapper licenseMapper;
|
||||||
|
@Db
|
||||||
|
private UserMapper userMapper;
|
||||||
|
@Db
|
||||||
|
private PortPoolMapper portPoolMapper;
|
||||||
|
@Inject
|
||||||
|
private VisitorChannelService visitorChannelService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private PortPoolService portPoolService;
|
||||||
|
@Inject
|
||||||
|
private ProxyConfig proxyConfig;
|
||||||
|
@Inject
|
||||||
|
private DBInitialize dbInitialize;
|
||||||
|
@Inject
|
||||||
|
private LicenseService licenseService;
|
||||||
|
|
||||||
|
|
||||||
|
public PageInfo<DomainMappingDto> page(PageQuery pageQuery, DomainMappingDto req) {
|
||||||
|
if (StringUtils.isNotEmpty(req.getDescription())) {
|
||||||
|
//描述字段为模糊查询,在应用层处理,否则sqlite不支持
|
||||||
|
req.setDescription("%" + req.getDescription() + "%");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 协议名称转换
|
||||||
|
if (StringUtils.isNotBlank(req.getProtocal())) {
|
||||||
|
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
||||||
|
req.setProtocal(networkProtocolEnum.getDesc());
|
||||||
|
}
|
||||||
|
|
||||||
|
Page<DomainMappingDO> page = new Page<>(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
List<DomainMappingDO> list = domainMappingMapper.selectDomainMappingByCondition(page, req);
|
||||||
|
List<DomainMappingDto> respList = list.stream().map(DomainMappingDO::toRes).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return PageInfo.of(respList, page.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<Integer> licenseIds = respList.stream().map(DomainMappingDto::getLicenseId).collect(Collectors.toSet());
|
||||||
|
List<LicenseDO> licenseList = licenseMapper.findByIds(licenseIds);
|
||||||
|
if (CollectionUtil.isEmpty(licenseList)) {
|
||||||
|
return PageInfo.of(respList, page.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
}
|
||||||
|
Set<Integer> userIds = licenseList.stream().map(LicenseDO::getUserId).collect(Collectors.toSet());
|
||||||
|
List<UserDO> userList = userMapper.findByIds(userIds);
|
||||||
|
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
||||||
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
|
|
||||||
|
respList.forEach(item -> {
|
||||||
|
LicenseDO license = licenseMap.get(item.getLicenseId());
|
||||||
|
if (null == license) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setLicenseName(license.getName());
|
||||||
|
item.setUserId(license.getUserId());
|
||||||
|
UserDO user = userMap.get(license.getUserId());
|
||||||
|
if (null == user) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setUserName(user.getName());
|
||||||
|
if (NetworkProtocolEnum.HTTP.getDesc().equals(item.getProtocal())) {
|
||||||
|
item.setProtocal("HTTP(S)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//sorted [userId asc] [licenseId asc] [createTime asc]
|
||||||
|
respList = respList.stream()
|
||||||
|
.filter(e -> null != e.getUserId())
|
||||||
|
.sorted(Comparator.comparing(DomainMappingDto::getUserId).thenComparing(DomainMappingDto::getLicenseId).thenComparing(DomainMappingDto::getCreateTime)).collect(Collectors.toList());
|
||||||
|
return PageInfo.of(respList, page.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Tran
|
||||||
|
public PortMappingCreateRes modify(DomainMappingDO dmd) {
|
||||||
|
LicenseDO licenseDO = licenseMapper.findById(dmd.getLicenseId());
|
||||||
|
ParamCheckUtil.checkNotNull(licenseDO, ExceptionConstant.LICENSE_NOT_EXIST);
|
||||||
|
if (!SystemContextHolder.isAdmin()) {
|
||||||
|
// 临时处理,如果当前用户不是管理员,则操作userId不能为1
|
||||||
|
ParamCheckUtil.checkExpression(!licenseDO.getUserId().equals(1), ExceptionConstant.NO_PERMISSION_VISIT);
|
||||||
|
}
|
||||||
|
if (null != dmd.getId()) { // 编辑
|
||||||
|
Date now = new Date();
|
||||||
|
dmd.setEnable(EnableStatusEnum.ENABLE.getStatus());
|
||||||
|
dmd.setUpdateTime(now);
|
||||||
|
domainMappingMapper.updateById(dmd);
|
||||||
|
// 更新VisitorChannel
|
||||||
|
DomainMappingDO oldDmd = domainMappingMapper.findById(dmd.getId());
|
||||||
|
ParamCheckUtil.checkNotNull(oldDmd, ExceptionConstant.PORT_MAPPING_NOT_EXIST);
|
||||||
|
ProxyMapping oldProxy = new ProxyMapping(oldDmd.getLicenseId(),oldDmd.getId(),oldDmd.getTargetPath(), NetworkProtocolEnum.HTTP.getDesc());
|
||||||
|
visitorChannelService.updateVisitorChannelByProxyMapping(oldProxy, new ProxyMapping(dmd.getLicenseId(),dmd.getId(),dmd.getTargetPath(), NetworkProtocolEnum.HTTP.getDesc()));
|
||||||
|
} else { // 新增
|
||||||
|
Date now = new Date();
|
||||||
|
dmd.setEnable(EnableStatusEnum.ENABLE.getStatus());
|
||||||
|
dmd.setCreateTime(now);
|
||||||
|
dmd.setUpdateTime(now);
|
||||||
|
domainMappingMapper.insert(dmd);
|
||||||
|
// 新增
|
||||||
|
visitorChannelService.addVisitorChannelByProxyMapping(new ProxyMapping(dmd.getLicenseId(),dmd.getId(),dmd.getTargetPath(), NetworkProtocolEnum.HTTP.getDesc()));
|
||||||
|
}
|
||||||
|
// 更新域名映射
|
||||||
|
ProxyUtil.domainMapingMap.put(dmd.getDomain(), new DomainMapping(dmd.getId(), dmd.getLicenseId(), dmd.getDomain(), dmd.getTargetPath()));
|
||||||
|
|
||||||
|
return new PortMappingCreateRes();
|
||||||
|
}
|
||||||
|
@Tran
|
||||||
|
public PortMappingUpdateEnableStatusRes updateEnableStatus(PortMappingUpdateEnableStatusReq req) {
|
||||||
|
DomainMappingDO domainMappingDO = domainMappingMapper.findById(req.getId());
|
||||||
|
ParamCheckUtil.checkNotNull(domainMappingDO, ExceptionConstant.PORT_MAPPING_NOT_EXIST);
|
||||||
|
|
||||||
|
LicenseDO licenseDO = licenseMapper.findById(domainMappingDO.getLicenseId());
|
||||||
|
ParamCheckUtil.checkNotNull(licenseDO, ExceptionConstant.LICENSE_NOT_EXIST);
|
||||||
|
if (!SystemContextHolder.isAdmin()) {
|
||||||
|
ParamCheckUtil.checkExpression(!licenseDO.getUserId().equals(1), ExceptionConstant.NO_PERMISSION_VISIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
domainMappingMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
|
||||||
|
|
||||||
|
// 更新VisitorChannel
|
||||||
|
domainMappingDO.setEnable(req.getEnable());
|
||||||
|
if (EnableStatusEnum.ENABLE == EnableStatusEnum.of(req.getEnable())) {
|
||||||
|
visitorChannelService.addVisitorChannelByProxyMapping(new ProxyMapping(domainMappingDO.getLicenseId(),domainMappingDO.getId(),domainMappingDO.getTargetPath(), NetworkProtocolEnum.HTTP.getDesc()));
|
||||||
|
} else {
|
||||||
|
visitorChannelService.removeVisitorChannelByProxyMapping(new ProxyMapping(domainMappingDO.getLicenseId(),domainMappingDO.getId(),domainMappingDO.getTargetPath(), NetworkProtocolEnum.HTTP.getDesc()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PortMappingUpdateEnableStatusRes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delete(Integer id) {
|
||||||
|
DomainMappingDO domain = domainMappingMapper.findById(id);
|
||||||
|
ParamCheckUtil.checkNotNull(domain, ExceptionConstant.PORT_MAPPING_NOT_EXIST);
|
||||||
|
|
||||||
|
LicenseDO licenseDO = licenseMapper.findById(domain.getLicenseId());
|
||||||
|
if (null != licenseDO && !SystemContextHolder.isAdmin()) {
|
||||||
|
// 临时处理,如果当前用户不是管理员,则操作userId不能为1
|
||||||
|
ParamCheckUtil.checkExpression(!licenseDO.getUserId().equals(1), ExceptionConstant.NO_PERMISSION_VISIT);
|
||||||
|
}
|
||||||
|
domainMappingMapper.deleteById(id);
|
||||||
|
|
||||||
|
// 更新VisitorChannel
|
||||||
|
visitorChannelService.removeVisitorChannelByProxyMapping(new ProxyMapping(domain.getLicenseId(),domain.getId(),domain.getTargetPath(), NetworkProtocolEnum.HTTP.getDesc()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void domainBindSecurityGroup(Integer portMappingId, Integer groupId) {
|
||||||
|
DomainMappingDO mappingDO = domainMappingMapper.findById(portMappingId);
|
||||||
|
if (mappingDO == null) {
|
||||||
|
throw new RuntimeException("指定的端口映射不存在");
|
||||||
|
}
|
||||||
|
mappingDO.setSecurityGroupId(groupId);
|
||||||
|
mappingDO.setUpdateTime(new Date());
|
||||||
|
domainMappingMapper.updateById(mappingDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void domainUnbindSecurityGroup(Integer portMappingId) {
|
||||||
|
DomainMappingDO mappingDO = domainMappingMapper.findById(portMappingId);
|
||||||
|
if (mappingDO == null) {
|
||||||
|
throw new RuntimeException("指定的端口映射不存在");
|
||||||
|
}
|
||||||
|
mappingDO.setSecurityGroupId(0);
|
||||||
|
mappingDO.setUpdateTime(new Date());
|
||||||
|
domainMappingMapper.updateById(mappingDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据license查询可用的端口映射列表
|
||||||
|
*
|
||||||
|
* @param licenseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<DomainMappingDO> findEnableListByLicenseId(Integer licenseId) {
|
||||||
|
return domainMappingMapper.findEnableListByLicenseId(licenseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务端项目停止、启动时,更新在线状态为离线
|
||||||
|
*/
|
||||||
|
@Init
|
||||||
|
public void init() {
|
||||||
|
// aot 阶段,不初始化
|
||||||
|
if (NativeDetector.isAotRuntime()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<DomainMappingDO> allMappingDOList = domainMappingMapper.selectList(Wrappers.lambdaQuery(DomainMappingDO.class));
|
||||||
|
if(CollectionUtil.isNotEmpty(allMappingDOList)) {
|
||||||
|
allMappingDOList.forEach(domain -> {
|
||||||
|
ProxyUtil.domainMapingMap.put(domain.getDomain(),
|
||||||
|
new DomainMapping(domain.getId(), domain.getLicenseId(), domain.getDomain(), domain.getTargetPath()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start() throws Throwable {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务端项目停止、启动时,更新在线状态为离线
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void stop() throws Throwable {
|
||||||
|
// domainMappingMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
public DomainMappingDto one(Integer id) {
|
||||||
|
DomainMappingDO domainMappingDO = domainMappingMapper.findById(id);
|
||||||
|
if (null == domainMappingDO) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
DomainMappingDto res = (DomainMappingDto)domainMappingDO;
|
||||||
|
|
||||||
|
LicenseDO license = licenseMapper.findById(domainMappingDO.getLicenseId());
|
||||||
|
if (null != license) {
|
||||||
|
res.setLicenseName(license.getName());
|
||||||
|
res.setUserId(license.getUserId());
|
||||||
|
UserDO user = userMapper.findById(license.getUserId());
|
||||||
|
if (null != user) {
|
||||||
|
res.setUserName(user.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查端口是否被占用
|
||||||
|
* 端口映射编辑时,如果端口号没有变动,则不验证。避免出现端口映射正在使用时,无法更新端口映射其他信息的问题
|
||||||
|
* @param domain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean exitDomain(String domain, Integer id) {
|
||||||
|
DomainMappingDO domainMappingDO = domainMappingMapper.findByDomain(domain, ObjectUtil.isNotNull(id) ? new HashSet<>(){{add(id);}} : new HashSet());
|
||||||
|
if (null == domainMappingDO) return Boolean.TRUE;
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,301 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.service;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.text.StrPool;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.ibatis.solon.annotation.Db;
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
|
||||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.*;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.DomainCreateReq;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.DomainListReq;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.DomainUpdateEnableStatusReq;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.DomainUpdateReq;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainListRes;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainUpdateDefaultStatusRes;
|
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.DomainUpdateEnableStatusRes;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.DomainMapper;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.DomainPortMappingMapper;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.DomainNameDO;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.enhance.SslContextManager;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO;
|
|
||||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
|
||||||
import org.noear.solon.annotation.Component;
|
|
||||||
import org.noear.solon.annotation.Init;
|
|
||||||
import org.noear.solon.annotation.Inject;
|
|
||||||
import org.noear.solon.core.handle.UploadedFile;
|
|
||||||
import org.noear.solon.core.runtime.NativeDetector;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Mirac
|
|
||||||
* @date 21/7/2024
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class DomainService {
|
|
||||||
@Db
|
|
||||||
private DomainMapper domainMapper;
|
|
||||||
@Db
|
|
||||||
private UserMapper userMapper;
|
|
||||||
@Db
|
|
||||||
private PortMappingMapper portMappingMapper;
|
|
||||||
@Db
|
|
||||||
private DomainPortMappingMapper domainPortMappingMapper;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private SslContextManager sslContextManager;
|
|
||||||
|
|
||||||
public PageInfo<DomainListRes> page(PageQuery pageQuery, DomainListReq req) {
|
|
||||||
Page<DomainNameDO> page = domainMapper.selectPage(new Page<>(pageQuery.getCurrent(), pageQuery.getSize()), new LambdaQueryWrapper<DomainNameDO>()
|
|
||||||
.eq(req.getEnable() != null, DomainNameDO::getEnable, req.getEnable())
|
|
||||||
.eq(req.getUserId() != null, DomainNameDO::getUserId, req.getUserId())
|
|
||||||
.orderByAsc(Arrays.asList(DomainNameDO::getUserId, DomainNameDO::getId))
|
|
||||||
);
|
|
||||||
List<DomainListRes> resList = page.getRecords().stream().map(DomainNameDO::toRes).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isEmpty(page.getRecords())) {
|
|
||||||
return PageInfo.of(resList, page);
|
|
||||||
}
|
|
||||||
Set<Integer> userIds = resList.stream().map(DomainListRes::getUserId).collect(Collectors.toSet());
|
|
||||||
List<UserDO> userDOList = userMapper.findByIds(userIds);
|
|
||||||
Map<Integer, UserDO> userMap = userDOList.stream().collect(Collectors.toMap(UserDO::getId, c -> c));
|
|
||||||
for (DomainListRes item : resList) {
|
|
||||||
UserDO userDO = userMap.get(item.getUserId());
|
|
||||||
if (null != userDO) {
|
|
||||||
item.setUserName(userDO.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return PageInfo.of(resList, page);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DomainListRes> all(DomainListReq req) {
|
|
||||||
LambdaQueryWrapper<DomainNameDO> wrapper = Wrappers.<DomainNameDO>lambdaQuery()
|
|
||||||
.eq(req.getEnable() != null, DomainNameDO::getEnable, req.getEnable());
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectList(wrapper);
|
|
||||||
if (CollectionUtil.isEmpty(domainNameDOS)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
List<DomainListRes> resList = domainNameDOS.stream().map(DomainNameDO::toRes).toList();
|
|
||||||
Set<Integer> userIds = resList.stream().map(DomainListRes::getUserId).collect(Collectors.toSet());
|
|
||||||
List<UserDO> userDOList = userMapper.findByIds(userIds);
|
|
||||||
Map<Integer, UserDO> userMap = userDOList.stream().collect(Collectors.toMap(UserDO::getId, c -> c));
|
|
||||||
for (DomainListRes item : resList) {
|
|
||||||
UserDO userDO = userMap.get(item.getUserId());
|
|
||||||
if (null != userDO) {
|
|
||||||
item.setUserName(userDO.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return resList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建域名
|
|
||||||
*
|
|
||||||
* @param req
|
|
||||||
*/
|
|
||||||
public void create(DomainCreateReq req, UploadedFile jks) {
|
|
||||||
DomainNameDO domainNameCheck = domainMapper.checkRepeat(req.getDomain(), null);
|
|
||||||
ParamCheckUtil.checkMustNull(domainNameCheck, ExceptionConstant.DOMAIN_NAME_CANNOT_REPEAT);
|
|
||||||
DomainNameDO domainNameDO = new DomainNameDO();
|
|
||||||
if (null != jks) {
|
|
||||||
try {
|
|
||||||
ParamCheckUtil.checkNotEmpty(req.getKeyStorePassword(), "keyStorePassword");
|
|
||||||
|
|
||||||
InputStream content = jks.getContent();
|
|
||||||
byte[] byteArray = toByteArray(content);
|
|
||||||
domainNameDO.setJks(byteArray);
|
|
||||||
domainNameDO.setKeyStorePassword(req.getKeyStorePassword());
|
|
||||||
//添加证书
|
|
||||||
sslContextManager.addDomainAndCert(req.getDomain(), byteArray, req.getKeyStorePassword());
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("证书添加失败", e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Integer userId = SystemContextHolder.getUserId();
|
|
||||||
Date now = new Date();
|
|
||||||
domainNameDO.setDomain(req.getDomain());
|
|
||||||
domainNameDO.setIsDefault(DefaultDomainStatusEnum.DISABLE.getStatus());
|
|
||||||
domainNameDO.setForceHttps(req.getForceHttps() != null ? HttpsStatusEnum.of(req.getForceHttps()).getStatus() : HttpsStatusEnum.DISABLE_ONLY_HTTPS.getStatus());
|
|
||||||
domainNameDO.setUserId(userId);
|
|
||||||
domainNameDO.setEnable(EnableStatusEnum.ENABLE.getStatus());
|
|
||||||
domainNameDO.setCreateTime(now);
|
|
||||||
domainNameDO.setUpdateTime(now);
|
|
||||||
domainMapper.insert(domainNameDO);
|
|
||||||
//更新主域名到域名id映射
|
|
||||||
ProxyUtil.setDomainToDomainNameId(domainNameDO.getDomain(), domainNameDO.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将 InputStream 转换为 byte[]
|
|
||||||
*/
|
|
||||||
private byte[] toByteArray(InputStream input) throws IOException {
|
|
||||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
|
||||||
int nRead;
|
|
||||||
byte[] data = new byte[1024];
|
|
||||||
while ((nRead = input.read(data, 0, data.length)) != -1) {
|
|
||||||
buffer.write(data, 0, nRead);
|
|
||||||
}
|
|
||||||
buffer.flush();
|
|
||||||
return buffer.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(DomainUpdateReq req, UploadedFile jks) {
|
|
||||||
DomainNameDO domainNameCheck = domainMapper.checkRepeat(req.getDomain(), Sets.newHashSet(req.getId()));
|
|
||||||
ParamCheckUtil.checkMustNull(domainNameCheck, ExceptionConstant.DOMAIN_NAME_CANNOT_REPEAT);
|
|
||||||
|
|
||||||
DomainNameDO oldDomainNameDO = domainMapper.selectOne(Wrappers.<DomainNameDO>lambdaQuery().eq(DomainNameDO::getId, req.getId()));
|
|
||||||
List<FullDomainNameBO> oldFullDomainNameBOS = domainMapper.selectFullDomainNameListByDomainNameIds(Sets.newHashSet(req.getId()));
|
|
||||||
LambdaUpdateWrapper<DomainNameDO> updateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
updateWrapper.eq(DomainNameDO::getId, req.getId());
|
|
||||||
if (null != jks) {
|
|
||||||
try {
|
|
||||||
ParamCheckUtil.checkNotEmpty(req.getKeyStorePassword(), "keyStorePassword");
|
|
||||||
|
|
||||||
InputStream content = jks.getContent();
|
|
||||||
byte[] byteArray = toByteArray(content);
|
|
||||||
updateWrapper.set(DomainNameDO::getKeyStorePassword, req.getKeyStorePassword());
|
|
||||||
updateWrapper.set(DomainNameDO::getJks, byteArray);
|
|
||||||
//添加证书并删除旧的证书
|
|
||||||
sslContextManager.addDomainAndCert(req.getDomain(), byteArray, req.getKeyStorePassword());
|
|
||||||
if (!req.getDomain().equals(oldDomainNameDO.getDomain())) {
|
|
||||||
sslContextManager.removeSslContextByDomain(oldDomainNameDO.getDomain());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("证书添加失败", e);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateWrapper.set(DomainNameDO::getDomain, req.getDomain());
|
|
||||||
updateWrapper.set(DomainNameDO::getUpdateTime, new Date());
|
|
||||||
updateWrapper.set(req.getForceHttps() != null, DomainNameDO::getForceHttps, req.getForceHttps());
|
|
||||||
domainMapper.update(updateWrapper);
|
|
||||||
|
|
||||||
//更新域名相关映射
|
|
||||||
if (!Objects.equals(oldDomainNameDO.getDomain(), req.getDomain())) {
|
|
||||||
//更新主域名到域名id映射
|
|
||||||
ProxyUtil.removeDomainToDomainNameId(oldDomainNameDO.getDomain());
|
|
||||||
ProxyUtil.setDomainToDomainNameId(req.getDomain(), req.getId());
|
|
||||||
if (CollectionUtil.isEmpty(oldFullDomainNameBOS)) return;
|
|
||||||
//存在域名映射,更新完整域名到服务器端口映射
|
|
||||||
for (FullDomainNameBO oldFullDomainNameBO : oldFullDomainNameBOS) {
|
|
||||||
String oldFullDomain = StrUtil.join(StrPool.DOT, oldFullDomainNameBO.getSubdomain(), oldFullDomainNameBO.getDomain());
|
|
||||||
Integer serverPort = ProxyUtil.getServerPortByFullDomain(oldFullDomain);
|
|
||||||
ProxyUtil.removeFullDomainToServerPort(oldFullDomain);
|
|
||||||
ProxyUtil.setFullDomainToServerPort(StrUtil.join(StrPool.DOT, oldFullDomainNameBO.getSubdomain(), req.getDomain()), serverPort);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DomainUpdateEnableStatusRes updateEnableStatus(DomainUpdateEnableStatusReq req) {
|
|
||||||
if (Objects.equals(req.getEnable(), EnableStatusEnum.DISABLE.getStatus())) {
|
|
||||||
//如果设置状态为禁用,则将默认域名设置为非默认域名
|
|
||||||
updateDefaultStatus(req.getId(), DefaultDomainStatusEnum.DISABLE.getStatus());
|
|
||||||
}
|
|
||||||
domainMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
|
|
||||||
if (Objects.equals(req.getEnable(), EnableStatusEnum.ENABLE.getStatus())) {
|
|
||||||
ProxyUtil.setDomainToDomainNameId(req.getDomain(), req.getId());
|
|
||||||
} else {
|
|
||||||
ProxyUtil.removeDomainToDomainNameId(req.getDomain());
|
|
||||||
}
|
|
||||||
return new DomainUpdateEnableStatusRes();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void delete(Integer domainNameId) {
|
|
||||||
//检查当前域名是否正在使用
|
|
||||||
boolean checkUsed = domainPortMappingMapper.checkUsed(domainNameId);
|
|
||||||
ParamCheckUtil.checkExpression(!checkUsed, ExceptionConstant.DOMAIN_NAME_IS_USED);
|
|
||||||
DomainNameDO domainNameDO = domainMapper.selectOne(Wrappers.<DomainNameDO>lambdaQuery()
|
|
||||||
.eq(DomainNameDO::getId, domainNameId)
|
|
||||||
.select(DomainNameDO::getDomain, DomainNameDO::getEnable));
|
|
||||||
if (Objects.equals(domainNameDO.getEnable(), EnableStatusEnum.ENABLE.getStatus())) {
|
|
||||||
ProxyUtil.removeDomainToDomainNameId(domainNameDO.getDomain());
|
|
||||||
}
|
|
||||||
domainMapper.deleteById(domainNameId);
|
|
||||||
//删除证书
|
|
||||||
sslContextManager.removeSslContextByDomain(domainNameDO.getDomain());
|
|
||||||
}
|
|
||||||
|
|
||||||
public DomainUpdateDefaultStatusRes updateDefaultStatus(Integer id, Integer isDefault) {
|
|
||||||
if (Objects.equals(isDefault, DefaultDomainStatusEnum.ENABLE.getStatus())) {
|
|
||||||
//如果设置状态为默认域名,则将之前的默认域名设置为非默认域名
|
|
||||||
DomainNameDO oldDomainNameDO = domainMapper.selectOne(Wrappers.<DomainNameDO>lambdaQuery()
|
|
||||||
.select(DomainNameDO::getId)
|
|
||||||
.eq(DomainNameDO::getIsDefault, DefaultDomainStatusEnum.ENABLE.getStatus()));
|
|
||||||
if (oldDomainNameDO != null) {
|
|
||||||
oldDomainNameDO.setIsDefault(DefaultDomainStatusEnum.DISABLE.getStatus());
|
|
||||||
domainMapper.updateById(oldDomainNameDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DomainNameDO domainNameDO = new DomainNameDO();
|
|
||||||
domainNameDO.setId(id);
|
|
||||||
domainNameDO.setIsDefault(isDefault);
|
|
||||||
domainMapper.updateById(domainNameDO);
|
|
||||||
|
|
||||||
return new DomainUpdateDefaultStatusRes();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Init
|
|
||||||
public void init() {
|
|
||||||
// aot 阶段,不初始化
|
|
||||||
if (NativeDetector.isAotRuntime()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<FullDomainNameBO> fullDomainNameBOS = domainMapper.selectFullDomainNameList();
|
|
||||||
if (CollectionUtil.isEmpty(fullDomainNameBOS)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Set<Integer> portMappingIds = fullDomainNameBOS.stream().map(FullDomainNameBO::getPortMappingId).collect(Collectors.toSet());
|
|
||||||
List<PortMappingDO> portMappingDOS = portMappingMapper.selectBatchIds(portMappingIds);
|
|
||||||
if (CollectionUtil.isEmpty(portMappingDOS)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Map<Integer, PortMappingDO> portMappingDOMap = portMappingDOS.stream()
|
|
||||||
.filter(item -> NetworkProtocolEnum.HTTP.getDesc().equals(item.getProtocal()))
|
|
||||||
.collect(Collectors.toMap(PortMappingDO::getId, Function.identity()));
|
|
||||||
fullDomainNameBOS.forEach(item -> {
|
|
||||||
PortMappingDO portMappingDO = portMappingDOMap.get(item.getPortMappingId());
|
|
||||||
if (null == portMappingDO) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String fullDomain = StrUtil.join(StrPool.DOT, item.getSubdomain(), item.getDomain());
|
|
||||||
//更新完整域名到端口映射
|
|
||||||
ProxyUtil.setFullDomainToServerPort(fullDomain, portMappingDO.getServerPort());
|
|
||||||
});
|
|
||||||
|
|
||||||
//更新主域名到主域名id缓存,未禁用
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectList(Wrappers.<DomainNameDO>lambdaQuery()
|
|
||||||
.eq(DomainNameDO::getEnable, EnableStatusEnum.ENABLE.getStatus())
|
|
||||||
.select(DomainNameDO::getDomain, DomainNameDO::getId));
|
|
||||||
for (DomainNameDO domainNameDO : domainNameDOS) {
|
|
||||||
ProxyUtil.setDomainToDomainNameId(domainNameDO.getDomain(), domainNameDO.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOnlyHttps(Integer domainNameId) {
|
|
||||||
ParamCheckUtil.checkExpression((domainNameId != null && domainNameId > 0), ExceptionConstant.DOMAIN_NAME_NOT_EXIST);
|
|
||||||
DomainNameDO domainNameDO = domainMapper.selectOne(Wrappers.<DomainNameDO>lambdaQuery()
|
|
||||||
.eq(DomainNameDO::getId, domainNameId));
|
|
||||||
return domainNameDO != null && Objects.equals(domainNameDO.getForceHttps(), HttpsStatusEnum.ONLY_HTTPS.getStatus());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.service;
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.core.util.LockUtil;
|
import org.dromara.neutrinoproxy.core.util.LockUtil;
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.service;
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import org.noear.solon.annotation.Init;
|
|||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
import org.noear.solon.core.bean.LifecycleBean;
|
import org.noear.solon.core.bean.LifecycleBean;
|
||||||
import org.noear.solon.core.runtime.NativeDetector;
|
import org.noear.solon.core.runtime.NativeDetector;
|
||||||
|
import org.noear.solon.data.annotation.Tran;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -107,17 +108,16 @@ public class LicenseService implements LifecycleBean {
|
|||||||
|
|
||||||
private List<LicenseListRes> assembleConvertLicenses(List<LicenseDO> list) {
|
private List<LicenseListRes> assembleConvertLicenses(List<LicenseDO> list) {
|
||||||
List<LicenseListRes> licenseList = list.stream().map(LicenseDO::toRes).collect(Collectors.toList());
|
List<LicenseListRes> licenseList = list.stream().map(LicenseDO::toRes).collect(Collectors.toList());
|
||||||
if (!CollectionUtil.isEmpty(licenseList)) {
|
// 插入用户名
|
||||||
Set<Integer> userIds = licenseList.stream().map(LicenseListRes::getUserId).collect(Collectors.toSet());
|
Set<Integer> userIds = licenseList.stream().map(LicenseListRes::getUserId).collect(Collectors.toSet());
|
||||||
List<UserDO> userList = userMapper.findByIds(userIds);
|
List<UserDO> userList = userMapper.findByIds(userIds);
|
||||||
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
for (LicenseListRes item : licenseList) {
|
for (LicenseListRes item : licenseList) {
|
||||||
UserDO userDO = userMap.get(item.getUserId());
|
UserDO userDO = userMap.get(item.getUserId());
|
||||||
if (null != userDO) {
|
if (null != userDO) {
|
||||||
item.setUserName(userDO.getName());
|
item.setUserName(userDO.getName());
|
||||||
}
|
|
||||||
item.setKey(desensitization(item.getUserId(), item.getKey()));
|
|
||||||
}
|
}
|
||||||
|
item.setKey(desensitization(item.getUserId(), item.getKey()));
|
||||||
}
|
}
|
||||||
return licenseList;
|
return licenseList;
|
||||||
}
|
}
|
||||||
@@ -203,10 +203,20 @@ public class LicenseService implements LifecycleBean {
|
|||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Tran
|
||||||
public LicenseUpdateEnableStatusRes updateEnableStatus(LicenseUpdateEnableStatusReq req) {
|
public LicenseUpdateEnableStatusRes updateEnableStatus(LicenseUpdateEnableStatusReq req) {
|
||||||
licenseMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
|
// 服务端免通道 直接转发,所以无需建立客户端通道。启用即在线,禁用即离线 20240311 设计取消
|
||||||
// 更新VisitorChannel
|
// if (req.getId() == 1) {
|
||||||
visitorChannelService.updateVisitorChannelByLicenseId(req.getId(), req.getEnable());
|
// licenseMapper.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
||||||
|
// .eq(LicenseDO::getId, req.getId())
|
||||||
|
// .set(LicenseDO::getEnable, req.getEnable())
|
||||||
|
// .set(LicenseDO::getIsOnline, req.getEnable())
|
||||||
|
// .set(LicenseDO::getUpdateTime, new Date()));
|
||||||
|
// } else {
|
||||||
|
licenseMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
|
||||||
|
// 更新VisitorChannel
|
||||||
|
visitorChannelService.updateVisitorChannelByLicenseId(req.getId(), req.getEnable());
|
||||||
|
// }
|
||||||
return new LicenseUpdateEnableStatusRes();
|
return new LicenseUpdateEnableStatusRes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,6 +348,7 @@ public class LicenseService implements LifecycleBean {
|
|||||||
.eq(LicenseDO::getEnable, EnableStatusEnum.ENABLE.getStatus())
|
.eq(LicenseDO::getEnable, EnableStatusEnum.ENABLE.getStatus())
|
||||||
.eq(LicenseDO::getUserId, SystemContextHolder.getUserId())
|
.eq(LicenseDO::getUserId, SystemContextHolder.getUserId())
|
||||||
);
|
);
|
||||||
|
if (CollectionUtil.isEmpty(list)) return null;
|
||||||
List<LicenseListRes> licenseList = assembleConvertLicenses(list);
|
List<LicenseListRes> licenseList = assembleConvertLicenses(list);
|
||||||
return licenseList;
|
return licenseList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package org.dromara.neutrinoproxy.server.service;
|
|||||||
|
|
||||||
import cn.hutool.cache.Cache;
|
import cn.hutool.cache.Cache;
|
||||||
import cn.hutool.cache.CacheUtil;
|
import cn.hutool.cache.CacheUtil;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.text.StrPool;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -30,10 +30,17 @@ import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingCreateRe
|
|||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingDetailRes;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingDetailRes;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingListRes;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingListRes;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingUpdateEnableStatusRes;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingUpdateEnableStatusRes;
|
||||||
import org.dromara.neutrinoproxy.server.dal.*;
|
import org.dromara.neutrinoproxy.server.controller.res.proxy.PortMappingUpdateRes;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.*;
|
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.PortPoolMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||||
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
|
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FlowLimitBO;
|
import org.dromara.neutrinoproxy.server.service.bo.FlowLimitBO;
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO;
|
|
||||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.dromara.neutrinoproxy.server.util.StringUtil;
|
import org.dromara.neutrinoproxy.server.util.StringUtil;
|
||||||
@@ -62,10 +69,6 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
@Db
|
@Db
|
||||||
private PortPoolMapper portPoolMapper;
|
private PortPoolMapper portPoolMapper;
|
||||||
@Db
|
|
||||||
private DomainMapper domainMapper;
|
|
||||||
@Db
|
|
||||||
private DomainPortMappingMapper domainPortMappingMapper;
|
|
||||||
@Inject
|
@Inject
|
||||||
private VisitorChannelService visitorChannelService;
|
private VisitorChannelService visitorChannelService;
|
||||||
|
|
||||||
@@ -80,6 +83,7 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
|
|
||||||
/** 端口到安全组Id的映射 */
|
/** 端口到安全组Id的映射 */
|
||||||
private final Map<Integer, Integer> mappingPortToSecurityGroupMap = new ConcurrentHashMap<>();
|
private final Map<Integer, Integer> mappingPortToSecurityGroupMap = new ConcurrentHashMap<>();
|
||||||
|
// 服务端端口到端口映射id的映射
|
||||||
private final Cache<Integer, Integer> serverPortToPortMappingIdCache = CacheUtil.newLRUCache(500, 1000 * 60 * 10);
|
private final Cache<Integer, Integer> serverPortToPortMappingIdCache = CacheUtil.newLRUCache(500, 1000 * 60 * 10);
|
||||||
// 端口映射id到licenseId
|
// 端口映射id到licenseId
|
||||||
private final Cache<Integer, Integer> idToLicenseIdCache = CacheUtil.newLRUCache(500, 1000 * 60 * 10);
|
private final Cache<Integer, Integer> idToLicenseIdCache = CacheUtil.newLRUCache(500, 1000 * 60 * 10);
|
||||||
@@ -115,11 +119,6 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
||||||
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
|
|
||||||
//域名相关
|
|
||||||
Set<Integer> portMappingIds = respList.stream().map(PortMappingListRes::getId).collect(Collectors.toSet());
|
|
||||||
List<FullDomainNameBO> fullDomainNameBOS = domainMapper.selectFullDomainNameListByPortMappingIds(portMappingIds);
|
|
||||||
Map<Integer, List<FullDomainNameBO>> fullDomainNameBOMap = fullDomainNameBOS.stream().collect(Collectors.groupingBy(FullDomainNameBO::getPortMappingId));
|
|
||||||
|
|
||||||
respList.forEach(item -> {
|
respList.forEach(item -> {
|
||||||
LicenseDO license = licenseMap.get(item.getLicenseId());
|
LicenseDO license = licenseMap.get(item.getLicenseId());
|
||||||
if (null == license) {
|
if (null == license) {
|
||||||
@@ -132,8 +131,6 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
item.setUserName(user.getName());
|
item.setUserName(user.getName());
|
||||||
//域名映射
|
|
||||||
item.setFullDomainMappings(fullDomainNameBOMap.get(item.getId()));
|
|
||||||
if (NetworkProtocolEnum.HTTP.getDesc().equals(item.getProtocal())) {
|
if (NetworkProtocolEnum.HTTP.getDesc().equals(item.getProtocal())) {
|
||||||
item.setProtocal("HTTP(S)");
|
item.setProtocal("HTTP(S)");
|
||||||
}
|
}
|
||||||
@@ -155,21 +152,7 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
PortPoolDO portPoolDO = portPoolMapper.findByPort(req.getServerPort());
|
PortPoolDO portPoolDO = portPoolMapper.findByPort(req.getServerPort());
|
||||||
ParamCheckUtil.checkNotNull(portPoolDO, ExceptionConstant.PORT_NOT_EXIST);
|
ParamCheckUtil.checkNotNull(portPoolDO, ExceptionConstant.PORT_NOT_EXIST);
|
||||||
ParamCheckUtil.checkExpression(null == portMappingMapper.findByPort(req.getServerPort(), null), ExceptionConstant.PORT_CANNOT_REPEAT_MAPPING, req.getServerPort());
|
ParamCheckUtil.checkExpression(null == portMappingMapper.findByPort(req.getServerPort(), null), ExceptionConstant.PORT_CANNOT_REPEAT_MAPPING, req.getServerPort());
|
||||||
//验证域名映射相关参数条件
|
|
||||||
if (NetworkProtocolEnum.isHttp(req.getProtocal()) && CollectionUtil.isNotEmpty(req.getDomainMappings())) {
|
|
||||||
Set<Integer> domainIds = req.getDomainMappings().stream().map(item -> item.getDomainId()).collect(Collectors.toSet());
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectBatchIds(domainIds);
|
|
||||||
Map<Integer, DomainNameDO> domainNameDOMap = domainNameDOS.stream().collect(Collectors.toMap(DomainNameDO::getId, Function.identity()));
|
|
||||||
|
|
||||||
req.getDomainMappings().forEach(item -> {
|
|
||||||
DomainNameDO domainNameDO = domainNameDOMap.get(item.getDomainId());
|
|
||||||
ParamCheckUtil.checkNotNull(domainNameDO, ExceptionConstant.DOMAIN_NAME_NOT_EXIST);
|
|
||||||
//检查当前域名是否被禁用
|
|
||||||
//ParamCheckUtil.checkExpression(Objects.equals(EnableStatusEnum.ENABLE.getStatus(), domainNameDO.getEnable()), ExceptionConstant.DOMAIN_NAME_IS_DISABLE, domainNameDO.getDomain());
|
|
||||||
//检查子域名是否重复
|
|
||||||
ParamCheckUtil.checkExpression(!domainPortMappingMapper.checkRepeatBySubdomain(item.getSubdomain(), item.getDomainId(), null), ExceptionConstant.SUDOMAIN_NAME_CANNOT_REPEAT);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
PortMappingDO portMappingDO = new PortMappingDO();
|
PortMappingDO portMappingDO = new PortMappingDO();
|
||||||
portMappingDO.setLicenseId(req.getLicenseId());
|
portMappingDO.setLicenseId(req.getLicenseId());
|
||||||
@@ -188,26 +171,7 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
portMappingDO.setUpdateTime(now);
|
portMappingDO.setUpdateTime(now);
|
||||||
portMappingMapper.insert(portMappingDO);
|
portMappingMapper.insert(portMappingDO);
|
||||||
// 更新VisitorChannel
|
// 更新VisitorChannel
|
||||||
visitorChannelService.addVisitorChannelByPortMapping(portMappingDO);
|
visitorChannelService.addVisitorChannelByProxyMapping(ProxyMapping.build(portMappingDO));
|
||||||
|
|
||||||
// 更新域名映射,添加新的域名映射
|
|
||||||
if (NetworkProtocolEnum.isHttp(portMappingDO.getProtocal()) && CollectionUtil.isNotEmpty(req.getDomainMappings())) {
|
|
||||||
Set<Integer> domainIds = req.getDomainMappings().stream().map(item -> item.getDomainId()).collect(Collectors.toSet());
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectBatchIds(domainIds);
|
|
||||||
Map<Integer, DomainNameDO> domainNameDOMap = domainNameDOS.stream().collect(Collectors.toMap(DomainNameDO::getId, Function.identity()));
|
|
||||||
|
|
||||||
req.getDomainMappings().forEach(item -> {
|
|
||||||
DomainNameDO domainNameDO = domainNameDOMap.get(item.getDomainId());
|
|
||||||
//创建域名映射
|
|
||||||
DomainPortMappingDO domainPortMappingDO = new DomainPortMappingDO();
|
|
||||||
domainPortMappingDO.setDomainNameId(item.getDomainId());
|
|
||||||
domainPortMappingDO.setSubdomain(item.getSubdomain());
|
|
||||||
domainPortMappingDO.setPortMappingId(portMappingDO.getId());
|
|
||||||
domainPortMappingMapper.insert(domainPortMappingDO);
|
|
||||||
//设置完整域名到服务端端口的映射
|
|
||||||
ProxyUtil.setFullDomainToServerPort(StrUtil.join(StrPool.DOT, item.getSubdomain(), domainNameDO.getDomain()), portMappingDO.getServerPort());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
updateMappingPortToSecurityGroupMap(portMappingDO.getServerPort(), req.getSecurityGroupId());
|
updateMappingPortToSecurityGroupMap(portMappingDO.getServerPort(), req.getSecurityGroupId());
|
||||||
|
|
||||||
@@ -231,25 +195,11 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
PortPoolDO portPoolDO = portPoolMapper.findByPort(req.getServerPort());
|
PortPoolDO portPoolDO = portPoolMapper.findByPort(req.getServerPort());
|
||||||
ParamCheckUtil.checkNotNull(portPoolDO, ExceptionConstant.PORT_NOT_EXIST);
|
ParamCheckUtil.checkNotNull(portPoolDO, ExceptionConstant.PORT_NOT_EXIST);
|
||||||
ParamCheckUtil.checkExpression(null == portMappingMapper.findByPort(req.getServerPort(), Sets.newHashSet(req.getId())), ExceptionConstant.PORT_CANNOT_REPEAT_MAPPING, req.getServerPort());
|
ParamCheckUtil.checkExpression(null == portMappingMapper.findByPort(req.getServerPort(), Sets.newHashSet(req.getId())), ExceptionConstant.PORT_CANNOT_REPEAT_MAPPING, req.getServerPort());
|
||||||
|
|
||||||
// 查询原端口映射
|
// 查询原端口映射
|
||||||
PortMappingDO oldPortMappingDO = portMappingMapper.findById(req.getId());
|
PortMappingDO oldPortMappingDO = portMappingMapper.findById(req.getId());
|
||||||
ParamCheckUtil.checkNotNull(oldPortMappingDO, ExceptionConstant.PORT_MAPPING_NOT_EXIST);
|
ParamCheckUtil.checkNotNull(oldPortMappingDO, ExceptionConstant.PORT_MAPPING_NOT_EXIST);
|
||||||
|
|
||||||
//验证域名映射相关参数条件
|
|
||||||
if (NetworkProtocolEnum.isHttp(req.getProtocal()) && CollectionUtil.isNotEmpty(req.getDomainMappings())) {
|
|
||||||
Set<Integer> domainIds = req.getDomainMappings().stream().map(item -> item.getDomainId()).collect(Collectors.toSet());
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectBatchIds(domainIds);
|
|
||||||
Map<Integer, DomainNameDO> domainNameDOMap = domainNameDOS.stream().collect(Collectors.toMap(DomainNameDO::getId, Function.identity()));
|
|
||||||
|
|
||||||
req.getDomainMappings().forEach(item -> {
|
|
||||||
DomainNameDO domainNameDO = domainNameDOMap.get(item.getDomainId());
|
|
||||||
ParamCheckUtil.checkNotNull(domainNameDO, ExceptionConstant.DOMAIN_NAME_NOT_EXIST);
|
|
||||||
//检查子域名是否重复
|
|
||||||
boolean b = !domainPortMappingMapper.checkRepeatBySubdomain(item.getSubdomain(), item.getDomainId(), item.getId());
|
|
||||||
ParamCheckUtil.checkExpression(b,
|
|
||||||
ExceptionConstant.SUDOMAIN_NAME_CANNOT_REPEAT);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 更新端口映射
|
// 更新端口映射
|
||||||
portMappingMapper.update(null, new LambdaUpdateWrapper<PortMappingDO>()
|
portMappingMapper.update(null, new LambdaUpdateWrapper<PortMappingDO>()
|
||||||
.eq(PortMappingDO::getId, req.getId())
|
.eq(PortMappingDO::getId, req.getId())
|
||||||
@@ -268,36 +218,7 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
|
|
||||||
// 更新VisitorChannel
|
// 更新VisitorChannel
|
||||||
PortMappingDO portMappingDO = portMappingMapper.findById(req.getId());
|
PortMappingDO portMappingDO = portMappingMapper.findById(req.getId());
|
||||||
visitorChannelService.updateVisitorChannelByPortMapping(oldPortMappingDO, portMappingDO);
|
visitorChannelService.updateVisitorChannelByProxyMapping(ProxyMapping.build(oldPortMappingDO), ProxyMapping.build(portMappingDO));
|
||||||
|
|
||||||
// 更新域名映射
|
|
||||||
// 删除老的域名映射
|
|
||||||
if (NetworkProtocolEnum.isHttp(oldPortMappingDO.getProtocal())) {
|
|
||||||
//删除完整域名到服务端端口的映射
|
|
||||||
ProxyUtil.removeFullDomainToServerPortByServerPort(oldPortMappingDO.getServerPort());
|
|
||||||
//删除旧的域名映射
|
|
||||||
LambdaQueryWrapper<DomainPortMappingDO> lambdaQueryWrapper = Wrappers.<DomainPortMappingDO>lambdaQuery()
|
|
||||||
.eq(DomainPortMappingDO::getPortMappingId, oldPortMappingDO.getId());
|
|
||||||
domainPortMappingMapper.delete(lambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
// 添加新的域名映射
|
|
||||||
if (NetworkProtocolEnum.isHttp(portMappingDO.getProtocal()) && CollectionUtil.isNotEmpty(req.getDomainMappings())) {
|
|
||||||
Set<Integer> domainIds = req.getDomainMappings().stream().map(item -> item.getDomainId()).collect(Collectors.toSet());
|
|
||||||
List<DomainNameDO> domainNameDOS = domainMapper.selectBatchIds(domainIds);
|
|
||||||
Map<Integer, DomainNameDO> domainNameDOMap = domainNameDOS.stream().collect(Collectors.toMap(DomainNameDO::getId, Function.identity()));
|
|
||||||
|
|
||||||
req.getDomainMappings().forEach(item -> {
|
|
||||||
DomainNameDO domainNameDO = domainNameDOMap.get(item.getDomainId());
|
|
||||||
//创建域名映射
|
|
||||||
DomainPortMappingDO domainPortMappingDO = new DomainPortMappingDO();
|
|
||||||
domainPortMappingDO.setDomainNameId(item.getDomainId());
|
|
||||||
domainPortMappingDO.setSubdomain(item.getSubdomain());
|
|
||||||
domainPortMappingDO.setPortMappingId(portMappingDO.getId());
|
|
||||||
domainPortMappingMapper.insert(domainPortMappingDO);
|
|
||||||
//设置完整域名到服务端端口的映射
|
|
||||||
ProxyUtil.setFullDomainToServerPort(StrUtil.join(StrPool.DOT, item.getSubdomain(), domainNameDO.getDomain()), portMappingDO.getServerPort());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
updateMappingPortToSecurityGroupMap(portMappingDO.getServerPort(), req.getSecurityGroupId());
|
updateMappingPortToSecurityGroupMap(portMappingDO.getServerPort(), req.getSecurityGroupId());
|
||||||
|
|
||||||
@@ -355,9 +276,9 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
// 更新VisitorChannel
|
// 更新VisitorChannel
|
||||||
portMappingDO.setEnable(req.getEnable());
|
portMappingDO.setEnable(req.getEnable());
|
||||||
if (EnableStatusEnum.ENABLE == EnableStatusEnum.of(req.getEnable())) {
|
if (EnableStatusEnum.ENABLE == EnableStatusEnum.of(req.getEnable())) {
|
||||||
visitorChannelService.addVisitorChannelByPortMapping(portMappingDO);
|
visitorChannelService.addVisitorChannelByProxyMapping(ProxyMapping.build(portMappingDO));
|
||||||
} else {
|
} else {
|
||||||
visitorChannelService.removeVisitorChannelByPortMapping(portMappingDO);
|
visitorChannelService.removeVisitorChannelByProxyMapping(ProxyMapping.build(portMappingDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PortMappingUpdateEnableStatusRes();
|
return new PortMappingUpdateEnableStatusRes();
|
||||||
@@ -376,17 +297,8 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
portMappingMapper.deleteById(id);
|
portMappingMapper.deleteById(id);
|
||||||
|
|
||||||
// 更新VisitorChannel
|
// 更新VisitorChannel
|
||||||
visitorChannelService.removeVisitorChannelByPortMapping(portMappingDO);
|
visitorChannelService.removeVisitorChannelByProxyMapping(ProxyMapping.build(portMappingDO));
|
||||||
|
// 更新域名映射
|
||||||
// 删除域名映射
|
|
||||||
if (NetworkProtocolEnum.isHttp(portMappingDO.getProtocal())) {
|
|
||||||
//删除完整域名到服务端端口的映射
|
|
||||||
ProxyUtil.removeFullDomainToServerPortByServerPort(portMappingDO.getServerPort());
|
|
||||||
//删除旧的域名映射
|
|
||||||
LambdaQueryWrapper<DomainPortMappingDO> lambdaQueryWrapper = Wrappers.<DomainPortMappingDO>lambdaQuery()
|
|
||||||
.eq(DomainPortMappingDO::getPortMappingId, portMappingDO.getId());
|
|
||||||
domainPortMappingMapper.delete(lambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateMappingPortToSecurityGroupMap(portMappingDO.getServerPort(), null);
|
updateMappingPortToSecurityGroupMap(portMappingDO.getServerPort(), null);
|
||||||
|
|
||||||
@@ -458,6 +370,7 @@ public class PortMappingService implements LifecycleBean {
|
|||||||
// 刷新流量限制缓存
|
// 刷新流量限制缓存
|
||||||
refreshFlowLimitCache(item.getId(), item.getUpLimitRate(), item.getDownLimitRate());
|
refreshFlowLimitCache(item.getId(), item.getUpLimitRate(), item.getDownLimitRate());
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ public class PortPoolService {
|
|||||||
log.warn("bulk add port err:{}",e.getMessage());
|
log.warn("bulk add port err:{}",e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
throw ServiceException.create(PORT_RANGE_FAIL);
|
throw ServiceException.create(PORT_RANGE_FAIL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.service;
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package org.dromara.neutrinoproxy.server.service;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.ibatis.solon.annotation.Db;
|
import org.apache.ibatis.solon.annotation.Db;
|
||||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
@@ -132,7 +131,6 @@ public class UserService {
|
|||||||
|
|
||||||
public PageInfo<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
public PageInfo<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
||||||
Page<UserDO> page = userMapper.selectPage(new Page<>(pageQuery.getCurrent(), pageQuery.getSize()), new LambdaQueryWrapper<UserDO>()
|
Page<UserDO> page = userMapper.selectPage(new Page<>(pageQuery.getCurrent(), pageQuery.getSize()), new LambdaQueryWrapper<UserDO>()
|
||||||
.like(StringUtils.isNotBlank(req.getName()), UserDO::getName, req.getName())
|
|
||||||
.orderByAsc(UserDO::getId)
|
.orderByAsc(UserDO::getId)
|
||||||
);
|
);
|
||||||
List<UserListRes> respList = page.getRecords().stream().map(UserDO::toRes).collect(Collectors.toList());
|
List<UserListRes> respList = page.getRecords().stream().map(UserDO::toRes).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -59,17 +59,18 @@ public class VisitorChannelService {
|
|||||||
private PortPoolMapper portPoolMapper;
|
private PortPoolMapper portPoolMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化
|
* 初始化 - 域名id/端口号,客户端通道绑定初始化
|
||||||
* @param licenseId
|
* @param licenseId
|
||||||
*/
|
*/
|
||||||
public void initVisitorChannel(Integer licenseId, Channel cmdChannel) {
|
public void initVisitorChannel(Integer licenseId, Channel cmdChannel) {
|
||||||
List<PortMappingDO> portMappingList = portMappingMapper.findEnableListByLicenseId(licenseId);
|
// List<PortMappingDO> portMappingList = portMappingMapper.findEnableListByLicenseId(licenseId);
|
||||||
|
List<ProxyMapping> proxyMappingList = licenseMapper.findEnableProxyMappingListByLicenseId(licenseId);
|
||||||
// 没有端口映射仍然保持连接
|
// 没有端口映射仍然保持连接
|
||||||
ProxyUtil.initProxyInfo(licenseId, ProxyMapping.buildList(portMappingList));
|
ProxyUtil.initProxyInfo(licenseId, proxyMappingList); //ProxyMapping.buildList(portMappingList));
|
||||||
|
|
||||||
ProxyUtil.addCmdChannel(licenseId, cmdChannel, portMappingList.stream().map(PortMappingDO::getServerPort).collect(Collectors.toSet()));
|
ProxyUtil.addCmdChannel(licenseId, cmdChannel, proxyMappingList.stream().map(ProxyMapping::getServerPort).collect(Collectors.toSet()));
|
||||||
|
|
||||||
startUserPortServer(ProxyUtil.getAttachInfo(cmdChannel), portMappingList);
|
startUserPortServer(ProxyUtil.getAttachInfo(cmdChannel), proxyMappingList); // portMappingList
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,9 +90,9 @@ public class VisitorChannelService {
|
|||||||
EnableStatusEnum enableStatusEnum = EnableStatusEnum.of(enable);
|
EnableStatusEnum enableStatusEnum = EnableStatusEnum.of(enable);
|
||||||
for (PortMappingDO portMappingDO : portMappingDOList) {
|
for (PortMappingDO portMappingDO : portMappingDOList) {
|
||||||
if (EnableStatusEnum.DISABLE == enableStatusEnum) {
|
if (EnableStatusEnum.DISABLE == enableStatusEnum) {
|
||||||
removeVisitorChannelByPortMapping(portMappingDO);
|
removeVisitorChannelByProxyMapping(ProxyMapping.build(portMappingDO));
|
||||||
} else if (EnableStatusEnum.ENABLE == EnableStatusEnum.of(portMappingDO.getEnable())) {
|
} else if (EnableStatusEnum.ENABLE == EnableStatusEnum.of(portMappingDO.getEnable())) {
|
||||||
addVisitorChannelByPortMapping(portMappingDO);
|
addVisitorChannelByProxyMapping(ProxyMapping.build(portMappingDO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -130,82 +131,82 @@ public class VisitorChannelService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EnableStatusEnum enableStatusEnum = EnableStatusEnum.of(enable);
|
EnableStatusEnum enableStatusEnum = EnableStatusEnum.of(enable);
|
||||||
List<PortMappingDO> portMappingDOList = portMappingMapper.findListByLicenseId(licenseId);
|
if (EnableStatusEnum.DISABLE == enableStatusEnum) { // 禁用删除,关闭所有链接及配置
|
||||||
if (!CollectionUtil.isEmpty(portMappingDOList)) {
|
List<ProxyMapping> allProxyMappingList = licenseMapper.findAllProxyMappingListByLicenseId(licenseId);
|
||||||
for (PortMappingDO portMappingDO : portMappingDOList) {
|
for (ProxyMapping proxy : allProxyMappingList) {
|
||||||
if (EnableStatusEnum.DISABLE == enableStatusEnum) {
|
removeVisitorChannelByProxyMapping(proxy);
|
||||||
removeVisitorChannelByPortMapping(portMappingDO);
|
}
|
||||||
} else if (EnableStatusEnum.ENABLE == EnableStatusEnum.of(portMappingDO.getEnable())) {
|
} else { // if (EnableStatusEnum.ENABLE == enableStatusEnum) 如果实启用,则开启所有
|
||||||
addVisitorChannelByPortMapping(portMappingDO);
|
List<ProxyMapping> enableProxyMappingList = licenseMapper.findEnableProxyMappingListByLicenseId(licenseId);
|
||||||
}
|
for (ProxyMapping eproxy : enableProxyMappingList) {
|
||||||
|
addVisitorChannelByProxyMapping(eproxy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
* 触发时机:修改端口映射
|
* 触发时机:修改端口映射
|
||||||
* @param oldPortMappingDO
|
* @param oldProxyMapping
|
||||||
* @param newPortMappingDO
|
* @param newProxyMapping
|
||||||
*/
|
*/
|
||||||
public void updateVisitorChannelByPortMapping(PortMappingDO oldPortMappingDO, PortMappingDO newPortMappingDO) {
|
public void updateVisitorChannelByProxyMapping(ProxyMapping oldProxyMapping, ProxyMapping newProxyMapping) {
|
||||||
if (null == oldPortMappingDO || null == newPortMappingDO) {
|
if (null == oldProxyMapping || null == newProxyMapping) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
removeVisitorChannelByPortMapping(oldPortMappingDO);
|
removeVisitorChannelByProxyMapping(oldProxyMapping);
|
||||||
addVisitorChannelByPortMapping(newPortMappingDO);
|
addVisitorChannelByProxyMapping(newProxyMapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增VisitorChannel
|
* 新增VisitorChannel
|
||||||
* 触发时机:新增端口映射、启用端口映射
|
* 触发时机:新增端口映射、启用端口映射
|
||||||
* @param portMappingDO
|
* @param proxyMapping
|
||||||
*/
|
*/
|
||||||
public void addVisitorChannelByPortMapping(PortMappingDO portMappingDO) {
|
public void addVisitorChannelByProxyMapping(ProxyMapping proxyMapping) {
|
||||||
if (null == portMappingDO) {
|
if (null == proxyMapping) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Channel cmdChannel = ProxyUtil.getCmdChannelByLicenseId(portMappingDO.getLicenseId());
|
Channel cmdChannel = ProxyUtil.getCmdChannelByLicenseId(proxyMapping.getLicenseId());
|
||||||
if (null == cmdChannel) {
|
if (null == cmdChannel) {
|
||||||
// 如果不存在有效的cmdChannel,则无需更新VisitorChannel
|
// 如果不存在有效的cmdChannel,则无需更新VisitorChannel
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 判断端口映射是否启用
|
// 判断端口映射是否启用
|
||||||
if (EnableStatusEnum.DISABLE != EnableStatusEnum.of(portMappingDO.getEnable())) {
|
// if (EnableStatusEnum.DISABLE != EnableStatusEnum.of(portMappingDO.getEnable())) {
|
||||||
LicenseDO licenseDO = licenseMapper.findById(portMappingDO.getLicenseId());
|
LicenseDO licenseDO = licenseMapper.findById(proxyMapping.getLicenseId());
|
||||||
// 判断license是否启用
|
// 判断license是否启用
|
||||||
if (null != licenseDO && EnableStatusEnum.ENABLE == EnableStatusEnum.of(licenseDO.getEnable())) {
|
if (null != licenseDO && EnableStatusEnum.ENABLE == EnableStatusEnum.of(licenseDO.getEnable())) {
|
||||||
UserDO userDO = userMapper.findById(licenseDO.getUserId());
|
UserDO userDO = userMapper.findById(licenseDO.getUserId());
|
||||||
// 判断用户是否启用
|
// 判断用户是否启用
|
||||||
if (null != userDO && EnableStatusEnum.ENABLE == EnableStatusEnum.of(userDO.getEnable())) {
|
if (null != userDO && EnableStatusEnum.ENABLE == EnableStatusEnum.of(userDO.getEnable())) {
|
||||||
PortPoolDO portPoolDO = portPoolMapper.findByPort(portMappingDO.getServerPort());
|
PortPoolDO portPoolDO = portPoolMapper.findByPort(proxyMapping.getServerPort());
|
||||||
// 判断端口池是否启用
|
// 端口池大于65535 为域名解析,小于65535为端口映射,端口映射要判断端口池是否启用
|
||||||
if (null != portPoolDO && EnableStatusEnum.ENABLE == EnableStatusEnum.of(portPoolDO.getEnable())) {
|
if (proxyMapping.getServerPort() > 65535 || (null != portPoolDO && EnableStatusEnum.ENABLE == EnableStatusEnum.of(portPoolDO.getEnable()))) {
|
||||||
// 未删除且未禁用,则开启代理
|
// 未删除且未禁用,则开启代理
|
||||||
ProxyUtil.addProxyInfo(portMappingDO.getLicenseId(), ProxyMapping.build(portMappingDO));
|
ProxyUtil.addProxyInfo(proxyMapping.getLicenseId(), proxyMapping);
|
||||||
ProxyUtil.addCmdChannel(portMappingDO.getLicenseId(), cmdChannel, Sets.newHashSet(portMappingDO.getServerPort()));
|
ProxyUtil.addCmdChannel(proxyMapping.getLicenseId(), cmdChannel, Sets.newHashSet(proxyMapping.getServerPort()));
|
||||||
startUserPortServer(ProxyUtil.getAttachInfo(cmdChannel), Lists.newArrayList(portMappingDO));
|
startUserPortServer(ProxyUtil.getAttachInfo(cmdChannel), Lists.newArrayList(proxyMapping));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除VisitorChannel
|
* 删除VisitorChannel
|
||||||
* 触发时机:删除端口映射、禁用端口映射
|
* 触发时机:删除端口映射、禁用端口映射
|
||||||
* @param portMappingDO
|
* @param proxyMapping
|
||||||
*/
|
*/
|
||||||
public void removeVisitorChannelByPortMapping(PortMappingDO portMappingDO) {
|
public void removeVisitorChannelByProxyMapping(ProxyMapping proxyMapping) {
|
||||||
if (null == portMappingDO) {
|
if (null == proxyMapping) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Channel cmdChannel = ProxyUtil.getCmdChannelByLicenseId(portMappingDO.getLicenseId());
|
Channel cmdChannel = ProxyUtil.getCmdChannelByLicenseId(proxyMapping.getLicenseId());
|
||||||
if (null == cmdChannel) {
|
if (null == cmdChannel) {
|
||||||
// 如果不存在有效的cmdChannel,则无需更新VisitorChannel
|
// 如果不存在有效的cmdChannel,则无需更新VisitorChannel
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Channel visitorChannel = ProxyUtil.getVisitorChannelByServerPort(portMappingDO.getServerPort());
|
Channel visitorChannel = ProxyUtil.getVisitorChannelByServerPort(proxyMapping.getServerPort());
|
||||||
if (null != visitorChannel) {
|
if (null != visitorChannel) {
|
||||||
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null != proxyChannel) {
|
if (null != proxyChannel) {
|
||||||
@@ -214,29 +215,28 @@ public class VisitorChannelService {
|
|||||||
// TODO 此处如果时UDP的visitorChannel,则不能close,后续重构考虑
|
// TODO 此处如果时UDP的visitorChannel,则不能close,后续重构考虑
|
||||||
// visitorChannel.close();
|
// visitorChannel.close();
|
||||||
}
|
}
|
||||||
ProxyUtil.removeProxyInfo(portMappingDO.getServerPort());
|
ProxyUtil.removeProxyInfo(proxyMapping.getServerPort());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startUserPortServer(CmdChannelAttachInfo cmdChannelAttachInfo, List<PortMappingDO> portMappingList) {
|
private void startUserPortServer(CmdChannelAttachInfo cmdChannelAttachInfo, List<ProxyMapping> proxyMappingList) {
|
||||||
if (CollectionUtil.isEmpty(portMappingList)) {
|
if (CollectionUtil.isEmpty(proxyMappingList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
for (ProxyMapping proxyMapping : proxyMappingList) {
|
||||||
for (PortMappingDO portMapping : portMappingList) {
|
// if (EnableStatusEnum.DISABLE.getStatus().equals(proxyMapping.getEnable())) {
|
||||||
if (EnableStatusEnum.DISABLE.getStatus().equals(portMapping.getEnable())) {
|
// // 端口映射被禁用了,忽略 TODO 映射没被禁用,但端口被禁用了也需要处理 修改方案 20240306查询时就处理了【端口禁用】和【端口映射禁用】的情况,待验证
|
||||||
// 端口映射被禁用了,忽略 TODO 映射没被禁用,但端口被禁用了也需要处理
|
// continue;
|
||||||
continue;
|
// }
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
proxyMutualService.bindServerPort(cmdChannelAttachInfo, portMapping.getServerPort());
|
proxyMutualService.bindServerPort(cmdChannelAttachInfo, proxyMapping.getServerPort());
|
||||||
|
|
||||||
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(portMapping.getProtocal());
|
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(proxyMapping.getProtocal());
|
||||||
if (networkProtocolEnum == NetworkProtocolEnum.UDP) {
|
if (networkProtocolEnum == NetworkProtocolEnum.UDP) {
|
||||||
udpServerBootstrap.bind(portMapping.getServerPort()).get();
|
udpServerBootstrap.bind(proxyMapping.getServerPort()).get();
|
||||||
log.info("bind UDP user port: {}", portMapping.getServerPort());
|
log.info("bind UDP user port: {}", proxyMapping.getServerPort());
|
||||||
} else {
|
} else if (proxyMapping.getServerPort() <= 65535){// 大于65535 的端口号是域名解析无需绑定服务端端口号
|
||||||
tcpServerBootstrap.bind(portMapping.getServerPort()).get();
|
tcpServerBootstrap.bind(proxyMapping.getServerPort()).get();
|
||||||
log.info("bind TCP user port: {}", portMapping.getServerPort());
|
log.info("bind TCP ServerPort: {}", proxyMapping.getServerPort());
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// BindException表示该端口已经绑定过
|
// BindException表示该端口已经绑定过
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package org.dromara.neutrinoproxy.server.service.bo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.HttpsStatusEnum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完整域名
|
|
||||||
* @author: mirac
|
|
||||||
* @date: 2024/8/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class FullDomainNameBO {
|
|
||||||
/**
|
|
||||||
* 域名端口映射id
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
/**
|
|
||||||
* 端口映射id
|
|
||||||
*/
|
|
||||||
private Integer portMappingId;
|
|
||||||
/**
|
|
||||||
* 子域名
|
|
||||||
*/
|
|
||||||
private String subdomain;
|
|
||||||
/**
|
|
||||||
* 域名id
|
|
||||||
*/
|
|
||||||
private Integer domainNameId;
|
|
||||||
/**
|
|
||||||
* 域名
|
|
||||||
*/
|
|
||||||
private String domain;
|
|
||||||
/**
|
|
||||||
* 强制使用HTTPS(1、是 2、否)
|
|
||||||
* {@link HttpsStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer forceHttps;
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.server.util;
|
package org.dromara.neutrinoproxy.server.util;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dromara.neutrinoproxy.core.ChannelAttribute;
|
import org.dromara.neutrinoproxy.core.ChannelAttribute;
|
||||||
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
import org.dromara.neutrinoproxy.server.proxy.domain.*;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.util.AttributeKey;
|
import io.netty.util.AttributeKey;
|
||||||
|
import org.dromara.neutrinoproxy.server.service.DomainMappingService;
|
||||||
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -18,7 +19,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
import java.util.concurrent.locks.ReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ public class ProxyUtil {
|
|||||||
*/
|
*/
|
||||||
private static final Map<Integer, Set<Integer>> licenseToServerPortMap = new HashMap<>();
|
private static final Map<Integer, Set<Integer>> licenseToServerPortMap = new HashMap<>();
|
||||||
/**
|
/**
|
||||||
* 代理信息映射 e.g.: 9104 -> 127.0.0.1:8848
|
* 代理信息映射
|
||||||
*/
|
*/
|
||||||
private static final Map<Integer, String> proxyInfoMap = new ConcurrentHashMap<>();
|
private static final Map<Integer, String> proxyInfoMap = new ConcurrentHashMap<>();
|
||||||
/**
|
/**
|
||||||
@@ -60,19 +60,19 @@ public class ProxyUtil {
|
|||||||
* 代理 - connect附加映射
|
* 代理 - connect附加映射
|
||||||
*/
|
*/
|
||||||
private static Map<String, ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
private static Map<String, ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
||||||
/**
|
|
||||||
* 完整域名 - 服务端端口映射
|
|
||||||
*/
|
|
||||||
private static Map<String, Integer> fullDomainToServerPortMap = new ConcurrentHashMap<>();
|
|
||||||
/**
|
/**
|
||||||
* 主域名 - 域名id映射
|
* 域名 解析 映射
|
||||||
*/
|
*/
|
||||||
private static Map<String, Integer> domainToDomainNameIdMap = new ConcurrentHashMap<>();
|
public static final Map<String, DomainMapping> domainMapingMap = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* licenseId - 客户端Id映射
|
* licenseId - 客户端Id映射
|
||||||
*/
|
*/
|
||||||
private static Map<Integer, String> licenseIdToClientIdMap = new HashMap<>();
|
private static Map<Integer, String> licenseIdToClientIdMap = new HashMap<>();
|
||||||
|
@Inject
|
||||||
|
private DomainMappingService domainMappingService;
|
||||||
/**
|
/**
|
||||||
* 初始化代理信息
|
* 初始化代理信息
|
||||||
* @param licenseId licenseId
|
* @param licenseId licenseId
|
||||||
@@ -83,6 +83,7 @@ public class ProxyUtil {
|
|||||||
addProxyInfo(licenseId, proxyMappingList);
|
addProxyInfo(licenseId, proxyMappingList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void addProxyInfo(Integer licenseId, List<ProxyMapping> proxyMappingList) {
|
public static void addProxyInfo(Integer licenseId, List<ProxyMapping> proxyMappingList) {
|
||||||
if (!CollectionUtil.isEmpty(proxyMappingList)) {
|
if (!CollectionUtil.isEmpty(proxyMappingList)) {
|
||||||
for (ProxyMapping proxyMapping : proxyMappingList) {
|
for (ProxyMapping proxyMapping : proxyMappingList) {
|
||||||
@@ -342,87 +343,8 @@ public class ProxyUtil {
|
|||||||
proxyConnectAttachmentMap.remove(visitorId);
|
proxyConnectAttachmentMap.remove(visitorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置完整域名到服务端端口的映射
|
|
||||||
* @param fullDomain
|
|
||||||
* @param serverPort
|
|
||||||
*/
|
|
||||||
public static void setFullDomainToServerPort(String fullDomain, Integer serverPort) {
|
|
||||||
fullDomainToServerPortMap.put(fullDomain, serverPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除完整域名到服务端端口的映射
|
|
||||||
* @param fullDomain
|
|
||||||
*/
|
|
||||||
public static void removeFullDomainToServerPort(String fullDomain) {
|
|
||||||
fullDomainToServerPortMap.remove(fullDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过服务器端口删除完整域名到服务端端口的映射
|
|
||||||
* @param serverPort
|
|
||||||
*/
|
|
||||||
public static void removeFullDomainToServerPortByServerPort(Integer serverPort) {
|
|
||||||
fullDomainToServerPortMap.entrySet().removeIf(entry -> Objects.equals(entry.getValue(), serverPort));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据完整域名获取外网端口
|
|
||||||
* @param fullDomain
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Integer getServerPortByFullDomain(String fullDomain) {
|
|
||||||
return fullDomainToServerPortMap.get(fullDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加域名到域名id的映射
|
|
||||||
*/
|
|
||||||
public static void setDomainToDomainNameId(String domain, Integer domainNameId) {
|
|
||||||
domainToDomainNameIdMap.put(domain, domainNameId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除域名到域名id的映射
|
|
||||||
*/
|
|
||||||
public static void removeDomainToDomainNameId(String domain) {
|
|
||||||
domainToDomainNameIdMap.remove(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主域名获取域名id
|
|
||||||
*/
|
|
||||||
public static Integer getDomainNameIdByDomain(String domain) {
|
|
||||||
return domainToDomainNameIdMap.get(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过完整域名获取域名id
|
|
||||||
*/
|
|
||||||
public static Integer getDomainNameIdByFullDomain(String fullDomain) {
|
|
||||||
List<String> domains = domainToDomainNameIdMap.keySet().stream().sorted((a,b) -> b.length() - a.length()).filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
|
||||||
// 不存在,返回null
|
|
||||||
if (CollectionUtil.isEmpty(domains)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// 优先匹配最长的域名,默认取第一个,后续思考如何优化
|
|
||||||
return getDomainNameIdByDomain(domains.get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过完整域名获取域名
|
|
||||||
*/
|
|
||||||
public static String getDomainNameByFullDomain(String fullDomain) {
|
|
||||||
List<String> domains = domainToDomainNameIdMap.keySet().stream().sorted((a,b) -> b.length() - a.length()).filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
|
||||||
// 不存在 或者 有多条记录,返回null
|
|
||||||
if (CollectionUtil.isEmpty(domains)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return domains.getFirst();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭http响应channel
|
* 关闭http响应channel
|
||||||
* @param channel
|
* @param channel
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
server:
|
server:
|
||||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||||
port: ${WEB_PORT:8888}
|
port: 8888
|
||||||
# 日志级别
|
# 日志级别
|
||||||
solon.logging:
|
solon.logging:
|
||||||
logger:
|
logger:
|
||||||
@@ -18,9 +18,9 @@ neutrino:
|
|||||||
boss-thread-count: 2
|
boss-thread-count: 2
|
||||||
work-thread-count: 10
|
work-thread-count: 10
|
||||||
# 隧道非SSL端口
|
# 隧道非SSL端口
|
||||||
port: ${OPEN_PORT:9000}
|
port: 9000
|
||||||
# 隧道SSL端口
|
# 隧道SSL端口
|
||||||
ssl-port: ${SSL_PORT:9002}
|
ssl-port: 9002
|
||||||
# 隧道SSL证书配置
|
# 隧道SSL证书配置
|
||||||
key-store-password: 123456
|
key-store-password: 123456
|
||||||
key-manager-password: 123456
|
key-manager-password: 123456
|
||||||
@@ -34,10 +34,15 @@ neutrino:
|
|||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
boss-thread-count: 5
|
boss-thread-count: 5
|
||||||
work-thread-count: 20
|
work-thread-count: 20
|
||||||
# http代理端口,默认80(不配置不支持)
|
# http代理端口,默认80
|
||||||
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
http-proxy-port: 80
|
||||||
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
# https代理端口,默认443 (需要配置域名、证书)
|
||||||
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
https-proxy-port: 443
|
||||||
|
# 如果不配置,则不支持域名映射
|
||||||
|
domain-name:
|
||||||
|
# https证书配置
|
||||||
|
key-store-password:
|
||||||
|
jks-path:
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: false
|
transfer-log-enable: false
|
||||||
udp:
|
udp:
|
||||||
@@ -49,10 +54,10 @@ neutrino:
|
|||||||
data:
|
data:
|
||||||
db:
|
db:
|
||||||
# 数据库类型,目前支持h2、mysql、mariadb
|
# 数据库类型,目前支持h2、mysql、mariadb
|
||||||
type: ${DB_TYPE:h2}
|
type: h2
|
||||||
# 数据库连接URL
|
# 数据库连接URL
|
||||||
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
url: jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE
|
||||||
# 数据库用户名
|
# 数据库用户名
|
||||||
username: ${DB_USER:}
|
username:
|
||||||
# 数据库密码
|
# 数据库密码
|
||||||
password: ${DB_PASSWORD:}
|
password:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ server:
|
|||||||
solon:
|
solon:
|
||||||
app:
|
app:
|
||||||
name: neutrino-proxy-server
|
name: neutrino-proxy-server
|
||||||
version: 2.0.2
|
version: 2.0.1
|
||||||
config:
|
config:
|
||||||
add: ./app.yml
|
add: ./app.yml
|
||||||
# 日志级别
|
# 日志级别
|
||||||
@@ -54,10 +54,15 @@ neutrino:
|
|||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
boss-thread-count: 5
|
boss-thread-count: 5
|
||||||
work-thread-count: 20
|
work-thread-count: 20
|
||||||
# http代理端口,默认80(不配置不支持)
|
# http代理端口,默认80
|
||||||
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
http-proxy-port: ${HTTP_PR0OXY_PORT:80}
|
||||||
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
# https代理端口,默认443 (需要配置域名、证书)
|
||||||
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
||||||
|
# 如果不配置,则不支持域名映射
|
||||||
|
domain-name: ${DOMAIN_NAME:server.com}
|
||||||
|
# https证书配置
|
||||||
|
key-store-password: ${HTTPS_STORE_PASS:123456}
|
||||||
|
jks-path: ${HTTPS_JKS_PATH:classpath:/test.jks}
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: ${SERVER_LOG:false}
|
transfer-log-enable: ${SERVER_LOG:false}
|
||||||
udp:
|
udp:
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="org.dromara.neutrinoproxy.server.dal.DomainMapper">
|
|
||||||
|
|
||||||
<select id="selectFullDomainNameListByPortMappingIds" resultType="org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO">
|
|
||||||
SELECT dpm.id as id, pm.id AS portMappingId, dpm.subdomain as subdomain, dn.domain AS domain, dn.id as domainNameId, dn.force_https as forceHttps
|
|
||||||
FROM domain_port_mapping dpm
|
|
||||||
LEFT JOIN port_mapping pm ON pm.id = dpm.port_mapping_id
|
|
||||||
LEFT JOIN domain_name dn ON dn.id = dpm.domain_name_id
|
|
||||||
WHERE pm.id IN
|
|
||||||
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
<select id="selectFullDomainNameList"
|
|
||||||
resultType="org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO">
|
|
||||||
SELECT dpm.id as id, pm.id AS portMappingId, dpm.subdomain as subdomain, dn.domain AS domain, dn.id as domainNameId, dn.force_https as forceHttps
|
|
||||||
FROM domain_port_mapping dpm
|
|
||||||
LEFT JOIN port_mapping pm ON pm.id = dpm.port_mapping_id
|
|
||||||
LEFT JOIN domain_name dn ON dn.id = dpm.domain_name_id
|
|
||||||
</select>
|
|
||||||
<select id="selectFullDomainNameListByDomainNameIds"
|
|
||||||
resultType="org.dromara.neutrinoproxy.server.service.bo.FullDomainNameBO">
|
|
||||||
SELECT dpm.id as id, pm.id AS portMappingId, dpm.subdomain as subdomain, dn.domain AS domain, dn.id as domainNameId, dn.force_https as forceHttps
|
|
||||||
FROM domain_port_mapping dpm
|
|
||||||
LEFT JOIN port_mapping pm ON pm.id = dpm.port_mapping_id
|
|
||||||
LEFT JOIN domain_name dn ON dn.id = dpm.domain_name_id
|
|
||||||
WHERE dn.id IN
|
|
||||||
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.dromara.neutrinoproxy.server.dal.DomainMappingMapper">
|
||||||
|
|
||||||
|
<select id="selectDomainMappingByCondition" resultType="org.dromara.neutrinoproxy.server.dal.entity.DomainMappingDO">
|
||||||
|
SELECT pm.*,l.is_online as isOnline
|
||||||
|
FROM domain_mapping pm
|
||||||
|
LEFT JOIN license l ON pm.license_id = l.`id`
|
||||||
|
<where>
|
||||||
|
<if test="req.userId != null">
|
||||||
|
AND l.user_id = #{req.userId}
|
||||||
|
</if>
|
||||||
|
<if test="req.licenseId != null">
|
||||||
|
AND pm.license_id = #{req.licenseId}
|
||||||
|
</if>
|
||||||
|
<if test="req.domain != null">
|
||||||
|
AND pm.domain = #{req.domain}
|
||||||
|
</if>
|
||||||
|
<if test="req.isOnline != null">
|
||||||
|
AND l.is_online = #{req.isOnline}
|
||||||
|
</if>
|
||||||
|
<if test="req.enable != null">
|
||||||
|
AND pm.enable = #{req.enable}
|
||||||
|
</if>
|
||||||
|
<if test="req.protocal != null and req.protocal != ''">
|
||||||
|
AND pm.protocal = #{req.protocal}
|
||||||
|
</if>
|
||||||
|
<if test="req.description != null and req.description != '' ">
|
||||||
|
AND pm.description like #{req.description}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by pm.id asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.dromara.neutrinoproxy.server.dal.LicenseMapper">
|
||||||
|
|
||||||
|
<select id="findEnableProxyMappingListByLicenseId" resultType="org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping">
|
||||||
|
SELECT pm.license_id as licenseId, pm.server_port as serverPort,CONCAT(pm.client_ip, ':', pm.client_port) as lanInfo, pm.protocal as protocal
|
||||||
|
FROM port_mapping pm
|
||||||
|
LEFT JOIN port_pool pp on pm.server_port = pp.port
|
||||||
|
WHERE pm.enable = 1 AND pm.is_online = 1 AND pp.enable = 1 AND pm.license_id = #{licenseId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT dm.license_id as licenseId, dm.id as serverPort,dm.target_path as lanInfo, 'HTTP' as protocal
|
||||||
|
FROM domain_mapping dm
|
||||||
|
LEFT JOIN license l on dm.license_id = l.`id`
|
||||||
|
WHERE dm.enable = 1 AND l.is_online = 1 AND dm.license_id = #{licenseId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findAllProxyMappingListByLicenseId" resultType="org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping">
|
||||||
|
SELECT pm.license_id as licenseId, pm.server_port as serverPort,CONCAT(pm.client_ip, ':', pm.client_port) as lanInfo, pm.protocal as protocal
|
||||||
|
FROM port_mapping pm
|
||||||
|
LEFT JOIN port_pool pp on pm.server_port = pp.port
|
||||||
|
WHERE pm.license_id = #{licenseId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT dm.id as serverPort,dm.target_path as lanInfo, 'HTTP' as protocal
|
||||||
|
FROM domain_mapping dm
|
||||||
|
LEFT JOIN license l on dm.license_id = l.`id`
|
||||||
|
WHERE dm.license_id = #{licenseId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -98,7 +98,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
`license_id` INTEGER(20) NOT NULL,
|
`license_id` INTEGER(20) NOT NULL,
|
||||||
`protocal` VARCHAR(10) NOT NULL DEFAULT 'TCP',
|
`protocal` VARCHAR(10) NOT NULL DEFAULT 'TCP',
|
||||||
`server_port` INTEGER NOT NULL,
|
`server_port` INTEGER NOT NULL,
|
||||||
`client_ip` VARCHAR(255) NOT NULL,
|
`client_ip` VARCHAR(20) NOT NULL,
|
||||||
`client_port` INTEGER NOT NULL,
|
`client_port` INTEGER NOT NULL,
|
||||||
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
@@ -113,32 +113,6 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS I_port_mapping_server_port ON port_mapping (server_port ASC);
|
CREATE UNIQUE INDEX IF NOT EXISTS I_port_mapping_server_port ON port_mapping (server_port ASC);
|
||||||
|
|
||||||
#域名表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_name` (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
`domain` VARCHAR(50) NOT NULL,
|
|
||||||
`user_id` INTEGER NOT NULL,
|
|
||||||
`jks` BLOB DEFAULT NULL,
|
|
||||||
`key_store_password` varchar(255) DEFAULT NULL,
|
|
||||||
`is_default` INTEGER(2) NOT NULL,
|
|
||||||
`force_https` INTEGER(2) NOT NULL,
|
|
||||||
`enable` INTEGER(2) NOT NULL,
|
|
||||||
`create_time` TIMESTAMP NOT NULL,
|
|
||||||
`update_time` TIMESTAMP NOT NULL
|
|
||||||
);
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS I_domain_name_domain ON domain_name (`domain` ASC);
|
|
||||||
|
|
||||||
#域名映射中间表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_port_mapping` (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
`subdomain` VARCHAR(50) NOT NULL,
|
|
||||||
`domain_name_id` INTEGER NOT NULL,
|
|
||||||
`port_mapping_id` INTEGER NOT NULL
|
|
||||||
);
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS I_unique_domain_port_mapping ON domain_port_mapping (`domain_name_id` ASC, `subdomain` ASC);
|
|
||||||
CREATE INDEX IF NOT EXISTS I_domain_port_mapping_domain_name_id ON domain_port_mapping (`domain_name_id` ASC);
|
|
||||||
CREATE INDEX IF NOT EXISTS I_domain_port_mapping_port_mapping_id ON domain_port_mapping (`port_mapping_id` ASC);
|
|
||||||
|
|
||||||
#############################日志管理相关表#############################
|
#############################日志管理相关表#############################
|
||||||
#用户登录记录表
|
#用户登录记录表
|
||||||
CREATE TABLE IF NOT EXISTS `user_login_record` (
|
CREATE TABLE IF NOT EXISTS `user_login_record` (
|
||||||
@@ -254,3 +228,21 @@ CREATE INDEX IF NOT EXISTS I_flow_report_month_create_time ON flow_report_month(
|
|||||||
CREATE INDEX IF NOT EXISTS I_flow_report_month_date ON flow_report_month(`date`);
|
CREATE INDEX IF NOT EXISTS I_flow_report_month_date ON flow_report_month(`date`);
|
||||||
CREATE INDEX IF NOT EXISTS I_flow_report_month_user_id ON flow_report_month(`user_id`);
|
CREATE INDEX IF NOT EXISTS I_flow_report_month_user_id ON flow_report_month(`user_id`);
|
||||||
CREATE INDEX IF NOT EXISTS I_flow_report_month_license_id ON flow_report_month(`license_id`);
|
CREATE INDEX IF NOT EXISTS I_flow_report_month_license_id ON flow_report_month(`license_id`);
|
||||||
|
|
||||||
|
# 域名 映射表 AUTO_INCREMENT 设置65550 避开端口号0-65535,减少域名解析代码修改
|
||||||
|
CREATE TABLE IF NOT EXISTS `domain_mapping` (
|
||||||
|
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
`license_id` INTEGER(20) NOT NULL,
|
||||||
|
`protocal` VARCHAR(10) NOT NULL DEFAULT 'HTTP',
|
||||||
|
`domain` VARCHAR(50) DEFAULT NULL,
|
||||||
|
`target_path` VARCHAR(50) NOT NULL,
|
||||||
|
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
`description` VARCHAR(100) DEFAULT NULL,
|
||||||
|
`request_header` INTEGER(20) NOT NULL DEFAULT 0,
|
||||||
|
`enable` INTEGER(2) NOT NULL,
|
||||||
|
`security_group_id` INTEGER(20) NOT NULL DEFAULT 0,
|
||||||
|
`create_time` TIMESTAMP NOT NULL,
|
||||||
|
`update_time` TIMESTAMP NOT NULL
|
||||||
|
) AUTO_INCREMENT = 65550;
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS I_domain_mapping_domain ON domain_mapping (`domain` ASC);
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#license
|
#license
|
||||||
INSERT INTO license(`id`, `name`, `key`, `user_id`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO license(`id`, `name`, `key`, `user_id`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||||
(1, '我的mac', 'b0a907332b474b25897c4dcb31fc7eb6', 1, 2, 1, now(), now());
|
(1, '测试客户端', 'b0a907332b474b25897c4dcb31fc7eb6', 1, 1, 1, now(), now());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#port_mapping
|
#port_mapping
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`,`client_ip`, `client_port`, `is_online`, `enable`,`description`,`create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`,`create_time`, `update_time`) VALUES
|
||||||
(1, 1, 9101, 'HTTP', '127.0.0.1', 8080, 2, 1,'test1', now(), now());
|
(1, 1, 9101, 'HTTP', '127.0.0.1', 8080, 2, 1,'test1', now(), now());
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES
|
||||||
(2, 1, 9102, 'TCP', '127.0.0.1', 3306, 2, 1,'test2', now(), now());
|
(2, 1, 9102, 'TCP', '127.0.0.1', 3306, 2, 1,'test2', now(), now());
|
||||||
|
|||||||
@@ -9,33 +9,3 @@ INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update
|
|||||||
(4, 1, 9104, 1, now(), now());
|
(4, 1, 9104, 1, now(), now());
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
||||||
(5, 1, 9105, 1, now(), now());
|
(5, 1, 9105, 1, now(), now());
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(6, 1, 9106, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(7, 1, 9107, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(8, 1, 9108, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(9, 1, 9109, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(10, 1, 9110, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(11, 1, 9111, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(12, 1, 9112, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(13, 1, 9113, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(14, 1, 9114, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(15, 1, 9115, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(16, 1, 9116, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(17, 1, 9117, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(18, 1, 9118, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(19, 1, 9119, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(20, 1, 9120, 1, now(), now());
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
ALTER TABLE port_pool ADD group_id INTEGER NOT NULL DEFAULT 1;
|
|
||||||
|
|
||||||
#端口分组
|
|
||||||
CREATE TABLE IF NOT EXISTS `port_group` (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`name` VARCHAR(255) NOT NULL,
|
|
||||||
`possessor_type` INTEGER NOT NULL DEFAULT '0',
|
|
||||||
`possessor_id` INTEGER NOT NULL DEFAULT '-1',
|
|
||||||
`enable` INTEGER NOT NULL,
|
|
||||||
`create_time` datetime(3) NOT NULL,
|
|
||||||
`update_time` datetime(3) NOT NULL
|
|
||||||
);
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
ALTER TABLE port_mapping ADD `protocal` varchar(10) NOT NULL DEFAULT 'TCP';
|
|
||||||
ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL;
|
|
||||||
ALTER TABLE port_mapping ADD `description` varchar(100);
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
ALTER TABLE port_mapping ADD `proxy_responses` INTEGER(20) NOT NULL DEFAULT 0;
|
|
||||||
ALTER TABLE port_mapping ADD `proxy_timeout_ms` INTEGER(20) NOT NULL DEFAULT 0;
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#安全组
|
|
||||||
CREATE TABLE IF NOT EXISTS `security_group` (
|
|
||||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
|
||||||
`name` VARCHAR(20) NOT NULL,
|
|
||||||
`description` VARCHAR(255),
|
|
||||||
`user_id` INTEGER NOT NULL,
|
|
||||||
`enable` INTEGER NOT NULL,
|
|
||||||
`default_pass_type` INTEGER NOT NULL,
|
|
||||||
`create_time` TIMESTAMP NOT NULL,
|
|
||||||
`update_time` TIMESTAMP NOT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
);
|
|
||||||
|
|
||||||
#安全组规则
|
|
||||||
CREATE TABLE IF NOT EXISTS `security_rule` (
|
|
||||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
|
||||||
`group_id` INTEGER NOT NULL,
|
|
||||||
`name` VARCHAR(20) NOT NULL,
|
|
||||||
`description` VARCHAR(255) NOT NULL,
|
|
||||||
`rule` text NOT NULL,
|
|
||||||
`pass_type` INTEGER NOT NULL,
|
|
||||||
`priority` INTEGER NOT NULL,
|
|
||||||
`user_id` INTEGER NOT NULL,
|
|
||||||
`enable` INTEGER NOT NULL,
|
|
||||||
`create_time` TIMESTAMP NOT NULL,
|
|
||||||
`update_time` TIMESTAMP NOT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
);
|
|
||||||
CREATE INDEX IF NOT EXISTS I_security_rule_group_id ON security_rule(group_id);
|
|
||||||
|
|
||||||
# port_mapping表增加字段
|
|
||||||
ALTER TABLE `port_mapping` ADD COLUMN `security_group_id` INTEGER DEFAULT 0;
|
|
||||||
ALTER TABLE `port_mapping` ADD COLUMN `up_limit_rate` varchar(20) DEFAULT NULL;
|
|
||||||
ALTER TABLE `port_mapping` ADD COLUMN `down_limit_rate` varchar(20) DEFAULT NULL;
|
|
||||||
|
|
||||||
# license表增加字段
|
|
||||||
ALTER TABLE `license` ADD COLUMN `up_limit_rate` varchar(20) DEFAULT NULL;
|
|
||||||
ALTER TABLE `license` ADD COLUMN `down_limit_rate` varchar(20) DEFAULT NULL;
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#域名表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_name` (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
`domain` VARCHAR(50) NOT NULL,
|
|
||||||
`user_id` INTEGER NOT NULL,
|
|
||||||
`jks` BLOB DEFAULT NULL,
|
|
||||||
`key_store_password` varchar(255) DEFAULT NULL,
|
|
||||||
`is_default` INTEGER(2) NOT NULL,
|
|
||||||
`force_https` INTEGER(2) NOT NULL,
|
|
||||||
`enable` INTEGER(2) NOT NULL,
|
|
||||||
`create_time` TIMESTAMP NOT NULL,
|
|
||||||
`update_time` TIMESTAMP NOT NULL
|
|
||||||
);
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS I_domain_name_domain ON domain_name (`domain` ASC);
|
|
||||||
|
|
||||||
#域名映射中间表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_port_mapping` (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
`subdomain` VARCHAR(50) NOT NULL,
|
|
||||||
`domain_name_id` INTEGER NOT NULL,
|
|
||||||
`port_mapping_id` INTEGER NOT NULL
|
|
||||||
);
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS I_unique_domain_port_mapping ON domain_port_mapping (`domain_name_id` ASC, `subdomain` ASC);
|
|
||||||
CREATE INDEX IF NOT EXISTS I_domain_port_mapping_domain_name_id ON domain_port_mapping (`domain_name_id` ASC);
|
|
||||||
CREATE INDEX IF NOT EXISTS I_domain_port_mapping_port_mapping_id ON domain_port_mapping (`port_mapping_id` ASC);
|
|
||||||
|
|
||||||
# port_mapping表删除字段
|
|
||||||
ALTER TABLE `port_mapping` DROP COLUMN `subdomain`;
|
|
||||||
@@ -103,7 +103,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
`license_id` int NOT NULL COMMENT 'licenseID',
|
`license_id` int NOT NULL COMMENT 'licenseID',
|
||||||
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
||||||
`server_port` int NOT NULL COMMENT '服务端端口',
|
`server_port` int NOT NULL COMMENT '服务端端口',
|
||||||
`client_ip` varchar(255) NOT NULL COMMENT '客户端IP',
|
`client_ip` varchar(20) NOT NULL COMMENT '客户端IP',
|
||||||
`client_port` int NOT NULL COMMENT '客户端端口',
|
`client_port` int NOT NULL COMMENT '客户端端口',
|
||||||
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
||||||
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
||||||
@@ -118,34 +118,6 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `I_port_mapping_server_port` (`server_port`)
|
KEY `I_port_mapping_server_port` (`server_port`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
#域名表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_name` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
||||||
`domain` varchar(50) NOT NULL COMMENT '域名',
|
|
||||||
`user_id` int NOT NULL COMMENT '用户Id',
|
|
||||||
`jks` BLOB DEFAULT NULL COMMENT 'jks文件',
|
|
||||||
`key_store_password` varchar(255) DEFAULT NULL COMMENT 'jks密码',
|
|
||||||
`is_default` int(2) NOT NULL COMMENT '是否开启默认域名(1、开启 2、关闭)',
|
|
||||||
`force_https` int(2) NOT NULL COMMENT '是否启用强制https(1、开启 2、关闭)',
|
|
||||||
`enable` int(2) NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
|
||||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
|
||||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE INDEX `I_domain_name_domain` (`domain` ASC)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
#域名映射中间表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_port_mapping` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '创建时间',
|
|
||||||
`subdomain` varchar(50) NOT NULL COMMENT '子域名',
|
|
||||||
`domain_name_id` int NOT NULL COMMENT '域名Id',
|
|
||||||
`port_mapping_id` int NOT NULL COMMENT '端口映射Id',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE INDEX `I_unique_domain_port_mapping` (`domain_name_id` ASC, `subdomain` ASC),
|
|
||||||
INDEX `I_domain_port_mapping_domain_name_id` (`domain_name_id` ASC),
|
|
||||||
INDEX `I_domain_port_mapping_port_mapping_id` (`port_mapping_id` ASC)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
#############################日志管理相关表#############################
|
#############################日志管理相关表#############################
|
||||||
#用户登录记录表
|
#用户登录记录表
|
||||||
CREATE TABLE IF NOT EXISTS `user_login_record` (
|
CREATE TABLE IF NOT EXISTS `user_login_record` (
|
||||||
@@ -269,3 +241,22 @@ CREATE TABLE IF NOT EXISTS `flow_report_month` (
|
|||||||
KEY `I_flow_report_month_user_id` (`user_id`),
|
KEY `I_flow_report_month_user_id` (`user_id`),
|
||||||
KEY `I_flow_report_month_license_id` (`license_id`)
|
KEY `I_flow_report_month_license_id` (`license_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
|
# 域名 映射表 AUTO_INCREMENT 设置65550 避开端口号0-65535,减少域名解析代码修改
|
||||||
|
CREATE TABLE IF NOT EXISTS `domain_mapping` (
|
||||||
|
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
`license_id` INTEGER(20) NOT NULL,
|
||||||
|
`protocal` VARCHAR(10) NOT NULL DEFAULT 'HTTP',
|
||||||
|
`domain` VARCHAR(50) DEFAULT NULL,
|
||||||
|
`target_path` VARCHAR(50) NOT NULL,
|
||||||
|
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
`description` VARCHAR(100) DEFAULT NULL,
|
||||||
|
`request_header` INTEGER(20) NOT NULL DEFAULT 0,
|
||||||
|
`enable` INTEGER(2) NOT NULL,
|
||||||
|
`security_group_id` INTEGER(20) NOT NULL DEFAULT 0,
|
||||||
|
`create_time` TIMESTAMP NOT NULL,
|
||||||
|
`update_time` TIMESTAMP NOT NULL
|
||||||
|
) AUTO_INCREMENT = 65550;
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS I_domain_mapping_domain ON domain_mapping (`domain` ASC);
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#license
|
#license
|
||||||
INSERT INTO license(`id`, `name`, `key`, `user_id`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO license(`id`, `name`, `key`, `user_id`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||||
(1, '我的mac', 'b0a907332b474b25897c4dcb31fc7eb6', 1, 2, 1, now(), now());
|
(1, '服务端(不可编辑删除,可禁用)', 'b0a907332b474b25897c4dcb31fc7eb6', 1, 1, 1, now(), now());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#port_mapping
|
#port_mapping
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`,`create_time`, `update_time`) VALUES
|
||||||
(1, 1, 9101, 'HTTP', '127.0.0.1', 8080, 2, 1, now(), now());
|
(1, 1, 9101, 'HTTP', '127.0.0.1', 8080, 2, 1,'test1', now(), now());
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES
|
||||||
(2, 1, 9102, 'TCP', '127.0.0.1', 3306, 2, 1, now(), now());
|
(2, 1, 9102, 'TCP', '127.0.0.1', 3306, 2, 1,'test2', now(), now());
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES
|
||||||
(3, 1, 9103, 'HTTP', '127.0.0.1', 8081, 2, 1, now(), now());
|
(3, 1, 9103, 'HTTP', '127.0.0.1', 8081, 2, 1,'test3', now(), now());
|
||||||
@@ -9,33 +9,3 @@ INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update
|
|||||||
(4, 1, 9104, 1, now(), now());
|
(4, 1, 9104, 1, now(), now());
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
||||||
(5, 1, 9105, 1, now(), now());
|
(5, 1, 9105, 1, now(), now());
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(6, 1, 9106, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(7, 1, 9107, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(8, 1, 9108, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(9, 1, 9109, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(10, 1, 9110, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(11, 1, 9111, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(12, 1, 9112, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(13, 1, 9113, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(14, 1, 9114, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(15, 1, 9115, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(16, 1, 9116, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(17, 1, 9117, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(18, 1, 9118, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(19, 1, 9119, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(20, 1, 9120, 1, now(), now());
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#域名表
|
|
||||||
INSERT INTO domain_name(`id`, `domain`, `user_id`, `jks`, `key_store_password`, `is_default`, `force_https`, `enable`,`create_time`, `update_time`) VALUES
|
|
||||||
(1, 'default.fun', 1, null, null, 1, 2, 1, now(), now());
|
|
||||||
@@ -103,7 +103,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
`license_id` int NOT NULL COMMENT 'licenseID',
|
`license_id` int NOT NULL COMMENT 'licenseID',
|
||||||
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
||||||
`server_port` int NOT NULL COMMENT '服务端端口',
|
`server_port` int NOT NULL COMMENT '服务端端口',
|
||||||
`client_ip` varchar(255) NOT NULL COMMENT '客户端IP',
|
`client_ip` varchar(20) NOT NULL COMMENT '客户端IP',
|
||||||
`client_port` int NOT NULL COMMENT '客户端端口',
|
`client_port` int NOT NULL COMMENT '客户端端口',
|
||||||
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
||||||
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
||||||
@@ -118,34 +118,6 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `I_port_mapping_server_port` (`server_port`)
|
KEY `I_port_mapping_server_port` (`server_port`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
#域名表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_name` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
||||||
`domain` varchar(50) NOT NULL COMMENT '域名',
|
|
||||||
`user_id` int NOT NULL COMMENT '用户Id',
|
|
||||||
`jks` BLOB DEFAULT NULL COMMENT 'jks文件',
|
|
||||||
`key_store_password` varchar(255) DEFAULT NULL COMMENT 'jks密码',
|
|
||||||
`is_default` int(2) NOT NULL COMMENT '是否开启默认域名(1、开启 2、关闭)',
|
|
||||||
`force_https` int(2) NOT NULL COMMENT '是否启用强制https(1、开启 2、关闭)',
|
|
||||||
`enable` int(2) NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
|
||||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
|
||||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE INDEX `I_domain_name_domain` (`domain` ASC)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
#域名映射中间表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_port_mapping` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '创建时间',
|
|
||||||
`subdomain` varchar(50) NOT NULL COMMENT '子域名',
|
|
||||||
`domain_name_id` int NOT NULL COMMENT '域名Id',
|
|
||||||
`port_mapping_id` int NOT NULL COMMENT '端口映射Id',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE INDEX `I_unique_domain_port_mapping` (`domain_name_id` ASC, `subdomain` ASC),
|
|
||||||
INDEX `I_domain_port_mapping_domain_name_id` (`domain_name_id` ASC),
|
|
||||||
INDEX `I_domain_port_mapping_port_mapping_id` (`port_mapping_id` ASC)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
#############################日志管理相关表#############################
|
#############################日志管理相关表#############################
|
||||||
#用户登录记录表
|
#用户登录记录表
|
||||||
CREATE TABLE IF NOT EXISTS `user_login_record` (
|
CREATE TABLE IF NOT EXISTS `user_login_record` (
|
||||||
@@ -270,3 +242,20 @@ CREATE TABLE IF NOT EXISTS `flow_report_month` (
|
|||||||
KEY `I_flow_report_month_license_id` (`license_id`)
|
KEY `I_flow_report_month_license_id` (`license_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
# 域名 映射表 AUTO_INCREMENT 设置65550 避开端口号0-65535,减少域名解析代码修改
|
||||||
|
CREATE TABLE IF NOT EXISTS `domain_mapping` (
|
||||||
|
`id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
`license_id` INTEGER(20) NOT NULL,
|
||||||
|
`protocal` VARCHAR(10) NOT NULL DEFAULT 'HTTP',
|
||||||
|
`domain` VARCHAR(50) DEFAULT NULL,
|
||||||
|
`target_path` VARCHAR(50) NOT NULL,
|
||||||
|
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
`description` VARCHAR(100) DEFAULT NULL,
|
||||||
|
`request_header` INTEGER(20) NOT NULL DEFAULT 0,
|
||||||
|
`enable` INTEGER(2) NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
||||||
|
`security_group_id` INTEGER(20) NOT NULL DEFAULT 0,
|
||||||
|
`create_time` TIMESTAMP NOT NULL,
|
||||||
|
`update_time` TIMESTAMP NOT NULL
|
||||||
|
) AUTO_INCREMENT = 65550;
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS I_domain_mapping_domain ON domain_mapping (`domain` ASC);
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#license
|
#license
|
||||||
INSERT INTO license(`id`, `name`, `key`, `user_id`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO license(`id`, `name`, `key`, `user_id`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||||
(1, '我的mac', 'b0a907332b474b25897c4dcb31fc7eb6', 1, 2, 1, now(), now());
|
(1, '服务端(不可编辑删除,可禁用)', 'b0a907332b474b25897c4dcb31fc7eb6', 1, 1, 1, now(), now());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#port_mapping
|
#port_mapping
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`,`create_time`, `update_time`) VALUES
|
||||||
(1, 1, 9101, 'HTTP', '127.0.0.1', 8080, 2, 1, now(), now());
|
(1, 1, 9101, 'HTTP', '127.0.0.1', 8080, 2, 1,'test1', now(), now());
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES
|
||||||
(2, 1, 9102, 'TCP', '127.0.0.1', 3306, 2, 1, now(), now());
|
(2, 1, 9102, 'TCP', '127.0.0.1', 3306, 2, 1,'test2', now(), now());
|
||||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES
|
||||||
(3, 1, 9103, 'HTTP', '127.0.0.1', 8081, 2, 1, now(), now());
|
(3, 1, 9103, 'HTTP', '127.0.0.1', 8081, 2, 1,'test3', now(), now());
|
||||||
@@ -9,33 +9,3 @@ INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update
|
|||||||
(4, 1, 9104, 1, now(), now());
|
(4, 1, 9104, 1, now(), now());
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
||||||
(5, 1, 9105, 1, now(), now());
|
(5, 1, 9105, 1, now(), now());
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(6, 1, 9106, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(7, 1, 9107, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(8, 1, 9108, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(9, 1, 9109, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(10, 1, 9110, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(11, 1, 9111, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(12, 1, 9112, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(13, 1, 9113, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(14, 1, 9114, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(15, 1, 9115, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(16, 1, 9116, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(17, 1, 9117, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(18, 1, 9118, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(19, 1, 9119, 1, now(), now());
|
|
||||||
INSERT INTO port_pool(`id`, `group_id`, `port`, `enable`, `create_time`, `update_time`) VALUES
|
|
||||||
(20, 1, 9120, 1, now(), now());
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
ALTER TABLE port_pool ADD group_id INT NOT NULL DEFAULT 1 COMMENT "分组ID";
|
|
||||||
|
|
||||||
#端口分组
|
|
||||||
CREATE TABLE IF NOT EXISTS `port_group` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
||||||
`name` varchar(255) NOT NULL COMMENT '分组名称',
|
|
||||||
`possessor_type` int NOT NULL DEFAULT '0' COMMENT '所有者类型 (0、全局共享 1、用户所有 2License所有) ',
|
|
||||||
`possessor_id` int NOT NULL DEFAULT '-1' COMMENT '所有者id(当type为0时 固定为-1、当type为1时为用户id 、当type为2时为licenseid)',
|
|
||||||
`enable` int NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
|
||||||
`create_time` datetime(3) NOT NULL COMMENT '创建时间',
|
|
||||||
`update_time` datetime(3) NOT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='端口分组';
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
ALTER TABLE port_mapping ADD `protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议';
|
|
||||||
ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL COMMENT '子域名(仅HTTP时有效)';
|
|
||||||
ALTER TABLE port_mapping ADD `description` varchar(100) DEFAULT NULL COMMENT '描述';
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
ALTER TABLE port_mapping ADD `proxy_responses` int NOT NULL DEFAULT 0 COMMENT '代理响应数据包数量';
|
|
||||||
ALTER TABLE port_mapping ADD `proxy_timeout_ms` int NOT NULL DEFAULT 0 COMMENT '代理超时毫秒数';
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
ALTER TABLE `flow_report_minute` MODIFY COLUMN `read_bytes` BIGINT NOT NULL COMMENT '读取流量';
|
|
||||||
ALTER TABLE `flow_report_minute` MODIFY COLUMN `write_bytes` BIGINT NOT NULL COMMENT '写入流量';
|
|
||||||
ALTER TABLE `flow_report_hour` MODIFY COLUMN `read_bytes` BIGINT NOT NULL COMMENT '读取流量';
|
|
||||||
ALTER TABLE `flow_report_hour` MODIFY COLUMN `write_bytes` BIGINT NOT NULL COMMENT '写入流量';
|
|
||||||
ALTER TABLE `flow_report_day` MODIFY COLUMN `read_bytes` BIGINT NOT NULL COMMENT '读取流量';
|
|
||||||
ALTER TABLE `flow_report_day` MODIFY COLUMN `write_bytes` BIGINT NOT NULL COMMENT '写入流量';
|
|
||||||
ALTER TABLE `flow_report_month` MODIFY COLUMN `read_bytes` BIGINT NOT NULL COMMENT '读取流量';
|
|
||||||
ALTER TABLE `flow_report_month` MODIFY COLUMN `write_bytes` BIGINT NOT NULL COMMENT '写入流量';
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#安全组
|
|
||||||
CREATE TABLE IF NOT EXISTS `security_group` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
||||||
`name` varchar(20) NOT NULL COMMENT '安全组名称',
|
|
||||||
`description` varchar(255) COMMENT '安全组描述',
|
|
||||||
`user_id` int NOT NULL COMMENT '用户ID',
|
|
||||||
`enable` int NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
|
||||||
`default_pass_type` int NOT NULL COMMENT '默认放行类型',
|
|
||||||
`create_time` datetime(3) NOT NULL COMMENT '创建时间',
|
|
||||||
`update_time` datetime(3) NOT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
#安全组规则
|
|
||||||
CREATE TABLE IF NOT EXISTS `security_rule` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
||||||
`group_id` int NOT NULL COMMENT '关联安全组',
|
|
||||||
`name` varchar(20) NOT NULL COMMENT '规则名称',
|
|
||||||
`description` varchar(255) NOT NULL COMMENT '规则描述',
|
|
||||||
`rule` text NOT NULL COMMENT '规则内容',
|
|
||||||
`pass_type`int NOT NULL COMMENT '放行类型',
|
|
||||||
`priority` int(1) NOT NULL COMMENT '优先级',
|
|
||||||
`user_id` int NOT NULL COMMENT '用户ID',
|
|
||||||
`enable` int NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
|
||||||
`create_time` datetime(3) NOT NULL COMMENT '创建时间',
|
|
||||||
`update_time` datetime(3) NOT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
KEY `I_security_rule_group_id_priority` (`group_id`, `priority`) USING BTREE
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
# port_mapping表增加字段
|
|
||||||
ALTER TABLE `port_mapping` ADD COLUMN `security_group_id` int DEFAULT 0 COMMENT '安全组Id';
|
|
||||||
ALTER TABLE `port_mapping` ADD COLUMN `up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速';
|
|
||||||
ALTER TABLE `port_mapping` ADD COLUMN `down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速';
|
|
||||||
|
|
||||||
# license表增加字段
|
|
||||||
ALTER TABLE `license` ADD COLUMN `up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速';
|
|
||||||
ALTER TABLE `license` ADD COLUMN `down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速';
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#域名表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_name` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
||||||
`domain` varchar(50) NOT NULL COMMENT '域名',
|
|
||||||
`user_id` int NOT NULL COMMENT '用户Id',
|
|
||||||
`jks` BLOB DEFAULT NULL COMMENT 'jks文件',
|
|
||||||
`key_store_password` varchar(255) DEFAULT NULL COMMENT 'jks密码',
|
|
||||||
`is_default` int(2) NOT NULL COMMENT '是否开启默认域名(1、开启 2、关闭)',
|
|
||||||
`force_https` int(2) NOT NULL COMMENT '是否启用强制https(1、开启 2、关闭)',
|
|
||||||
`enable` int(2) NOT NULL COMMENT '是否启用(1、启用 2、禁用)',
|
|
||||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
|
||||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE INDEX `I_domain_name_domain` (`domain` ASC)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
#域名映射中间表
|
|
||||||
CREATE TABLE IF NOT EXISTS `domain_port_mapping` (
|
|
||||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '创建时间',
|
|
||||||
`subdomain` varchar(50) NOT NULL COMMENT '子域名',
|
|
||||||
`domain_name_id` int NOT NULL COMMENT '域名Id',
|
|
||||||
`port_mapping_id` int NOT NULL COMMENT '端口映射Id',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE INDEX `I_unique_domain_port_mapping` (`domain_name_id` ASC, `subdomain` ASC),
|
|
||||||
INDEX `I_domain_port_mapping_domain_name_id` (`domain_name_id` ASC),
|
|
||||||
INDEX `I_domain_port_mapping_port_mapping_id` (`port_mapping_id` ASC)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
# port_mapping表删除字段
|
|
||||||
ALTER TABLE `port_mapping` DROP COLUMN `subdomain`;
|
|
||||||
@@ -8,5 +8,3 @@
|
|||||||
[主题仓库](https://github.com/xugaoyi/vuepress-theme-vdoing)
|
[主题仓库](https://github.com/xugaoyi/vuepress-theme-vdoing)
|
||||||
|
|
||||||
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing-doc)
|
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing-doc)
|
||||||
|
|
||||||
hello11
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ module.exports = {
|
|||||||
|
|
||||||
title: "中微子代理",
|
title: "中微子代理",
|
||||||
description: '一个基于Netty的开源内网穿透神器',
|
description: '一个基于Netty的开源内网穿透神器',
|
||||||
// base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
|
base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
|
||||||
base: '/',
|
|
||||||
head: [ // 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
|
head: [ // 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
|
||||||
['link', {rel: 'icon', href: '/img/favicon.ico'}], //favicons,资源放在public文件夹
|
['link', {rel: 'icon', href: '/img/favicon.ico'}], //favicons,资源放在public文件夹
|
||||||
['meta', {name: 'keywords', content: 'vuepress,theme,blog,vdoing'}],
|
['meta', {name: 'keywords', content: 'vuepress,theme,blog,vdoing'}],
|
||||||
@@ -34,7 +33,6 @@ module.exports = {
|
|||||||
{text: '案例', link: '/pages/5d571c/'},
|
{text: '案例', link: '/pages/5d571c/'},
|
||||||
{text: '支持', link: '/pages/1ab20b/'},
|
{text: '支持', link: '/pages/1ab20b/'},
|
||||||
{text: '更新记录', link: '/pages/ff3519/'},
|
{text: '更新记录', link: '/pages/ff3519/'},
|
||||||
{text: 'GitCode', link: 'https://gitcode.com/dromara/neutrino-proxy'},
|
|
||||||
{text: 'Gitee', link: 'https://gitee.com/dromara/neutrino-proxy'},
|
{text: 'Gitee', link: 'https://gitee.com/dromara/neutrino-proxy'},
|
||||||
],
|
],
|
||||||
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
|
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 87 KiB |
@@ -6,7 +6,7 @@ article: false
|
|||||||
---
|
---
|
||||||
|
|
||||||
::: tip
|
::: tip
|
||||||
当前最新版本:2.0.3。从之前的版本升级过来,请参照:更新记录 > 版本记录.
|
当前最新版本:2.0.1。从之前的版本升级过来,请参照:更新记录 > 版本记录
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## 1、快速上手须知
|
## 1、快速上手须知
|
||||||
@@ -16,7 +16,8 @@ article: false
|
|||||||
- 快速上手中涉及到的配置,仅仅是快速体验所必须的配置,完整的配置请参照使用须知中的`服务端配置`、`客户端配置`
|
- 快速上手中涉及到的配置,仅仅是快速体验所必须的配置,完整的配置请参照使用须知中的`服务端配置`、`客户端配置`
|
||||||
|
|
||||||
## 2、部署服务
|
## 2、部署服务
|
||||||
- 根据需要自行选择宝塔面板、jar、docker、原生部署、docker-compose任意一种完成部署,分别参见对应的文档
|
- 根据需要自行选择jar、docker、原生部署任意一种完成部署
|
||||||
|
- 三种方式分别参见对应的文档
|
||||||
- 任何一种部署方式,不要求客户端与服务端一致。如:服务端采用docker部署,客户端可以用docker部署、也可以用jar、原生部署
|
- 任何一种部署方式,不要求客户端与服务端一致。如:服务端采用docker部署,客户端可以用docker部署、也可以用jar、原生部署
|
||||||
- 管理后台说明
|
- 管理后台说明
|
||||||
- 服务端部署成功后,访问http://{服务端IP}:8888打开后台管理页面。使用默认的管理员帐号登录:admin/123456
|
- 服务端部署成功后,访问http://{服务端IP}:8888打开后台管理页面。使用默认的管理员帐号登录:admin/123456
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ permalink: /pages/eebea1/
|
|||||||
|
|
||||||
## 1、环境准备
|
## 1、环境准备
|
||||||
- 首先确保已安装Java21运行环境
|
- 首先确保已安装Java21运行环境
|
||||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server-jdk21-2.0.2-jar.zip`、`neutrino-proxy-client-jdk21-2.0.2-jar.zip`
|
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server-jdk21-2.0.1-jar.zip`、`neutrino-proxy-client-jdk21-2.0.1-jar.zip`
|
||||||
|
|
||||||
|
|
||||||
## 2、部署服务端
|
## 2、部署服务端
|
||||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||||
- 将`neutrino-proxy-server-jdk21-2.0.2-jar.zip`上传至服务器部署目录,并解压
|
- 将`neutrino-proxy-server-jdk21-2.0.1-jar.zip`上传至服务器部署目录,并解压
|
||||||
- 执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用h2数据库。
|
- 执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用h2数据库。
|
||||||
- 若需要指定自己的mysql数据库,则需要在当前目录下的`app.yml`文件中,修改数据库配置如下:
|
- 若需要指定自己的mysql数据库,则需要在当前目录下的`app.yml`文件中,修改数据库配置如下:
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ neutrino:
|
|||||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/scripts/unix/server_start.sh 使用shell脚本启动服务端。
|
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/scripts/unix/server_start.sh 使用shell脚本启动服务端。
|
||||||
|
|
||||||
## 3、部署客户端
|
## 3、部署客户端
|
||||||
- 本地解压`neutrino-proxy-client-jdk21-2.0.2-jar.zip`文件
|
- 本地解压`neutrino-proxy-client-jdk21-2.0.1-jar.zip`文件
|
||||||
- 修改`app.yml`文件中的server-ip为服务器公网ip,并配置license-key,以下是相关的部分配置:
|
- 修改`app.yml`文件中的server-ip为服务器公网ip,并配置license-key,以下是相关的部分配置:
|
||||||
```yml
|
```yml
|
||||||
neutrino:
|
neutrino:
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
title: 通过宝塔面板部署
|
|
||||||
date: 2024-23-20 13:32:00
|
|
||||||
permalink: /pages/9e0fde/
|
|
||||||
article: false
|
|
||||||
---
|
|
||||||
|
|
||||||
## 前提
|
|
||||||
- 仅适用于宝塔面板9.2.0及以上版本
|
|
||||||
- 安装宝塔面板,前往[宝塔面板](https://www.bt.cn/new/download.html?r=dk_neuproxy)官网,选择正式版的脚本下载安装
|
|
||||||
|
|
||||||
## 部署
|
|
||||||
#### 1、登录宝塔面板,在左侧菜单栏中点击`Docker`
|
|
||||||
|
|
||||||
<img :src="$withBase('/img/baota/step1.png')"></img>
|
|
||||||
|
|
||||||
#### 2、首次会提示安装Docker和Docker Compose服务,点击立即安装,若已安装请忽略。
|
|
||||||
|
|
||||||
<img :src="$withBase('/img/baota/step2.png')"></img>
|
|
||||||
|
|
||||||
#### 3、安装完成后在Docker-应用商店中找到 中微子代理(搜索“NeutrinoProxy”),点击安装
|
|
||||||
|
|
||||||
<img :src="$withBase('/img/baota/step3.png')"></img>
|
|
||||||
|
|
||||||
#### 4、设置基本信息,点击确定
|
|
||||||
- 名称:应用名称,默认`neuproxy_随机字符`
|
|
||||||
- 版本:默认`latest`
|
|
||||||
- 允许外部访问:如您需通过`IP+Port`直接访问,请勾选,如您已经设置了域名,请不要勾选此处
|
|
||||||
- web管理端口:默认`9988`,可自行修改
|
|
||||||
- 客户端连接端口:默认`9989`,可自行修改
|
|
||||||
- 客户端SSL连接端口:默认`9990`,可自行修改
|
|
||||||
|
|
||||||
<img :src="$withBase('/img/baota/step4.png')"></img>
|
|
||||||
|
|
||||||
#### 5、提交后面板会自动进行应用初始化,大概需要`1-3`分钟,初始化完成后即可访问。
|
|
||||||
- 如果部署失败,可能是从DockerHub拉取镜像失败,可以自行设置镜像加速。
|
|
||||||
|
|
||||||
<img :src="$withBase('/img/baota/step5.png')"></img>
|
|
||||||
|
|
||||||
#### 6、访问中微子代理管理后台
|
|
||||||
<img :src="$withBase('/img/baota/step6.png')"></img>
|
|
||||||
|
|
||||||
|
|
||||||
@@ -5,8 +5,6 @@ permalink: /pages/5b9bef/
|
|||||||
---
|
---
|
||||||
|
|
||||||
## 1、 部署服务端
|
## 1、 部署服务端
|
||||||
- dockerHub镜像地址:aoshiguchen/neutrino-proxy-server:latest
|
|
||||||
- 阿里云镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
|
||||||
### 使用默认h2数据库一键部署
|
### 使用默认h2数据库一键部署
|
||||||
```shell
|
```shell
|
||||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||||
@@ -36,8 +34,6 @@ neutrino:
|
|||||||
- 然后再执行上面的docker一键部署命令即可
|
- 然后再执行上面的docker一键部署命令即可
|
||||||
|
|
||||||
## 2、部署客户端
|
## 2、部署客户端
|
||||||
- dockerHub镜像地址:aoshiguchen/neutrino-proxy-client:latest
|
|
||||||
- 阿里云镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy-client:latest
|
|
||||||
- 命令中的服务端ip、license请自行补充
|
- 命令中的服务端ip、license请自行补充
|
||||||
- 若是首次使用,请仔细阅读快速上手,以确定license从哪里取得
|
- 若是首次使用,请仔细阅读快速上手,以确定license从哪里取得
|
||||||
```shell
|
```shell
|
||||||
@@ -18,7 +18,7 @@ permalink: /pages/69699a/
|
|||||||
|
|
||||||
## 1、安装包下载
|
## 1、安装包下载
|
||||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载所需的最新的release包:
|
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载所需的最新的release包:
|
||||||
- 比如服务器为linux则可下载`neutrino-proxy-server-linux-2.0.2-native.zip`文件,客户端为windows则可下载`neutrino-proxy-client-windows-2.0.2-native.zip`
|
- 比如服务器为linux则可下载`neutrino-proxy-server-linux-2.0.1-native.zip`文件,客户端为windows则可下载`neutrino-proxy-client-windows-2.0.1-native.zip`
|
||||||
|
|
||||||
## 2、部署服务端
|
## 2、部署服务端
|
||||||
- 将服务端安装包上传至服务器,并解压
|
- 将服务端安装包上传至服务器,并解压
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
title: 使用docker-compose部署
|
|
||||||
date: 2024-12-07 14:40:50
|
|
||||||
permalink: /pages/2d4123/
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1、 部署服务端
|
|
||||||
### 使用默认h2数据库一键部署
|
|
||||||
- 注意自行修改配置文件:config/app.yml
|
|
||||||
```shell
|
|
||||||
git clone https://gitee.com/dromara/neutrino-proxy.git
|
|
||||||
cd neutrino-proxy/scripts/docker-compose/neutrino-proxy-server-h2
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
### 使用默认mysql数据库一键部署
|
|
||||||
- 注意自行修改配置文件:config/app.yml
|
|
||||||
```shell
|
|
||||||
git clone https://gitee.com/dromara/neutrino-proxy.git
|
|
||||||
cd neutrino-proxy/scripts/docker-compose/neutrino-proxy-server-mysql
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
## 2、部署客户端
|
|
||||||
- 注意自行修改配置文件:config/app.yml
|
|
||||||
```shell
|
|
||||||
git clone https://gitee.com/dromara/neutrino-proxy.git
|
|
||||||
cd neutrino-proxy/scripts/docker-compose/neutrino-proxy-client
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
@@ -21,7 +21,6 @@ article: false
|
|||||||
- 默认所有代理没有限速
|
- 默认所有代理没有限速
|
||||||
- 对License限速,将使得License下的所有端口映射都被限速
|
- 对License限速,将使得License下的所有端口映射都被限速
|
||||||
- 若License设置了限速,License下的某条映射也设置了限速,则对于该映射优先采用端口映射上的限速规则
|
- 若License设置了限速,License下的某条映射也设置了限速,则对于该映射优先采用端口映射上的限速规则
|
||||||
- 域名管理:用于管理服务器主域名和证书,用于支持域名映射。一个主域名域名可以创建多个域名映射(配置不同的子域名)。
|
|
||||||
|
|
||||||
<img :src="$withBase('/img/run-example/license2.png')"></img>
|
<img :src="$withBase('/img/run-example/license2.png')"></img>
|
||||||
<img :src="$withBase('/img/run-example/port-mapping2.png')"></img>
|
<img :src="$withBase('/img/run-example/port-mapping2.png')"></img>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ permalink: /pages/269a2e/
|
|||||||
|
|
||||||
# 什么是域名映射?
|
# 什么是域名映射?
|
||||||
域名映射是将指定端口映射绑定到某一个子域名上,通过直接访问域名的方式,达到访问被代理服务的目的。
|
域名映射是将指定端口映射绑定到某一个子域名上,通过直接访问域名的方式,达到访问被代理服务的目的。
|
||||||
支持维护多个主域名并为多个主域名配置不同的子域名实现域名映射。
|
|
||||||
|
|
||||||
# 域名映射能解决什么问题?
|
# 域名映射能解决什么问题?
|
||||||
- 1、当服务端端口需要经常变动的时候,可以通过固定域名的方式,使得开发调试能够长期稳定的进行,不用每次更改访问地址。
|
- 1、当服务端端口需要经常变动的时候,可以通过固定域名的方式,使得开发调试能够长期稳定的进行,不用每次更改访问地址。
|
||||||
@@ -18,8 +17,8 @@ permalink: /pages/269a2e/
|
|||||||
|
|
||||||
## 情况1:代理服务端使用80端口
|
## 情况1:代理服务端使用80端口
|
||||||
- 1、DNS解析配置泛域名解析 proxy.asgc.fun 指向代理服务端IP
|
- 1、DNS解析配置泛域名解析 proxy.asgc.fun 指向代理服务端IP
|
||||||
- 2、服务端管理后台域名管理新建域名,如:asgc.fun
|
- 2、代理服务端app.yml配置域名:proxy.asgc.fun,部署
|
||||||
- 3、服务端管理后台新建端口映射,协议选择:HTTP(S),选择主域名并设置好子域名,如:test1.proxy
|
- 3、服务端管理后台新建端口映射,协议选择:HTTP,设置好子域名,如:test1
|
||||||
- 4、配置好客户端并启动,代理映射完成
|
- 4、配置好客户端并启动,代理映射完成
|
||||||
- 5、通过访问: http://test1.proxy.asgc.fun 实现访问被代理服务
|
- 5、通过访问: http://test1.proxy.asgc.fun 实现访问被代理服务
|
||||||
|
|
||||||
@@ -28,8 +27,8 @@ permalink: /pages/269a2e/
|
|||||||
|
|
||||||
- 1、DNS解析配置泛域名解析 proxy.asgc.fun 指向代理服务端IP
|
- 1、DNS解析配置泛域名解析 proxy.asgc.fun 指向代理服务端IP
|
||||||
- 2、nginx 80端口下将 *.proxy.asgc.fun 请求转到82端口,并附带原有请求头(特别是`Host`)
|
- 2、nginx 80端口下将 *.proxy.asgc.fun 请求转到82端口,并附带原有请求头(特别是`Host`)
|
||||||
- 3、服务端管理后台域名管理新建域名,如:asgc.fun
|
- 3、代理服务端app.yml配置域名:proxy.asgc.fun,部署
|
||||||
- 4、服务端管理后台新建端口映射,协议选择:HTTP(S),设置好子域名,如:test1.proxy
|
- 4、服务端管理后台新建端口映射,协议选择:HTTP,设置好子域名,如:test1
|
||||||
- 5、配置好客户端并启动,代理映射完成
|
- 5、配置好客户端并启动,代理映射完成
|
||||||
- 6、通过访问: http://test1.proxy.asgc.fun 实现访问被代理服务
|
- 6、通过访问: http://test1.proxy.asgc.fun 实现访问被代理服务
|
||||||
|
|
||||||
@@ -37,13 +36,6 @@ permalink: /pages/269a2e/
|
|||||||
不行的。之所以能实现域名绑定,原因是HTTP请求附带了Host请求头,包含了请求的域名信息,代理服务端能根据请求的域名做分发。而TCP协议本身并不包含域名,因此无法实现。
|
不行的。之所以能实现域名绑定,原因是HTTP请求附带了Host请求头,包含了请求的域名信息,代理服务端能根据请求的域名做分发。而TCP协议本身并不包含域名,因此无法实现。
|
||||||
所以,目前只有HTTP(涵盖HTTPS)协议能支持。
|
所以,目前只有HTTP(涵盖HTTPS)协议能支持。
|
||||||
|
|
||||||
# 域名映射支持HTTPS吗?
|
|
||||||
支持的。在服务端管理后台-域名管理中新建域名并上传域名对应的服务器证书,可以选择强制HTTPS,这样会拦截所有HTTP请求,只支持通过HTTPS访问。
|
|
||||||
如果上传后的证书仍不支持HTTPS访问,请确保上传证书有效并且和配置的主域名或完整域名映射匹配。
|
|
||||||
|
|
||||||
# 上传服务器证书的文件有要求吗?
|
|
||||||
有的。目前只支持通过jks文件上传服务器证书,jks文件中只包含服务器证书(如:.cer文件),并设置密码。
|
|
||||||
|
|
||||||
# 代理服务端使用非80端口时,nginx配置示例
|
# 代理服务端使用非80端口时,nginx配置示例
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ permalink: /pages/99a300/
|
|||||||
|
|
||||||
## HTTPS配置流程
|
## HTTPS配置流程
|
||||||
- 按照域名映射流程,完成域名的配置
|
- 按照域名映射流程,完成域名的配置
|
||||||
- 在服务端管理后台上传对应域名的HTTPS证书信息(此处应该是通配符证书)
|
- 在服务端配置域名的HTTPS证书信息(此处应该是通配符证书)
|
||||||
|
|
||||||
|
|
||||||
## HTTPS端口问题
|
## HTTPS端口问题
|
||||||
- 与HTTP类似,HTTPS也有一个默认端口:443,默认情况下需要占用服务端443端口
|
- 与HTTP类似,HTTPS也有一个默认端口:443,默认情况下需要占用服务端443端口
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: 服务端配置
|
title: 服务端配置
|
||||||
date: 2024-09-22 11:41:44
|
date: 2023-05-27 11:41:44
|
||||||
permalink: /pages/f2d0f1/
|
permalink: /pages/f2d0f1/
|
||||||
---
|
---
|
||||||
|
|
||||||
::: tip
|
::: tip
|
||||||
|
|
||||||
2.0.2版本,服务端配置格式有所调整。从之前的版本升级的,需要注意
|
1.9.0版本,服务端配置格式有所调整。从之前的版本升级的,需要注意
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -16,12 +16,13 @@ permalink: /pages/f2d0f1/
|
|||||||
server:
|
server:
|
||||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||||
port: ${WEB_PORT:8888}
|
port: ${WEB_PORT:8888}
|
||||||
|
# 日志级别
|
||||||
|
solon.logging.logger:
|
||||||
|
"root":
|
||||||
|
level: info
|
||||||
|
|
||||||
neutrino:
|
neutrino:
|
||||||
proxy:
|
proxy:
|
||||||
logger:
|
|
||||||
# 日志级别
|
|
||||||
level: ${LOG_LEVEL:info}
|
|
||||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||||
tunnel:
|
tunnel:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
@@ -37,6 +38,8 @@ neutrino:
|
|||||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: ${TUNNEL_LOG:false}
|
transfer-log-enable: ${TUNNEL_LOG:false}
|
||||||
|
# 是否开启心跳日志
|
||||||
|
heartbeat-log-enable: ${HEARTBEAT_LOG:false}
|
||||||
server:
|
server:
|
||||||
tcp:
|
tcp:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
@@ -46,6 +49,11 @@ neutrino:
|
|||||||
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
||||||
# https代理端口,默认443 (需要配置域名、证书)
|
# https代理端口,默认443 (需要配置域名、证书)
|
||||||
https-proxy-port: ${HTTPS_PROXY_PORT: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时开启才有效)
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: ${SERVER_LOG:false}
|
transfer-log-enable: ${SERVER_LOG:false}
|
||||||
udp:
|
udp:
|
||||||
@@ -56,7 +64,7 @@ neutrino:
|
|||||||
transfer-log-enable: ${SERVER_LOG:false}
|
transfer-log-enable: ${SERVER_LOG:false}
|
||||||
data:
|
data:
|
||||||
db:
|
db:
|
||||||
# 数据库类型,目前支持sqlite、mysql、mariadb
|
# 数据库类型,目前支持h2、mysql、mariadb
|
||||||
type: ${DB_TYPE:h2}
|
type: ${DB_TYPE:h2}
|
||||||
# 数据库连接URL
|
# 数据库连接URL
|
||||||
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
title: 服务端原声包启动,db初始化异常
|
|
||||||
date: 2024-11-09 15:28:37
|
|
||||||
permalink: /pages/7dcba8/
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.1、报错“Data truncation: Data too long for column 'name' at row 1”
|
|
||||||
配置文件中配置的mysql连接地址,去掉“characterEncoding=UTF-8”参数
|
|
||||||
@@ -7,14 +7,6 @@ permalink: /pages/acdf0a/
|
|||||||
|
|
||||||
| 日期 | 渠道 | 金额 |昵称| 备注 |
|
| 日期 | 渠道 | 金额 |昵称| 备注 |
|
||||||
|:-----------|:---|:-----|:-|:--------------------------------------|
|
|:-----------|:---|:-----|:-|:--------------------------------------|
|
||||||
| 2024-11-19|支付宝收款码|2|*亮||
|
|
||||||
| 2024-10-06 |Gitee捐助|100|碧云天|感谢您的开源项目!|
|
|
||||||
| 2024-10-14 |微信红包|5|泛微eteams刘新东17699059661|
|
|
||||||
| 2024-09-04 |Gitee捐助|8.88|lusen998|感谢您的开源项目!|
|
|
||||||
| 2024-08-30 | 微信转账|100|吴忧吴虑|
|
|
||||||
| 2024-07-29 |Gitee捐助|10|QuanJWS|感谢您的开源项目!看着很不错的样子,加油! |
|
|
||||||
| 2024-07-29 |微信赞赏码|120|陈某| |
|
|
||||||
| 2024-05-07 |微信转账|100|仲秀| |
|
|
||||||
| 2024-04-16 |微信转账|100|暮光:城中城| |
|
| 2024-04-16 |微信转账|100|暮光:城中城| |
|
||||||
| 2024-04-03 |微信转账|100|仲秀| 大神,非常感谢 |
|
| 2024-04-03 |微信转账|100|仲秀| 大神,非常感谢 |
|
||||||
| 2024-03-24 |Gitee捐助|10|include|
|
| 2024-03-24 |Gitee捐助|10|include|
|
||||||
|
|||||||
@@ -4,27 +4,6 @@ date: 2023-10-26 17:43:43
|
|||||||
permalink: /pages/ff3519/
|
permalink: /pages/ff3519/
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2.0.3
|
|
||||||
- 紧急bug修复:解决http请求拆包情况下域名映射失效的问题
|
|
||||||
|
|
||||||
## 2.0.2
|
|
||||||
- bug修复
|
|
||||||
- 解决安全组在ipv6场景下误拦截导致域名映射访问不通的问题
|
|
||||||
- 解决native编译后,端口池批量删除报错的问题
|
|
||||||
- 解决客户端docker方式部署环境变量指定参数不生效的问题
|
|
||||||
- 服务端解决native下清理日志定时任务报错的问题
|
|
||||||
- 解决后台分页查询的已知问题
|
|
||||||
- 端口映射中的客户端ip字段加长一点,解决配置阿里云数据库域名字段不够的问题
|
|
||||||
- 解决服务端native部署时,访问后台用户列表,日志警告“you should use: nativeMetadata.registerField(field) at aot runtime”的问题
|
|
||||||
- 新增功能
|
|
||||||
- 新增后台域名管理,⽀持新增、修改、删除、禁⽤主域名,支持添加多级域名。
|
|
||||||
- 域名管理支持上传域名对应的SSL证书、⽀持设置强制HTTPS、⽀持域名映射⾃动加载对应的服务器证书。
|
|
||||||
- 端口映射支持选择切换不同的主域名,⽀持绑定多个⼦域名,单个端⼝⽀持绑定多个不同的主域名。
|
|
||||||
- 升级须知:
|
|
||||||
- **域名和SSL证书的配置由配置文件配置改为后台域名管理页面配置。**
|
|
||||||
- 去掉了配置文件声明服务器端域名和证书的方式,改为通过页面进行管理,请注意自行进行数据迁移。
|
|
||||||
- 数据库新增`域名表`和`域名映射中间表`,修改了`端口映射表`,涉及到表结构变更,执行[增量SQL](https://gitee.com/dromara/neutrino-proxy/blob/master/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20240808.SQL)
|
|
||||||
|
|
||||||
## 2.0.1
|
## 2.0.1
|
||||||
- jdk版本升级为21
|
- jdk版本升级为21
|
||||||
- 新增安全组模块,支持黑名单、白名单限制
|
- 新增安全组模块,支持黑名单、白名单限制
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ title: 里程碑
|
|||||||
date: 2023-10-26 17:41:26
|
date: 2023-10-26 17:41:26
|
||||||
permalink: /pages/e406dd/
|
permalink: /pages/e406dd/
|
||||||
---
|
---
|
||||||
- 2024-12-20 中微子代理服务端支持宝塔面板一件部署
|
|
||||||
- 2024-12-10 2.0.2版本发布,新增域名管理,端口映射支持绑定多个域名
|
|
||||||
- 2023-12-21 2.0.1版本发布,jdk版本升级到21,支持安全组(黑/白名单IP限制)、限速
|
- 2023-12-21 2.0.1版本发布,jdk版本升级到21,支持安全组(黑/白名单IP限制)、限速
|
||||||
- 2023-10-31 2.0.0版本发布,升级jdk版本至jdk17、支持原生编译、去掉sqlite改为默认H2数据库
|
- 2023-10-31 2.0.0版本发布,升级jdk版本至jdk17、支持原生编译、去掉sqlite改为默认H2数据库
|
||||||
- 2023-09-25 中微子代理Gitee Star数突破1000
|
- 2023-09-25 中微子代理Gitee Star数突破1000
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vuepress dev docs",
|
"dev": "vuepress dev docs",
|
||||||
"build": "vuepress build docs",
|
"build": "vuepress build docs",
|
||||||
"buildAndDeploy": "vuepress build docs && bash deploy/deploy1.sh",
|
"buildAndDeploy": "vuepress build docs && bash deploy/deploy2.sh",
|
||||||
"deploy": "bash deploy/deploy1.sh",
|
"deploy": "bash deploy/deploy2.sh",
|
||||||
"updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D",
|
"updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D",
|
||||||
"editFm": "node utils/editFrontmatter.js"
|
"editFm": "node utils/editFrontmatter.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
<revision>2.0.3</revision>
|
<revision>2.0.1</revision>
|
||||||
|
|
||||||
<native.version>0.9.28</native.version>
|
<native.version>0.9.28</native.version>
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
## 项目简介
|
|
||||||
- [中微子代理(neutrino-proxy)](https://gitee.com/dromara/neutrino-proxy) 是一款基于Solon、Netty的内网穿透神器。该项目采用最为宽松的MIT协议,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
|
||||||
- 市面上基于内网穿透的常见产品有:花生壳、TeamView、cpolar等。
|
|
||||||
- 常见的使用场景:
|
|
||||||
- 本地开发调试第三方回调
|
|
||||||
- 本地开发异地接口连调
|
|
||||||
- 远程登录内网windows机器
|
|
||||||
- 将本地服务映射到外网,用于演示
|
|
||||||
- Gitee仓库:https://gitee.com/dromara/neutrino-proxy
|
|
||||||
- GitCode仓库:https://gitcode.com/dromara/neutrino-proxy
|
|
||||||
- GitHub仓库:https://github.com/dromara/neutrino-proxy
|
|
||||||
- 官网地址: https://neutrino-proxy.dromara.org
|
|
||||||
|
|
||||||
## 主要特点:
|
|
||||||
- 1、流量监控:首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
|
||||||
- 2、用户/License:支持多用户、多客户端使用。后台禁用实时生效。
|
|
||||||
- 3、端口池:对外端口统一管理,支持用户、License独占端口。
|
|
||||||
- 4、端口映射:新增、编辑、删除、禁用实时生效。
|
|
||||||
- 5、Docker:服务端/客户端支持Docker一键部署。
|
|
||||||
- 6、SSL证书:隧道通信支持SSL加密,保护您的数据安全。
|
|
||||||
- 7、域名映射:支持绑定子域名,方便本地调试三方回调
|
|
||||||
- 8、多种协议:支持代理TCP、HTTP、HTTPS、UDP协议
|
|
||||||
- 9、原生部署:支持编译为原生可执行文件,更低部署门槛、更少内存占用
|
|
||||||
- 10、安全组:支持黑/白名单IP访问限制
|
|
||||||
- 11、限速:支持对License、端口映射限制上传/下载速度
|
|
||||||
- 12、采用最为宽松的MIT协议,免去你的后顾之忧
|
|
||||||
|
|
||||||
## 镜像版本&地址
|
|
||||||
- 版本:当前最新版本为`2.0.1`,可直接使用`latest`拉取最新镜像
|
|
||||||
- neutrino-proxy-server
|
|
||||||
- DockerHub镜像地址:aoshiguchen/neutrino-proxy-server:latest
|
|
||||||
- 阿里云镜像地址:neutrino-proxy registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
|
||||||
- neutrino-proxy-client
|
|
||||||
- DockerHub镜像地址:aoshiguchen/neutrino-proxy-client:latest
|
|
||||||
- 阿里云镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy-client:latest
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
solon.logging.logger:
|
|
||||||
"root":
|
|
||||||
level: info
|
|
||||||
|
|
||||||
neutrino:
|
|
||||||
proxy:
|
|
||||||
tunnel:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
thread-count: 50
|
|
||||||
# 隧道SSL证书配置
|
|
||||||
key-store-password: 123456
|
|
||||||
jks-path: classpath:/test.jks
|
|
||||||
# 服务端IP
|
|
||||||
server-ip: host.docker.internal
|
|
||||||
# 服务端端口(对应服务端app.yml中的tunnel.port、tunnel.ssl-port)
|
|
||||||
server-port: 9002
|
|
||||||
# 是否启用SSL(注意:该配置必须和server-port对应上)
|
|
||||||
ssl-enable: true
|
|
||||||
# 客户端连接唯一凭证
|
|
||||||
license-key: b0a907332b474b25897c4dcb31fc7eb6
|
|
||||||
# 客户端唯一身份标识(可忽略,若不设置首次启动会自动生成)
|
|
||||||
client-id:
|
|
||||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
# 是否开启心跳日志
|
|
||||||
heartbeat-log-enable: 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: false
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
npClient:
|
|
||||||
driver: bridge
|
|
||||||
services:
|
|
||||||
npClient:
|
|
||||||
image: aoshiguchen/neutrino-proxy-client:latest
|
|
||||||
container_name: compose-npClient
|
|
||||||
hostname: npClient
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
LANG: zh_CN.UTF-8
|
|
||||||
volumes:
|
|
||||||
- ./config:/root/neutrino-proxy/config
|
|
||||||
- ./logs:/root/neutrino-proxy/logs
|
|
||||||
ports:
|
|
||||||
- "10000-10500:10000-10500/udp"
|
|
||||||
networks:
|
|
||||||
- npClient
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
server:
|
|
||||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
|
||||||
port: 8888
|
|
||||||
# 日志级别
|
|
||||||
solon.logging:
|
|
||||||
logger:
|
|
||||||
"root":
|
|
||||||
level: info
|
|
||||||
appender:
|
|
||||||
file:
|
|
||||||
level: info
|
|
||||||
|
|
||||||
neutrino:
|
|
||||||
proxy:
|
|
||||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
|
||||||
tunnel:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
boss-thread-count: 2
|
|
||||||
work-thread-count: 10
|
|
||||||
# 隧道非SSL端口
|
|
||||||
port: 9000
|
|
||||||
# 隧道SSL端口
|
|
||||||
ssl-port: 9002
|
|
||||||
# 隧道SSL证书配置
|
|
||||||
key-store-password: 123456
|
|
||||||
key-manager-password: 123456
|
|
||||||
jks-path: classpath:/test.jks
|
|
||||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
# 是否开启心跳日志
|
|
||||||
heartbeat-log-enable: false
|
|
||||||
server:
|
|
||||||
tcp:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
boss-thread-count: 5
|
|
||||||
work-thread-count: 20
|
|
||||||
# http代理端口,默认80(不配置不支持)
|
|
||||||
http-proxy-port: 80
|
|
||||||
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
|
||||||
https-proxy-port: 443
|
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
udp:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
boss-thread-count: 5
|
|
||||||
work-thread-count: 20
|
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
data:
|
|
||||||
db:
|
|
||||||
# 数据库类型,目前支持h2、mysql、mariadb
|
|
||||||
type: h2
|
|
||||||
# 数据库连接URL
|
|
||||||
url: jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE
|
|
||||||
# 数据库用户名
|
|
||||||
username:
|
|
||||||
# 数据库密码
|
|
||||||
password:
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
npServer:
|
|
||||||
driver: bridge
|
|
||||||
services:
|
|
||||||
npServer:
|
|
||||||
image: aoshiguchen/neutrino-proxy-server:latest
|
|
||||||
container_name: compose-npServer
|
|
||||||
hostname: npServer
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
LANG: zh_CN.UTF-8
|
|
||||||
volumes:
|
|
||||||
- ./config:/root/neutrino-proxy/config
|
|
||||||
- ./data:/root/neutrino-proxy/data
|
|
||||||
- ./logs:/root/neutrino-proxy/logs
|
|
||||||
ports:
|
|
||||||
- "8888:8888"
|
|
||||||
- "9000:9000"
|
|
||||||
- "9002:9002"
|
|
||||||
- "9101-9120:9101-9120"
|
|
||||||
networks:
|
|
||||||
- npServer
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
server:
|
|
||||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
|
||||||
port: 8888
|
|
||||||
# 日志级别
|
|
||||||
solon.logging:
|
|
||||||
logger:
|
|
||||||
"root":
|
|
||||||
level: info
|
|
||||||
appender:
|
|
||||||
file:
|
|
||||||
level: info
|
|
||||||
|
|
||||||
neutrino:
|
|
||||||
proxy:
|
|
||||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
|
||||||
tunnel:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
boss-thread-count: 2
|
|
||||||
work-thread-count: 10
|
|
||||||
# 隧道非SSL端口
|
|
||||||
port: 9000
|
|
||||||
# 隧道SSL端口
|
|
||||||
ssl-port: 9002
|
|
||||||
# 隧道SSL证书配置
|
|
||||||
key-store-password: 123456
|
|
||||||
key-manager-password: 123456
|
|
||||||
jks-path: classpath:/test.jks
|
|
||||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
# 是否开启心跳日志
|
|
||||||
heartbeat-log-enable: false
|
|
||||||
server:
|
|
||||||
tcp:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
boss-thread-count: 5
|
|
||||||
work-thread-count: 20
|
|
||||||
# http代理端口,默认80(不配置不支持)
|
|
||||||
http-proxy-port: 80
|
|
||||||
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
|
||||||
https-proxy-port: 443
|
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
udp:
|
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
|
||||||
boss-thread-count: 5
|
|
||||||
work-thread-count: 20
|
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
|
||||||
transfer-log-enable: false
|
|
||||||
data:
|
|
||||||
db:
|
|
||||||
# 数据库类型,目前支持h2、mysql、mariadb
|
|
||||||
type: mysql
|
|
||||||
# 数据库连接URL
|
|
||||||
url: jdbc:mysql://mysql:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
|
||||||
# 数据库用户名
|
|
||||||
username: root
|
|
||||||
# 数据库密码
|
|
||||||
password: 123456
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
-- Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
-- or more contributor license agreements. See the NOTICE file
|
|
||||||
-- distributed with this work for additional information
|
|
||||||
-- regarding copyright ownership. The ASF licenses this file
|
|
||||||
-- to you under the Apache License, Version 2.0 (the
|
|
||||||
-- "License"); you may not use this file except in compliance
|
|
||||||
-- with the License. You may obtain a copy of the License at
|
|
||||||
--
|
|
||||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
--
|
|
||||||
-- Unless required by applicable law or agreed to in writing, software
|
|
||||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
-- See the License for the specific language governing permissions and
|
|
||||||
-- limitations under the License.
|
|
||||||
|
|
||||||
-- this file works for MySQL.
|
|
||||||
|
|
||||||
set names utf8mb4;
|
|
||||||
create database if not exists `neutrino-proxy` default charset utf8mb4 collate utf8mb4_general_ci;
|
|
||||||
commit;
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
npServer:
|
|
||||||
driver: bridge
|
|
||||||
services:
|
|
||||||
mysql:
|
|
||||||
image: mysql:8
|
|
||||||
container_name: compose-mysql
|
|
||||||
hostname: mysql
|
|
||||||
restart: always
|
|
||||||
healthcheck:
|
|
||||||
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --silent']
|
|
||||||
interval: 3s
|
|
||||||
retries: 5
|
|
||||||
start_period: 3m
|
|
||||||
ports:
|
|
||||||
- "3308:3306"
|
|
||||||
environment:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
MYSQL_ROOT_PASSWORD: 123456
|
|
||||||
volumes:
|
|
||||||
- ./data/mysqldata:/var/lib/mysql/
|
|
||||||
- ./config/sql:/docker-entrypoint-initdb.d/
|
|
||||||
networks:
|
|
||||||
- npServer
|
|
||||||
npServer:
|
|
||||||
image: aoshiguchen/neutrino-proxy-server:latest
|
|
||||||
container_name: compose-npServer
|
|
||||||
hostname: npServer
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
LANG: zh_CN.UTF-8
|
|
||||||
depends_on:
|
|
||||||
mysql:
|
|
||||||
condition: service_healthy
|
|
||||||
volumes:
|
|
||||||
- ./config:/root/neutrino-proxy/config
|
|
||||||
- ./data:/root/neutrino-proxy/data
|
|
||||||
- ./logs:/root/neutrino-proxy/logs
|
|
||||||
ports:
|
|
||||||
- "8888:8888"
|
|
||||||
- "9000:9000"
|
|
||||||
- "9002:9002"
|
|
||||||
- "9101-9120:9101-9120"
|
|
||||||
networks:
|
|
||||||
- npServer
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# 镜像版本,每次更新版本时需要调整
|
# 镜像版本,每次更新版本时需要调整
|
||||||
ImageVer=2.0.2
|
ImageVer=2.0.0
|
||||||
ImageName=neutrino-proxy-client
|
ImageName=neutrino-proxy-client
|
||||||
DockerFilePath=$PWD/../../neutrino-proxy-client
|
DockerFilePath=$PWD/../../neutrino-proxy-client
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ MODULE_NAME=neutrino-proxy-client
|
|||||||
deployDir="deploy"
|
deployDir="deploy"
|
||||||
clientDeployDir=$deployDir"/client"
|
clientDeployDir=$deployDir"/client"
|
||||||
machine=macos
|
machine=macos
|
||||||
VER=2.0.3
|
VER=2.0.1
|
||||||
|
|
||||||
#切到项目根目录
|
#切到项目根目录
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# 镜像版本,每次更新版本时需要调整
|
# 镜像版本,每次更新版本时需要调整
|
||||||
ImageVer=2.0.2
|
ImageVer=2.0.0
|
||||||
ImageName=neutrino-proxy
|
ImageName=neutrino-proxy
|
||||||
DockerFilePath=$PWD/../../neutrino-proxy-server
|
DockerFilePath=$PWD/../../neutrino-proxy-server
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ MODULE_NAME=neutrino-proxy-server
|
|||||||
deployDir="deploy"
|
deployDir="deploy"
|
||||||
serverDeployDir=$deployDir"/server"
|
serverDeployDir=$deployDir"/server"
|
||||||
machine=macos
|
machine=macos
|
||||||
VER=2.0.3
|
VER=2.0.1
|
||||||
|
|
||||||
#切到项目根目录
|
#切到项目根目录
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|||||||