capi-v2/config/sys.config
Jarosław Rogov 8381da653a
ED-282/deps: Migrate to feat for idempotency feats (#578)
* ED-282/deps: Migrate to feat for idempotency feats

* ED-282/ref: Fix dialyzer warning

* ED-282/ref: Fix dialyzer warnings

* ED-282/fix: Remove leftover

* ED-282/ref: Fix legacy module naming

* ED-282/ref: Fix headers module naming

* ED-282/fix: Fix v2 legacy fallback

* ED-282/fix: Fix v2 compativility code

* ED-282/ref: Fix dialyzer and linter warnings

* ED-282/fix: Fix bug and dialyzer warnings

* ED-282/test: Return create_invoice_legacy_fail

* ED-282/ref: Rewrite feat CT reader

Make it simpler and more explicit

* ED-282/ref: Fix formatting

* ED-282/fix: Remove debug leftovers

* ED-282/fix: Fix CT feat reader

* ED-282/test: Fix unused fields

* ED-282/ref: Refactor capi_bender

* ED-282/ref: Refactor arg naming in capi_bender

* ED-282/fix: Fix capi_bender list_diff for legacy

* ED-282/test: Add success test and fix impl

* ED-282/fix: Fix types for consistency

* ED-282/ref: Tweak elvis to ignore idemp tests

* ED-282/ref: Simplify capi_bender API

* ED-282/deps: Switch capi_bender to bender_client

* ED-282/ref: Remove direct bender call leftovers

* ED-282/fix: Return spec for get_context_data

* ED-282/ref: Rename bender capi namespace const

* ED-282/ref: Remove leftover

* ED-282/ref: Remove read_schema redundant clauses

* ED-282/ref: Rename bender namespace var

* ED-282/ref: Remove leftovers and fix formatting
2021-11-02 15:24:00 +03:00

216 lines
7.1 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
{bouncer_ruleset_id, <<"service/authz/api">>},
{access_conf, #{
jwt => #{
keyset => #{
capi => #{
source => {pem_file, "var/keys/capi/private.pem"},
metadata => #{
auth_method => user_session_token,
user_realm => <<"external">>
}
}
}
}
}},
{swagger_handler_opts, #{
validation_opts => #{
schema => #{
response => mild
}
}
}},
{health_check, #{
disk => {erl_health, disk , ["/", 99]},
memory => {erl_health, cg_memory, [99]},
service => {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">>]
}},
{auth_config, #{
metadata_mappings => #{
party_id => <<"test.rbkmoney.party.id">>,
token_consumer => <<"test.rbkmoney.capi.consumer">>,
user_id => <<"test.rbkmoney.user.id">>,
user_email => <<"test.rbkmoney.user.email">>
}
}}
]},
{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">>,
payouts => <<"http://payouter:8022/reports">>,
geo_ip_service => <<"http://columbus:8022/repo">>
}},
{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">>
}}
]},
{party_client, [
{services, #{
'party_management' => "http://hellgate:8022/v1/processing/partymgmt"
}},
{woody, #{
cache_mode => safe, % disabled | safe | aggressive
options => #{
woody_client => #{
event_handler => {scoper_woody_event_handler, #{
event_handler_opts => #{
formatter_opts => #{
max_length => 1000
}
}
}}
}
},
%retries => #{
% 'GetRevision' => finish,
% '_' => finish
%},
deadline_timeout => 60000
}}
]},
{bender_client, [
{services, #{
'Bender' => <<"http://bender:8022/v1/bender">>,
'Generator' => <<"http://bender:8022/v1/generator">>
}},
{deadline, 60000}
%{retries, #{
% 'GenerateID' => finish,
% 'GetInternalID' => finish,
% '_' => finish
%}}
]},
{bouncer_client, [
{service_clients, #{
bouncer => #{
url => <<"http://bouncer:8022/">>,
timeout => 500,
retries => #{
'Judge' => {linear, 1, 100},
'_' => finish
}
},
org_management => #{
url => <<"http://orgmgmt:8022/">>,
retries => #{
'GetUserContext' => {linear, 2, 500},
'_' => finish
}
}
}}
]},
{token_keeper_client, [
{service_client, #{
url => <<"http://token-keeper:8022/">>,
timeout => 1000,
retries => #{
'GetByToken' => {linear, 3, 100},
'_' => finish
}
}}
]},
{how_are_you, [
{metrics_publishers, [
% {hay_statsd_publisher, #{
% key_prefix => <<"capi-v2.">>,
% host => "localhost",
% port => 8125
% }}
]}
]},
{snowflake, [
% {machine_id, 42}
]},
{prometheus, [
{collectors, [default]}
]}
].