From d7a615b8eae33faae5673d3e585fc7dd9c5e8db6 Mon Sep 17 00:00:00 2001 From: YuehuCao Date: Wed, 20 Aug 2025 00:35:59 +0800 Subject: [PATCH 1/2] chore(config): remove redundant environment configs --- apps/notification/tests/alpha.env | 33 ------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 apps/notification/tests/alpha.env diff --git a/apps/notification/tests/alpha.env b/apps/notification/tests/alpha.env deleted file mode 100644 index 5f2a539..0000000 --- a/apps/notification/tests/alpha.env +++ /dev/null @@ -1,33 +0,0 @@ -export APP_NAME=notification -export SERVICE_API_ACCESS_HOST=0.0.0.0 -export SERVICE_API_ACCESS_PORT=8014 -export CONTAINER_APP_ROOT=/app -export LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME -export BACKEND_LOG_FILE_NAME=$APP_NAME -export APPLICATION_ACTIVITY_LOG=$APP_NAME-activity -export SENDGRID_API_KEY=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 -export EMAIL_FROM=freeleaps@freeleaps.com -export TWILIO_ACCOUNT_SID=ACf8c9283a6acda060258eadb29be58bc8 -export TWILIO_AUTH_TOKEN=ef160748cc22c8b7195b49df4b8eca7e -export SYSTEM_USER_ID=117f191e810c19729de860aa -export SMS_FROM=+16898887156 -export EMAIL_FROM=freeleaps@freeleaps.com -export SECRET_KEY=ea84edf152976b2fcec12b78aa8e45bc26a5cf0ef61bf16f5c317ae33b3fd8b0 -export GIT_REPO_ROOT=/mnt/freeleaps/freeleaps-service-hub -export CODEBASE_ROOT=/mnt/freeleaps/freeleaps-service-hub/apps/notification -export SITE_DEPLOY_FOLDER=/mnt/freeleaps/freeleaps-service-hub/sites/notification/deploy -#!/bin/bash -export VENV_DIR=venv_t -export VENV_ACTIVATE=venv_t/bin/activate -export DOCKER_HOME=/var/lib/docker -export DOCKER_APP_HOME=$DOCKER_HOME/app -export DOCKER_BACKEND_HOME=$DOCKER_APP_HOME/$APP_NAME -export DOCKER_BACKEND_LOG_HOME=$DOCKER_BACKEND_HOME/log -export RABBITMQ_HOST=localhost -export RABBITMQ_PORT=5672 -#export MONGODB_URI="mongodb://localhost:27017/" -#export MONGODB_NAME="interview" -export MONGODB_URI="mongodb+srv://jetli:8IHKx6dZK8BfugGp@freeleaps2.hanbj.mongodb.net/" -export MONGODB_NAME="interview" -export FREELEAPS_ENV=alpha -export LOG_BASE_PATH=./log From 8a5343156c733ca2b2b5bd729436c484585b54c7 Mon Sep 17 00:00:00 2001 From: YuehuCao Date: Thu, 28 Aug 2025 16:23:57 +0800 Subject: [PATCH 2/2] feat(email): remove rate limit functionality --- .../backend/business/tenant_notification_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/notification/backend/business/tenant_notification_manager.py b/apps/notification/backend/business/tenant_notification_manager.py index 0353faf..7a7c667 100644 --- a/apps/notification/backend/business/tenant_notification_manager.py +++ b/apps/notification/backend/business/tenant_notification_manager.py @@ -58,9 +58,9 @@ class TenantNotificationManager: raise InvalidDataError("All recipient emails are blacklisted") # 3. check rate limit - rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email) - if not rate_limit_result["allowed"]: - raise InvalidDataError("Rate limit exceeded") + #rate_limit_result = await self.email_spam_protection_service.check_rate_limit(tenant_id, sender_email) + #if not rate_limit_result["allowed"]: + #raise InvalidDataError("Rate limit exceeded") # 4. spam detection with region email_content = { @@ -89,7 +89,7 @@ class TenantNotificationManager: "invalid_recipients": invalid_recipients, "invalid_sender": not valid_sender, "blacklisted_recipients": blacklisted_recipients, - "rate_limit_info": rate_limit_result, + #"rate_limit_info": rate_limit_result, "spam_detection_info": spam_result } } @@ -114,7 +114,7 @@ class TenantNotificationManager: "invalid_recipients": invalid_recipients, "invalid_sender": not valid_sender, "blacklisted_recipients": blacklisted_recipients, - "rate_limit_info": rate_limit_result, + #"rate_limit_info": rate_limit_result, "spam_detection_info": spam_result } }