Skip to content

Commit

Permalink
4.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
cym1102 committed Jun 11, 2024
1 parent 410c1ab commit 978de3f
Show file tree
Hide file tree
Showing 27 changed files with 247 additions and 215 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM alpine:3.20
ENV LANG=zh_CN.UTF-8 \
TZ=Asia/Shanghai \
PS1="\u@\h:\w \$ "
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --update --no-cache \
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
RUN apk add --update --no-cache \
nginx \
nginx-mod-stream \
nginx-mod-http-headers-more \
Expand Down
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ Path : JDK安装目录\bin

```
Linux: mkdir /home/nginxWebUI/
wget -O /home/nginxWebUI/nginxWebUI.jar https://file.nginxwebui.cn/nginxWebUI-4.1.4.jar
wget -O /home/nginxWebUI/nginxWebUI.jar https://file.nginxwebui.cn/nginxWebUI-4.1.5.jar
Windows: 直接使用浏览器下载 https://file.nginxwebui.cn/nginxWebUI-4.1.4.jar 到 D:/home/nginxWebUI/nginxWebUI.jar
Windows: 直接使用浏览器下载 https://file.nginxwebui.cn/nginxWebUI-4.1.5.jar 到 D:/home/nginxWebUI/nginxWebUI.jar
```

有新版本只需要修改路径中的版本即可
Expand Down Expand Up @@ -137,6 +137,10 @@ yum install docker

```
docker pull cym1102/nginxwebui:latest
或者
docker pull registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest
```

3.启动容器:
Expand All @@ -148,6 +152,15 @@ docker run -itd \
--net=host \
--restart=always \
cym1102/nginxwebui:latest
或者
docker run -itd \
-v /home/nginxWebUI:/home/nginxWebUI \
-e BOOT_OPTIONS="--server.port=8080" \
--net=host \
--restart=always \
registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest
```

注意:
Expand Down Expand Up @@ -178,6 +191,20 @@ services:
privileged: true
network_mode: "host"
或者
version: "3.2"
services:
nginxWebUi-server:
image: registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest
volumes:
- type: bind
source: "/home/nginxWebUI"
target: "/home/nginxWebUI"
environment:
BOOT_OPTIONS: "--server.port=8080"
privileged: true
network_mode: "host"
```


Expand Down
31 changes: 29 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ reboot

```
Linux: mkdir /home/nginxWebUI/
wget -O /home/nginxWebUI/nginxWebUI.jar https://file.nginxwebui.cn/nginxWebUI-4.1.4.jar
wget -O /home/nginxWebUI/nginxWebUI.jar https://file.nginxwebui.cn/nginxWebUI-4.1.5.jar
Windows: Download directly from your browser https://file.nginxwebui.cn/nginxWebUI-4.1.4.jar into D:/home/nginxWebUI/
Windows: Download directly from your browser https://file.nginxwebui.cn/nginxWebUI-4.1.5.jar into D:/home/nginxWebUI/
```

With a new version, you just need to change the version in the path
Expand Down Expand Up @@ -133,6 +133,10 @@ yum install docker

```
docker pull cym1102/nginxwebui:latest
or
docker pull registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest
```

3.start container
Expand All @@ -144,6 +148,15 @@ docker run -itd \
--net=host \
--restart=always \
cym1102/nginxwebui:latest
or
docker run -itd \
-v /home/nginxWebUI:/home/nginxWebUI \
-e BOOT_OPTIONS="--server.port=8080" \
--net=host \
--restart=always \
registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest
```

notice:
Expand Down Expand Up @@ -173,7 +186,21 @@ services:
BOOT_OPTIONS: "--server.port=8080"
privileged: true
network_mode: "host"
or
version: "3.2"
services:
nginxWebUi-server:
image: registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest
volumes:
- type: bind
source: "/home/nginxWebUI"
target: "/home/nginxWebUI"
environment:
BOOT_OPTIONS: "--server.port=8080"
privileged: true
network_mode: "host"
```


Expand Down
11 changes: 6 additions & 5 deletions buildx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
set -o pipefail

## 基本信息
repo="cym1102/nginxwebui"
arch="linux/386,linux/amd64,linux/arm64,linux/arm/v7"
arch="linux/amd64,linux/arm64"
ver=$(cat pom.xml | grep -A1 nginxWebUI | grep version | grep -oP "\d+\.\d+\.\d+")
echo "构建镜像:$repo"
echo "构建镜像:nginxwebui"
echo "构建架构:$arch"
echo "构建版本:$ver"

Expand All @@ -34,8 +33,10 @@ docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform "$arch" \
--tag ${repo}:${ver} \
--tag ${repo}:latest \
--tag cym1102/nginxwebui:${ver} \
--tag cym1102/nginxwebui:latest \
--tag registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:${ver} \
--tag registry.cn-hangzhou.aliyuncs.com/cym19871102/nginxwebui:latest \
--push \
.

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.cym</groupId>
<artifactId>nginxWebUI</artifactId>
<version>4.1.4</version>
<version>4.1.5</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/cym/controller/adminPage/ExportController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Produces;
import org.noear.solon.boot.web.MimeType;
import org.noear.solon.core.handle.Context;
import org.noear.solon.core.handle.DownloadedFile;
import org.noear.solon.core.handle.ModelAndView;
Expand All @@ -18,11 +20,8 @@
import org.slf4j.LoggerFactory;

import com.cym.ext.AsycPack;
import com.cym.model.Cert;
import com.cym.model.CertCode;
import com.cym.service.CertService;
import com.cym.service.ConfService;
import com.cym.sqlhelper.utils.ConditionAndWrapper;
import com.cym.utils.BaseController;

import cn.hutool.core.date.DateUtil;
Expand Down Expand Up @@ -55,9 +54,10 @@ public DownloadedFile dataExport(Context context) {
DownloadedFile downloadedFile = new DownloadedFile("application/octet-stream", new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)), date + ".json");
return downloadedFile;
}


@Produces(MimeType.TEXT_HTML_VALUE)
@Mapping(value = "dataImport")
public void dataImport(UploadedFile file, Context context) throws IOException {
public String dataImport(UploadedFile file, Context context) throws IOException {
if (file != null) {
File tempFile = new File(homeConfig.home + "temp" + File.separator + file.getName().replace("..", ""));
FileUtil.mkdir(tempFile.getParentFile());
Expand All @@ -69,7 +69,7 @@ public void dataImport(UploadedFile file, Context context) throws IOException {
confService.setAsycPack(asycPack);

}
context.redirect("/adminPage/export?over=true");
return "<script>window.parent.finisheUpload();</script> ";
}

@Mapping("logExport")
Expand Down
30 changes: 21 additions & 9 deletions src/main/java/com/cym/model/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,21 @@ public class Location extends BaseModel {
*/
@InitValue("0")
Integer type;

@JsonIgnore
String locationParamJson;

/**
* 重定向路径
*/
String returnUrl;

/**
* 重定向是否携带源路径 0否 1是(默认)
*/
@InitValue("1")
Integer returnPath;

/**
* 动态代理目标 (例:http://10.10.10.1:8080/)
*/
Expand Down Expand Up @@ -72,7 +83,7 @@ public class Location extends BaseModel {
*/
@InitValue("$host")
String headerHost;

/**
* 是否开启websocket支持 0否(默认) 1是
*/
Expand All @@ -89,14 +100,15 @@ public class Location extends BaseModel {
* 描述
*/
String descr;

/**
* 重定向路径
*/
String returnUrl;



public Integer getReturnPath() {
return returnPath;
}

public void setReturnPath(Integer returnPath) {
this.returnPath = returnPath;
}

public String getReturnUrl() {
return returnUrl;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cym/service/ConfService.java
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ public NgxBlock bulidBlockServer(Server server, ConfExt confExt) {

} else if (location.getType() == 4) { // 重定向
ngxParam = new NgxParam();
ngxParam.addValue("return 301 " + location.getReturnUrl() + "$request_uri");
ngxParam.addValue("return 301 " + location.getReturnUrl() + (location.getReturnPath() == 1 ? "$request_uri" : ""));
ngxBlockLocation.addEntry(ngxParam);
}

Expand Down Expand Up @@ -937,7 +937,7 @@ public void replace(String nginxPath, String nginxContent, List<String> subConte
FileUtil.writeString(subContent.get(i), tagert, StandardCharsets.UTF_8); // 清空
}
}

// 写入周边配置文件
ClassPathResource resource = new ClassPathResource("conf.zip");
InputStream inputStream = resource.getStream();
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/WEB-INF/view/adminPage/export/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<legend>${menuStr.export}</legend>
</fieldset>

<form action="${ctx}/adminPage/export/dataImport" enctype="multipart/form-data" id="dataImport" method="post">
<form action="${ctx}/adminPage/export/dataImport" enctype="multipart/form-data" target="uploadTarget" id="dataImport" method="post">
<div class="layui-form">
<div class="layui-inline">
<button type="button" id="dataExport" class="layui-btn layui-btn-sm" onclick="dExport()">${exportStr.dExport}</button>
Expand All @@ -35,7 +35,7 @@
</div>
</div>
</form>

<iframe id="uploadTarget" name="uploadTarget" src="#" style="width: 0; height: 0; border: 0px solid #fff;"></iframe>

</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ serverStr.portUserdList = \u4EE5\u4E0B\u7AEF\u53E3\u88AB\u5360\u7528
serverStr.protocols = ssl\u534F\u8BAE\u7248\u672C
serverStr.proxyTarget = \u4EE3\u7406\u76EE\u6807
serverStr.proxyType = \u4EE3\u7406\u7C7B\u578B
serverStr.returnPath = \u643A\u5E26\u539F\u8DEF\u5F84
serverStr.rewriteListen = \u4ECE\u8BE5\u7AEF\u53E3\u8DF3\u8F6C
serverStr.rootModel = root\u6A21\u5F0F
serverStr.selectCert = \u9009\u62E9\u5185\u7F6E\u8BC1\u4E66
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ serverStr.portUserdList = The following ports are occupied.
serverStr.protocols = SSL protocols
serverStr.proxyTarget = Proxy target
serverStr.proxyType = Proxy type
serverStr.returnPath = With original path
serverStr.rewriteListen = Jump from this port
serverStr.rootModel = root model
serverStr.selectCert = Built-in Certificate
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages_zh_TW.properties
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ serverStr.portUserdList = \u4EE5\u4E0B\u7AEF\u53E3\u88AB\u5360\u7528
serverStr.protocols = ssl\u5354\u8B70\u7248\u672C
serverStr.proxyTarget = \u4EE3\u7406\u76EE\u6A19
serverStr.proxyType = \u4EE3\u7406\u985E\u578B
serverStr.returnPath = \u651C\u5E36\u539F\u8DEF\u5F91
serverStr.rewriteListen = \u5F9E\u8A72\u7AEF\u53E3\u8DF3\u8F49
serverStr.rootModel = root\u6A21\u5F0F
serverStr.selectCert = \u9078\u64C7\u5167\u7F6E\u8B49\u66F8
Expand Down
Loading

0 comments on commit 978de3f

Please sign in to comment.