Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #11

Merged
merged 110 commits into from
Jul 6, 2020
Merged

sync #11

Changes from 1 commit
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
33b437d
feature: implemented plugin `sys logger`. (#1414)
May 6, 2020
ffce4b7
bugfix(CORS): using rewrite phase and add lru cache for multiple orig…
ShiningRush May 6, 2020
0068f28
change: updated the dashboard submodule to latest version. (#1540)
May 6, 2020
e8091f6
doc: alter logger plugins documentations. (#1541)
May 7, 2020
fd626ae
bugfix: Adding function to remove stale objects from kafka logger (#1…
sshniro May 7, 2020
5570e64
bugfix: removed stale objects from tcp logger (#1543)
sshniro May 7, 2020
a328fcc
bugfix: removing stale objects from udp logger (#1544)
sshniro May 7, 2020
fa59f20
optimize: use buffer for plugin `syslog`. (#1551)
May 8, 2020
64fcb9f
plugin: add HTTP logger for APISIX (#1396)
sshniro May 9, 2020
0300304
bugfix: got 500 error when using post method in grpc-transcode plugin…
nic-chen May 11, 2020
3300f4d
bugfix: removed stale object in sys log. (#1557)
May 11, 2020
463c521
feature(prometheus): support to collect metric `overhead` (#1576)
membphis May 12, 2020
cafbfe1
feature: support new field `exptime` for SSL object. (#1575)
membphis May 12, 2020
e9eba07
doc: Added FAQ about how to reload your own plugin (#1568)
Miss-you May 12, 2020
89baaea
doc: repair the white paper's url of README (#1582)
hiproz May 12, 2020
3ad79cc
chore: fix function name typo in ip-restriction (#1586)
spacewander May 14, 2020
05b3c39
doc: added http logger Chinese docs (#1581)
scaat May 14, 2020
e7d19ec
feature: support discovery center (#1440)
qiujiayu May 14, 2020
2c17ca7
doc:add chinese version for install doc (#1590)
ShiningRush May 14, 2020
3906545
bugfix: incorrect variable name `hostCount` (#1585)
dengliming May 14, 2020
e79cf65
doc: update kakfa logger plugin's cn version (#1594)
ShiningRush May 18, 2020
6fb3ebe
doc: fix the doc style for *_logger.md (#1605)
dabue May 22, 2020
9a6fc51
bugfix: raise error when none of the configured etcd can be connected…
spacewander May 22, 2020
c9a53ab
test: updated style. (#1606)
membphis May 22, 2020
dab6fd1
release: released 1.3 version. (#1558)
moonming May 25, 2020
5aeac03
bugfix(CLI): fixed garbled Chinese response in browser. (#1598)
xxm404 May 25, 2020
cdf4acb
change: updated prometheus to version 1.1 . (#1607)
membphis May 26, 2020
dff6ca3
doc: add asf.yaml. (#1612)
moonming May 26, 2020
d14371f
fix some doc style for response-rewrite* and health-check.md (#1611)
dabue May 26, 2020
1bc2af5
makefile: add default check for install command (#1591)
ShiningRush May 26, 2020
67a2096
test cases: add doc and test cases for how to redirect http to https.…
moonming May 26, 2020
398941b
feature: add skywalking plugin. (#1241)
moonming May 27, 2020
9792045
doc: removed external links and docs. (#1619)
moonming May 27, 2020
cebd3e9
doc: add coc file (#1589)
ShiningRush May 28, 2020
f16e25d
bugfix: change the version of skywalking to 1.0-0 (#1624)
dabue May 28, 2020
6cf21d3
bugfix(prometheus): the `overhead` should use milliseconds. #1615 (#1…
dabue May 28, 2020
39ef6fb
feature: add option to include request body in log util (#1545)
sshniro May 29, 2020
25e608c
bugfix: fix typo of `instance_id` in skywalking plugin. (#1629)
qiujiayu May 31, 2020
2e67c98
doc: added the link to discovery.md (#1631)
qiujiayu Jun 1, 2020
fa1d2c6
change(ASF): add notifications to mailing list. (#1635)
moonming Jun 1, 2020
e2154d9
change(doc): style for HttpResponse section (#1634)
Gerrard-YNWA Jun 1, 2020
887e812
doc(limit-count): fixed document description does not match source co…
xxm404 Jun 2, 2020
6faf3ef
bugfix(batch-requests): support cookie (#1599)
ShiningRush Jun 2, 2020
ecd684b
feat(admin api): enhance `PATCH` method, allow to update partial data…
nic-chen Jun 2, 2020
82f85e5
test: added test tests for skywalking. (#1621)
moonming Jun 2, 2020
81519f3
doc: add skywalking plugin instructions (#1636)
cyxinda Jun 3, 2020
f615cf7
feature: support http_to_https in redirect plugin. (#1642)
moonming Jun 3, 2020
171db26
test: add test case for #1625 to test the filed of overhead (#1645)
dabue Jun 5, 2020
52fa154
CLI: compatibility of benchmark script and apisix reload command on O…
qiukeren Jun 6, 2020
3228e16
feature: support to enable HTTPS for admin API (#1648)
dabue Jun 7, 2020
f61b703
[log] Optimize the buffer size and flush time (#1570)
Miss-you Jun 7, 2020
12bfcec
doc: add 'X-API-KEY' parameter for each interface of Admin API. (#1661)
Miss-you Jun 8, 2020
c452846
bugfix: wildcard certificates cannot match multi-level subdomains in …
membphis Jun 8, 2020
d6cee16
plugin: add consumer-restriction (#1437)
stone4774 Jun 8, 2020
b59a519
feat: support resource name for route, service and upstream object. (…
nic-chen Jun 9, 2020
d780f74
[bugfix(CLI)]: check whether the user has enabled etcd v2 protocol. …
dabue Jun 9, 2020
4b47391
bugfix(CLI): generate the 'worker_cpu_affinity' config for Linux OS (…
Miss-you Jun 9, 2020
1b7c1bc
test case: formatted by `reindex`. (#1651)
membphis Jun 9, 2020
9b47b31
change: disable reuseport in development mode, it more easy to manage…
membphis Jun 10, 2020
2025337
test: add test case for route with `filter_func`. (#1683)
membphis Jun 11, 2020
ce386b0
doc: rename grpc-transcoding-cn.md to grpc-transcode-cn.md (#1694)
juzhiyuan Jun 11, 2020
51b867f
fix bug: Execute command 'make run' multiple times, will start multip…
kevhoo Jun 11, 2020
8dba2c0
doc(FAQ): added example for gray release. (#1687)
moonming Jun 11, 2020
b34b554
change: set default reject code for some plugins (#1696)
membphis Jun 11, 2020
56aeb4a
feature: ssl enhance (#1678)
nic-chen Jun 13, 2020
1764890
feature: support body filter plugin `echo`. (#1632)
Jun 13, 2020
75e429a
doc: Update README_CN.md (#1705)
QuakeWang Jun 14, 2020
1251385
change: use `iterate` to scan items in etcd. (#1717)
xxm404 Jun 16, 2020
8b4ae7c
doc: added doc of key for limit-* plugins. (#1714)
moonming Jun 16, 2020
cd98a2b
feature: support authorization Plugin for Keycloak Identity Server (#…
sshniro Jun 16, 2020
3010e04
feat[batch-request]: cp all header to every request (#1697)
ShiningRush Jun 16, 2020
6c3e667
doc: updated main picture. (#1719)
membphis Jun 17, 2020
3afcf54
doc: update echo-cn.md (#1726)
agile6v Jun 18, 2020
7d78a7e
update `resty-etcd` to version 1.0 . (#1725)
membphis Jun 18, 2020
fab0589
doc: health-check-cn.md (#1723)
Corey-Wang Jun 18, 2020
0a8b739
doc: add Chinese translation of authz-keycloak plugin (#1729)
hellmage Jun 18, 2020
b0a1580
doc: Refactoring docs to support docsify (#1724)
sshniro Jun 19, 2020
e38d0a9
change: update `resty-radixtree` to version 1.9 . (#1730)
membphis Jun 19, 2020
7307797
feature: support the use of independent files to implement the load a…
membphis Jun 19, 2020
f8f104d
feature(echo): support header filter and access phases. (#1708)
Jun 19, 2020
f1e66ad
bugfix: id can be string object, which contains `^[a-zA-Z0-9-_]+$`. (…
membphis Jun 21, 2020
2b5ddbc
test: add test cases about the string id in `service` #1659 (#1750)
shibingli Jun 22, 2020
9533c8a
update `lua-resty-raditree` to ver 2.0 . (#1748)
membphis Jun 22, 2020
748e337
refactory: collect `upstream` logic and put them in a single file. (#…
membphis Jun 22, 2020
6a43a8c
feature: implemented plugin `uri-blocklist` . (#1727)
membphis Jun 22, 2020
497acbb
doc: update `http-logger` plugins Chinese docs. (#1755)
scaat Jun 22, 2020
a5ac97f
doc: update admin-api docs (#1753)
scaat Jun 22, 2020
550cf74
doc: add oauth plugins Chinese docs. (#1754)
scaat Jun 23, 2020
d372fe2
bugfix: fixed configures of nginx.conf for security reasons (#1759)
moonming Jun 23, 2020
eafaf15
doc: update Chinese README.md (#1758)
scaat Jun 23, 2020
e30a746
test: use longer ttl, avoid the cached item expired. (#1760)
membphis Jun 23, 2020
8a523b6
doc: updated k8s doc (#1757)
scaat Jun 23, 2020
78ab35d
bugfix: Fix for remote open ID connect introspection (#1743)
sshniro Jun 24, 2020
d419fb2
test: added test cases. (#1752)
membphis Jun 24, 2020
492fa71
bugfix: added `content-type` for admin API responses (#1746)
shenal Jun 24, 2020
ef89dce
feature: support etcd auth (#1769)
shenal Jun 26, 2020
0ce0ed5
plugin(heartbeat): use `info` log level when failed to report heartbe…
membphis Jun 28, 2020
ee75338
optimize: Use lru to avoid resolving IP addresses repeatedly . (#1772)
membphis Jun 28, 2020
3fc7e7d
doc: update Chinese README.md (#1763)
scaat Jun 28, 2020
0d58ba7
doc: remove router `r3` . (#1764)
membphis Jun 30, 2020
d787cbd
release: released 1.4-0 version (#1742)
sshniro Jun 30, 2020
3061aee
bugfix(config etcd): when we reset the fetched data, `sync_times` als…
wangxiaochuang Jul 1, 2020
a9d60f9
change: remove authentication type for cors plugin (#1788)
morrme Jul 1, 2020
0bcd397
rocks: fixed wrong source of 1.4. (#1783)
moonming Jul 1, 2020
aeab71d
change: 'get_plugin_list' API sorts the return list base on priority …
hanke0 Jul 1, 2020
2ccf020
test: format by tool `reindex`. (#1775)
membphis Jul 2, 2020
e6e387a
bugfix: missing argument `premature` because it was called by ngx.tim…
wangxiaochuang Jul 2, 2020
794b1eb
bugfix: return `404 Not Found` when the dashboard folder is empty. (…
xxm404 Jul 3, 2020
57289ae
doc: add guides for installing dependencies on fedora (#1800)
imjoey Jul 3, 2020
8494506
doc: fixed some punctuation error in the document sample shell (#1803)
vyyd Jul 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix some doc style for response-rewrite* and health-check.md (apache#…
dabue authored May 26, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d14371fbd0bf0b4b10263f280fccd688e0fd8637
37 changes: 19 additions & 18 deletions doc/health-check.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,8 @@
# limitations under the License.
#
-->
## Health Checks for Upstream

# Health Checks for Upstream

Health Check of APISIX is based on [lua-resty-healthcheck](https://github.com/Kong/lua-resty-healthcheck),
you can use it for upstream.
@@ -77,26 +78,26 @@ contains: `active` or `passive`.

* `active`: To enable active health checks, you need to specify the configuration items under `checks.active` in the Upstream object configuration.

* `active.http_path`: The HTTP GET request path used to detect if the upstream is healthy.
* `active.host`: The HTTP request host used to detect if the upstream is healthy.
* `active.http_path`: The HTTP GET request path used to detect if the upstream is healthy.
* `active.host`: The HTTP request host used to detect if the upstream is healthy.

The threshold fields of `healthy` are:
* `active.healthy.interval`: Interval between health checks for healthy targets (in seconds), the minimum is 1.
* `active.healthy.successes`: The number of success times to determine the target is healthy, the minimum is 1.
The threshold fields of `healthy` are:
* `active.healthy.interval`: Interval between health checks for healthy targets (in seconds), the minimum is 1.
* `active.healthy.successes`: The number of success times to determine the target is healthy, the minimum is 1.

The threshold fields of `unhealthy` are:
* `active.unhealthy.interval`: Interval between health checks for unhealthy targets (in seconds), the minimum is 1.
* `active.unhealthy.http_failures`: The number of http failures times to determine the target is unhealthy, the minimum is 1.
* `active.req_headers`: Additional request headers. Array format, so you can fill in multiple headers.
The threshold fields of `unhealthy` are:
* `active.unhealthy.interval`: Interval between health checks for unhealthy targets (in seconds), the minimum is 1.
* `active.unhealthy.http_failures`: The number of http failures times to determine the target is unhealthy, the minimum is 1.
* `active.req_headers`: Additional request headers. Array format, so you can fill in multiple headers.

* `passive`: To enable passive health checks, you need to specify the configuration items under `checks.passive` in the Upstream object configuration.

The threshold fields of `healthy` are:
* `passive.healthy.http_statuses`: If the current response code is equal to any of these, set the upstream node to the `healthy` state. Otherwise ignore this request.
* `passive.healthy.successes`: Number of successes in proxied traffic (as defined by `passive.healthy.http_statuses`) to consider a target healthy, as observed by passive health checks.
The threshold fields of `healthy` are:
* `passive.healthy.http_statuses`: If the current response code is equal to any of these, set the upstream node to the `healthy` state. Otherwise ignore this request.
* `passive.healthy.successes`: Number of successes in proxied traffic (as defined by `passive.healthy.http_statuses`) to consider a target healthy, as observed by passive health checks.

The threshold fields of `unhealthy` are:
* `passive.unhealthy.http_statuses`: If the current response code is equal to any of these, set the upstream node to the `unhealthy` state. Otherwise ignore this request.
* `passive.unhealthy.tcp_failures`: Number of TCP failures in proxied traffic to consider a target unhealthy, as observed by passive health checks.
* `passive.unhealthy.timeouts`: Number of timeouts in proxied traffic to consider a target unhealthy, as observed by passive health checks.
* `passive.unhealthy.http_failures`: Number of HTTP failures in proxied traffic (as defined by `passive.unhealthy.http_statuses`) to consider a target unhealthy, as observed by passive health checks.
The threshold fields of `unhealthy` are:
* `passive.unhealthy.http_statuses`: If the current response code is equal to any of these, set the upstream node to the `unhealthy` state. Otherwise ignore this request.
* `passive.unhealthy.tcp_failures`: Number of TCP failures in proxied traffic to consider a target unhealthy, as observed by passive health checks.
* `passive.unhealthy.timeouts`: Number of timeouts in proxied traffic to consider a target unhealthy, as observed by passive health checks.
* `passive.unhealthy.http_failures`: Number of HTTP failures in proxied traffic (as defined by `passive.unhealthy.http_statuses`) to consider a target unhealthy, as observed by passive health checks.
14 changes: 9 additions & 5 deletions doc/plugins/response-rewrite-cn.md
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
-->

[English](response-rewrite.md)

# response-rewrite

该插件支持修改上游服务返回的 body 和 header 信息。
@@ -26,18 +27,19 @@
1、可以设置 `Access-Control-Allow-*` 等 header 信息,来实现 CORS (跨域资源共享)的功能。
2、另外也可以通过配置 status_code 和 header 里面的 Location 来实现重定向,当然如果只是需要重定向功能,最好使用 [redirect](redirect-cn.md) 插件。

#### 配置参数
## 配置参数

|名字 |可选|说明|
|------- |-----|------|
|status_code |可选| 修改上游返回状态码|
|body |可选| 修改上游返回的 `body` 内容,如果设置了新内容,header 里面的 content-length 字段也会被去掉|
|body_base64 |可选| 布尔类型,描述 `body` 字段是否需要 base64 解码之后再返回给客户端,用在某些图片和 Protobuffer 场景|
|headers |可选| 返回给客户端的 `headers`,这里可以设置多个。头信息如果存在将重写,不存在则添加。想要删除某个 header 的话,把对应的值设置为空字符串即可|

## 示例

### 示例
### 开启插件

#### 开启插件
下面是一个示例,在指定的 route 上开启了 `response rewrite` 插件:

```shell
@@ -63,15 +65,17 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f1
}'
```

#### 测试插件
### 测试插件

基于上述配置进行测试:

```shell
curl -X GET -i http://127.0.0.1:9080/test/index.html
```

如果看到返回的头部信息和内容都被修改了,即表示 `response rewrite` 插件生效了。
```

```shell
HTTP/1.1 200 OK
Date: Sat, 16 Nov 2019 09:15:12 GMT
Transfer-Encoding: chunked
10 changes: 9 additions & 1 deletion doc/plugins/response-rewrite.md
Original file line number Diff line number Diff line change
@@ -20,20 +20,24 @@
[Chinese](response-rewrite-cn.md)

# Summary

- [**Name**](#name)
- [**Attributes**](#attributes)
- [**How To Enable**](#how-to-enable)
- [**Test Plugin**](#test-plugin)
- [**Disable Plugin**](#disable-plugin)

## Name

response rewrite plugin, rewrite the content from upstream.

**senario**:

1. can set `Access-Control-Allow-*` series field to support CORS(Cross-origin Resource Sharing).
2. we can set customized `status_code` and `Location` field in header to achieve redirect, you can alse use [redirect](redirect.md) plugin if you just want a redirection.

## Attributes

|Name |Requirement|Description|
|------- |-----|------|
|status_code |optional| New `status code` to client|
@@ -42,6 +46,7 @@ response rewrite plugin, rewrite the content from upstream.
|headers |optional| Set the new `headers` for client, can set up multiple. If it exists already from upstream, will rewrite the header, otherwise will add the header. You can set the corresponding value to an empty string to remove a header. |

## How To Enable

Here's an example, enable the `response rewrite` plugin on the specified route:

```shell
@@ -68,6 +73,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f1
```

## Test Plugin

Testing based on the above examples :

```shell
@@ -76,6 +82,7 @@ curl -X GET -i http://127.0.0.1:9080/test/index.html

It will output like below,no matter what kind of content from upstream.
```

HTTP/1.1 200 OK
Date: Sat, 16 Nov 2019 09:15:12 GMT
Transfer-Encoding: chunked
@@ -89,9 +96,11 @@ X-Server-status: on
This means that the `response rewrite` plugin is in effect.

## Disable Plugin

When you want to disable the `response rewrite` plugin, it is very simple,
you can delete the corresponding json configuration in the plugin configuration,
no need to restart the service, it will take effect immediately:

```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
@@ -107,4 +116,3 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f1
```

The `response rewrite` plugin has been disabled now. It works for other plugins.