-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
63 lines (53 loc) · 2.3 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import os
from dotenv import load_dotenv
load_dotenv()
# common settings
DEBUG = True
APP_NAMES = ['app_BA', 'app_RTP', 'app_TTP']
PROVIDER_URL = os.getenv('PROVIDER_URL')
LOG_FILES_MAXSIZE = int(os.getenv('LOG_FILES_MAXSIZE'))
# settings Internal DB
INT_DB_NAME = os.getenv('INT_DB_NAME')
INT_DB_USER = os.getenv('INT_DB_USER')
INT_DB_PASSWORD = os.getenv('INT_DB_PASSWORD')
INT_DB_HOST = os.getenv('INT_DB_HOST')
SQLALCHEMY_DB_URI = f'postgresql://{INT_DB_USER}:{INT_DB_PASSWORD}@{INT_DB_HOST}/{INT_DB_NAME}'
# settings External DB ( real
EXT_DB_NAME = os.getenv('EXT_DB_NAME')
EXT_DB_USER = os.getenv('EXT_DB_USER')
EXT_DB_PASSWORD = os.getenv('EXT_DB_PASSWORD')
EXT_DB_HOST = os.getenv('EXT_DB_HOST')
SQLALCHEMY_BINDS = {
'inner_BA_DB': SQLALCHEMY_DB_URI,
'outer_CENTRAL_DB': f'postgresql://{EXT_DB_USER}:{EXT_DB_PASSWORD}@{EXT_DB_HOST}/{EXT_DB_NAME}'
}
# settings TTP
SECRET_KEY_TTP = os.getenv('SECRET_KEY_TTP')
SEND_GAS_MAX_FEE_PER_GAS = int(os.getenv('SEND_GAS_MAX_FEE_PER_GAS'))
SEND_GAS_MAX_PRIORITY_FEE_PER_GAS = int(os.getenv('SEND_GAS_MAX_PRIORITY_FEE_PER_GAS'))
CELERY_BROKER_URL = os.getenv('CELERY_BROKER_URL')
COLD_WALLET = os.getenv('COLD_WALLET')
GAS_KEEPER = os.getenv('GAS_KEEPER')
GAS_KEEPER_PK = os.getenv('GAS_KEEPER_PK')
GAS_KEEPER_ALERT_VALUE = int(os.getenv('GAS_KEEPER_ALERT_VALUE'))
CHECK_GAS_LACK_TASK_FREQUENCY = int(os.getenv('CHECK_GAS_LACK_TASK_FREQUENCY'))
# settings RTP
SECRET_KEY_RTP = os.getenv('SECRET_KEY_RTP')
SLEEP_RETRY_503 = float(os.getenv('SLEEP_RETRY_503'))
# settings BA
SECRET_KEY_BA = os.getenv('SECRET_KEY_RTP') # Похоже, здесь должно быть 'SECRET_KEY_BA'
BLOCK_PACK_PARAMETER = int(os.getenv('BLOCK_PACK_PARAMETER'))
# Настройки для Celery
CELERY_RESULT_BACKEND = os.getenv('CELERY_RESULT_BACKEND')
# settings Redis
REDIS_HOST = os.getenv('REDIS_HOST')
REDIS_PORT = os.getenv('REDIS_PORT')
REDIS_DB = os.getenv('REDIS_DB')
# settings RabbitMQ
RABBITMQ_PROTOCOL = os.getenv('RABBITMQ_PROTOCOL')
RABBITMQ_USERNAME = os.getenv('RABBITMQ_USERNAME')
RABBITMQ_PASSWORD = os.getenv('RABBITMQ_PASSWORD')
RABBITMQ_HOST = os.getenv('RABBITMQ_HOST')
RABBITMQ_PORT = os.getenv('RABBITMQ_PORT')
RABBITMQ_VHOST = os.getenv('RABBITMQ_VHOST')
RABBIT_URL = f'{RABBITMQ_PROTOCOL}{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@{RABBITMQ_HOST}:{RABBITMQ_PORT}/{RABBITMQ_VHOST}'