@dazhicheng/common 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -12,7 +12,6 @@ variables:
12
12
  image: node:24-alpine
13
13
  tags:
14
14
  - build
15
- resource_group: build
16
15
  script:
17
16
  - npm install -g pnpm@latest
18
17
  - pnpm config set registry https://registry.npmmirror.com
@@ -42,7 +41,6 @@ MR 构建验证:
42
41
  image: docker:20.10.20
43
42
  tags:
44
43
  - MR_TEST
45
- needs: [构建_dev]
46
44
  script:
47
45
  - docker build --build-arg NODE_ENV=dev -t mr-test:mr-$CI_MERGE_REQUEST_IID .
48
46
  - docker images | grep mr-test
@@ -52,14 +50,14 @@ MR 构建验证:
52
50
  # 项目级 deploy jobs 注入点 ------------------------------------------------
53
51
  构建_dev:
54
52
  <<: *build_template
53
+ resource_group: build-dev
55
54
  variables:
56
55
  NODE_ENV: dev
57
- rules:
58
- - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
59
- - if: $CI_COMMIT_BRANCH == "develop"
56
+ only: [develop]
60
57
 
61
58
  构建_test:
62
59
  <<: *build_template
60
+ resource_group: build-test
63
61
  variables:
64
62
  NODE_ENV: test
65
63
  only: [test]
package/nginx_dev.conf CHANGED
@@ -1,14 +1,14 @@
1
1
  # 自定义日志格式:包含实际转发的后端地址
2
2
  log_format proxy_log
3
- '[$time_local] $status $request ============================== '
4
- 'client=$remote_addr upstream=$upstream_addr ============================== '
5
- 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s ============================== '
3
+ '[$time_local] $status $request | '
4
+ 'client=$remote_addr upstream=$upstream_addr | '
5
+ 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s | '
6
6
  'referer="$http_referer" agent="$http_user_agent"';
7
7
 
8
- # 根据请求Host分配后端地址(公网Host走公网,默认走内网)
9
- map $http_host $dev_backend_addr {
8
+ # 根据请求IP分配后端地址(公网IP走公网,默认走内网)
9
+ map $host $dev_backend_addr {
10
10
  default 192.168.128.215:11000; # 默认走内网
11
- 120.76.61.203:13000 14.220.235.21:11000; # 公网Host走公网
11
+ 120.76.61.203 14.220.235.0:11000; # 公网IP走公网
12
12
  }
13
13
 
14
14
  # HTTP 服务器 - 保持原有配置
@@ -34,7 +34,7 @@ server {
34
34
  proxy_set_header X-Forwarded-For $remote_addr;
35
35
 
36
36
  rewrite ^/dev-api/(.*) /$1 break;
37
- proxy_pass http://$dev_backend_addr/;
37
+ proxy_pass http://$dev_backend_addr;
38
38
  }
39
39
 
40
40
  error_page 500 502 503 504 /50x.html;
package/nginx_test.conf CHANGED
@@ -1,14 +1,14 @@
1
1
  # 自定义日志格式:包含实际转发的后端地址
2
2
  log_format proxy_log
3
- '[$time_local] $status $request ============================== '
4
- 'client=$remote_addr upstream=$upstream_addr ============================== '
5
- 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s ============================== '
3
+ '[$time_local] $status $request | '
4
+ 'client=$remote_addr upstream=$upstream_addr | '
5
+ 'upstream_status=$upstream_status upstream_time=${upstream_response_time}s | '
6
6
  'referer="$http_referer" agent="$http_user_agent"';
7
7
 
8
- # 根据请求Host分配后端地址(公网Host走公网,默认走内网)
9
- map $http_host $test_backend_addr {
8
+ # 根据请求IP分配后端地址(公网IP走公网,默认走内网)
9
+ map $host $test_backend_addr {
10
10
  default 192.168.127.72:11000; # 默认走内网
11
- 120.76.61.203:13000 116.6.49.180:11001; # 公网Host走公网
11
+ 120.76.61.203 116.6.49.180:11001; # 公网IP走公网
12
12
  }
13
13
 
14
14
  # HTTP 服务器 - 保持原有配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/common",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "共享配置文件",
5
5
  "type": "module",
6
6
  "types": "./src/types/index.d.ts",