vogler / free-games-claimer

Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG.
GNU Affero General Public License v3.0
2.21k stars 139 forks source link

how to use VNC without docker #199

Open lyj0309 opened 10 months ago

lyj0309 commented 10 months ago

Hi , i'm running this in a linux server, there is a node runtime so i don't want use docker, but when i try to login, there is a captcha , so i want to use browser to run it, but there is a error

SHOW=1 node epic-games
2023-08-29 10:23:27.505 started checking epic-games
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

browserType.launchPersistentContext: 
╔════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Looks like you launched a headed browser without having a XServer running.                     ║
║ Set either 'headless: true' or use 'xvfb-run <your-playwright-app>' before running Playwright. ║
║                                                                                                ║
║ <3 Playwright Team                                                                             ║
╚════════════════════════════════════════════════════════════════════════════════════════════════╝
=========================== logs ===========================
<launching> /root/.cache/ms-playwright/firefox-1378/firefox/firefox -no-remote -wait-for-browser -foreground -profile /root/code/free-games-claimer/data/browser -juggler-pipe --hide-crash-restore-bubble about:blank
<launched> pid=442455
[pid=442455][err] Error: no DISPLAY environment variable specified
[pid=442455] <process did exit: exitCode=1, signal=null>
[pid=442455] starting temporary directories cleanup
============================================================
    at async file:///root/code/free-games-claimer/epic-games.js:24:17

Node.js v18.16.0

so is there any way run this like docker? expose a port like 6080, then i can visit it.

xamindar commented 10 months ago

Normally you should be able to do that. But at this time the 6080 port access (vnc stuff in container) appears to be broken.

vogler commented 10 months ago

@lyj0309 is running it without docker, so you have to take care of an XServer and VNC yourself (see the Playwright message). You can't run with SHOW=1 if there's no display to show it on. It'd be easiest for you to run the image.

Targunitoth commented 7 months ago

Came here from #183 for testing the tool completely without docker.

This Command did the trick for me: x11vnc -create -env FD_PROG="/usr/bin/node /opt/free-games-claimer/epic-games.js" -env X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 -env X11VNC_CREATE_GEOM=${1:-1280x720x16} -env SHOW=1 -env WIDTH=1280 -env HEIGHT=720 -env LOGIN_TIMEOUT=10000 -env TIMEOUT=10000 -gone 'killall Xvfb' -bg -nopw

Dependents on sudo apt-get install x11vnc xvfb

Source: https://stackoverflow.com/questions/12050021/how-to-make-xvfb-display-visible

Then connect to it, for example with noVNC: https://github.com/novnc/noVNC

vogler commented 7 months ago

Should put that in the wiki.

@Targunitoth Does that give you captchas as well? If no, some details (Debian/Ubuntu, version) would be beneficial for #183.

Targunitoth commented 6 months ago

Sadly yes, still captchas: grafik I can only log in via steam.

It's an oracle VM: # uname -a Linux ubuntu-server 5.15.0-1048-oracle #54-Ubuntu SMP Wed Nov 8 15:12:17 UTC 2023 x86_64 x86_64 x86_64GNU/Linux` # cat /etc/issue Ubuntu 22.04.3 LTS \n \l`

narjekdjcusbe commented 5 months ago

Came here from #183 for testing the tool completely without docker.

This Command did the trick for me: x11vnc -create -env FD_PROG="/usr/bin/node /opt/free-games-claimer/epic-games.js" -env X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 -env X11VNC_CREATE_GEOM=${1:-1280x720x16} -env SHOW=1 -env WIDTH=1280 -env HEIGHT=720 -env LOGIN_TIMEOUT=10000 -env TIMEOUT=10000 -gone 'killall Xvfb' -bg -nopw

Dependents on sudo apt-get install x11vnc xvfb

Source: https://stackoverflow.com/questions/12050021/how-to-make-xvfb-display-visible

Then connect to it, for example with noVNC: https://github.com/novnc/noVNC

This unfortunately didn't work for me. I was able to connect using tightVNC, however after that the command exited and tightVNC shows nothing but a black, blank screen. Running node epic-games again with that screen open brings the same error as before re: xserver etc.