[PR #154] [MERGED] 针对nginx+keeplived的vip映射管理方案 #3986

Closed
opened 2026-02-28 11:58:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/0xJacky/nginx-ui/pull/154
Author: @quanbisen
Created: 8/18/2023
Status: Merged
Merged: 8/21/2023
Merged by: @0xJacky

Base: devHead: dev


📝 Commits (4)

📊 Changes

23 files changed (+586 additions, -159 deletions)

View changed files

📝 frontend/src/api/domain.ts (+3 -2)
📝 frontend/src/components/EnvIndicator/EnvIndicator.vue (+3 -1)
📝 frontend/src/components/StdDataEntry/StdDataEntry.tsx (+9 -1)
📝 frontend/src/components/StdDataEntry/index.tsx (+12 -2)
📝 frontend/src/language/en/app.po (+32 -14)
📝 frontend/src/language/es/app.po (+36 -14)
📝 frontend/src/language/fr_FR/app.po (+37 -15)
📝 frontend/src/language/messages.pot (+30 -14)
📝 frontend/src/language/ru_RU/app.po (+35 -15)
📝 frontend/src/language/translations.json (+1 -1)
📝 frontend/src/language/zh_CN/app.po (+39 -14)
📝 frontend/src/language/zh_TW/app.po (+41 -21)
📝 frontend/src/views/domain/components/SiteDuplicate.vue (+8 -1)
📝 frontend/src/views/environment/Environment.vue (+33 -2)
📝 server/api/config.go (+10 -4)
📝 server/api/domain.go (+25 -5)
📝 server/api/environment.go (+32 -9)
📝 server/api/ngx.go (+16 -4)
📝 server/internal/nginx/nginx.go (+13 -8)
📝 server/model/environment.go (+5 -3)

...and 3 more files

📄 Description

目前我们公司内部使用遇到了vip的使用场景,要求多环境的nginx配置操作需要同步,我目前的方案是在环境的管理页面添加该环境是否需要同步的开关,并配置需要同步的操作API正则表达式。当开关开启且操作的接口完全匹配上,就会把该操作也作用到该环境上,代码用了一个middleware实现了,修改了部分逻辑。作者评估一下该方案如何,如果有bug等问题也可以联系我帮忙修复,希望该merge能被合并到下一版本中去。

详细变更内容如下:

  1. 环境管理配置添加是否操作同步功能,自定义配置接口API正则,针对非GET请求的,如一些配置管理、证书管理和重载等操作应用到该环境上,主要业务场景是nginx配置了KeepAlive,做主备的,需要保持配置同步;
  2. Nginx操作restart,reload,check添加错误处理,如果命令不存在,原忽略错误提示会返回200;
  3. 修复Nginx运行状态显示错误,增加对nginx.pid文件的大小判断,目前发现systemctl stop nginx某些情况下会存在nginx.pid文件存在,大小为0的情况;
  4. 站点复制默认填充原配置名称,添加了逻辑,若配置本身是enabled,复制过去应该也是enabled,相当于配置下发,如在主节点上操作测试通过了,然后复制到其它环境,reload一次就可以了;
  5. 组件StdDataEntry添加了一个show属性回调入口,动态控制模态框的FormItem是否显示;

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/0xJacky/nginx-ui/pull/154 **Author:** [@quanbisen](https://github.com/quanbisen) **Created:** 8/18/2023 **Status:** ✅ Merged **Merged:** 8/21/2023 **Merged by:** [@0xJacky](https://github.com/0xJacky) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (4) - [`4f28b14`](https://github.com/0xJacky/nginx-ui/commit/4f28b14f24b364b51adcef148e38ff255551d4f9) fixed environment indicator display overlay & edit not obtain newest data - [`07bba2e`](https://github.com/0xJacky/nginx-ui/commit/07bba2e21fb8a387386fda8c6412238461abde9e) Merge branch 'dev' of https://github.com/0xJacky/nginx-ui into dev - [`f954a21`](https://github.com/0xJacky/nginx-ui/commit/f954a2112e61cfaf77971557344d285ca75fe286) finished environment operation sync - [`02acea9`](https://github.com/0xJacky/nginx-ui/commit/02acea9e96efd816388cef14105f494c02c4c1ed) fix: environment indicator display overflow not ellipsis ### 📊 Changes **23 files changed** (+586 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/api/domain.ts` (+3 -2) 📝 `frontend/src/components/EnvIndicator/EnvIndicator.vue` (+3 -1) 📝 `frontend/src/components/StdDataEntry/StdDataEntry.tsx` (+9 -1) 📝 `frontend/src/components/StdDataEntry/index.tsx` (+12 -2) 📝 `frontend/src/language/en/app.po` (+32 -14) 📝 `frontend/src/language/es/app.po` (+36 -14) 📝 `frontend/src/language/fr_FR/app.po` (+37 -15) 📝 `frontend/src/language/messages.pot` (+30 -14) 📝 `frontend/src/language/ru_RU/app.po` (+35 -15) 📝 `frontend/src/language/translations.json` (+1 -1) 📝 `frontend/src/language/zh_CN/app.po` (+39 -14) 📝 `frontend/src/language/zh_TW/app.po` (+41 -21) 📝 `frontend/src/views/domain/components/SiteDuplicate.vue` (+8 -1) 📝 `frontend/src/views/environment/Environment.vue` (+33 -2) 📝 `server/api/config.go` (+10 -4) 📝 `server/api/domain.go` (+25 -5) 📝 `server/api/environment.go` (+32 -9) 📝 `server/api/ngx.go` (+16 -4) 📝 `server/internal/nginx/nginx.go` (+13 -8) 📝 `server/model/environment.go` (+5 -3) _...and 3 more files_ </details> ### 📄 Description 目前我们公司内部使用遇到了vip的使用场景,要求多环境的nginx配置操作需要同步,我目前的方案是在环境的管理页面添加该环境是否需要同步的开关,并配置需要同步的操作API正则表达式。当开关开启且操作的接口完全匹配上,就会把该操作也作用到该环境上,代码用了一个middleware实现了,修改了部分逻辑。作者评估一下该方案如何,如果有bug等问题也可以联系我帮忙修复,希望该merge能被合并到下一版本中去。 详细变更内容如下: 1. 环境管理配置添加是否操作同步功能,自定义配置接口API正则,针对非GET请求的,如一些配置管理、证书管理和重载等操作应用到该环境上,主要业务场景是nginx配置了KeepAlive,做主备的,需要保持配置同步; 2. Nginx操作restart,reload,check添加错误处理,如果命令不存在,原忽略错误提示会返回200; 3. 修复Nginx运行状态显示错误,增加对nginx.pid文件的大小判断,目前发现systemctl stop nginx某些情况下会存在nginx.pid文件存在,大小为0的情况; 4. 站点复制默认填充原配置名称,添加了逻辑,若配置本身是enabled,复制过去应该也是enabled,相当于配置下发,如在主节点上操作测试通过了,然后复制到其它环境,reload一次就可以了; 5. 组件StdDataEntry添加了一个show属性回调入口,动态控制模态框的FormItem是否显示; --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 11:58:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#3986
No description provided.