From 12dc5c3395535ec5be592498142f159db8f3570b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 13 Jul 2022 11:58:10 +0300 Subject: [PATCH] [#1563] config: Replace `127.0.0.1` with `localhost` Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/storagecfg/root.go | 4 ++-- cmd/neofs-ir/defaults.go | 4 ++-- cmd/neofs-node/config/control/config_test.go | 2 +- cmd/neofs-node/config/metrics/config_test.go | 2 +- cmd/neofs-node/config/profiler/config_test.go | 2 +- config/example/ir.env | 6 +++--- config/example/ir.yaml | 6 +++--- config/example/node.env | 6 +++--- config/example/node.json | 6 +++--- config/example/node.yaml | 6 +++--- config/mainnet/config.yml | 2 +- config/testnet/config.yml | 2 +- config/testnet/node_config.env | 2 +- config/testnet/prometheus.yml | 2 +- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/storagecfg/root.go b/cmd/neofs-adm/internal/modules/storagecfg/root.go index 3e6fb5faf0..ac7f07df97 100644 --- a/cmd/neofs-adm/internal/modules/storagecfg/root.go +++ b/cmd/neofs-adm/internal/modules/storagecfg/root.go @@ -41,8 +41,8 @@ const ( ) const ( - defaultControlEndpoint = "127.0.0.1:8090" - defaultDataEndpoint = "127.0.0.1" + defaultControlEndpoint = "localhost:8090" + defaultDataEndpoint = "localhost" ) // RootCmd is a root command of config section. diff --git a/cmd/neofs-ir/defaults.go b/cmd/neofs-ir/defaults.go index 7a1f95a1e8..5c96513fed 100644 --- a/cmd/neofs-ir/defaults.go +++ b/cmd/neofs-ir/defaults.go @@ -37,10 +37,10 @@ func newConfig(path string) (*viper.Viper, error) { func defaultConfiguration(cfg *viper.Viper) { cfg.SetDefault("logger.level", "info") - cfg.SetDefault("profiler.address", "") + cfg.SetDefault("profiler.address", "localhost:9090") cfg.SetDefault("profiler.shutdown_timeout", "30s") - cfg.SetDefault("metrics.address", "") + cfg.SetDefault("metrics.address", "localhost:6060") cfg.SetDefault("metrics.shutdown_timeout", "30s") cfg.SetDefault("without_mainnet", false) diff --git a/cmd/neofs-node/config/control/config_test.go b/cmd/neofs-node/config/control/config_test.go index 654c0f8b01..27ba75ed77 100644 --- a/cmd/neofs-node/config/control/config_test.go +++ b/cmd/neofs-node/config/control/config_test.go @@ -26,7 +26,7 @@ func TestControlSection(t *testing.T) { var fileConfigTest = func(c *config.Config) { require.Equal(t, pubs, controlconfig.AuthorizedKeys(c)) - require.Equal(t, "127.0.0.1:8090", controlconfig.GRPC(c).Endpoint()) + require.Equal(t, "localhost:8090", controlconfig.GRPC(c).Endpoint()) } configtest.ForEachFileType(path, fileConfigTest) diff --git a/cmd/neofs-node/config/metrics/config_test.go b/cmd/neofs-node/config/metrics/config_test.go index 92056ee5f0..3cdaa12fa7 100644 --- a/cmd/neofs-node/config/metrics/config_test.go +++ b/cmd/neofs-node/config/metrics/config_test.go @@ -26,7 +26,7 @@ func TestMetricsSection(t *testing.T) { addr := metricsconfig.Address(c) require.Equal(t, 15*time.Second, to) - require.Equal(t, "127.0.0.1:9090", addr) + require.Equal(t, "localhost:9090", addr) } configtest.ForEachFileType(path, fileConfigTest) diff --git a/cmd/neofs-node/config/profiler/config_test.go b/cmd/neofs-node/config/profiler/config_test.go index 18eb9fae13..4a773dd14c 100644 --- a/cmd/neofs-node/config/profiler/config_test.go +++ b/cmd/neofs-node/config/profiler/config_test.go @@ -26,7 +26,7 @@ func TestProfilerSection(t *testing.T) { addr := profilerconfig.Address(c) require.Equal(t, 15*time.Second, to) - require.Equal(t, "127.0.0.1:6060", addr) + require.Equal(t, "localhost:6060", addr) } configtest.ForEachFileType(path, fileConfigTest) diff --git a/config/example/ir.env b/config/example/ir.env index 7a7b9c037a..ab86ebc255 100644 --- a/config/example/ir.env +++ b/config/example/ir.env @@ -14,7 +14,7 @@ NEOFS_IR_MAINNET_DIAL_TIMEOUT=5s NEOFS_IR_MORPH_ENDPOINT_CLIENT="wss://mainchain1.fs.neo.org:30333/ws wss://mainchain2.fs.neo.org:30333/ws" NEOFS_IR_CONTROL_AUTHORIZED_KEYS="035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6" -NEOFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:8090 +NEOFS_IR_CONTROL_GRPC_ENDPOINT=localhost:8090 NEOFS_IR_GOVERNANCE_DISABLE=false @@ -82,10 +82,10 @@ NEOFS_IR_CONTRACTS_ALPHABET_DOBRO=e6122b65d45c8feeb04455d67814394c147ed4d1 NEOFS_IR_CONTRACTS_ALPHABET_YEST=cdbca5cb5d48a4472923844d0e3ee6328cf86d38 NEOFS_IR_CONTRACTS_ALPHABET_ZHIVETE=f584699bc2ff457d339fb09f16217042c1a42101 -NEOFS_IR_PROFILER_ADDRESS=127.0.0.1:6060 +NEOFS_IR_PROFILER_ADDRESS=localhost:6060 NEOFS_IR_PROFILER_SHUTDOWN_TIMEOUT=30s -NEOFS_IR_METRICS_ADDRESS=127.0.0.1:9090 +NEOFS_IR_METRICS_ADDRESS=localhost:9090 NEOFS_IR_METRICS_SHUTDOWN_TIMEOUT=30s NEOFS_IR_SETTLEMENT_BASIC_INCOME_RATE=100 diff --git a/config/example/ir.yaml b/config/example/ir.yaml index ddb800ab0b..74b4eb0f25 100644 --- a/config/example/ir.yaml +++ b/config/example/ir.yaml @@ -31,7 +31,7 @@ control: - 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 - 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 grpc: - endpoint: 127.0.0.1:8090 # Endpoint that is listened by the control service; disabled by default + endpoint: localhost:8090 # Endpoint that is listened by the control service; disabled by default governance: disable: false # Disable synchronization of sidechain committee and mainchain role management contract; ignore if mainchain is disabled @@ -124,11 +124,11 @@ contracts: zhivete: f584699bc2ff457d339fb09f16217042c1a42101 # Optional: override address of zhivete contract in sidechain profiler: - address: 127.0.0.1:6060 # Endpoint for application pprof profiling; disabled by default + address: localhost:6060 # Endpoint for application pprof profiling; disabled by default shutdown_timeout: 30s # Timeout for profiling HTTP server graceful shutdown metrics: - address: 127.0.0.1:9090 # Endpoint for application prometheus metrics; disabled by default + address: localhost:9090 # Endpoint for application prometheus metrics; disabled by default shutdown_timeout: 30s # Timeout for metrics HTTP server graceful shutdown settlement: diff --git a/config/example/node.env b/config/example/node.env index ff7281661c..f2492bbf03 100644 --- a/config/example/node.env +++ b/config/example/node.env @@ -1,9 +1,9 @@ NEOFS_LOGGER_LEVEL=debug -NEOFS_PROFILER_ADDRESS=127.0.0.1:6060 +NEOFS_PROFILER_ADDRESS=localhost:6060 NEOFS_PROFILER_SHUTDOWN_TIMEOUT=15s -NEOFS_METRICS_ADDRESS=127.0.0.1:9090 +NEOFS_METRICS_ADDRESS=localhost:9090 NEOFS_METRICS_SHUTDOWN_TIMEOUT=15s # Node section @@ -42,7 +42,7 @@ NEOFS_GRPC_1_TLS_ENABLED=false # Control service section NEOFS_CONTROL_AUTHORIZED_KEYS="035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6" -NEOFS_CONTROL_GRPC_ENDPOINT=127.0.0.1:8090 +NEOFS_CONTROL_GRPC_ENDPOINT=localhost:8090 # Contracts section NEOFS_CONTRACTS_BALANCE=5263abba1abedbf79bb57f3e40b50b4425d2d6cd diff --git a/config/example/node.json b/config/example/node.json index d1a878b99e..6d5cb103a7 100644 --- a/config/example/node.json +++ b/config/example/node.json @@ -3,11 +3,11 @@ "level": "debug" }, "profiler": { - "address": "127.0.0.1:6060", + "address": "localhost:6060", "shutdown_timeout": "15s" }, "metrics": { - "address": "127.0.0.1:9090", + "address": "localhost:9090", "shutdown_timeout": "15s" }, "node": { @@ -79,7 +79,7 @@ "028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6" ], "grpc": { - "endpoint": "127.0.0.1:8090" + "endpoint": "localhost:8090" } }, "contracts": { diff --git a/config/example/node.yaml b/config/example/node.yaml index caac66f47f..311138b368 100644 --- a/config/example/node.yaml +++ b/config/example/node.yaml @@ -2,11 +2,11 @@ logger: level: debug # logger level: one of "debug", "info" (default), "warn", "error", "dpanic", "panic", "fatal" profiler: - address: 127.0.0.1:6060 # endpoint for Node profiling + address: localhost:6060 # endpoint for Node profiling shutdown_timeout: 15s # timeout for profiling HTTP server graceful shutdown metrics: - address: 127.0.0.1:9090 # endpoint for Node metrics + address: localhost:9090 # endpoint for Node metrics shutdown_timeout: 15s # timeout for metrics HTTP server graceful shutdown node: @@ -65,7 +65,7 @@ control: - 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 - 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 grpc: - endpoint: 127.0.0.1:8090 # endpoint that is listened by the Control Service + endpoint: localhost:8090 # endpoint that is listened by the Control Service contracts: # side chain NEOFS contract script hashes; optional, override values retrieved from NNS contract balance: 5263abba1abedbf79bb57f3e40b50b4425d2d6cd diff --git a/config/mainnet/config.yml b/config/mainnet/config.yml index 922545d0f2..be6739a2cc 100644 --- a/config/mainnet/config.yml +++ b/config/mainnet/config.yml @@ -40,7 +40,7 @@ logger: level: info metrics: - address: 127.0.0.1:9090 + address: localhost:9090 shutdown_timeout: 15s object: diff --git a/config/testnet/config.yml b/config/testnet/config.yml index 62d5b06fd8..0697eec85f 100644 --- a/config/testnet/config.yml +++ b/config/testnet/config.yml @@ -24,7 +24,7 @@ node: attribute_1: User-Agent:NeoFS\/0.27 metrics: - address: 127.0.0.1:9090 + address: localhost:9090 shutdown_timeout: 15s storage: diff --git a/config/testnet/node_config.env b/config/testnet/node_config.env index 7d2905b937..1d274fc6f9 100644 --- a/config/testnet/node_config.env +++ b/config/testnet/node_config.env @@ -18,7 +18,7 @@ NEOFS_GRPC_NUM=1 # Specify control service endpoint for node administration. # It must be different from connection port. # Keep control service endpoint private with firewall rules or use localhost. -NEOFS_CONTROL_GRPC_ENDPOINT=127.0.0.1:30512 +NEOFS_CONTROL_GRPC_ENDPOINT=localhost:30512 #https://unece.org/trade/cefact/unlocode-code-list-country-and-territory diff --git a/config/testnet/prometheus.yml b/config/testnet/prometheus.yml index ced799bd60..7b8e99bafb 100644 --- a/config/testnet/prometheus.yml +++ b/config/testnet/prometheus.yml @@ -7,7 +7,7 @@ scrape_configs: - job_name: 'neofs-node-user' scrape_interval: 5s static_configs: - - targets: ['127.0.0.1:9090'] + - targets: ['localhost:9090'] relabel_configs: - target_label: 'instance' replacement: "%{NEOFS_NODE_ADDRESS}"