configs from env updated

This commit is contained in:
berkay 2025-03-25 11:26:23 +03:00
parent 7e41e09289
commit d95a369370
5 changed files with 54 additions and 23 deletions

View File

@ -1,12 +1,32 @@
import os
from ApiLayers.AllConfigs import HostConfig from ApiLayers.AllConfigs import HostConfig
class Config:
MAILBOX: str = os.getenv('MAILBOX', "bilgilendirme@ileti.isbank.com.tr")
MAIN_MAIL: str = os.getenv('MAIN_MAIL', "karatay.berkay@gmail.com")
INFO_MAIL: str = os.getenv('INFO_MAIL', "mehmet.karatay@hotmail.com")
EMAIL_HOST: str = os.getenv('EMAIL_HOST', "10.10.2.34")
EMAIL_SENDER_USERNAME: str = os.getenv('EMAIL_SENDER_USERNAME', "karatay@mehmetkaratay.com.tr")
EMAIL_USERNAME: str = os.getenv('EMAIL_USERNAME', "isbank@mehmetkaratay.com.tr")
EMAIL_PASSWORD: str = os.getenv('EMAIL_PASSWORD', "system")
AUTHORIZE_IBAN: str = os.getenv('AUTHORIZE_IBAN', "4245-0093333")
SERVICE_TIMING: int = int(os.getenv('SERVICE_TIMING', 900))
EMAIL_PORT: int = int(os.getenv('EMAIL_PORT', 993))
EMAIL_SEND_PORT: int = int(os.getenv('EMAIL_SEND_PORT', 587))
EMAIL_SLEEP: int = int(os.getenv('EMAIL_SLEEP', 60))
EMAIL_SEND: bool = bool(os.getenv('EMAIL_SEND', False))
class EmailConfig: class EmailConfig:
EMAIL_HOST: str = HostConfig.EMAIL_HOST EMAIL_HOST: str = HostConfig.EMAIL_HOST
EMAIL_USERNAME: str = "karatay@mehmetkaratay.com.tr" EMAIL_USERNAME: str = Config.EMAIL_SENDER_USERNAME
EMAIL_PASSWORD: str = "system" EMAIL_PASSWORD: str = Config.EMAIL_PASSWORD
EMAIL_PORT: int = 587 EMAIL_PORT: int = Config.EMAIL_SEND_PORT
EMAIL_SEND: bool = False EMAIL_SEND: bool = Config.EMAIL_SEND
@classmethod @classmethod
def as_dict(cls): def as_dict(cls):
@ -16,19 +36,3 @@ class EmailConfig:
username=EmailConfig.EMAIL_USERNAME, username=EmailConfig.EMAIL_USERNAME,
password=EmailConfig.EMAIL_PASSWORD, password=EmailConfig.EMAIL_PASSWORD,
) )
class Config:
SERVICE_TIMING: int = 900 # 15 min
MAILBOX: str = "bilgilendirme@ileti.isbank.com.tr"
MAIN_MAIL: str = "karatay.berkay@gmail.com"
INFO_MAIL = "mehmet.karatay@hotmail.com"
EMAIL_HOST: str = "10.10.2.34"
# EMAIL_USERNAME: str = "karatay@mehmetkaratay.com.tr"
EMAIL_USERNAME: str = "isbank@mehmetkaratay.com.tr"
EMAIL_PORT: int = 993
EMAIL_PASSWORD: str = "system"
EMAIL_SLEEP: int = 60
AUTHORIZE_IBAN: str = "4245-0093333"

View File

@ -1,6 +1,9 @@
class HostConfig: class HostConfig:
MAIN_HOST = "10.10.2.36" # http://10.10.2.36
EMAIL_HOST = "10.10.2.34" # http://10.10.2.34 MAIN_HOST = "10.10.2.36" # http://10.10.2.36 Database and other services
EMAIL_HOST = "10.10.2.34" # http://10.10.2.34 Email service
class MainConfig: class MainConfig:

View File

@ -2,7 +2,7 @@ import time
import arrow import arrow
from typing import TypeVar from typing import TypeVar
from config import Config from ApiLayers.AllConfigs.Email.configs import Config
from redbox import EmailBox from redbox import EmailBox
from redbox.query import FROM, UNSEEN, OR from redbox.query import FROM, UNSEEN, OR

View File

@ -58,6 +58,8 @@ services:
dockerfile: BankServices/EmailService/Dockerfile dockerfile: BankServices/EmailService/Dockerfile
networks: networks:
- network_store_services - network_store_services
env_file:
- email.env
parser_service: parser_service:
container_name: parser_service container_name: parser_service
@ -66,6 +68,8 @@ services:
dockerfile: BankServices/ParserService/Dockerfile dockerfile: BankServices/ParserService/Dockerfile
networks: networks:
- network_store_services - network_store_services
env_file:
- email.env
writer_service: writer_service:
container_name: writer_service container_name: writer_service
@ -74,6 +78,8 @@ services:
dockerfile: BankServices/WriterService/Dockerfile dockerfile: BankServices/WriterService/Dockerfile
networks: networks:
- network_store_services - network_store_services
env_file:
- email.env
routine_email_service: routine_email_service:
container_name: routine_email_service container_name: routine_email_service
@ -82,6 +88,8 @@ services:
dockerfile: BankServices/RoutineEmailService/Dockerfile dockerfile: BankServices/RoutineEmailService/Dockerfile
networks: networks:
- network_store_services - network_store_services
env_file:
- email.env
sender_service: sender_service:
container_name: sender_service container_name: sender_service
@ -90,6 +98,8 @@ services:
dockerfile: BankServices/SenderService/Dockerfile dockerfile: BankServices/SenderService/Dockerfile
networks: networks:
- network_store_services - network_store_services
env_file:
- email.env
# initservice: # initservice:
# container_name: initservice # container_name: initservice

14
email.env Normal file
View File

@ -0,0 +1,14 @@
SERVICE_TIMING=900
AUTHORIZE_IBAN=4245-0093333
MAILBOX=bilgilendirme@ileti.isbank.com.tr
MAIN_MAIL=karatay.berkay@gmail.com
INFO_MAIL=mehmet.karatay@hotmail.com
EMAIL_HOST=10.10.2.34
EMAIL_PROVIDER_HOST=10.10.2.36
EMAIL_USERNAME=isbank@mehmetkaratay.com.tr
EMAIL_PORT=993
EMAIL_SEND_PORT=587
EMAIL_PASSWORD=system
EMAIL_SLEEP=60
EMAIL_SENDER_USERNAME=karatay@mehmetkaratay.com.tr
EMAIL_SEND=False