Skip to content

Commit 0b7ed8b

Browse files
ci: fix chinese lint action (#9379)
1 parent 9135556 commit 0b7ed8b

35 files changed

+51
-46
lines changed

.github/actions/autocorrect

Submodule autocorrect added at 2aefcaa

.github/workflows/doc-lint.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
timeout-minutes: 1
4949
steps:
5050
- uses: actions/checkout@v3
51+
with:
52+
submodules: recursive
5153
- name: Check Chinese copywriting
52-
uses: huacnlee/[email protected]
54+
uses: ./.github/actions/autocorrect
5355
with:
54-
args: --lint --no-diff-bg-color docs/zh/latest/**.md
56+
args: autocorrect --lint --no-diff-bg-color ./docs/zh/latest/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule ".github/actions/action-semantic-pull-request"]
55
path = .github/actions/action-semantic-pull-request
66
url = https://github.com/amannn/action-semantic-pull-request.git
7+
[submodule ".github/actions/autocorrect"]
8+
path = .github/actions/autocorrect
9+
url = https://github.com/huacnlee/autocorrect.git

docs/en/latest/getting-started/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ You will see the following message once APISIX is ready:
4343
✔ APISIX is ready!
4444
```
4545

46-
4746
## Validate
4847

4948
Once APISIX is running, you can use curl to interact with it. Send a simple HTTP request to validate if APISIX is working properly:
@@ -68,4 +67,3 @@ The following tutorial is based on the working APISIX, please keep everything ru
6867
* [Load Balancing](load-balancing.md)
6968
* [Rate Limiting](rate-limiting.md)
7069
* [Key Authentication](key-authentication.md)
71-

docs/en/latest/getting-started/key-authentication.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ In APISIX, a Consumer requires a unique _username_ and an authentication _plugin
4040
## What is Key Authentication
4141

4242
Key authentication is a relatively simple but widely used authentication approach. The idea is as follows:
43+
4344
1. Administrator adds an authentication key (API key) to the Route.
4445
2. API consumers add the key to the query string or headers for authentication when sending requests.
4546

docs/en/latest/getting-started/load-balancing.md

+2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ curl -i "http://127.0.0.1:9180/apisix/admin/routes" -X PUT -d '
4444
You will receive an `HTTP/1.1 201 OK` response if the route was created successfully.
4545

4646
:::info
47+
4748
1. The `pass_host` field is set to `node` to pass the host header to the upstream.
4849
2. The `scheme` field is set to `https` to enable TLS when sending requests to the upstream.
50+
4951
:::
5052

5153
## Validate

docs/en/latest/plugins/forward-auth.md

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ This Plugin moves the authentication and authorization logic to a dedicated exte
5050
| keepalive_pool | integer | False | 5 | [1, ...]ms | Connection pool limit. |
5151
| allow_degradation | boolean | False | false | | When set to `true`, allows authentication to be skipped when authentication server is unavailable. |
5252

53-
5453
## Data definition
5554

5655
APISIX will generate and send the request headers listed below to the authorization service:

docs/zh/latest/discovery/dns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ Upstream 配置是这样的:
143143
我们把权重为 0 的记录当作权重为 1,因此节点“被选中的可能性很小”,这也是处理此类记录的常用方法。
144144

145145
对于端口为 0 的 SRV 记录,我们会使用上游协议的默认端口。
146-
你也可以在 “service_name” 字段中直接指定端口,比如 “srv.blah.service:8848”。
146+
你也可以在“service_name”字段中直接指定端口,比如“srv.blah.service:8848”。

docs/zh/latest/discovery/kubernetes.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ discovery:
128128
nodes(service_name)
129129

130130
**说明:**
131-
service_name 必须满足格式: [namespace]/[name]:[portName]
131+
service_name 必须满足格式[namespace]/[name]:[portName]
132132

133133
+ namespace: Endpoints 所在的命名空间
134134

@@ -237,7 +237,7 @@ discovery:
237237
nodes(service_name)
238238

239239
**说明:**
240-
service_name 必须满足格式: [id]/[namespace]/[name]:[portName]
240+
service_name 必须满足格式[id]/[namespace]/[name]:[portName]
241241

242242
+ id: Kubernetes 服务发现配置中定义的集群 id 值
243243

@@ -336,7 +336,7 @@ subjects:
336336

337337
**Q: 怎样获取指定 [_ServiceAccount_](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) 的 Token 值?**
338338

339-
A: 假定你指定的 [_ServiceAccount_](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) 资源名为 “kubernetes-discovery“, 命名空间为 “apisix”, 请按如下步骤获取其 Token 值。
339+
A: 假定你指定的 [_ServiceAccount_](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) 资源名为“kubernetes-discovery“, 命名空间为“apisix”, 请按如下步骤获取其 Token 值。
340340

341341
1. 获取 _Secret_ 资源名。执行以下命令,输出的第一列内容就是目标 _Secret_ 资源名:
342342

docs/zh/latest/discovery/nacos.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ discovery:
5959
#### 七层
6060
6161
例如,转发 URI 匹配 "/nacos/*" 的请求到一个上游服务,
62-
该服务在 Nacos 中的服务名是 APISIX-NACOS ,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS ,创建路由时指定服务发现类型为 nacos
62+
该服务在 Nacos 中的服务名是 APISIX-NACOS,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS,创建路由时指定服务发现类型为 nacos。
6363
6464
```shell
6565
$ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
@@ -126,7 +126,7 @@ $ curl http://127.0.0.1:9180/apisix/admin/stream_routes/1 -H 'X-API-KEY: edd1c9f
126126
#### 指定命名空间
127127

128128
例如,转发 URI 匹配 "/nacosWithNamespaceId/*" 的请求到一个上游服务,
129-
该服务在 Nacos 中的服务名是 APISIX-NACOS,命名空间是 test_ns,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS&namespaceId=test_ns ,创建路由时指定服务发现类型为 nacos
129+
该服务在 Nacos 中的服务名是 APISIX-NACOS,命名空间是 test_ns,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS&namespaceId=test_ns,创建路由时指定服务发现类型为 nacos。
130130

131131
```shell
132132
$ curl http://127.0.0.1:9180/apisix/admin/routes/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
@@ -175,7 +175,7 @@ $ curl http://127.0.0.1:9180/apisix/admin/routes/2 -H 'X-API-KEY: edd1c9f034335f
175175
#### 指定组
176176

177177
例如,转发 URI 匹配 "/nacosWithGroupName/*" 的请求到一个上游服务,
178-
该服务在 Nacos 中的服务名是 APISIX-NACOS,组名是 test_group,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS&groupName=test_group ,创建路由时指定服务发现类型为 nacos
178+
该服务在 Nacos 中的服务名是 APISIX-NACOS,组名是 test_group,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS&groupName=test_group,创建路由时指定服务发现类型为 nacos。
179179

180180
```shell
181181
$ curl http://127.0.0.1:9180/apisix/admin/routes/3 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
@@ -224,7 +224,7 @@ $ curl http://127.0.0.1:9180/apisix/admin/routes/3 -H 'X-API-KEY: edd1c9f034335f
224224
#### 同时指定命名空间和组
225225

226226
例如,转发 URI 匹配 "/nacosWithNamespaceIdAndGroupName/*" 的请求到一个上游服务,
227-
该服务在 Nacos 中的服务名是 APISIX-NACOS,命名空间是 test_ns,组名是 test_group,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS&namespaceId=test_ns&groupName=test_group ,创建路由时指定服务发现类型为 nacos
227+
该服务在 Nacos 中的服务名是 APISIX-NACOS,命名空间是 test_ns,组名是 test_group,查询地址是 http://192.168.33.1:8848/nacos/v1/ns/instance/list?serviceName=APISIX-NACOS&namespaceId=test_ns&groupName=test_group,创建路由时指定服务发现类型为 nacos。
228228

229229
```shell
230230
$ curl http://127.0.0.1:9180/apisix/admin/routes/4 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '

docs/zh/latest/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ curl -sL https://run.api7.ai/apisix/quickstart | sh
143143
curl "http://127.0.0.1:9080" --head | grep Server
144144
```
145145

146-
I如果一切顺利,将输出如下信息。
146+
如果一切顺利,将输出如下信息。
147147

148148
```text
149149
Server: APISIX/3.1.0
150150
```
151151

152-
现在,你已经成功安装并运行了 APISIX
152+
现在,你已经成功安装并运行了 APISIX!
153153

154154
## 创建路由
155155

docs/zh/latest/installation-guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ helm install apisix apisix/apisix --create-namespace --namespace apisix
101101

102102
<TabItem value="rpm">
103103

104-
该安装方法适用于 CentOS 7 和 CentOS 8。如果你选择该方法安装 APISIX,需要先安装 etcd。具体安装方法请参考[安装 etcd](#安装-etcd)
104+
该安装方法适用于 CentOS 7 和 CentOS 8。如果你选择该方法安装 APISIX,需要先安装 etcd。具体安装方法请参考 [安装 etcd](#安装-etcd)
105105

106106
### 通过 RPM 仓库安装
107107

@@ -197,7 +197,7 @@ apisix start
197197

198198
<TabItem value="source code">
199199

200-
如果你想要使用源码构建 APISIX,请参考[源码安装 APISIX](./building-apisix.md)
200+
如果你想要使用源码构建 APISIX,请参考 [源码安装 APISIX](./building-apisix.md)
201201

202202
</TabItem>
203203
</Tabs>

docs/zh/latest/plugins/authz-casdoor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ description: 本篇文档介绍了 Apache APISIX auth-casdoor 插件的相关信
4545

4646
:::info IMPORTANT
4747

48-
指定 `endpoint_addr``callback_url` 属性时不要以 “/” 来结尾。
48+
指定 `endpoint_addr``callback_url` 属性时不要以“/”来结尾。
4949

5050
`callback_url` 必须是路由的 URI。具体细节可查看下方示例内容,了解相关配置。
5151

docs/zh/latest/plugins/authz-keycloak.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ description: 本文介绍了关于 Apache APISIX `authz-keycloak` 插件的基
5555
| lazy_load_paths | boolean || false | [true, false] | 当设置为 true 时,使用资源注册端点而不是静态权限将请求 URI 动态解析为资源。 |
5656
| http_method_as_scope | boolean || false | [true, false] | 设置为 true 时,将 HTTP 请求类型映射到同名范围并添加到所有请求的权限。 |
5757
| timeout | integer || 3000 | [1000, ...] | 与 Identity Server 的 HTTP 连接超时(毫秒)。 |
58-
| access_token_expires_in | integer || 300 | [1, ...] | 访问令牌的有效期。 token. |
58+
| access_token_expires_in | integer || 300 | [1, ...] | 访问令牌的有效期。token. |
5959
| access_token_expires_leeway | integer || 0 | [0, ...] | access_token 更新的到期余地。设置后,令牌将在到期前几秒更新 access_token_expires_leeway。这避免了 access_token 在到达 OAuth 资源服务器时刚刚过期的情况。 |
6060
| refresh_token_expires_in | integer || 3600 | [1, ...] | 刷新令牌的失效时间。 |
6161
| refresh_token_expires_leeway | integer || 0 | [0, ...] | refresh_token 更新的到期余地。设置后,令牌将在到期前几秒刷新 refresh_token_expires_leeway。这样可以避免在到达 OAuth 资源服务器时 refresh_token 刚刚过期的错误。 |

docs/zh/latest/plugins/aws-lambda.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ description: 本文介绍了关于 Apache APISIX aws-lambda 插件的基本信
4242
| function_uri | string || | | 触发 lambda serverless 函数的 AWS API Gateway 端点。 |
4343
| authorization | object || | | 访问云函数的授权凭证。 |
4444
| authorization.apikey | string || | | 生成的 API 密钥,用于授权对 AWS Gateway 端点的请求。 |
45-
| authorization.iam | object || | | 用于通过 AWS v4 请求签名执行的基于 AWS IAM 角色的授权。 请参考 [IAM 授权方案](#iam-授权方案)|
45+
| authorization.iam | object || | | 用于通过 AWS v4 请求签名执行的基于 AWS IAM 角色的授权。请参考 [IAM 授权方案](#iam-授权方案)|
4646
| timeout | integer || 3000 | [100,...] | 代理请求超时(以毫秒为单位)。 |
4747
| ssl_verify | boolean || true | true/false | 当设置为 `true` 时执行 SSL 验证。 |
4848
| keepalive | boolean || true | true/false | 当设置为 `true` 时,保持连接的活动状态以便重复使用。 |

docs/zh/latest/plugins/batch-requests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ plugins:
6767
6868
## 配置插件
6969
70-
默认情况下,可以发送到 `/apisix/batch-requests` 的最大请求体不能大于 1 MiB。 你可以通过 `apisix/admin/plugin_metadata/batch-requests` 更改插件的此配置:
70+
默认情况下,可以发送到 `/apisix/batch-requests` 的最大请求体不能大于 1 MiB。你可以通过 `apisix/admin/plugin_metadata/batch-requests` 更改插件的此配置:
7171

7272
```shell
7373
curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/batch-requests \

docs/zh/latest/plugins/clickhouse-logger.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ description: 本文介绍了 API 网关 Apache APISIX 如何使用 clickhouse-lo
4040
| database | string || | | 使用的数据库。 |
4141
| logtable | string || | | 写入的表名。 |
4242
| user | string || | | ClickHouse 的用户。 |
43-
| password | string || | | ClickHouse 的密码 |
43+
| password | string || | | ClickHouse 的密码。 |
4444
| timeout | integer || 3 | [1,...] | 发送请求后保持连接活动的时间。 |
4545
| name | string || "clickhouse logger" | | 标识 logger 的唯一标识符。 |
4646
| ssl_verify | boolean || true | [true,false] | 当设置为 `true` 时,验证证书。 |

docs/zh/latest/plugins/cors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ description: 本文介绍了 Apache APISIX cors 插件的基本信息及使用
3737
| allow_origins | string || "*" | 允许跨域访问的 Origin,格式为 `scheme://host:port`,示例如 `https://somedomain.com:8081`。如果你有多个 Origin,请使用 `,` 分隔。当 `allow_credential``false` 时,可以使用 `*` 来表示允许所有 Origin 通过。你也可以在启用了 `allow_credential` 后使用 `**` 强制允许所有 Origin 均通过,但请注意这样存在安全隐患。 |
3838
| allow_methods | string || "*" | 允许跨域访问的 Method,比如:`GET``POST` 等。如果你有多个 Method,请使用 `,` 分割。当 `allow_credential``false` 时,可以使用 `*` 来表示允许所有 Method 通过。你也可以在启用了 `allow_credential` 后使用 `**` 强制允许所有 Method 都通过,但请注意这样存在安全隐患。 |
3939
| allow_headers | string || "*" | 允许跨域访问时请求方携带哪些非 `CORS 规范` 以外的 Header。如果你有多个 Header,请使用 `,` 分割。当 `allow_credential``false` 时,可以使用 `*` 来表示允许所有 Header 通过。你也可以在启用了 `allow_credential` 后使用 `**` 强制允许所有 Header 都通过,但请注意这样存在安全隐患。 |
40-
| expose_headers | string || "*" | 允许跨域访问时响应方携带哪些非 `CORS 规范` 以外的 Header。如果你有多个 Header,请使用 `,` 分割。当 `allow_credential``false` 时,可以使用 `*` 来表示允许任意 Header 。你也可以在启用了 `allow_credential` 后使用 `**` 强制允许任意 Header,但请注意这样存在安全隐患。 |
40+
| expose_headers | string || "*" | 允许跨域访问时响应方携带哪些非 `CORS 规范` 以外的 Header。如果你有多个 Header,请使用 `,` 分割。当 `allow_credential``false` 时,可以使用 `*` 来表示允许任意 Header。你也可以在启用了 `allow_credential` 后使用 `**` 强制允许任意 Header,但请注意这样存在安全隐患。 |
4141
| max_age | integer || 5 | 浏览器缓存 CORS 结果的最大时间,单位为秒。在这个时间范围内,浏览器会复用上一次的检查结果,`-1` 表示不缓存。请注意各个浏览器允许的最大时间不同,详情请参考 [Access-Control-Max-Age - MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age#directives)|
4242
| allow_credential | boolean || false | 是否允许跨域访问的请求方携带凭据(如 Cookie 等)。根据 CORS 规范,如果设置该选项为 `true`,那么将不能在其他属性中使用 `*`|
4343
| allow_origins_by_regex | array || nil | 使用正则表达式数组来匹配允许跨域访问的 Origin,如 `[".*\.test.com"]` 可以匹配任何 `test.com` 的子域名 `*`。如果 `allow_origins_by_regex` 属性已经指定,则会忽略 `allow_origins` 属性。 |

docs/zh/latest/plugins/dubbo-proxy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ $ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335
132132
}'
133133
```
134134

135-
现在 `dubbo-proxy` 插件就已经被禁用了。 此方法同样适用于其他插件。
135+
现在 `dubbo-proxy` 插件就已经被禁用了。此方法同样适用于其他插件。
136136

137137
如果你想彻底禁用 `dubbo-proxy` 插件,
138138
你需要在 `config.yaml` 中注释掉以下内容:

0 commit comments

Comments
 (0)