The following files contain sensitive information and should NEVER be committed to version control:
appsettings.json- Main server configuration with database credentialsappsettings.*.json- Environment-specific settings
*.db- SQLite database files*.sql- Database dumps or backups*.backup- Database backup files
key.pem- Private keys*.p12,*.pfx- Certificate fileskeys/- Directory containing private keyscertificates/- Directory containing certificates
logs/- Log directories may contain sensitive information*.log- Log filesserver.log- Server runtime logs
-
Copy example files:
cp src/Standalone/appsettings.json.dist src/Standalone/appsettings.json
-
Update configuration:
- Edit
src/Standalone/appsettings.jsonwith your database credentials - Update the PostgreSQL connection string with your database details
- Generate strong random values for any security keys
- Edit
-
Verify .gitignore:
- Ensure all sensitive files are listed in
.gitignore - Never force-add ignored files with
git add -f
- Ensure all sensitive files are listed in
- Use strong, randomly generated passwords
- Regularly rotate encryption keys and passwords
- Enable database SSL/TLS connections in production
- Use secrets management systems for production environments
- Implement proper access controls for configuration files
If sensitive data is accidentally committed:
- Immediately rotate all exposed credentials
- Use
git filter-branchor BFG Repo-Cleaner to remove from history - Force push to overwrite remote history (coordinate with team)
- Notify all team members to re-clone the repository