Skip to content

Commit

Permalink
Refinement and address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate committed Jan 19, 2024
1 parent 98565dc commit 84b8a2e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 42 deletions.
44 changes: 23 additions & 21 deletions config/deployments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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
Expand All @@ -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
Expand All @@ -41,31 +41,32 @@ 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.

The environment-specific `sandbox.toml` file, which contains the Hyperswitch recommended defaults, is merged with the `sandbox_config.toml` file to create the final configuration file called `sandbox_release.toml`. This file is marked as ready for deploying on the sandbox environment.

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

Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions config/deployments/drainer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ key_id = "kms_key_id"
region = "kms_region"

[log.console]
enabled = "true"
enabled = true
level = "DEBUG"
log_format = "json"

Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions config/deployments/env_specific.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -111,7 +111,7 @@ level = "DEBUG"
log_format = "json"

[log.file]
enabled = true
enabled = false
level = "DEBUG"
log_format = "json"

Expand Down Expand Up @@ -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]
Expand Down
6 changes: 0 additions & 6 deletions config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"

Expand Down
3 changes: 0 additions & 3 deletions config/deployments/production.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 0 additions & 3 deletions config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 84b8a2e

Please sign in to comment.