Skip to content

fix(security): replace hardcoded credentials with .env variables - #66

Open
jasonjose007 wants to merge 1 commit into
Vaibhav2154:mainfrom
jasonjose007:fix/issue-59-env-secret-management
Open

jasonjose007 wants to merge 1 commit into
Vaibhav2154:mainfrom
jasonjose007:fix/issue-59-env-secret-management

Conversation

@jasonjose007

Copy link
Copy Markdown

Summary

  • scripts/automation/1.py had an email address hardcoded in source and expected the password to be pasted directly into the file
  • scripts/automation/auto_email_sender.py fell back to empty credentials when no JSON config file existed, with no guidance on where to put them
  • Both scripts now use python-dotenv to load credentials from environment variables (EMAIL_ADDRESS, EMAIL_PASSWORD, SMTP_SERVER, SMTP_PORT)

Changes

  • backend/scripts/automation/1.py — replaced hardcoded email/password with os.getenv() + load_dotenv()
  • backend/scripts/automation/auto_email_sender.py — fallback config now reads from env vars instead of empty strings
  • backend/.env.example — new template documenting all required variables
  • backend/requirements.txt — added python-dotenv==1.1.0
  • .env was already in .gitignore (no change needed)

Test plan

  • Scripts load credentials from .env file when present
  • Scripts fall back gracefully when env vars are not set (empty strings, same as before)
  • JSON config file still works for auto_email_sender.py (takes precedence)
  • .env.example documents all variables contributors need to set

Closes #59

Automation scripts had email credentials hardcoded in source files,
risking accidental exposure when pushed to version control.

Adds python-dotenv to load credentials from environment variables.
Provides .env.example as a template so contributors know which
variables to configure. The .gitignore already excludes .env.

Closes Vaibhav2154#59
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

@jasonjose007 is attempting to deploy a commit to the vaibhav2154's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: Add Secure Way to Manage User Secrets (API Keys, Passwords)

1 participant