From b8d0ac84a9a252f0bbf6e29815bf71bf1afa9722 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Wed, 10 Mar 2021 22:11:07 +0000 Subject: [PATCH] Replaces 0.0.0.0 on the codebase (#388) Co-authored-by: Mark Phelps --- CHANGELOG.md | 2 +- README.md | 2 +- config/config.go | 2 +- config/config_test.go | 2 +- config/default.yml | 2 +- config/local.yml | 2 +- config/production.yml | 2 +- config/testdata/config/database.yml | 2 +- config/testdata/config/default.yml | 2 +- test/api | 2 +- test/qawolf | 2 +- ui/__tests__/e2e/createFlag.test.js | 6 +++--- ui/__tests__/e2e/createSegment.test.js | 6 +++--- ui/src/services/api.js | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9041a63e9..3e70700646 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -399,7 +399,7 @@ Happy Halloween! Flipt goes 1.0.0 today! :jack_o_lantern: ```yaml server: - host: 0.0.0.0 + host: 127.0.0.1 http_port: 8080 grpc_port: 9000 ``` diff --git a/README.md b/README.md index bf4ddd14bf..6ee423d3e3 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Try Flipt out yourself with Docker: ❯ docker run --rm -p 8080:8080 -p 9000:9000 -t markphelps/flipt:latest ``` -Flipt UI will now be reachable at [http://0.0.0.0:8080/](http://0.0.0.0:8080). +Flipt UI will now be reachable at [http://127.0.0.1:8080/](http://127.0.0.1:8080). For more permanent methods of running Flipt, see the [Installation](https://flipt.io/docs/installation/) section. diff --git a/config/config.go b/config/config.go index a0957f729f..4fd2ad0a2e 100644 --- a/config/config.go +++ b/config/config.go @@ -166,7 +166,7 @@ func Default() *Config { }, Server: ServerConfig{ - Host: "0.0.0.0", + Host: "127.0.0.1", Protocol: HTTP, HTTPPort: 8080, HTTPSPort: 443, diff --git a/config/config_test.go b/config/config_test.go index 6344fdf00e..5d3383249e 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -85,7 +85,7 @@ func TestLoad(t *testing.T) { }, Server: ServerConfig{ - Host: "0.0.0.0", + Host: "127.0.0.1", Protocol: HTTP, HTTPPort: 8080, HTTPSPort: 443, diff --git a/config/default.yml b/config/default.yml index aabb6e2c94..ee110e341f 100644 --- a/config/default.yml +++ b/config/default.yml @@ -17,7 +17,7 @@ # server: # protocol: http -# host: 0.0.0.0 +# host: 127.0.0.1 # https_port: 443 # http_port: 8080 # grpc_port: 9000 diff --git a/config/local.yml b/config/local.yml index 9ccc20671f..e056f3a012 100644 --- a/config/local.yml +++ b/config/local.yml @@ -16,7 +16,7 @@ log: # server: # protocol: http -# host: 0.0.0.0 +# host: 127.0.0.1 # https_port: 443 # http_port: 8080 # grpc_port: 9000 diff --git a/config/production.yml b/config/production.yml index 76383aa210..3a61d23cb1 100644 --- a/config/production.yml +++ b/config/production.yml @@ -3,7 +3,7 @@ log: server: protocol: https - host: 0.0.0.0 + host: 127.0.0.1 http_port: 8080 https_port: 443 grpc_port: 9000 diff --git a/config/testdata/config/database.yml b/config/testdata/config/database.yml index e0fcf09307..0eb54350ef 100644 --- a/config/testdata/config/database.yml +++ b/config/testdata/config/database.yml @@ -16,7 +16,7 @@ # server: # protocol: http -# host: 0.0.0.0 +# host: 127.0.0.1 # https_port: 443 # http_port: 8080 # grpc_port: 9000 diff --git a/config/testdata/config/default.yml b/config/testdata/config/default.yml index 678c0291f6..eb615bed9f 100644 --- a/config/testdata/config/default.yml +++ b/config/testdata/config/default.yml @@ -16,7 +16,7 @@ # server: # protocol: http -# host: 0.0.0.0 +# host: 127.0.0.1 # https_port: 443 # http_port: 8080 # grpc_port: 9000 diff --git a/test/api b/test/api index c3898174f5..37cd7223d9 100755 --- a/test/api +++ b/test/api @@ -268,7 +268,7 @@ run() sleep 5 - flipt_host="0.0.0.0:8080" + flipt_host="127.0.0.1:8080" echo -e "\e[32m \e[0m" echo -e "\e[32m===========================================\e[0m" diff --git a/test/qawolf b/test/qawolf index 570ec5c806..61a333223c 100755 --- a/test/qawolf +++ b/test/qawolf @@ -11,7 +11,7 @@ run() sleep 5 - flipt_host="0.0.0.0:8080" + flipt_host="127.0.0.1:8080" echo -e "\e[32m \e[0m" echo -e "\e[32m===========================================\e[0m" diff --git a/ui/__tests__/e2e/createFlag.test.js b/ui/__tests__/e2e/createFlag.test.js index ce45554ed6..71e0a804f4 100644 --- a/ui/__tests__/e2e/createFlag.test.js +++ b/ui/__tests__/e2e/createFlag.test.js @@ -17,7 +17,7 @@ afterAll(async () => { }); test("createFlag", async () => { - await page.goto("http://0.0.0.0:8080"); + await page.goto("http://127.0.0.1:8080"); await page.click("[data-testid='new-flag']"); await page.type("[placeholder='Flag name']", "Awesome new feature"); await page.type("[placeholder='Flag description']", "Our product manager cannot wait to ship this!"); @@ -25,10 +25,10 @@ test("createFlag", async () => { }); test('createFlagDisallowSpecialChars', async () => { - await page.goto("http://0.0.0.0:8080"); + await page.goto("http://127.0.0.1:8080"); await page.click("[data-testid='new-flag']"); await page.type("[placeholder='Flag name']", "My flag with colons"); await page.type("[placeholder='Flag key']", "colons:are:not:allowed"); await page.type("[placeholder='Flag description']", "This should not be saved"); await expect(page).toHaveText("Only letters, numbers, hypens and underscores allowed"); -}); \ No newline at end of file +}); diff --git a/ui/__tests__/e2e/createSegment.test.js b/ui/__tests__/e2e/createSegment.test.js index 6218a28158..849edcc523 100644 --- a/ui/__tests__/e2e/createSegment.test.js +++ b/ui/__tests__/e2e/createSegment.test.js @@ -17,7 +17,7 @@ afterAll(async () => { }); test("createSegment", async () => { - await page.goto("http://0.0.0.0:8080"); + await page.goto("http://127.0.0.1:8080"); await page.click("[data-testid='segments']"); await page.click("[data-testid='new-segment']"); await page.click("[placeholder='Segment name']"); @@ -28,11 +28,11 @@ test("createSegment", async () => { }); test('createSegmentDisallowSpecialChars', async () => { - await page.goto("http://0.0.0.0:8080"); + await page.goto("http://127.0.0.1:8080"); await page.click("[data-testid='segments']"); await page.click("[data-testid='new-segment']"); await page.type("[placeholder='Segment name']", "My segment with colons"); await page.type("[placeholder='Segment key']", "colons:are:not:allowed"); await page.type("[placeholder='Segment description']", "This should not be saved"); await expect(page).toHaveText("Only letters, numbers, hypens and underscores allowed"); -}); \ No newline at end of file +}); diff --git a/ui/src/services/api.js b/ui/src/services/api.js index 309ac737b9..3b2a32924d 100644 --- a/ui/src/services/api.js +++ b/ui/src/services/api.js @@ -1,7 +1,7 @@ import axios from "axios"; let host = - process.env.NODE_ENV === "production" ? window.location.host : "0.0.0.0:8080"; + process.env.NODE_ENV === "production" ? window.location.host : "127.0.0.1:8080"; export const Api = axios.create({ baseURL: "//" + host + "/api/v1/"