[#1563] config: Replace 127.0.0.1 with localhost

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-07-13 11:58:10 +03:00 committed by fyrchik
parent 4a8dfd0ce4
commit 12dc5c3395
14 changed files with 26 additions and 26 deletions

View file

@ -41,8 +41,8 @@ const (
) )
const ( const (
defaultControlEndpoint = "127.0.0.1:8090" defaultControlEndpoint = "localhost:8090"
defaultDataEndpoint = "127.0.0.1" defaultDataEndpoint = "localhost"
) )
// RootCmd is a root command of config section. // RootCmd is a root command of config section.

View file

@ -37,10 +37,10 @@ func newConfig(path string) (*viper.Viper, error) {
func defaultConfiguration(cfg *viper.Viper) { func defaultConfiguration(cfg *viper.Viper) {
cfg.SetDefault("logger.level", "info") cfg.SetDefault("logger.level", "info")
cfg.SetDefault("profiler.address", "") cfg.SetDefault("profiler.address", "localhost:9090")
cfg.SetDefault("profiler.shutdown_timeout", "30s") cfg.SetDefault("profiler.shutdown_timeout", "30s")
cfg.SetDefault("metrics.address", "") cfg.SetDefault("metrics.address", "localhost:6060")
cfg.SetDefault("metrics.shutdown_timeout", "30s") cfg.SetDefault("metrics.shutdown_timeout", "30s")
cfg.SetDefault("without_mainnet", false) cfg.SetDefault("without_mainnet", false)

View file

@ -26,7 +26,7 @@ func TestControlSection(t *testing.T) {
var fileConfigTest = func(c *config.Config) { var fileConfigTest = func(c *config.Config) {
require.Equal(t, pubs, controlconfig.AuthorizedKeys(c)) 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) configtest.ForEachFileType(path, fileConfigTest)

View file

@ -26,7 +26,7 @@ func TestMetricsSection(t *testing.T) {
addr := metricsconfig.Address(c) addr := metricsconfig.Address(c)
require.Equal(t, 15*time.Second, to) 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) configtest.ForEachFileType(path, fileConfigTest)

View file

@ -26,7 +26,7 @@ func TestProfilerSection(t *testing.T) {
addr := profilerconfig.Address(c) addr := profilerconfig.Address(c)
require.Equal(t, 15*time.Second, to) 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) configtest.ForEachFileType(path, fileConfigTest)

View file

@ -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_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_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 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_YEST=cdbca5cb5d48a4472923844d0e3ee6328cf86d38
NEOFS_IR_CONTRACTS_ALPHABET_ZHIVETE=f584699bc2ff457d339fb09f16217042c1a42101 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_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_METRICS_SHUTDOWN_TIMEOUT=30s
NEOFS_IR_SETTLEMENT_BASIC_INCOME_RATE=100 NEOFS_IR_SETTLEMENT_BASIC_INCOME_RATE=100

View file

@ -31,7 +31,7 @@ control:
- 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 - 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11
- 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 - 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6
grpc: 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: governance:
disable: false # Disable synchronization of sidechain committee and mainchain role management contract; ignore if mainchain is disabled 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 zhivete: f584699bc2ff457d339fb09f16217042c1a42101 # Optional: override address of zhivete contract in sidechain
profiler: 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 shutdown_timeout: 30s # Timeout for profiling HTTP server graceful shutdown
metrics: 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 shutdown_timeout: 30s # Timeout for metrics HTTP server graceful shutdown
settlement: settlement:

View file

@ -1,9 +1,9 @@
NEOFS_LOGGER_LEVEL=debug NEOFS_LOGGER_LEVEL=debug
NEOFS_PROFILER_ADDRESS=127.0.0.1:6060 NEOFS_PROFILER_ADDRESS=localhost:6060
NEOFS_PROFILER_SHUTDOWN_TIMEOUT=15s NEOFS_PROFILER_SHUTDOWN_TIMEOUT=15s
NEOFS_METRICS_ADDRESS=127.0.0.1:9090 NEOFS_METRICS_ADDRESS=localhost:9090
NEOFS_METRICS_SHUTDOWN_TIMEOUT=15s NEOFS_METRICS_SHUTDOWN_TIMEOUT=15s
# Node section # Node section
@ -42,7 +42,7 @@ NEOFS_GRPC_1_TLS_ENABLED=false
# Control service section # Control service section
NEOFS_CONTROL_AUTHORIZED_KEYS="035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6" NEOFS_CONTROL_AUTHORIZED_KEYS="035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6"
NEOFS_CONTROL_GRPC_ENDPOINT=127.0.0.1:8090 NEOFS_CONTROL_GRPC_ENDPOINT=localhost:8090
# Contracts section # Contracts section
NEOFS_CONTRACTS_BALANCE=5263abba1abedbf79bb57f3e40b50b4425d2d6cd NEOFS_CONTRACTS_BALANCE=5263abba1abedbf79bb57f3e40b50b4425d2d6cd

View file

@ -3,11 +3,11 @@
"level": "debug" "level": "debug"
}, },
"profiler": { "profiler": {
"address": "127.0.0.1:6060", "address": "localhost:6060",
"shutdown_timeout": "15s" "shutdown_timeout": "15s"
}, },
"metrics": { "metrics": {
"address": "127.0.0.1:9090", "address": "localhost:9090",
"shutdown_timeout": "15s" "shutdown_timeout": "15s"
}, },
"node": { "node": {
@ -79,7 +79,7 @@
"028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6" "028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6"
], ],
"grpc": { "grpc": {
"endpoint": "127.0.0.1:8090" "endpoint": "localhost:8090"
} }
}, },
"contracts": { "contracts": {

View file

@ -2,11 +2,11 @@ logger:
level: debug # logger level: one of "debug", "info" (default), "warn", "error", "dpanic", "panic", "fatal" level: debug # logger level: one of "debug", "info" (default), "warn", "error", "dpanic", "panic", "fatal"
profiler: 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 shutdown_timeout: 15s # timeout for profiling HTTP server graceful shutdown
metrics: 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 shutdown_timeout: 15s # timeout for metrics HTTP server graceful shutdown
node: node:
@ -65,7 +65,7 @@ control:
- 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 - 035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11
- 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6 - 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6
grpc: 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 contracts: # side chain NEOFS contract script hashes; optional, override values retrieved from NNS contract
balance: 5263abba1abedbf79bb57f3e40b50b4425d2d6cd balance: 5263abba1abedbf79bb57f3e40b50b4425d2d6cd

View file

@ -40,7 +40,7 @@ logger:
level: info level: info
metrics: metrics:
address: 127.0.0.1:9090 address: localhost:9090
shutdown_timeout: 15s shutdown_timeout: 15s
object: object:

View file

@ -24,7 +24,7 @@ node:
attribute_1: User-Agent:NeoFS\/0.27 attribute_1: User-Agent:NeoFS\/0.27
metrics: metrics:
address: 127.0.0.1:9090 address: localhost:9090
shutdown_timeout: 15s shutdown_timeout: 15s
storage: storage:

View file

@ -18,7 +18,7 @@ NEOFS_GRPC_NUM=1
# Specify control service endpoint for node administration. # Specify control service endpoint for node administration.
# It must be different from connection port. # It must be different from connection port.
# Keep control service endpoint private with firewall rules or use localhost. # 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 #https://unece.org/trade/cefact/unlocode-code-list-country-and-territory

View file

@ -7,7 +7,7 @@ scrape_configs:
- job_name: 'neofs-node-user' - job_name: 'neofs-node-user'
scrape_interval: 5s scrape_interval: 5s
static_configs: static_configs:
- targets: ['127.0.0.1:9090'] - targets: ['localhost:9090']
relabel_configs: relabel_configs:
- target_label: 'instance' - target_label: 'instance'
replacement: "%{NEOFS_NODE_ADDRESS}" replacement: "%{NEOFS_NODE_ADDRESS}"