Không có mô tả

tanlie f4c42211c1 docker images 4 ngày trước cách đây
.github 1163b37a0b logger enhance 6 ngày trước cách đây
app d090e4db59 Add uwsgi Docker deployment 6 ngày trước cách đây
note 1904a24bfd 视图函数。 6 ngày trước cách đây
tests 026d79c122 AI优化。 6 ngày trước cách đây
.env.example 5ccceb51dc Track env example and align deployment defaults 6 ngày trước cách đây
.gitignore be0766cd53 删除重复内容 6 ngày trước cách đây
Dockerfile f4c42211c1 docker images 4 ngày trước cách đây
README.md 5d0119202f 数据库连接。 6 ngày trước cách đây
docker-compose.yaml f4c42211c1 docker images 4 ngày trước cách đây
ginger.py 6ae20abe2f feat: improve Flask app structure and logging 6 ngày trước cách đây
requirements.txt d090e4db59 Add uwsgi Docker deployment 6 ngày trước cách đây
uwsgi.ini d090e4db59 Add uwsgi Docker deployment 6 ngày trước cách đây

README.md

ginger

Small Flask project. This README explains how to store the MySQL password securely using the OS keyring and how to verify it.

Secure DB password with keyring

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:

  • macOS / Linux (python -c):

python -c "import keyring; keyring.set_password('ginger_mysql', 'root', '@@qinys12346..')"

  • Windows PowerShell:

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'))"

Alternative: environment variable

You can also set MYSQL_PASSWORD in .env (not recommended to commit .env). The repository .gitignore already ignores .env files.

Test DB connection (dev only)

Start the app and POST to /db/test (only works when DEBUG or TESTING is true) to create tables and insert a test user.

Notes

  • On CI or servers prefer a proper secret manager (Vault, AWS Secrets Manager, etc.) and inject secrets as env vars.
  • Do NOT commit real passwords to the repository.