From 4adb89705deaaa3d3ce875701072e85f0ee26409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E5=AE=89=E7=A7=91=E6=8A=80?= Date: Thu, 19 Sep 2024 18:18:10 +0800 Subject: [PATCH] Update README.md --- docs/api/README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/api/README.md b/docs/api/README.md index 5c10bea..66206e6 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -1,16 +1,25 @@ ## :strawberry: 全局配置 ### init_by_lua_block + +##### conf + - 类型: ``table`` -- 默认值: ``{ host = "127.0.0.1", port = 3306, user = "root", password = "safe3.waf" }`` +- 默认值: ``初始化南墙配置`` - 用法: ```lua - local conf = { host = "127.0.0.1", port = 3306, user = "root", password = "safe3.waf" } + waf = require("waf") + local conf = { + id = "1", -- 当使用集群时,用于区分不同的南墙主机 + db = { host = "127.0.0.1", port = 3306, user = "root", password = "Safe3.WAF" }, -- 数据库连接配置 + ml = { server = "http://127.0.0.1:4445", access_token = "secret" } -- 机器学习服务连接配置 + } + waf.http_init(conf) ``` - - local conf变量位于/uuwaf/conf/uuwaf.conf中,用于配置waf要读取配置的mysql数据库连接的ip、端口号、用户名和密码。 + + local conf变量位于/uuwaf/conf/uuwaf.conf中,用于初始化南墙配置。