1
0
Fork 0

wip switch to headed chrome

Dustin 2024-07-10 10:54:06 -05:00
parent 9640d762e0
commit c1ab4faa81
4 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,6 @@
* *
!.git !.git
!entrypoint.sh
!pinentry-stub.sh !pinentry-stub.sh
!pyproject.toml !pyproject.toml
!xactfetch.py !xactfetch.py

View File

@ -47,11 +47,16 @@ RUN --mount=type=cache,target=/var/cache \
libXrandr \ libXrandr \
libXrender \ libXrender \
libXtst \ libXtst \
libdrm \
libxcb \ libxcb \
mesa-libgbm \
nspr \
nss \
pango \ pango \
python3 \ python3 \
python3-pip \ python3-pip \
tini \ tini \
xorg-x11-server-Xvfb \
&& echo xactfetch:x:2468: >> /etc/group \ && echo xactfetch:x:2468: >> /etc/group \
&& echo xactfetch:*:2468:2468:xactfetch:/var/lib/xactfetch:/sbin/nologin >> /etc/passwd \ && echo xactfetch:*:2468:2468:xactfetch:/var/lib/xactfetch:/sbin/nologin >> /etc/passwd \
&& : && :
@ -62,7 +67,8 @@ RUN --mount=type=bind,from=build,source=/,target=/build \
python3 -m pip install --no-index -f /build/wheels xactfetch \ python3 -m pip install --no-index -f /build/wheels xactfetch \
&& cp /build/root/.cargo/bin/rbw* /usr/local/bin/ \ && cp /build/root/.cargo/bin/rbw* /usr/local/bin/ \
&& install /build/src/pinentry-stub.sh /usr/local/bin/pinentry-stub \ && install /build/src/pinentry-stub.sh /usr/local/bin/pinentry-stub \
&& playwright install firefox \ && install /build/src/entrypoint.sh /entrypoint.sh \
&& playwright install chromium \
&& : && :
VOLUME /var/lib/xactfetch VOLUME /var/lib/xactfetch
@ -71,6 +77,4 @@ WORKDIR /var/lib/xactfetch
USER 2468:2468 USER 2468:2468
ENV XDG_CONFIG_HOME=/etc ENTRYPOINT ["tini", "/entrypoint.sh", "--"]
ENTRYPOINT ["tini", "xactfetch", "--"]

3
entrypoint.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec xvfb-run -e /dev/stderr -s '-screen 0 1920x1080x24 -nolisten unix' xactfetch "$@"

View File

@ -721,8 +721,7 @@ async def amain() -> None:
end_date = datetime.date.today() - datetime.timedelta(days=1) end_date = datetime.date.today() - datetime.timedelta(days=1)
failed = False failed = False
async with async_playwright() as pw, secrets: async with async_playwright() as pw, secrets:
headless = os.environ.get('DEBUG_HEADLESS_BROWSER', '1') == '1' browser = await pw.chromium.launch(headless=False)
browser = await pw.firefox.launch(headless=headless)
page = await browser.new_page() page = await browser.new_page()
banks = sys.argv[1:] or list(ACCOUNTS.keys()) banks = sys.argv[1:] or list(ACCOUNTS.keys())
if 'commerce' in banks: if 'commerce' in banks: