mirror of
https://github.com/valitydev/url-shortener.git
synced 2024-11-06 01:55:19 +00:00
115 lines
3.8 KiB
Plaintext
115 lines
3.8 KiB
Plaintext
[
|
|
{scoper, [
|
|
{storage, scoper_storage_logger}
|
|
]},
|
|
|
|
{shortener, [
|
|
{bouncer_ruleset_id, <<"service/authz/api">>},
|
|
{space_size, 8},
|
|
{hash_algorithm, sha256},
|
|
{api, #{
|
|
ip => "::",
|
|
port => 8080,
|
|
short_url_template => #{
|
|
scheme => https,
|
|
netloc => "rbk.mn",
|
|
path => "/"
|
|
},
|
|
source_url_whitelist => [
|
|
"https://*"
|
|
]
|
|
}},
|
|
{processor, #{
|
|
ip => "::",
|
|
port => 8022,
|
|
protocol_opts => #{
|
|
request_timeout => 60000
|
|
}
|
|
}},
|
|
{service_clients, #{
|
|
automaton => #{
|
|
url => <<"http://machinegun:8022/v1/automaton">>,
|
|
retries => #{
|
|
% function => retry strategy
|
|
% '_' work as "any"
|
|
% default value is 'finish'
|
|
% for more info look genlib_retry :: strategy()
|
|
% https://github.com/rbkmoney/genlib/blob/master/src/genlib_retry.erl#L19
|
|
'Start' => {linear, 3, 1000},
|
|
'GetMachine' => {linear, 3, 1000},
|
|
'Remove' => {linear, 3, 1000},
|
|
'_' => finish
|
|
}
|
|
},
|
|
bouncer => #{
|
|
url => <<"http://bouncer:8022/">>,
|
|
retries => #{
|
|
% function => retry strategy
|
|
% '_' work as "any"
|
|
% default value is 'finish'
|
|
% for more info look genlib_retry :: strategy()
|
|
% https://github.com/rbkmoney/genlib/blob/master/src/genlib_retry.erl#L19
|
|
'Judge' => {linear, 3, 1000},
|
|
'_' => finish
|
|
}
|
|
}
|
|
}},
|
|
{health_checkers, [
|
|
{erl_health, disk, ["/", 99]},
|
|
{erl_health, cg_memory, [99]},
|
|
{erl_health, service, [<<"shortener">>]}
|
|
]},
|
|
{auth_config, #{
|
|
metadata_mappings => #{
|
|
party_id => <<"dev.vality.party.id">>,
|
|
user_id => <<"dev.vality.user.id">>,
|
|
user_email => <<"dev.vality.user.email">>
|
|
}
|
|
}}
|
|
]},
|
|
{kernel, [
|
|
{logger_level, info},
|
|
{logger, [
|
|
{handler, default, logger_std_h, #{
|
|
level => debug,
|
|
config => #{
|
|
type => file,
|
|
file => "/var/log/shortener/console.json",
|
|
sync_mode_qlen => 20,
|
|
burst_limit_enable => true,
|
|
burst_limit_max_count => 600,
|
|
burst_limit_window_time => 1000
|
|
},
|
|
filters => [{access_log, {fun logger_filters:domain/2, {stop, equal, [cowboy_access_log]}}}],
|
|
formatter => {logger_logstash_formatter, #{}}
|
|
}},
|
|
{handler, access_logger, logger_std_h, #{
|
|
level => info,
|
|
config => #{
|
|
type => {file, "/var/log/shortener/access_log.json"},
|
|
sync_mode_qlen => 20,
|
|
burst_limit_enable => true,
|
|
burst_limit_max_count => 600,
|
|
burst_limit_window_time => 1000
|
|
},
|
|
filters => [{access_log, {fun logger_filters:domain/2, {stop, not_equal, [cowboy_access_log]}}}],
|
|
formatter => {logger_logstash_formatter, #{}}
|
|
}}
|
|
]}
|
|
]},
|
|
|
|
{prometheus, [
|
|
{collectors, [default]}
|
|
]},
|
|
|
|
{how_are_you, [
|
|
{metrics_publishers, [
|
|
% {hay_statsd_publisher, #{
|
|
% key_prefix => <<"shortener.">>,
|
|
% host => "localhost",
|
|
% port => 8125
|
|
% }}
|
|
]}
|
|
]}
|
|
].
|