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

chore: change the default port of manager api from 8080 to 9000 #931

Merged
merged 3 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/backend-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
export GO111MOUDULE=on
export APISIX_CONF_PATH=$PWD/conf
sed -i 's/8080/8088/' conf/conf.yaml
sed -i 's/9000/8088/' conf/conf.yaml
go build -o ./manager-api
./manager-api > ./api.log 2>&1 &
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ COPY --from=fe-builder /usr/local/apisix-dashboard/output/ ./

RUN mkdir logs

EXPOSE 8080
EXPOSE 9000

CMD [ "/usr/local/apisix-dashboard/manager-api" ]
2 changes: 1 addition & 1 deletion api/conf/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
conf:
listen:
host: 127.0.0.1 # `manager api` listening ip or host name
port: 8080 # `manager api` listening port
port: 9000 # `manager api` listening port
etcd:
endpoints: # supports defining multiple etcd host addresses for an etcd cluster
- 127.0.0.1:2379
Expand Down
2 changes: 1 addition & 1 deletion api/test/docker-deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
depends_on:
- etcd
ports:
- '8080:8080/tcp'
- '9000:9000/tcp'
networks:
apisix_dashboard_e2e:
ipv4_address: 172.16.238.40
Expand Down
2 changes: 1 addition & 1 deletion api/test/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ COPY --from=build-env /usr/share/zoneinfo/Hongkong /etc/localtime

RUN mkdir logs

EXPOSE 8080
EXPOSE 9000

RUN chmod +x ./entry.sh

Expand Down
2 changes: 1 addition & 1 deletion api/test/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ services:
- node2
- node3
ports:
- '8080:8080/tcp'
- '9000:9000/tcp'
networks:
apisix_dashboard_e2e:
ipv4_address: 172.16.238.40
Expand Down
2 changes: 1 addition & 1 deletion api/test/docker/manager-api-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
conf:
listen:
host: 0.0.0.0 # `manager api` listening ip or host name. It's for e2e test, so it is set to 0.0.0.0
port: 8080 # `manager api` listening port
port: 9000 # `manager api` listening port
etcd:
endpoints: # supports defining multiple etcd host addresses for an etcd cluster
- 172.16.238.10:2379 # ips here are defined in docker compose.
Expand Down
4 changes: 2 additions & 2 deletions api/test/e2e/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func init() {
"password": "admin"
}`)

url := "http://127.0.0.1:8080/apisix/admin/user/login"
url := "http://127.0.0.1:9000/apisix/admin/user/login"
req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(requestBody))
if err != nil {
panic(err)
Expand Down Expand Up @@ -84,7 +84,7 @@ func httpGet(url string) ([]byte, int, error) {
}

func ManagerApiExpect(t *testing.T) *httpexpect.Expect {
return httpexpect.New(t, "http://127.0.0.1:8080")
return httpexpect.New(t, "http://127.0.0.1:9000")
}

func APISIXExpect(t *testing.T) *httpexpect.Expect {
Expand Down
8 changes: 4 additions & 4 deletions api/test/shell/docker_deploy_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
set -ex

# web page
curl http://127.0.0.1:8080
code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:8080)
curl http://127.0.0.1:9000
code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000)
if [ ! $code -eq 200 ]; then
echo "failed: failed to custom port"
exit 1
fi

# login
resp=$(curl http://127.0.0.1:8080/apisix/admin/user/login -X POST -d '{"username":"admin", "password": "admin"}')
resp=$(curl http://127.0.0.1:9000/apisix/admin/user/login -X POST -d '{"username":"admin", "password": "admin"}')
token=$(echo "${resp}" | sed 's/{/\n/g' | sed 's/,/\n/g' | grep "token" | sed 's/:/\n/g' | sed '1d' | sed 's/}//g' | sed 's/"//g')
if [ -z "${token}" ]; then
echo "login failed"
fi

# plugin orchestration
echo $token
code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:8080/apisix/admin/routes/1 -X PUT -i -H "Authorization: $token" -d '{"id":"1","uri":"/index.html","upstream":{"type":"roundrobin","nodes":[{"host":"www.test.com","port":80,"weight":1}]},"script":{"rule":{"root":"451106f8-560c-43a4-acf2-2a6ed0ea57b8","451106f8-560c-43a4-acf2-2a6ed0ea57b8":[["code==403","b93d622c-92ef-48b4-b6bb-57e1ce893ee3"],["","988ef5c2-c896-4606-a666-3d4cbe24a731"]]},"conf":{"451106f8-560c-43a4-acf2-2a6ed0ea57b8":{"name":"uri-blocker","conf":{"block_rules":["root.exe","root.m+"],"rejected_code":403}},"988ef5c2-c896-4606-a666-3d4cbe24a731":{"name":"kafka-logger","conf":{"batch_max_size":1000,"broker_list":{},"buffer_duration":60,"inactive_timeout":5,"include_req_body":false,"kafka_topic":"1","key":"2","max_retry_count":0,"name":"kafkalogger","retry_delay":1,"timeout":3}},"b93d622c-92ef-48b4-b6bb-57e1ce893ee3":{"name":"fault-injection","conf":{"abort":{"body":"200","http_status":300},"delay":{"duration":500}}}},"chart":{}}}')
code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000/apisix/admin/routes/1 -X PUT -i -H "Authorization: $token" -d '{"id":"1","uri":"/index.html","upstream":{"type":"roundrobin","nodes":[{"host":"www.test.com","port":80,"weight":1}]},"script":{"rule":{"root":"451106f8-560c-43a4-acf2-2a6ed0ea57b8","451106f8-560c-43a4-acf2-2a6ed0ea57b8":[["code==403","b93d622c-92ef-48b4-b6bb-57e1ce893ee3"],["","988ef5c2-c896-4606-a666-3d4cbe24a731"]]},"conf":{"451106f8-560c-43a4-acf2-2a6ed0ea57b8":{"name":"uri-blocker","conf":{"block_rules":["root.exe","root.m+"],"rejected_code":403}},"988ef5c2-c896-4606-a666-3d4cbe24a731":{"name":"kafka-logger","conf":{"batch_max_size":1000,"broker_list":{},"buffer_duration":60,"inactive_timeout":5,"include_req_body":false,"kafka_topic":"1","key":"2","max_retry_count":0,"name":"kafkalogger","retry_delay":1,"timeout":3}},"b93d622c-92ef-48b4-b6bb-57e1ce893ee3":{"name":"fault-injection","conf":{"abort":{"body":"200","http_status":300},"delay":{"duration":500}}}},"chart":{}}}')
if [ ! $code -eq 200 ]; then
echo "failed to create route"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions docs/deploy-with-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Kindly note:

```sh
# /path/to/conf.yaml Requires an absolute path pointing to the configuration file mentioned above.
$ docker run -d -p 80:8080 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard:$tag
$ docker run -d -p 9000:9000 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard:$tag
```

3. Check if the container started successfully
Expand All @@ -64,7 +64,7 @@ $ docker run -d -p 80:8080 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/con
$ docker ps -a
```

If the container `apisix-dashboard` is ok, visit `http://127.0.0.1:8080` to use the dashboard with GUI, where the default username and password are `admin`.
If the container `apisix-dashboard` is ok, visit `http://127.0.0.1:9000` to use the dashboard with GUI, where the default username and password are `admin`.

4. Stop the Dashboard

Expand Down
4 changes: 2 additions & 2 deletions docs/deploy-with-docker.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $ docker build -t apisix-dashboard:$tag . --build-arg ENABLE_PROXY=true

```sh
# /path/to/conf.yaml 需使用 绝对路径 指向上述提到的配置文件
$ docker run -d -p 80:8080 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard:$tag
$ docker run -d -p 9000:9000 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard:$tag
```

3. 检查容器是否启动成功
Expand All @@ -64,7 +64,7 @@ $ docker run -d -p 80:8080 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/con
$ docker ps -a
```

若容器 `apisix-dashboard` 状态正常,访问 `http://127.0.0.1:8080` 以使用有前端界面的控制台,默认用户密码均为 `admin`。
若容器 `apisix-dashboard` 状态正常,访问 `http://127.0.0.1:9000` 以使用有前端界面的控制台,默认用户密码均为 `admin`。

4. 停止 Dashboard

Expand Down
2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $ ./manager-api
$ nohup ./manager-api &
```

4. Without changing the configuration, visit `http://127.0.0.1:8080` to use the dashboard with GUI, where the default username and password are `admin`.
4. Without changing the configuration, visit `http://127.0.0.1:9000` to use the dashboard with GUI, where the default username and password are `admin`.

5. Stop the Dashboard

Expand Down
2 changes: 1 addition & 1 deletion docs/deploy.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ $ ./manager-api
$ nohup ./manager-api &
```

4. 在未修改配置的情况下,访问 `http://127.0.0.1:8080` 以使用有前端界面的控制台,默认用户密码均为 `admin`。
4. 在未修改配置的情况下,访问 `http://127.0.0.1:9000` 以使用有前端界面的控制台,默认用户密码均为 `admin`。

5. 停止 Dashboard

Expand Down