|
| 1 | +# Security Guidelines for Dir2md |
| 2 | + |
| 3 | +## 🔐 License Key Management |
| 4 | + |
| 5 | +### Safe Practices |
| 6 | + |
| 7 | +#### ✅ DO: |
| 8 | +- Use environment variables: `export DIR2MD_LICENSE="PRO-your_key"` |
| 9 | +- Create `.env` file locally (already in .gitignore) |
| 10 | +- Use different keys for development/production |
| 11 | +- Rotate keys periodically |
| 12 | + |
| 13 | +#### ❌ DON'T: |
| 14 | +- Never commit license keys to Git |
| 15 | +- Don't hardcode keys in scripts |
| 16 | +- Avoid sharing keys in plain text |
| 17 | +- Don't use production keys in testing |
| 18 | + |
| 19 | +### Setting Up Pro License |
| 20 | + |
| 21 | +1. **Create local environment file:** |
| 22 | + ```bash |
| 23 | + cp .env.example .env |
| 24 | + # Edit .env with your actual license key |
| 25 | + ``` |
| 26 | + |
| 27 | +2. **Or use environment variable:** |
| 28 | + ```bash |
| 29 | + export DIR2MD_LICENSE="PRO-your_license_key_here" |
| 30 | + ``` |
| 31 | + |
| 32 | +3. **Verify activation:** |
| 33 | + ```bash |
| 34 | + dir2md --version --verbose |
| 35 | + ``` |
| 36 | + |
| 37 | +### Development vs Production |
| 38 | + |
| 39 | +#### Development Environment: |
| 40 | +```bash |
| 41 | +# .env.development |
| 42 | +DIR2MD_LICENSE=PRO-dev_key_123456789 |
| 43 | +DIR2MD_LOG_LEVEL=DEBUG |
| 44 | +``` |
| 45 | + |
| 46 | +#### Production Environment: |
| 47 | +```bash |
| 48 | +# Use secure secret management |
| 49 | +export DIR2MD_LICENSE="${PROD_LICENSE_KEY}" |
| 50 | +``` |
| 51 | + |
| 52 | +### Git Safety Checks |
| 53 | + |
| 54 | +Before committing, always run: |
| 55 | +```bash |
| 56 | +# Check for accidentally committed secrets |
| 57 | +git diff --cached | grep -i "PRO-\|license\|key\|secret" |
| 58 | + |
| 59 | +# Use git-secrets if available |
| 60 | +git secrets --scan |
| 61 | +``` |
| 62 | + |
| 63 | +### License Key Format |
| 64 | + |
| 65 | +Valid Pro keys must: |
| 66 | +- Start with `PRO-` |
| 67 | +- Be at least 11 characters total |
| 68 | +- Example: `PRO-abc123def456` |
| 69 | + |
| 70 | +### Troubleshooting |
| 71 | + |
| 72 | +#### Key Not Working: |
| 73 | +1. Check format: `PRO-` prefix + sufficient length |
| 74 | +2. Verify environment variable is set |
| 75 | +3. Restart application after setting key |
| 76 | +4. Check for typos or extra spaces |
| 77 | + |
| 78 | +#### Accidental Exposure: |
| 79 | +1. Immediately rotate the key |
| 80 | +2. Remove from Git history if committed |
| 81 | +3. Check GitHub/GitLab secret scanning alerts |
| 82 | +4. Update all environments with new key |
| 83 | + |
| 84 | +### Contact |
| 85 | + |
| 86 | +For license issues: https://dir2md.com/support |
| 87 | +For security concerns: security@dir2md.com |
0 commit comments