Skip to content

Commit 6f8cd37

Browse files
committed
feat: 补充定时器异常退出日志
feat: 补充store存储前一次索引 fix: 修复reload导致自检定时器没有重启 fix: 修复登录页面名称错误 fix: 修复ssl调用代码错误 fix: 优化一些调用代码
1 parent c70316f commit 6f8cd37

29 files changed

+108
-54
lines changed

balance/count/tl_ops_balance_count_core.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ end
5757
-- 统计balance次数周期默认为5min,可调整配置
5858
tl_ops_balance_count_timer = function(premature, args)
5959
if premature then
60+
tlog:err("premature")
6061
return
6162
end
6263

balance/tl_ops_balance_core.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function _M:tl_ops_balance_core_filter(ctx)
129129
balance_count_node.tl_ops_balance_count_incr_node_fail(node.service, node_id)
130130
-- 负载失败 -- 限流统计器
131131
tl_ops_limit:tl_ops_limit_fuse_incr_fail(node.service, node_id);
132-
132+
133133
tl_ops_err_content:err_content_rewrite_to_balance(node.service .. ":" .. node.name, "offline", balance_mode, tl_ops_constant_balance.cache_key.offline, "")
134134
return
135135
end
@@ -164,7 +164,7 @@ function _M:tl_ops_balance_core_balance(ctx)
164164
ngx.header[tl_ops_constant_balance.proxy_state] = "online"
165165
ngx.header[tl_ops_constant_balance.proxy_mode] = tlops_ups_mode
166166
ngx.header[tl_ops_constant_balance.proxy_prefix] = tlops_ups_api_prefix
167-
167+
168168
local ok, err = ngx_balancer.set_current_peer(tlops_ups_node.ip, tlops_ups_node.port)
169169
if ok then
170170
ngx_balancer.set_timeouts(3, 60, 60)

bin/install_centeros.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TL_OPS_PATH="/usr/local/tl-ops-manage/"
66
TL_OPS_CONF_PATH="/usr/local/tl-ops-manage/conf/tl_ops_manage.conf"
77
TL_OPS_LUA_PATH="/usr/local/openresty/lualib/?.lua;;/usr/local/tl-ops-manage/?.lua;;"
88
TL_OPS_LUAC_PATH="/usr/local/openresty/lualib/?.so;;"
9-
TL_OPS_VER="v3.4.5"
9+
TL_OPS_VER="v3.4.6"
1010

1111
echo_msg(){
1212
cur_time=$(date "+%Y-%m-%d %H:%M:%S")

bin/install_ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TL_OPS_PATH="/usr/local/tl-ops-manage/"
66
TL_OPS_CONF_PATH="/usr/local/tl-ops-manage/conf/tl_ops_manage.conf"
77
TL_OPS_LUA_PATH="/usr/local/openresty/lualib/?.lua;;/usr/local/tl-ops-manage/?.lua;;"
88
TL_OPS_LUAC_PATH="/usr/local/openresty/lualib/?.so;;"
9-
TL_OPS_VER="v3.4.5"
9+
TL_OPS_VER="v3.4.6"
1010

1111
echo_msg(){
1212
cur_time=$(date "+%Y-%m-%d %H:%M:%S")

cache/tl_ops_cache_cus.lua

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,35 @@ end
3737

3838

3939
function _M:new()
40+
local default_cus = {
41+
get = function(key)
42+
return nil
43+
end,
44+
set = function(key, value)
45+
return nil
46+
end,
47+
del = function(key)
48+
return nil
49+
end
50+
}
4051
if not use_cus or use_cus == 'none' then
41-
return nil
52+
return default_cus
4253
end
4354

4455
local status, cus = pcall(require, "cache.tl_ops_cache_" .. use_cus)
4556
if status then
4657
if cus and type(cus) == 'table' then
4758
if type(cus.new) ~= 'function' then
48-
return nil
59+
return default_cus
4960
end
5061
if type(cus.get) ~= 'function' then
51-
return nil
62+
return default_cus
5263
end
5364
if type(cus.set) ~= 'function' then
54-
return nil
65+
return default_cus
5566
end
5667
if type(cus.del) ~= 'function' then
57-
return nil
68+
return default_cus
5869
end
5970
end
6071
end

cache/tl_ops_cache_store.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function _M:del(key)
6161
end
6262

6363
-- set seek to 4GB 等价删除索引
64-
self.cache_store:store_index(key, 4 * 1024 * 1024 * 1024)
64+
self.cache_store:store_index(key, 4 * 1024 * 1024 * 1024)
6565

6666
tlog:dbg("del cache store ok key=" .. key)
6767

constant/tl_ops_constant_service.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local tl_ops_constant_service = {
88
service_rule = "tl_ops_service_rule",
99
},
1010
list = {
11-
11+
1212
},
1313
demo = {
1414
id = 1,

doc/change.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11

22
## 事务更新日程
33

4+
2023-07-27
5+
6+
1. 补充定时器异常退出日志
7+
8+
2. 修复登录页面名称错误
9+
10+
3. 修复reload导致自检定时器没有重启
11+
12+
4. 修复ssl调用代码错误
13+
14+
5. 优化一些调用代码
15+
16+
6. 事务日程调整
17+
18+
419
2023-04-22
520

621
1. api规则细节限制优化
@@ -38,7 +53,7 @@
3853

3954
2. 支持waf详情多维度统计和展示
4055

41-
3. 支持管理后台退出登陆
56+
3. 支持管理后台退出登录
4257

4358
4. 优化代码注释
4459

gitbook/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
* [使用配置](usage/ssl/README.md)
8686

87-
* [登陆认证插件](code/auth/README.md)
87+
* [登录认证插件](code/auth/README.md)
8888

8989
* [使用配置](usage/auth/README.md)
9090

gitbook/code/auth/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# 登陆认证插件
1+
# 登录认证插件
22

3-
登陆认证插件主要为管理后台系统提供一个操作可控的权限认证,实现的方式是在 `tl_ops_process_before_init_rewrite` 阶段进行cookie或者header验证,对于需要拦截验证的链接进行验证,当然,拦截链接是可视化配置的,可以根据需要自定义
3+
登录认证插件主要为管理后台系统提供一个操作可控的权限认证,实现的方式是在 `tl_ops_process_before_init_rewrite` 阶段进行cookie或者header验证,对于需要拦截验证的链接进行验证,当然,拦截链接是可视化配置的,可以根据需要自定义
44

5-
登陆插件数据主要分为两个子模块,一个是自定义配置模块,一个是账号密码模块
5+
登录插件数据主要分为两个子模块,一个是自定义配置模块,一个是账号密码模块
66

77

88
### 拦截配置
99

10-
我们先看一下拦截配置的数据定义,主要包含几个方面,拦截的api,拦截api白名单,拦截后返回的内容,登陆验证身份相关
10+
我们先看一下拦截配置的数据定义,主要包含几个方面,拦截的api,拦截api白名单,拦截后返回的内容,登录验证身份相关
1111

1212
```lua
1313
# 代码位置 : plugins/tl_ops_auth/tl_ops_plugin_constant.lua
@@ -24,9 +24,9 @@ login = {
2424
"/tlops/auth/login",
2525
"/tlopsmanage/lib/",
2626
},
27-
auth_time = 3600, -- 登陆后session有效时间
28-
auth_cid = "_tl_t", -- 登陆后cookie值key
29-
auth_hid = "Tl-Auth-Rid", -- 登陆后header值key
27+
auth_time = 3600, -- 登录后session有效时间
28+
auth_cid = "_tl_t", -- 登录后cookie值key
29+
auth_hid = "Tl-Auth-Rid", -- 登录后header值key
3030
},
3131
```
3232

@@ -67,7 +67,7 @@ end
6767
```
6868

6969
进入 `auth_core` 方法,看实现逻辑为拿到设置配置后,判断当前uri是否需要拦截,如果需要拦截, 判断cookie或者header中的sessionkey是否有效,
70-
如果无效,则是没有登陆,返回自定义的配置内容。
70+
如果无效,则是没有登录,返回自定义的配置内容。
7171

7272
```lua
7373
# 代码位置 : plugins/tl_ops_auth/auth.lua

0 commit comments

Comments
 (0)