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