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

change: remove listen.host from api/conf/conf.yaml #1767

Merged
merged 17 commits into from
Apr 19, 2021

Conversation

nic-chen
Copy link
Member

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

The configuration item listen.host in conf.yaml often confuses users, because when the configuration dashboard can be accessed non-locally, two places need to be modified (the other place is allow_list).
remove the listen.host configuration item from conf.yaml, but retain the feature, and users can add it when they need it.

What changes will this PR take into?

remove listen.host from api/conf/conf.yaml
set ServerHost in the code to an empty string

Related issues

fix/resolve #1743

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@netlify
Copy link

netlify bot commented Apr 14, 2021

Deploy preview for apisix-dashboard ready!

Built with commit 368163e

https://deploy-preview-1767--apisix-dashboard.netlify.app

@juzhiyuan
Copy link
Member

bugfix or feature?

@juzhiyuan
Copy link
Member

may sync master codes to fix CI

@codecov-io
Copy link

codecov-io commented Apr 15, 2021

Codecov Report

Merging #1767 (4fbea88) into master (f95324f) will decrease coverage by 10.38%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1767       +/-   ##
===========================================
- Coverage   72.64%   62.25%   -10.39%     
===========================================
  Files         116       47       -69     
  Lines        2738     3129      +391     
  Branches      661        0      -661     
===========================================
- Hits         1989     1948       -41     
- Misses        749      867      +118     
- Partials        0      314      +314     
Flag Coverage Δ
backend-e2e-test 62.25% <ø> (?)
backend-e2e-test-ginkgo 49.21% <ø> (?)
frontend-e2e-test ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/internal/conf/conf.go 66.19% <ø> (ø)
web/src/pages/Route/components/Step2/index.tsx
web/src/pages/Consumer/service.ts
web/src/components/Plugin/UI/limit-conn.tsx
...ages/Route/components/Step2/RequestRewriteView.tsx
...eb/src/components/PluginOrchestration/constants.ts
...omponents/Upstream/components/UpstreamSelector.tsx
web/src/libs/iconfont.js
web/src/app.tsx
web/src/pages/Dashboard/service.ts
... and 116 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e2e0b7...4fbea88. Read the comment docs.

@juzhiyuan
Copy link
Member

Please sync the master branch

Copy link
Contributor

@starsz starsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not set “0.0.0.0” as default?

@@ -33,8 +33,9 @@ jobs:
- name: Modify Config
run: |
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' api/conf/conf.yaml
sed -i 's/host: 127.0.0.1/host: 0.0.0.0/' api/conf/conf.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add some notes about the default listen IP address(es).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

@nic-chen
Copy link
Member Author

Why not set “0.0.0.0” as default?

Because in our configuration, listen will only have port.

So it would be strange to display 0.0.0.0:9000 after the manager-api started, :9000 should be better.

What do you think? @starsz

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2021

Codecov Report

Merging #1767 (368163e) into master (5d9cd3f) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1767      +/-   ##
==========================================
+ Coverage   71.81%   71.85%   +0.03%     
==========================================
  Files         172      172              
  Lines        6064     6064              
  Branches      703      703              
==========================================
+ Hits         4355     4357       +2     
+ Misses       1466     1463       -3     
- Partials      243      244       +1     
Flag Coverage Δ
backend-e2e-test 62.39% <ø> (+0.22%) ⬆️
backend-e2e-test-ginkgo 48.83% <ø> (-0.23%) ⬇️
backend-unit-test 52.41% <ø> (ø)
frontend-e2e-test 72.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/internal/conf/conf.go 66.19% <ø> (-2.82%) ⬇️
api/internal/core/store/store.go 86.82% <0.00%> (-1.20%) ⬇️
api/internal/core/storage/etcd.go 49.09% <0.00%> (+1.81%) ⬆️
api/internal/core/store/storehub.go 74.76% <0.00%> (+3.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d9cd3f...368163e. Read the comment docs.

@@ -17,10 +17,15 @@

conf:
listen:
host: 127.0.0.1 # `manager api` listening ip or host name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still support configuring the host. So can we comment on this instead of removing them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@starsz your way is better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

port: 9000 # `manager api` listening port
allow_list: # If we don't set any IP list, then any IP access is allowed by default.
- 127.0.0.0/24
- 10.0.0.0/8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one 127.0.0.0/24 is enough.

we can add more comment to show how to set it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

@starsz
Copy link
Contributor

starsz commented Apr 19, 2021

Emmm.Need to fix the link error. @nic-chen

@nic-chen
Copy link
Member Author

Emmm.Need to fix the link error. @nic-chen

sure

@nic-chen nic-chen merged commit 5406ba3 into apache:master Apr 19, 2021
@nic-chen nic-chen deleted the remove-listen-host branch April 20, 2021 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change: remove listen.host from api/conf/conf.yaml
9 participants