Skip to content

Commit cb59390

Browse files
authored
Merge pull request #137 from dromara/dev
Dev
2 parents 670e40f + 69bc5b8 commit cb59390

File tree

305 files changed

+16779
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+16779
-877
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ SPRING_PROFILES_ACTIVE=prod
66
DEMO_MODE=false
77

88
API_CORS=true
9-
SECRET_KEY=uQeacXV8b3isvKLK
109
API_EXPOSE_TOKEN=pmqeHOyZaumHm0Wt
10+
SECRET_KEY=uQeacXV8b3isvKLK
11+
12+
NGINX_SERVICE_HOST=service
13+
NGINX_SERVICE_PORT=9200
1114

1215
MYSQL_HOST=mysql
1316
MYSQL_PORT=3306

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ target/
1616
.sts4-cache
1717

1818
### IntelliJ IDEA ###
19-
.idea
19+
**/.idea/*
20+
!**/.idea/icon.png
2021
*.iws
2122
*.iml
2223
*.ipr

.idea/icon.png

2.75 KB
Loading

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ docker compose up -d
113113
#### 主机监控
114114

115115
![主机监控](docs/assets/screenshot/monitor-list.png?time=20250627 "主机监控")
116-
![监控详情](docs/assets/screenshot/monitor-detail.png?time=20250627 "监控详情")
116+
![监控概览](docs/assets/screenshot/monitor-override.png?time=20250627 "监控概览")
117+
![监控详情](docs/assets/screenshot/monitor-chart.png?time=20250627 "监控表格")
118+
![告警通知](docs/assets/screenshot/monitor-alarm.png?time=20250627 "告警通知")
117119

118120
#### 批量执行
119121

docker-compose.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '3.3'
22

3-
# latest = 2.5.0
3+
# latest = 2.5.1
44

55
# 支持以下源
66
# lijiahangmax/*
@@ -12,6 +12,9 @@ services:
1212
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
1313
ports:
1414
- ${SERVICE_PORT:-1081}:80
15+
environment:
16+
NGINX_SERVICE_HOST: ${NGINX_SERVICE_HOST:-service}
17+
NGINX_SERVICE_PORT: ${NGINX_SERVICE_PORT:-9200}
1518
restart: unless-stopped
1619
depends_on:
1720
service:

docker/docker-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
source ./project-build.sh "$@"
88

99
# 版本号
10-
version=2.5.0
10+
version=2.5.1
1111
# 是否推送镜像
1212
push_image=false
1313
# 是否构建 latest

docker/project-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
# DockerContext: orion-visor
55

66
# 版本号
7-
version=2.5.0
7+
version=2.5.1
88
# 是否构建 service
99
export build_service=false
1010
# 是否构建 ui

docker/ui/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ RUN \
1111
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
1212
echo "${TZ}" > /etc/timezone && \
1313
rm -rf /var/cache/apk/* && \
14+
rm -rf /etc/nginx/nginx.conf && \
1415
rm -rf /etc/nginx/conf.d/*
1516

16-
# 复制包
17+
# 复制前端静态文件
1718
COPY ./ui/dist /usr/share/nginx/html
1819

1920
# 复制配置
20-
COPY ./ui/nginx.conf /etc/nginx/conf.d
21+
COPY ./ui/nginx.conf /etc/nginx
22+
COPY ./ui/service.conf /etc/nginx/conf.d
23+
24+
# 复制启动脚本
25+
COPY ./ui/entrypoint.sh /entrypoint.sh
26+
RUN chmod +x /entrypoint.sh
2127

2228
# 启动
29+
ENTRYPOINT ["/entrypoint.sh"]
2330
CMD ["nginx", "-g", "daemon off;"]

docker/ui/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# 设置环境变量
4+
NGINX_SERVICE_HOST="${NGINX_SERVICE_HOST:-service}"
5+
NGINX_SERVICE_PORT="${NGINX_SERVICE_PORT:-9200}"
6+
7+
# 替换环境变量
8+
sed -i "s|\${NGINX_SERVICE_HOST}|${NGINX_SERVICE_HOST}|g" /etc/nginx/conf.d/service.conf
9+
sed -i "s|\${NGINX_SERVICE_PORT}|${NGINX_SERVICE_PORT}|g" /etc/nginx/conf.d/service.conf
10+
11+
exec "$@"

docker/ui/nginx.conf

Lines changed: 27 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,30 @@
1-
server {
2-
listen 80;
3-
server_name localhost;
4-
client_max_body_size 1024m;
5-
6-
# 是否启动 gzip 压缩
7-
gzip on;
8-
# 需要压缩的常见静态资源
9-
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
10-
# 如果文件大于 1k 就启动压缩
11-
gzip_min_length 1k;
12-
# 缓冲区
13-
gzip_buffers 4 16k;
14-
# 压缩的等级
15-
gzip_comp_level 2;
16-
# access_log /var/log/nginx/host.access.log main;
17-
18-
location / {
19-
root /usr/share/nginx/html;
20-
index index.html index.htm;
21-
proxy_set_header Host $host;
22-
proxy_set_header X-Real-IP $remote_addr;
23-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
24-
proxy_set_header X-Forwarded-Proto $scheme;
25-
# web history 模式 404
26-
try_files $uri $uri/ /index.html;
27-
}
28-
29-
location /orion-visor/api {
30-
proxy_pass http://service:9200/orion-visor/api;
31-
proxy_set_header Host $host;
32-
proxy_set_header X-Real-IP $remote_addr;
33-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34-
proxy_set_header X-Forwarded-Proto $scheme;
35-
}
36-
37-
location /orion-visor/keep-alive {
38-
proxy_pass http://service:9200/orion-visor/keep-alive;
39-
proxy_http_version 1.1;
40-
proxy_set_header Upgrade $http_upgrade;
41-
proxy_set_header Connection "upgrade";
42-
proxy_set_header Host $host;
43-
proxy_set_header X-Real-IP $remote_addr;
44-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
45-
proxy_set_header X-Forwarded-Proto $scheme;
46-
proxy_read_timeout 3600s;
47-
proxy_send_timeout 3600s;
48-
}
49-
50-
error_page 500 502 503 504 /50x.html;
51-
location = /50x.html {
52-
root /usr/share/nginx/html;
53-
}
1+
user nginx;
2+
worker_processes auto;
543

4+
error_log /var/log/nginx/error.log notice;
5+
pid /run/nginx.pid;
6+
7+
events {
8+
worker_connections 1024;
559
}
5610

11+
http {
12+
include /etc/nginx/mime.types;
13+
default_type application/octet-stream;
14+
server_tokens off;
15+
16+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
17+
'$status $body_bytes_sent "$http_referer" '
18+
'"$http_user_agent" "$http_x_forwarded_for"';
19+
20+
access_log /var/log/nginx/access.log main;
21+
22+
sendfile on;
23+
#tcp_nopush on;
24+
25+
keepalive_timeout 65;
26+
27+
#gzip on;
28+
29+
include /etc/nginx/conf.d/*.conf;
30+
}

0 commit comments

Comments
 (0)