|
|
há 4 dias atrás | |
|---|---|---|
| .github | há 6 dias atrás | |
| app | há 4 dias atrás | |
| note | há 6 dias atrás | |
| tests | há 6 dias atrás | |
| .env.example | há 6 dias atrás | |
| .gitignore | há 6 dias atrás | |
| Dockerfile | há 4 dias atrás | |
| README.md | há 6 dias atrás | |
| docker-compose.yaml | há 4 dias atrás | |
| ginger.py | há 4 dias atrás | |
| requirements.txt | há 6 dias atrás | |
| uwsgi.ini | há 6 dias atrás |
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.