Skip to content

Commit 5406ba3

Browse files
authored
change: remove listen.host from api/conf/conf.yaml (#1767)
1 parent 5d9cd3f commit 5406ba3

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

.github/workflows/backend-e2e-test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ jobs:
2929
- name: Modify conf.yaml
3030
run: |
3131
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' ./api/conf/conf.yaml
32-
sed -i 's/127.0.0.1/0.0.0.0/' ./api/conf/conf.yaml
32+
sed -i 's@127.0.0.1@0.0.0.0/0@' ./api/conf/conf.yaml
3333
sed -i '/172.16.238.10:2379/a\ - 172.16.238.11:2379' ./api/conf/conf.yaml
3434
sed -i '/172.16.238.10:2379/a\ - 172.16.238.12:2379' ./api/conf/conf.yaml
35-
sed -i '[email protected]/[email protected]/0@' ./api/conf/conf.yaml
3635
sed -i 's@# - dubbo-proxy@- dubbo-proxy@' ./api/conf/conf.yaml
3736
3837
- name: download file Dockerfile-apisix
@@ -98,10 +97,9 @@ jobs:
9897
- name: Modify conf.yaml Configure for use by the manage-api cluster
9998
run: |
10099
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' ./api/conf/conf.yaml
101-
sed -i 's/127.0.0.1/0.0.0.0/' ./api/conf/conf.yaml
100+
sed -i 's@127.0.0.1@0.0.0.0/0@' ./api/conf/conf.yaml
102101
sed -i '/172.16.238.10:2379/a\ - 172.16.238.11:2379' ./api/conf/conf.yaml
103102
sed -i '/172.16.238.10:2379/a\ - 172.16.238.12:2379' ./api/conf/conf.yaml
104-
sed -i '[email protected]/[email protected]/0@' ./api/conf/conf.yaml
105103
106104
- name: download file Dockerfile-apisix
107105
working-directory: ./api/test/docker

.github/workflows/deploy-with-docker.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ jobs:
3333
- name: Modify Config
3434
run: |
3535
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' api/conf/conf.yaml
36-
sed -i 's/host: 127.0.0.1/host: 0.0.0.0/' api/conf/conf.yaml
37-
sed -i '[email protected]/[email protected]/0@' ./api/conf/conf.yaml
36+
sed -i '[email protected]@0.0.0.0/0@' ./api/conf/conf.yaml
37+
38+
# At present, the docker CI is still running the code of the master branch
39+
# So we need to configure `listen.host` so that it can be accessed outside docker
40+
sed -i '/port: 9000/i\ host: 0.0.0.0' ./api/conf/conf.yaml
3841
3942
- name: Run Docker Compose
4043
working-directory: ./api/test/docker-deploy

api/conf/conf.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
#
1717

1818
conf:
19-
listen:
20-
host: 127.0.0.1 # `manager api` listening ip or host name
21-
port: 9000 # `manager api` listening port
22-
allow_list: # If we don't set any IP list, then any IP access is allowed by default.
23-
- 127.0.0.0/24
19+
listen: # yamllint disable rule:comments-indentation
20+
# host: 127.0.0.1 # the address on which the `Manager API` should listen.
21+
# The default value is 0.0.0.0, if want to specify, please enable it.
22+
# This value accepts IPv4, IPv6, and hostname.
23+
port: 9000 # The port on which the `Manager API` should listen.
24+
allow_list: # If we don't set any IP list, then any IP access is allowed by default.
25+
- 127.0.0.1 # The rules are checked in sequence until the first match is found.
26+
- ::1 # In this example, access is allowed only for IPv4 network 127.0.0.1, and for IPv6 network ::1.
27+
# It also support CIDR like 192.168.1.0/24 and 2001:0db8::/32
2428
etcd:
25-
endpoints: # supports defining multiple etcd host addresses for an etcd cluster
29+
endpoints: # supports defining multiple etcd host addresses for an etcd cluster
2630
- 127.0.0.1:2379
2731
# yamllint disable rule:comments-indentation
2832
# etcd basic auth info
@@ -32,7 +36,7 @@ conf:
3236
key_file: "" # Path of your self-signed client side key
3337
cert_file: "" # Path of your self-signed client side cert
3438
ca_file: "" # Path of your self-signed ca cert, the CA is used to sign callers' certificates
35-
# prefix: /apisix # apisix config's prefix in etcd, /apisix by default
39+
# prefix: /apisix # apisix config's prefix in etcd, /apisix by default
3640
log:
3741
error_log:
3842
level: warn # supports levels, lower to higher: debug, info, warn, error, panic, fatal

api/internal/conf/conf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
ENV string
4545
Schema gjson.Result
4646
WorkDir = "."
47-
ServerHost = "127.0.0.1"
47+
ServerHost = "0.0.0.0"
4848
ServerPort = 80
4949
ETCDConfig *Etcd
5050
ErrorLogLevel = "warn"

api/test/docker/setup.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ up() {
9999

100100
#modifying config
101101
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' "$YAML_FILE"
102-
sed -i 's/127.0.0.1/0.0.0.0/' "$YAML_FILE"
102+
sed -i 's@127.0.0.1@0.0.0.0/0@' "$YAML_FILE"
103103
sed -i '/172.16.238.10:2379/a\ - 172.16.238.11:2379' "$YAML_FILE"
104104
sed -i '/172.16.238.10:2379/a\ - 172.16.238.12:2379' "$YAML_FILE"
105-
sed -i '[email protected]/[email protected]/0@' "$YAML_FILE"
106105
sed -i 's@# - dubbo-proxy@- dubbo-proxy@' "$YAML_FILE"
107106

108107
fi

api/test/shell/cli_test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ if [[ `grep -c "${LOGLEVEL}" ${STDOUT}` -ne '1' ]]; then
189189
exit 1
190190
fi
191191

192-
if [[ `grep -c "${HOST}:${PORT}" ${STDOUT}` -ne '1' ]]; then
192+
if [[ `grep -c "0.0.0.0:${PORT}" ${STDOUT}` -ne '1' ]]; then
193193
echo "failed: the manager server didn't show started info"
194194
exit 1
195195
fi
@@ -252,9 +252,9 @@ clean_up
252252

253253
# set ip allowed list
254254
if [[ $KERNEL = "Darwin" ]]; then
255-
sed -i "" '[email protected].0/24@10.0.0.1@' conf/conf.yaml
255+
sed -i "" 's@- 127.0.0.1 @- 10.0.0.1 @' conf/conf.yaml
256256
else
257-
sed -i '[email protected].0/24@10.0.0.1@' conf/conf.yaml
257+
sed -i 's@- 127.0.0.1 @- 10.0.0.1 @' conf/conf.yaml
258258
fi
259259

260260
./manager-api &

0 commit comments

Comments
 (0)