From 1659a76b5dd5fb49ddd985264b7ba4a4f5750a6d Mon Sep 17 00:00:00 2001
From: Pavel Karpy
Date: Thu, 24 Nov 2022 20:27:29 +0300
Subject: [PATCH] [#241] s3: Provide common params with `.yml` file
Signed-off-by: Pavel Karpy
---
services/s3_gate/.s3.env | 10 ----------
services/s3_gate/cfg/config.yml | 31 +++++++++++++++++++++++++++++
services/s3_gate/docker-compose.yml | 6 ++----
3 files changed, 33 insertions(+), 14 deletions(-)
create mode 100644 services/s3_gate/cfg/config.yml
diff --git a/services/s3_gate/.s3.env b/services/s3_gate/.s3.env
index e89578a..e69de29 100644
--- a/services/s3_gate/.s3.env
+++ b/services/s3_gate/.s3.env
@@ -1,10 +0,0 @@
-S3_GW_REBALANCE_INTERVAL=30s
-S3_GW_HEALTHCHECK_TIMEOUT=15s
-S3_GW_CONNECT_TIMEOUT=10s
-
-S3_GW_LOGGER_LEVEL=debug
-
-S3_GW_MAX_CLIENTS_COUNT=100
-S3_GW_MAX_CLIENTS_DEADLINE=30s
-
-S3_GW_RESOLVE_ORDER=nns
diff --git a/services/s3_gate/cfg/config.yml b/services/s3_gate/cfg/config.yml
new file mode 100644
index 0000000..374e4be
--- /dev/null
+++ b/services/s3_gate/cfg/config.yml
@@ -0,0 +1,31 @@
+logger:
+ level: debug
+
+# Interval to check node health
+rebalance_interval: 30s
+
+# Timeout to check node health during rebalance
+healthcheck_timeout: 15s
+
+# Timeout to connect to a node
+connect_timeout: 10s
+
+# Limits for processing of clients' requests
+max_clients_count: 100
+
+# Deadline after which the gate sends error `RequestTimeout` to a client
+max_clients_deadline: 30s
+
+resolve_order:
+ - nns
+
+server:
+ - tls:
+ enabled: true
+ cert_file: /tls.crt
+ key_file: /tls.key
+
+# Wallet configuration
+wallet:
+ path: /wallet.json # Path to wallet
+ passphrase: "s3" # Passphrase to decrypt wallet
diff --git a/services/s3_gate/docker-compose.yml b/services/s3_gate/docker-compose.yml
index 8dd9606..f86caf5 100644
--- a/services/s3_gate/docker-compose.yml
+++ b/services/s3_gate/docker-compose.yml
@@ -17,14 +17,12 @@ services:
- ./tls.key:/tls.key
- ./tls.crt:/tls.crt
- ./../../vendor/hosts:/etc/hosts
+ - ./cfg:/etc/frostfs/s3
stop_signal: SIGKILL
env_file: [ ".env", ".s3.env", ".int_test.env" ]
+ command: [ "frostfs-s3-gw", "--config", "/etc/frostfs/s3/config.yml" ]
environment:
- - S3_GW_WALLET_PATH=/wallet.json
- - S3_GW_WALLET_PASSPHRASE=s3
- S3_GW_RPC_ENDPOINT=http://morph-chain.${LOCAL_DOMAIN}:30333
- - S3_GW_SERVER_0_TLS_KEY_FILE=/tls.key
- - S3_GW_SERVER_0_TLS_CERT_FILE=/tls.crt
- S3_GW_SERVER_0_ADDRESS=s3.${LOCAL_DOMAIN}:8080
- S3_GW_LISTEN_DOMAINS=s3.${LOCAL_DOMAIN}
- S3_GW_TREE_SERVICE=s01.${LOCAL_DOMAIN}:8080