mirror of
https://github.com/valitydev/url-shortener.git
synced 2024-11-06 10:05:20 +00:00
102 lines
3.7 KiB
Plaintext
102 lines
3.7 KiB
Plaintext
[
|
|
{scoper, [
|
|
{storage, scoper_storage_logger}
|
|
]},
|
|
|
|
{shortener, [
|
|
{bouncer_ruleset_id , <<"service/authz/api">>},
|
|
{space_size , 8},
|
|
{hash_algorithm , sha256},
|
|
{api, #{
|
|
ip => "::",
|
|
port => 8080,
|
|
authorizer => #{
|
|
keyset => #{}
|
|
},
|
|
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">>]}
|
|
]}
|
|
]},
|
|
{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]}
|
|
]}
|
|
|
|
].
|