Skip to content

Commit

Permalink
change: drop support for port_admin (apache#7716)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzssangglass authored and Liu-Junlin committed Nov 4, 2022
1 parent 5a326d5 commit 05ade62
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 27 deletions.
3 changes: 0 additions & 3 deletions apisix/cli/ops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ Please modify "admin_key" in conf/config.yaml .
admin_server_addr = validate_and_get_listen_addr("admin port", "0.0.0.0",
yaml_conf.apisix.admin_listen.ip,
9180, yaml_conf.apisix.admin_listen.port)
elseif yaml_conf.apisix.port_admin then
admin_server_addr = validate_and_get_listen_addr("admin port", "0.0.0.0", nil,
9180, yaml_conf.apisix.port_admin)
end
end

Expand Down
3 changes: 0 additions & 3 deletions apisix/cli/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ local config_schema = {
}
}
},
port_admin = {
type = "integer",
},
https_admin = {
type = "boolean",
},
Expand Down
7 changes: 3 additions & 4 deletions conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ apisix:
# yaml: fetch the config value from local yaml file `/your_path/conf/apisix.yaml`

#proxy_protocol: # Proxy Protocol configuration
#listen_http_port: 9181 # The port with proxy protocol for http, it differs from node_listen and port_admin.
# This port can only receive http request with proxy protocol, but node_listen & port_admin
#listen_http_port: 9181 # The port with proxy protocol for http, it differs from node_listen and admin_listen.
# This port can only receive http request with proxy protocol, but node_listen & admin_listen
# can only receive http request. If you enable proxy protocol, you must use this port to
# receive http request with proxy protocol
#listen_https_port: 9182 # The port with proxy protocol for https
Expand Down Expand Up @@ -77,10 +77,9 @@ apisix:
#admin_listen: # use a separate port
# ip: 127.0.0.1 # Specific IP, if not set, the default value is `0.0.0.0`.
# port: 9180
#port_admin: 9180 # Not recommend: This parameter should be set via the `admin_listen`.
#https_admin: true # enable HTTPS when use a separate port for Admin API.
# Admin API will use conf/apisix_admin_api.crt and conf/apisix_admin_api.key as certificate.
admin_api_mtls: # Depends on `port_admin` and `https_admin`.
admin_api_mtls: # Depends on `admin_listen` and `https_admin`.
admin_ssl_cert: "" # Path of your self-signed server side cert.
admin_ssl_cert_key: "" # Path of your self-signed server side key.
admin_ssl_ca_cert: "" # Path of your self-signed ca cert.The CA is used to sign all admin api callers' certificates.
Expand Down
4 changes: 3 additions & 1 deletion docs/en/latest/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ You can follow the steps below to configure this:

```yaml
apisix:
port_admin: 9180 # use a separate port
admin_listen: # use a separate port
ip: 127.0.0.1
port: 9180
```

2. Add a proxy Route for the Apache APISIX dashboard:
Expand Down
2 changes: 1 addition & 1 deletion docs/en/latest/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes?name=test&uri=foo&label= \

[Routes](./terminology/route.md) match the client's request based on defined rules, loads and executes the corresponding [plugins](#plugin), and forwards the request to the specified [Upstream](#upstream).

**Note**: When the Admin API is enabled, to avoid conflicts with your design API, use a different port for the Admin API. This can be set in your configuration file by changing the `port_admin` key.
**Note**: When the Admin API is enabled, to avoid conflicts with your design API, use a different port for the Admin API. This can be set in your configuration file by changing the `admin_listen` key.

### Request Methods

Expand Down
4 changes: 3 additions & 1 deletion docs/en/latest/certificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ apisix:
- name: admin
key: edd1c9f034335f136f87ad84b625c8f1
role: admin
port_admin: 9180
admin_listen:
ip: 127.0.0.1
port: 9180
https_admin: true

admin_api_mtls:
Expand Down
4 changes: 3 additions & 1 deletion docs/en/latest/mtls.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ The clients will provide their certificates to the server and the server will ch
2. Modify configuration items in `conf/config.yaml`:

```yaml
port_admin: 9180
admin_listen:
ip: 127.0.0.1
port: 9180
https_admin: true

admin_api_mtls:
Expand Down
4 changes: 3 additions & 1 deletion docs/zh/latest/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ make: *** [deps] Error 1

```yaml
apisix:
port_admin: 9180 # use a separate port
admin_listen: # use a separate port
ip: 127.0.0.1
port: 9180
```

2、添加 APISIX Dashboard 的代理路由:
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/latest/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes?name=test&uri=foo&label= \

*说明*:Route 字面意思就是路由,通过定义一些规则来匹配客户端的请求,然后根据匹配结果加载并执行相应的插件,并把请求转发给到指定 Upstream。

注意:在启用 `Admin API` 时,它会占用前缀为 `/apisix/admin` 的 API。因此,为了避免您设计 API 与 `/apisix/admin` 冲突,建议为 Admin API 使用其他端口,您可以在 `conf/config.yaml` 中通过 `port_admin` 进行自定义 Admin API 端口。
注意:在启用 `Admin API` 时,它会占用前缀为 `/apisix/admin` 的 API。因此,为了避免您设计 API 与 `/apisix/admin` 冲突,建议为 Admin API 使用其他端口,您可以在 `conf/config.yaml` 中通过 `admin_listen` 进行自定义 Admin API 端口。

### 请求方法

Expand Down
4 changes: 3 additions & 1 deletion docs/zh/latest/certificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ apisix:
- name: admin
key: edd1c9f034335f136f87ad84b625c8f1
role: admin
port_admin: 9180
admin_listen:
ip: 127.0.0.1
port: 9180
https_admin: true

admin_api_mtls:
Expand Down
4 changes: 3 additions & 1 deletion docs/zh/latest/mtls.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ title: TLS 双向认证
2. 修改 `conf/config.yaml` 中的配置项:

```yaml
port_admin: 9180
admin_listen:
ip: 127.0.0.1
port: 9180
https_admin: true

admin_api_mtls:
Expand Down
3 changes: 2 additions & 1 deletion t/cli/test_access_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ apisix:
admin_api_mtls:
admin_ssl_cert: '../t/certs/apisix_admin_ssl.crt'
admin_ssl_cert_key: '../t/certs/apisix_admin_ssl.key'
port_admin: 9180
admin_listen:
port: 9180
https_admin: true
nginx_config:
http:
Expand Down
10 changes: 6 additions & 4 deletions t/cli/test_admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ apisix:
admin_api_mtls:
admin_ssl_cert: '../t/certs/apisix_admin_ssl.crt'
admin_ssl_cert_key: '../t/certs/apisix_admin_ssl.key'
port_admin: 9180
admin_listen:
port: 9180
https_admin: true
" > conf/config.yaml

Expand Down Expand Up @@ -169,10 +170,11 @@ fi

echo "pass: show WARNING message if the user used default token and allow any IP to access"

# port_admin set
# admin_listen set
echo '
apisix:
port_admin: 9180
admin_listen:
port: 9180
' > conf/config.yaml

rm logs/error.log
Expand All @@ -192,7 +194,7 @@ if grep -E 'using uninitialized ".+" variable while logging request' logs/error.
exit 1
fi

echo "pass: uninitialized variable not found during writing access log (port_admin set)"
echo "pass: uninitialized variable not found during writing access log (admin_listen set)"

# Admin API can only be used with etcd config_center
echo '
Expand Down
3 changes: 2 additions & 1 deletion t/cli/test_admin_mtls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

echo '
apisix:
port_admin: 9180
admin_listen:
port: 9180
https_admin: true
admin_api_mtls:
Expand Down
3 changes: 2 additions & 1 deletion t/cli/test_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ apisix:
admin_api_mtls:
admin_ssl_cert: '../t/certs/apisix_admin_ssl.crt'
admin_ssl_cert_key: '../t/certs/apisix_admin_ssl.key'
port_admin: 9180
admin_listen:
port: 9180
https_admin: true
" > conf/customized_config.yaml

Expand Down
3 changes: 2 additions & 1 deletion t/cli/test_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ echo '
apisix:
node_listen: 9080
enable_admin: true
port_admin: 9180
admin_listen:
port: 9180
stream_proxy:
only: false
tcp:
Expand Down
3 changes: 2 additions & 1 deletion t/cli/test_validate_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ echo '
apisix:
node_listen: 9080
enable_admin: true
port_admin: 9180
admin_listen:
port: 9180
stream_proxy:
tcp:
- "localhost:9100"
Expand Down

0 comments on commit 05ade62

Please sign in to comment.