security: remove .env from git and update .gitignore
CRITICAL: The .env file containing real database credentials was tracked in git. This commit: - Removes backend/.env from git tracking (file kept locally) - Adds .env patterns to .gitignore to prevent future commits - Updates .env.example with placeholder values only ACTION REQUIRED: Rotate all credentials that were exposed: - MySQL password - JWT secret key - Any other secrets in the .env file Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,3 +1,10 @@
|
|||||||
|
# Environment files (NEVER commit secrets!)
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
*.env
|
||||||
|
!.env.example
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|||||||
22
backend/.env
22
backend/.env
@@ -1,22 +0,0 @@
|
|||||||
# Database
|
|
||||||
MYSQL_HOST=mysql.theaken.com
|
|
||||||
MYSQL_PORT=33306
|
|
||||||
MYSQL_USER=A060
|
|
||||||
MYSQL_PASSWORD=WLeSCi0yhtc7
|
|
||||||
MYSQL_DATABASE=db_A060
|
|
||||||
|
|
||||||
# Redis
|
|
||||||
REDIS_HOST=localhost
|
|
||||||
REDIS_PORT=6379
|
|
||||||
REDIS_DB=0
|
|
||||||
|
|
||||||
# JWT
|
|
||||||
JWT_SECRET_KEY=pjctrl-jwt-secret-key-2024-change-in-production
|
|
||||||
JWT_ALGORITHM=HS256
|
|
||||||
JWT_EXPIRE_MINUTES=15
|
|
||||||
|
|
||||||
# External Auth API
|
|
||||||
AUTH_API_URL=https://pj-auth-api.vercel.app
|
|
||||||
|
|
||||||
# System Admin
|
|
||||||
SYSTEM_ADMIN_EMAIL=ymirliu@panjit.com.tw
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
# Database
|
# Database
|
||||||
MYSQL_HOST=mysql.theaken.com
|
MYSQL_HOST=your-mysql-host
|
||||||
MYSQL_PORT=33306
|
MYSQL_PORT=3306
|
||||||
MYSQL_USER=A060
|
MYSQL_USER=your-username
|
||||||
MYSQL_PASSWORD=your_password_here
|
MYSQL_PASSWORD=your-password-here
|
||||||
MYSQL_DATABASE=db_A060
|
MYSQL_DATABASE=your-database
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
REDIS_HOST=localhost
|
REDIS_HOST=localhost
|
||||||
@@ -13,13 +13,13 @@ REDIS_DB=0
|
|||||||
# JWT
|
# JWT
|
||||||
JWT_SECRET_KEY=generate-a-random-secret-key-here
|
JWT_SECRET_KEY=generate-a-random-secret-key-here
|
||||||
JWT_ALGORITHM=HS256
|
JWT_ALGORITHM=HS256
|
||||||
JWT_EXPIRE_MINUTES=15
|
JWT_EXPIRE_MINUTES=60
|
||||||
|
|
||||||
# External Auth API
|
# External Auth API
|
||||||
AUTH_API_URL=https://pj-auth-api.vercel.app
|
AUTH_API_URL=https://your-auth-api-url
|
||||||
|
|
||||||
# System Admin
|
# System Admin
|
||||||
SYSTEM_ADMIN_EMAIL=ymirliu@panjit.com.tw
|
SYSTEM_ADMIN_EMAIL=admin@example.com
|
||||||
|
|
||||||
# File Encryption (AES-256)
|
# File Encryption (AES-256)
|
||||||
# Master key for encrypting file encryption keys (optional - if not set, file encryption is disabled)
|
# Master key for encrypting file encryption keys (optional - if not set, file encryption is disabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user