|
|
il y a 4 jours | |
|---|---|---|
| .github | il y a 6 jours | |
| app | il y a 6 jours | |
| note | il y a 6 jours | |
| tests | il y a 6 jours | |
| .env.example | il y a 6 jours | |
| .gitignore | il y a 6 jours | |
| Dockerfile | il y a 4 jours | |
| README.md | il y a 6 jours | |
| docker-compose.yaml | il y a 4 jours | |
| ginger.py | il y a 6 jours | |
| requirements.txt | il y a 6 jours | |
| uwsgi.ini | il y a 6 jours |
Small Flask project. This README explains how to store the MySQL password securely using the OS keyring and how to verify it.
This project prefers reading MYSQL_PASSWORD from environment variables. If you don't want to store the password in .env, put it into the OS keyring (recommended for development machines).
Service name used: ginger_mysql
Examples:
python -c "import keyring; keyring.set_password('ginger_mysql', 'root', '@@qinys12346..')"
python -c "import keyring; keyring.set_password('ginger_mysql', 'root', '@@qinys12346..')"
To verify the stored password:
python -c "import keyring; print(keyring.get_password('ginger_mysql', 'root'))"
You can also set MYSQL_PASSWORD in .env (not recommended to commit .env). The repository .gitignore already ignores .env files.
Start the app and POST to /db/test (only works when DEBUG or TESTING is true) to create tables and insert a test user.