Commit Graph

160 Commits

Author SHA1 Message Date
罗泽轩
366d5040cf
test: make CI pass again (#2619) 2020-11-04 15:45:27 +08:00
Alex Zhang
61cd91440b
improve: refactor partial command line tool. (#2612)
This PR moves some environmental variables to `apisix/cli/environ.lua`,
and some auxiliary codes to `apisix/cli/util.lua`, which reduces the size
of `bin/apisix`.
2020-11-04 11:26:17 +08:00
Alex Zhang
5191374545
feat: support TLS connection with etcd. (#2548)
Support the TLS connection when communicating with etcd cluster. We added a configuration item to custom the certificate verification. Whether to setup TLS connection or not depends on the endpoints' scheme, for instance, when endpoints are:

```
etcd:
  host:
    - "https://127.0.0.1:2379"
    - "https://127.0.0.1:3379"
```

APISIX will originate TLS connection automatically, and the Server Name Indication extention will be set by the endpoint host (`127.0.0.1` in above case). Note by default APISIX will verify the certificate, close the verification in configuration explicitly if you want to bypass it.

```
etcd:
  tls:
    verfiy: false
```
2020-11-03 13:53:39 +08:00
YuanSheng Wang
edb8c7c590
bug(CLI): CI failed, failed to load apisix.cli.ngx_tpl (#2588)
* for test.

* CLI: load the Lua module after updated the `package.path`.

* CI: used patch to make the CI run normal.

* bugfix: add sudo

* chore:  print the location of `apisix`.

* reverted not related change.
2020-11-01 14:54:24 +08:00
Alex Zhang
952450bd76
improve(CLI): move ngx_tpl to apisix/cli/ngx_tpl.lua (#2581) 2020-10-31 22:56:42 +08:00
YuanSheng Wang
f2f5ab9766
feat: support json encoding escape for access logs (#2269)
fix #2266 .
2020-10-30 16:07:24 +08:00
罗泽轩
b6eb6f4842
change: rename APIX_WORKER_PROCESSES to APISIX_WORKER_PROCESSES (#2552)
Close #2517.
2020-10-30 08:14:04 +08:00
YuanSheng Wang
b23475fcba
feat: upgrade skywalking plugin to support skywalking 8.0 . (#2389) 2020-10-29 15:29:52 +08:00
Alex Zhang
d87ce33485
feature: support injecting lua_ssl_trusted_certificate. (#2519) 2020-10-28 06:49:20 +08:00
YuanSheng Wang
6a7dfa6775
feat: implement api breaker plugin. (#2455)
Co-authored-by: liuheng <liuhengloveyou@gmail.com>
2020-10-27 13:40:23 +08:00
Vinci Xu
1a6fb8ec2c
feat(CLI): worker and cpu optimization (#2153) 2020-10-22 16:28:26 +08:00
罗泽轩
d86c480ec5
fix: previously we could not merge configuration without middle layer (#2476) 2020-10-21 09:59:45 +08:00
尚墨
1fe4e50f5a
chore: show help message if the argument is invalid. (#2408) 2020-10-19 10:35:42 +08:00
YuanSheng Wang
c9392627a8
bugfix: empty allow_admin means that any IP is allowed to access Admin API and Dashboard (#1979)
fix #1939
2020-10-17 19:26:48 +08:00
Turein
90109ca678
feature: support multiple ports like stream listen in http and https … (#2409)
fix #1195
2020-10-17 17:44:26 +08:00
YuanSheng Wang
c65f5c9465
feature: plugin limit-count support to use redis cluster (#2406)
fix #638

Co-authored-by: liuheng <liuhengloveyou@gmail.com>
2020-10-17 08:21:47 +08:00
RocFang
4776dc8a66
fix: it does'nt make sence to compare etcd_version, since it's nil. (#2390)
no need to define a new local cluster_version since it's defined previously.
2020-10-13 23:15:42 +08:00
YuanSheng Wang
5614a95758
feat(http-logger): support for specified the log formats via admin API (#2309)
curl http://****/apisix/admin/plugin_metadata/http-logger -d '
{
    "log_format": {
        "host": "$host",
        "@timestamp": "$time_iso8601",
        "client_ip": "$remote_addr"
    }
}'

when we enabled plugin http-logger, we will get the message body like:

{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
2020-10-13 14:21:54 +08:00
dabue
40577ee1e2
chore: remove the folder 'logs' in root and replace baidu.com with github.com in test cases (#2374)
* rm log

* replace baidu.com to github.com in testcases

* keep folder logs

* remove the folder logs

* update Makefile
2020-10-12 23:49:43 +08:00
RocFang
647d8d9a62
bugfix: check every etcd version, rather than only check the first one (#2380) 2020-10-10 23:53:10 +08:00
Shuyang Wu
c228675a81
doc: update etcd installation step for v3.4 (#2346) 2020-10-04 19:15:58 +08:00
罗泽轩
a6611d3058
feat(proxy-cache): store the temporary file under cache directory. (#2317)
When the temporary file directory and cache directory are under
different disk, this option can avoid unexpected performance hurt.
2020-10-04 16:23:32 +08:00
Swayam Raina
385f2a471b
chore: remove apisix_cores (#2260) 2020-10-04 15:23:42 +08:00
Wen Ming
13b0968340
Revert "feat(http-logger): support for specified the log formats via admin API (#2294)" (#2307)
This reverts commit 89f89f3004.
2020-09-24 23:50:22 +08:00
YuanSheng Wang
89f89f3004
feat(http-logger): support for specified the log formats via admin API (#2294) 2020-09-24 20:45:50 +08:00
YuanSheng Wang
6a1fe8a546
bugfix(CLI): if the user used default token and allow any IP to access Admin API, will show a WARNING message.(#2244)
Co-authored-by: Wen Ming <moonbingbing@gmail.com>
2020-09-22 16:09:35 +08:00
Alex Zhang
e93cdbd48a
change: check etcd cluster version when init_etcd (#2233) 2020-09-16 17:46:53 +08:00
Shuyang Wu
4722198548
feature: support etcd v3 by mocking v2 API (#2036) 2020-09-16 10:19:04 +08:00
罗泽轩
b6354ec33e
feat: allow to limit client body size to protect the service (#2214) 2020-09-15 21:58:30 +08:00
seven dickens
312a97c96f
feat: define env in nginx.conf template (#2174)
Co-authored-by: lixiangyang <lixiangyang@dragonest.com>
2020-09-14 18:12:29 +08:00
redynasc
98bb5933d6
feature: implement ewma balancer for upstream node (#2001)
ewma is a different balancing implementation that will generate a weight for every backend IP based on the last server response time, basically it tries to dispatch more requests to the backends that reply faster, supposing that they are less loaded.

fix #1996
2020-08-29 23:14:16 +08:00
nic-chen
c54aec8f6c
feat: support custom access log format (#2122)
fix #2009
2020-08-26 16:51:44 +08:00
罗泽轩
0bb8f4693a
change: allow users to see warnings by default (#2116)
Previously, with the default configure, people don't have the chance to
ignore the warning message.
2020-08-26 14:19:46 +08:00
YuanSheng Wang
cf882bda1e
feature: divide config.yaml into two files config-custom.yaml & confi… (#2023)
* feature: divide config.yaml into two files config-custom.yaml & config-default.yaml .

fix #1923
2020-08-18 20:18:55 +08:00
罗泽轩
0b00e82773
bugfix: avoid setting Server header twice (#2065)
Fix #2064.
2020-08-15 17:19:35 +08:00
罗泽轩
f7b5f2b7ec
feat: allow customizing worker_processes (#2017)
* feat: allow customizing worker_processes

Close #2016
2020-08-07 17:25:26 +08:00
YuanSheng Wang
d32b5cf361
perf: no longer generate unnecessary nginx conf for better performance. (#1968)
* perf: no longer generate unnecessary nginx conf for better performance.
* benchmark: sync nginx.conf for fake-apisix.

> Is this PR backward compatible?

Disable two plugins by default(proxy-cache, proxy-mirror), if the user wants to enable them, need to modify the conf/config.yaml by manual.
2020-08-04 09:31:35 +08:00
wonglend
4cbb324cca
bugfix(CLI): fix wrong info Warning! Running apisix under /root when make init at non-root path (#1976) 2020-08-03 19:12:02 +08:00
nic-chen
333962a54b
bugfix: run apisix start several times will start multi APISIX servers (#1913) 2020-07-29 18:43:41 +08:00
nic-chen
a5fc25c2a9
feat: Support admin API authentication with SSL certificates (#1747) 2020-07-21 11:41:11 +08:00
罗泽轩
bfa24d41ba
feature: allow to congfiure the worker_shutdown_timeout (#1828)
The default 3s may be too low.
2020-07-10 21:59:44 +08:00
Wen Ming
a4e31b2f3d
optimize: increase ssl_session_cache size to 20m. (#1797) 2020-07-10 11:31:32 +08:00
wonglend
588d46ff18
fix: replace location /robots.txt with location =/robots.txt for admin page. (#1807) 2020-07-07 10:36:32 +08:00
xxm404
794b1eb65e
bugfix: return 404 Not Found when the dashboard folder is empty. (#1799)
close #1794
2020-07-03 21:18:05 +08:00
YuanSheng Wang
ee7533874d
optimize: Use lru to avoid resolving IP addresses repeatedly . (#1772)
* optimize: Use lru to avoid resolving IP addresses repeatedly .
Cached the global rules to `ctx` .

* optimzie: used a longer time interval for etcd and flush access log.

* optimize: return upstream node directly if the count is 1 .

* optimize: avoid to cache useless variable.
2020-06-28 18:14:38 +08:00
Wen Ming
d372fe2516
bugfix: fixed configures of nginx.conf for security reasons (#1759)
removed working_directory and removed TLSv1 TLSv1.1 from ssl_protocols
2020-06-23 16:03:19 +08:00
YuanSheng Wang
9b47b31c50
change: disable reuseport in development mode, it more easy to manage worker process. (#1175) 2020-06-10 11:32:52 +08:00
Yousa
4b47391a6c
bugfix(CLI): generate the 'worker_cpu_affinity' config for Linux OS (#1658)
Fix #1657
2020-06-09 20:44:15 +08:00
dabue
d780f7406f
[bugfix(CLI)]: check whether the user has enabled etcd v2 protocol. (#1665) 2020-06-09 20:42:38 +08:00
Yousa
f61b7036b0
[log] Optimize the buffer size and flush time (#1570)
* yousali:<log>Optimize the buffer size and flush time

1. buffer=4096 is better for Writes of more than PIPE_BUF bytes may be nonatomic
2. flush=1. Since the log buffer is lowered, the flush time should also be lowered.

* yousali:<fix>

hi, I also made a test.

```
4096  Requests/sec:  16079.75
8192 Requests/sec:  16389.52
16384 Requests/sec:  16395.30
32768 Requests/sec:  16459.71
```
I think a log buffer size of 8192 or 16384 would be appropriate.

On the other hand, the refresh time of 3 seconds is still relatively long, and 1 or 3 seconds doesn't particularly affect QPS.

So I also agree with `buffer=16384 flush=1; `
2020-06-07 23:57:54 +08:00