WellNuo/scripts/README.md
Sergei 1dd7eb8289 Remove hardcoded credentials and use environment variables
- Remove hardcoded database credentials from all scripts
- Remove hardcoded Legacy API tokens from backend scripts
- Remove hardcoded MQTT credentials from mqtt-test.js
- Update backend/.env.example with DB_HOST, DB_USER, DB_PASSWORD, DB_NAME
- Update backend/.env.example with LEGACY_API_TOKEN and MQTT credentials
- Add dotenv config to all scripts requiring credentials
- Create comprehensive documentation:
  - scripts/README.md - Root scripts usage
  - backend/scripts/README.md - Backend scripts documentation
  - MQTT_TESTING.md - MQTT testing guide
  - SECURITY_CREDENTIALS_CLEANUP.md - Security changes summary

All scripts now read credentials from backend/.env instead of hardcoded values.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-29 12:13:32 -08:00

39 lines
967 B
Markdown

# WellNuo Scripts
This directory contains utility scripts for database operations and testing.
## Environment Variables
These scripts require environment variables to be set. Create a `.env` file in the `backend/` directory with the following variables:
```bash
# Database Configuration
DB_HOST=your-database-host
DB_PORT=5432
DB_NAME=your-database-name
DB_USER=your-database-user
DB_PASSWORD=your-database-password
```
## Available Scripts
### fetch-otp.js
Fetches the latest OTP code for a given email address from the database.
**Usage:**
```bash
node scripts/fetch-otp.js <email>
```
**Example:**
```bash
node scripts/fetch-otp.js test@example.com
```
## Security
⚠️ **IMPORTANT**: Never commit files containing actual credentials to the repository. Always use environment variables for sensitive information.
- Database credentials should be stored in `backend/.env` (this file is git-ignored)
- See `backend/.env.example` for the required format