From 2e1f28967e2a772150eb0c82f3b5cba05c20895b Mon Sep 17 00:00:00 2001 From: Vasanth Date: Tue, 27 Oct 2026 19:14:37 +0530 Subject: [PATCH] Run the browser in IST so Aquilaehr Visit Dates are not shifted a day Aquilaehr's Export CSV is built in the browser and converts Visit Date to the browser timezone. On the server (TZ=America/New_York) every visit came out one day early, so Alpha matched 11 of 214 instead of 190. Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 3 ++- mek_recon.py | 3 +++ process_steps.md | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 57217d9..13cfd13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,8 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . # headless, system Chromium (Playwright's own browser download is not used) -ENV HEADLESS=1 CHROME_PATH=/usr/bin/chromium PYTHONUNBUFFERED=1 TZ=America/New_York +# TZ: IST like the team's PCs (also what the browser uses, see BROWSER_TZ in mek_recon.py) +ENV HEADLESS=1 CHROME_PATH=/usr/bin/chromium PYTHONUNBUFFERED=1 TZ=Asia/Kolkata EXPOSE 8000 # one worker: run state is kept in memory CMD ["gunicorn", "-w", "1", "--threads", "8", "-b", "0.0.0.0:8000", "--timeout", "120", "app:app"] diff --git a/mek_recon.py b/mek_recon.py index 1b3d593..f91eb5f 100644 --- a/mek_recon.py +++ b/mek_recon.py @@ -270,6 +270,9 @@ def run_site(site, locations): executable_path=chrome_path or None, channel=None if chrome_path else os.environ.get("CHROME_CHANNEL", "chrome") or None, headless=headless, + # Aquilaehr builds its Export CSV in the browser and shifts Visit Date by the browser's + # timezone: a US-timezone server gave every visit the day before. Match the team's IST. + timezone_id=os.environ.get("BROWSER_TZ", "Asia/Kolkata"), accept_downloads=True, no_viewport=not headless, viewport={"width": 1440, "height": 900} if headless else None, ) diff --git a/process_steps.md b/process_steps.md index c0661cc..2a26574 100644 --- a/process_steps.md +++ b/process_steps.md @@ -16,6 +16,15 @@ Logins come from .env (values never stored in code): ("first car" / "first job") -> click "Verify" - Aquilaehr: AQUILAEHR_USERNAME, AQUILAEHR_PASSWORD +## Web app / hosting +- `python app.py` -> http://127.0.0.1:8000 (sign in with APP_PASSWORD, Run, per-location / All Locations / ZIP downloads) +- Repo: https://giteanew.ecareindia.com/automation-tools/MEK-Charge-Reconciliation (main) +- Dokploy: project "MEK Charge Reconciliation", app mek-charge-reconciliation-jhyjop (Dockerfile, port 8000), + env vars hold all logins + APP_PASSWORD + SECRET_KEY + COOKIE_SECURE=1 +- Domain: https://mek-charge-reconciliation.api.ecareindia.com + DNS -> front proxy 10.200.0.55 -> Dokploy Traefik 10.200.0.15. The front proxy needs this host added + (status 10/27/2026: Dokploy route OK, front proxy returned 404 for this host and 502 for the other apps) + ## Locations (run the whole process for each, on BOTH sites) - ~~Adelman Health~~ (skipped) - Alpha Well-Being LLC