feat: configure mailservices domains in CSRF origins, robust secrets handling, and remote DB host
Some checks failed
Deploy Beta (NATIVE) / deploy (push) Failing after 3s

This commit is contained in:
vickytechkey 2026-09-13 10:40:59 +05:30
parent fc47bbb1e7
commit f726078ac2
3 changed files with 10 additions and 5 deletions

View file

@ -78,7 +78,7 @@ jobs:
echo "DEBUG=0" > .env
echo "DB_USER=vignesh" >> .env
echo "DB_PASSWORD=vtechnosoft@123A" >> .env
echo "DB_HOST=127.0.0.1" >> .env
echo "DB_HOST=16.113.106.152" >> .env
echo "DB_PORT=5432" >> .env
# ── 6. Run Database Migrations ─────────────────────────────────

View file

@ -78,7 +78,7 @@ jobs:
echo "DEBUG=0" > .env
echo "DB_USER=vignesh" >> .env
echo "DB_PASSWORD=vtechnosoft@123A" >> .env
echo "DB_HOST=127.0.0.1" >> .env
echo "DB_HOST=16.113.106.152" >> .env
echo "DB_PORT=5432" >> .env
# ── 6. Run Database Migrations ─────────────────────────────────

View file

@ -30,7 +30,12 @@ DEBUG = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['*']
CSRF_TRUSTED_ORIGINS = ['https://ec2-16-113-57-127.ap-south-2.compute.amazonaws.com:9002', 'https://*.amazonaws.com']
CSRF_TRUSTED_ORIGINS = [
'https://ec2-16-113-57-127.ap-south-2.compute.amazonaws.com:9002',
'https://*.amazonaws.com',
'https://mailservices.tradhox.com',
'https://beta-mailservices.tradhox.com',
]
# Application definition
@ -95,7 +100,7 @@ else:
'NAME': db_secret.get('database', 'emailservice'),
'USER': db_secret.get('username', 'vignesh'),
'PASSWORD': db_secret.get('password', ''),
'HOST': db_secret.get('host', '127.0.0.1'),
'HOST': os.environ.get('DB_HOST', db_secret.get('host', '16.113.106.152')),
'PORT': db_secret.get('port', '5432'),
}
}
@ -150,7 +155,7 @@ email_secret = get_secret("arn:aws:secretsmanager:ap-south-2:764709663363:secret
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = email_secret.get('smtp')
EMAIL_PORT = int(email_secret.get('smtp_port'))
EMAIL_PORT = int(email_secret.get('smtp_port', 465) or 465)
EMAIL_USE_SSL = True
EMAIL_HOST_USER = email_secret.get('username')
EMAIL_HOST_PASSWORD = email_secret.get('password')