mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 10:05:21 +00:00
3ff33850a7
* Revert "Revert "CAPI-278: api keys blacklist (#235)" (#237)"
This reverts commit b482abaf0f
.
* Add back blacklists
133 lines
4.6 KiB
Plaintext
133 lines
4.6 KiB
Plaintext
[
|
|
{kernel, [
|
|
{logger_level, info},
|
|
{logger, [
|
|
{handler, default, logger_std_h, #{
|
|
level => debug,
|
|
config => #{
|
|
type => {file, "/var/log/capi/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/capi/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, #{}}
|
|
}}
|
|
]}
|
|
]},
|
|
|
|
{scoper, [
|
|
{storage, scoper_storage_logger}
|
|
]},
|
|
|
|
{capi, [
|
|
{ip, "::"},
|
|
{port, 8080},
|
|
%% To send ASCII text in 5xx replies
|
|
%% {oops_bodies, #{
|
|
%% 500 => "oops_bodies/500_body"
|
|
%% }},
|
|
{reporter_url_lifetime, 60}, % seconds
|
|
{graceful_shutdown_timeout, 5000}, % non_neg_integer() | infinity
|
|
{service_type, real},
|
|
{access_conf, #{
|
|
jwt => #{
|
|
keyset => #{
|
|
capi => {pem_file, "var/keys/capi/private.pem"}
|
|
}
|
|
}
|
|
}},
|
|
{swagger_handler_opts, #{
|
|
validation_opts => #{
|
|
schema => #{
|
|
response => mild
|
|
}
|
|
}
|
|
}},
|
|
{api_key_blacklist, #{
|
|
update_interval => 50000, % milliseconds
|
|
blacklisted_keys_dir => "var/blacklisted_keys"
|
|
}},
|
|
{health_checkers, [
|
|
{erl_health, disk , ["/", 99] },
|
|
{erl_health, cg_memory, [99] },
|
|
{erl_health, service , [<<"capi">>]}
|
|
]},
|
|
{max_request_deadline, 60000}, % milliseconds
|
|
{default_processing_deadline, <<"30m">>},
|
|
{lechiffre_opts, #{
|
|
encryption_key_path => <<"path/to/key1.secret">>,
|
|
decryption_key_paths => [<<"path/to/key1.secret">>]
|
|
}}
|
|
]},
|
|
|
|
{capi_woody_client, [
|
|
{services, #{
|
|
party_management => "http://hellgate:8022/v1/processing/partymgmt",
|
|
customer_management => "http://hellgate:8022/v1/processing/customer_management",
|
|
accounter => "http://shumway:8022/accounter",
|
|
invoicing => "http://hellgate:8022/v1/processing/invoicing",
|
|
invoice_templating => "http://hellgate:8022/v1/processing/invoice_templating",
|
|
webhook_manager => "http://hooker:8022/hook",
|
|
merchant_stat => "http://magista:8022/stat",
|
|
reporting => "http://reporter:8022/reports",
|
|
geo_ip_service => "http://columbus:8022/repo",
|
|
bender => "http://bender:8022/v1/bender"
|
|
}},
|
|
{service_deadlines, #{
|
|
party_management => 5000, % milliseconds
|
|
customer_management => 10000
|
|
}},
|
|
{service_retries, #{
|
|
party_management => #{
|
|
% 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
|
|
'Get' => {linear, 3, 1000},
|
|
'_' => finish
|
|
}
|
|
}}
|
|
]},
|
|
|
|
{dmt_client, [
|
|
{cache_update_interval, 30000}, % milliseconds
|
|
{max_cache_size, #{
|
|
elements => 20,
|
|
memory => 52428800 % 50Mb
|
|
}},
|
|
{service_urls, #{
|
|
'Repository' => <<"dominant:8022/v1/domain/repository">>,
|
|
'RepositoryClient' => <<"dominant:8022/v1/domain/repository_client">>
|
|
}}
|
|
]},
|
|
|
|
{how_are_you, [
|
|
{metrics_publishers, [
|
|
% {hay_statsd_publisher, #{
|
|
% key_prefix => <<"capi-v2.">>,
|
|
% host => "localhost",
|
|
% port => 8125
|
|
% }}
|
|
]}
|
|
]},
|
|
|
|
{snowflake, [
|
|
% {machine_id, 42}
|
|
]}
|
|
].
|