epicgames-freegames-node icon indicating copy to clipboard operation
epicgames-freegames-node copied to clipboard

Add option to keep webserver always active for health check monitoring

Open sigboe opened this issue 2 years ago • 2 comments

I am running this docker and it successfully gets games for me. I have never been presented with a captcha (yet anyway). Is there supposed to be any output through http while no captcha is requested to be solved? I get connection refused on port 3000 while portforwarding port 3000 to port 3000 on the inside of the docker.

Is there supposed to be a landing page or something?

sigboe avatar Oct 06 '21 19:10 sigboe

No you shouldn't expect anything for 2 reasons:

  1. When idling (between scheduled free game checks), the container completely exits the Node process to save on memory (About 100MB saved). No web server is running here.
  2. The way puppeteer-extra-plugin-portal (which this project uses) works is that it only spins up a webserver when the a portal is opened. In this case, it's when an hCaptcha challenge is presented. If the captcha is bypassed, a webserver will never be opened.

I understand this makes testing the setup difficult, which is why I think #159 is a good idea.

There's also potential to spin up a "health check" webserver while idling. It would make the container consume a bunch more memory for no good reason, though.

claabs avatar Oct 06 '21 20:10 claabs

If you decide to include a health check, maybe it can only be running when a test environment variable is set. And that would be the same time it would test notifications, or they had separate environment variables to test that at startup.

sigboe avatar Oct 07 '21 07:10 sigboe