Dockerfile:
- Modified Gunicorn command to support Uvicorn workers: -k "uvicorn.workers.UvicornWorker" for ASGI compatibility.
app.py:
- Introduced asyncio and httpx for async HTTP requests.
- Converted functions to async (check_password_pwned, generate_passphrase, route handlers) for non-blocking operations.
- Updated special_characters to include a wider range of symbols.
- Simplified word list reading with .readlines().
- Added cache setup for response caching.
requirements.txt:
- Added httpx, flask-caching, uvicorn[standard]>=0.14.0.
- Updated Flask to support async: Flask[async]>=3.0.1.
- Specified gunicorn>=21.2.0 for compatibility.
To use:
docker pull jocxfin/pwgen:latest
docker run -d -p 5069:5069 jocxfin/pwgen:latestQuick and straightforward improvements for a better tool.