From 84b8a2e3d7b660f97d07b5f177953a2c945cdbd7 Mon Sep 17 00:00:00 2001 From: "PiX@work" <69745008+pixincreate@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:19:53 +0530 Subject: [PATCH] Refinement and address comments --- config/deployments/README.md | 44 +++++++++++++----------- config/deployments/drainer.toml | 6 ++-- config/deployments/env_specific.toml | 12 +++---- config/deployments/integration_test.toml | 6 ---- config/deployments/production.toml | 3 -- config/deployments/sandbox.toml | 3 -- 6 files changed, 32 insertions(+), 42 deletions(-) diff --git a/config/deployments/README.md b/config/deployments/README.md index bcebdebea78..2bf2924384f 100644 --- a/config/deployments/README.md +++ b/config/deployments/README.md @@ -2,7 +2,7 @@ ## Introduction -This directory contains the configs for deployments of hyperswitch in different hosted environments. +This directory contains the configs for deployments of Hyperswitch in different hosted environments. Hyperswitch has **3** components namely, @@ -12,7 +12,7 @@ Hyperswitch has **3** components namely, - consumer - producer -Hyperswitch maintains 3 different environments for deployments under the `router` component, namely, +We maintain configs for the `router` component for 3 different environments, namely, - Integration Test - Sandbox @@ -27,7 +27,7 @@ config/deployments # Root directory for the deployment configs ├── README.md # This file ├── drainer.toml # Config specific to drainer ├── env_specific.toml # Config for environment specific values which are meant to be sensitive (to be set by the user) -├── integ.toml # Config specific to integration_test environment +├── integration_test.toml # Config specific to integration_test environment ├── production.toml # Config specific to production environment ├── sandbox.toml # Config specific to sandbox environment └── scheduler # Directory for scheduler configs @@ -41,7 +41,7 @@ The `integration_test.toml`, `sandbox.toml`, and `production.toml` files are con ### Generating a Config File for the Router -The `env_specific.toml` file contains values that are specific to the environment. This file is kept separate because the values in it are sensitive and are meant to be set by the user. The `env_specific.toml` file is merged with the `integ.toml`, `sandbox.toml`, or `production.toml` file to create the final configuration file for the router. +The `env_specific.toml` file contains values that are specific to the environment. This file is kept separate because the values in it are sensitive and are meant to be set by the user. The `env_specific.toml` file is merged with the `integration_test.toml`, `sandbox.toml`, or `production.toml` file to create the final configuration file for the router. For example, to build and deploy Hyperswitch in the **sandbox environment**, you can duplicate the `env_specific.toml` file and rename it as `sandbox_config.toml`. Then, update the values in the file with the proper values for the sandbox environment. @@ -49,23 +49,24 @@ The environment-specific `sandbox.toml` file, which contains the Hyperswitch rec 1. Duplicate the `env_specific.toml` file and rename it as `sandbox_config.toml`: -```shell -cp config/deployments/env_specific.toml config/deployments/sandbox_config.toml -``` + ```shell + cp config/deployments/env_specific.toml config/deployments/sandbox_config.toml + ``` 2. Update the values in the `sandbox_config.toml` file with the proper values for the sandbox environment: -```shell -vi config/deployments/sandbox_config.toml -``` + ```shell + vi config/deployments/sandbox_config.toml + ``` 3. To merge the files you can use `cat`: -```shell -cat config/deployments/sandbox.toml config/deployments/sandbox_config.toml > config/deployments/sandbox_release.toml -``` + ```shell + cat config/deployments/sandbox.toml config/deployments/sandbox_config.toml > config/deployments/sandbox_release.toml + ``` -> Note: You can refer to the [`config.example.toml`][config_example] file to understand the variables that used are in the `env_specific.toml` file. +> [!NOTE] +> You can refer to the [`config.example.toml`][config_example] file to understand the variables that used are in the `env_specific.toml` file. ## Scheduler @@ -81,15 +82,15 @@ You can use `cat` to merge the files in the terminal. - Below is an example for consumer in sandbox environment: -```shell -cat config/deployments/scheduler/consumer.toml config/deployments/sandbox_release.toml > config/deployments/consumer_sandbox_release.toml -``` + ```shell + cat config/deployments/scheduler/consumer.toml config/deployments/sandbox_release.toml > config/deployments/consumer_sandbox_release.toml + ``` -Below is an example for producer in sandbox environment: +- Below is an example for producer in sandbox environment: -```shell -cat config/deployments/scheduler/producer.toml config/deployments/sandbox_release.toml > config/deployments/producer_sandbox_release.toml -``` + ```shell + cat config/deployments/scheduler/producer.toml config/deployments/sandbox_release.toml > config/deployments/producer_sandbox_release.toml + ``` ## Drainer @@ -144,6 +145,7 @@ hyperswitch-drainer: - ./config:/local/config ``` +> [!NOTE] > You can replace the term `sandbox` with the environment name that you are deploying to (e.g., `production`, `integration_test`, etc.) with respective changes (optional) and use the same steps to generate the final configuration file for the environment. You can verify that the server is up and running by hitting the health check endpoint: diff --git a/config/deployments/drainer.toml b/config/deployments/drainer.toml index f53f88ea480..42c89cbfd58 100644 --- a/config/deployments/drainer.toml +++ b/config/deployments/drainer.toml @@ -10,7 +10,7 @@ key_id = "kms_key_id" region = "kms_region" [log.console] -enabled = "true" +enabled = true level = "DEBUG" log_format = "json" @@ -20,7 +20,7 @@ otel_exporter_otlp_endpoint = "http://localhost:4317" [master_database] dbname = "master_database_name" -host = "http://localhost:4000" +host = "localhost" password = "master_database_password" pool_size = 3 port = 5432 @@ -30,7 +30,7 @@ username = "username" cluster_enabled = false cluster_urls = ["redis.cluster.uri-1:8080", "redis.cluster.uri-2:4115"] # List of redis cluster urls default_ttl = 300 -host = "http://localhost:4000" +host = "localhost" pool_size = 5 port = 6379 reconnect_delay = 5 diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml index 29ac014b513..69cea8c6e71 100644 --- a/config/deployments/env_specific.toml +++ b/config/deployments/env_specific.toml @@ -21,8 +21,8 @@ connection_timeout = 10 # Timeout for database connection in seconds queue_strategy = "Fifo" # Add the queue strategy used by the database bb8 client [api_keys] -# Base64-encoded (KMS encrypted) ciphertext of the API key hashing key -kms_encrypted_hash_key = "" +kms_encrypted_hash_key = "base64_encoded_ciphertext" # Base64-encoded (KMS encrypted) ciphertext of the API key hashing key +hash_key = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" # API key hashing key. Only applicable when KMS is disabled. [applepay_decrypt_keys] apple_pay_ppc = "APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE" # Payment Processing Certificate provided by Apple Pay (https://developer.apple.com/) Certificates, Identifiers & Profiles > Apple Pay Payment Processing Certificate @@ -37,9 +37,9 @@ merchant_cert_key = "apple_pay_merchant_certificate_key" applepay_endpoint = "https://apple-pay-gateway.apple.com/paymentservices/registerMerchant" [connector_onboarding.paypal] +enabled = true # boolean client_id = "paypal_client_id" client_secret = "paypal_client_secret" -enabled = true # boolean partner_id = "paypal_partner_id" [connector_request_reference_id_config] @@ -111,7 +111,7 @@ level = "DEBUG" log_format = "json" [log.file] -enabled = true +enabled = false level = "DEBUG" log_format = "json" @@ -149,8 +149,8 @@ pm_auth_key = "pm_auth_key" # Payment method auth key used for authorization redis_expiry = 900 # Redis expiry time in milliseconds [proxy] -http_url = "http://proxy_http_url" # Outgoing proxy http URL used by SES for sending emails since SES isn't accessible inside the VPC -https_url = "https://proxy_https_url" # Outgoing proxy https URL used by SES for sending emails since SES isn't accessible inside the VPC +http_url = "http://proxy_http_url" # Outgoing proxy http URL to proxy the http traffic which is also used by SES for sending emails +https_url = "https://proxy_https_url" # Outgoing proxy https URL to proxy the http traffic which is also used by SES for sending emails # Redis credentials [redis] diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index e8739cc91bc..4a858588b50 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -1,6 +1,3 @@ -[log.file] -enabled = false - [bank_config] eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_tirol_bank_ag,posojilnica_bank_e_gen,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag" eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" @@ -107,9 +104,6 @@ enabled = true connector_list = "gocardless,stax,stripe" payout_connector_list = "wise" -[connector_request_reference_id_config] -merchant_ids_send_payment_id_as_connector_request_id = [] - [delayed_session_response] connectors_with_delayed_session_response = "trustpay,payme" diff --git a/config/deployments/production.toml b/config/deployments/production.toml index fae064a62a6..376ae579a50 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -1,6 +1,3 @@ -[log.file] -enabled = false - [bank_config] eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_tirol_bank_ag,posojilnica_bank_e_gen,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag" eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index 85bcdcfe7f7..01616f3ecd0 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -1,6 +1,3 @@ -[log.file] -enabled = false - [bank_config] eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_tirol_bank_ag,posojilnica_bank_e_gen,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag" eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau"