feat: add optional new epic claimer mode
All checks were successful
build-and-push / lint (push) Successful in 5s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 1m13s

This commit is contained in:
nocci 2025-12-31 12:25:07 +00:00
parent 4ce50e2e43
commit 7a9f31df7c
6 changed files with 464 additions and 44 deletions

View file

@ -19,35 +19,45 @@ Quickstart (Docker Run)
```
docker run --rm -it \
-p 6080:6080 \
-v fgc:/fgc/data \
-v fgc-data:/fgc/data \
-v fgc-browser:/home/fgc/.cache/browser \
-v fgc-playwright:/home/fgc/.cache/ms-playwright \
-e SHOW=1 \
git.sky-net.it/nocci/free-games-claimer:latest \
node prime-gaming.js
git.sky-net.it/nocci/free-games-claimer:dev \
bash -c "node prime-gaming; node gog; ./keep-alive.sh"
```
- Ports 6080/5900: noVNC/VNC (only needed with `SHOW=1`)
- Data/configs are stored in volume `fgc` under `/fgc/data`
- Volumes persist profile + Playwright-Browser, damit Logins/Downloads bleiben.
Docker Compose Example
----------------------
Docker Compose Example (persistent volumes)
-------------------------------------------
```yaml
services:
fgc:
image: git.sky-net.it/nocci/free-games-claimer:latest
free-games-claimer:
image: git.sky-net.it/nocci/free-games-claimer:dev
container_name: fgc
environment:
- SHOW=1 # show browser via VNC/noVNC
- SHOW=1 # show browser via VNC/noVNC
# - PG_EMAIL=...
# - PG_PASSWORD=...
# - PG_OTPKEY=...
- BROWSER_DIR=/fgc/data/browser
- LOGIN_VISIBLE_TIMEOUT=20 # optional: faster login detection
- KEEP_ALIVE_SECONDS=86400 # optional: keep container alive after runs
volumes:
- fgc:/fgc/data
- fgc-data:/fgc/data
- fgc-browser:/home/fgc/.cache/browser
- fgc-playwright:/home/fgc/.cache/ms-playwright
ports:
- "6080:6080" # noVNC
# - "5900:5900" # VNC optional
command: bash -c "node epic-games; node prime-gaming; node gog"
- "6080:6080" # noVNC
# - "5900:5900" # VNC optional
command: bash -c "node prime-gaming; node gog; ./keep-alive.sh"
volumes:
fgc:
fgc-data:
fgc-browser:
fgc-playwright:
```
Hinweis: Das Image läuft auf `dev`; bei Bedarf `:latest` wählen.
Configuration (Environment Variables)
-------------------------------------
@ -55,6 +65,7 @@ Common options:
- `SHOW=0/1` (0 = headless, 1 = UI)
- `WIDTH`, `HEIGHT` (browser size)
- `TIMEOUT`, `LOGIN_TIMEOUT` (seconds)
- Epic: `EG_MODE=legacy|new` (legacy Playwright flow or neuer API-getriebener Claimer), `EG_PARENTALPIN`, `EG_EMAIL`, `EG_PASSWORD`, `EG_OTPKEY`
- Login: `EMAIL`, `PASSWORD` global; per store `EG_EMAIL`, `EG_PASSWORD`, `EG_OTPKEY`, `PG_EMAIL`, `PG_PASSWORD`, `PG_OTPKEY`, `GOG_EMAIL`, `GOG_PASSWORD`
- Prime Gaming: `PG_REDEEM=1` (auto-redeem keys, experimental), `PG_CLAIMDLC=1`, `PG_TIMELEFT=<days>` to skip long-remaining offers
- Screenshots: `SCREENSHOTS_DIR` (default `data/screenshots`)
@ -66,6 +77,9 @@ Common options:
- Directories: `SCREENSHOTS_DIR`, `BROWSER_DIR`, `DATA_DIR` (prefix for data; default under `data/`)
- VNC/noVNC: `VNC_PASSWORD` (for Docker entrypoint), `NOVNC_PORT`/`VNC_PORT` (Docker)
- General timeouts: `TIMEOUT` (per action), `LOGIN_TIMEOUT` (extra time for login)
- Login detection: `LOGIN_VISIBLE_TIMEOUT` (ms) to abort sooner when login buttons not present
- Keep-alive: `KEEP_ALIVE_SECONDS` (default 86400) for `keep-alive.sh`
- Repo banner: `REPO_URL` for log output
You can place a `data/config.env`; it is loaded via dotenv and is overridden by explicitly set environment variables.