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.6k stars 157 forks source link

Questions about setup, docker compose, config via env vars #43

Closed EQUALIT-CG closed 1 year ago

EQUALIT-CG commented 1 year ago

Hello Everyone

I just came across this project and have run in to an issues that was bough up to me

  1. I'm running this as a docker-compose i know how
  2. I also have someone else look over this and pointed out two things witch i didn't see first time

I'm happy to upload my docker-compose if needed but for not i will upload a screen shot and the info needed

I'm trying to run this as a docker-compose with docker nothing new I'm doing this via my Synology NAS witch is fine But I'm getting error witch can be see from the Attach files Capture02 Capture

the issues is "npx playwright install" The author can fix this but including this as part of it or it will fail and not run during build.

Please fix this or help me work out how to fix it I don't get how to install npx on a synology nas but besides the point should be part of the build as its a container

vogler commented 1 year ago

Show your docker compose config. There's some permission problem creating /fgc/data. It has nothing to do with npx since that's already done when building the image.

EQUALIT-CG commented 1 year ago

Hi @vogler

I just checked it was my mistake I was missing the fgc after the :/

This now runs fine for me Thank you that sorry for wasting your time

Last thing How does this work do i edit a config with my log in or something i just need a little how to what the ports are use for so i can tag them etc etc

Cheers

also my docker-compose looks like

version: '3.6'

services:
  free-games-claimer:
    container_name: fgc
    image: ghcr.io/vogler/free-games-claimer
    ports:
      - "5900:5900"              # webui...
      - "6080:6080"              # .....
    volumes:
      - /volume1/docker/test_data:/fgc/data
#      - /volume1/docker/test_data:/data
    restart: 'unless-stopped'
    environment:
      - TZ=Sydney/Australia
    user: 1061:101

networks:
  default:
    driver: bridge

Thanks for the help and will try and work out how to log in with my 2FA and stuff will take some time

Once i have worked out how to log in i will Close this PR

EQUALIT-CG commented 1 year ago

Hi guys

Does the screen shot look right / normal or I'm having issues as to why i can't open the http://localhost:6080 also not sure if its possible i saw VNC is running on port 5900 (no password!) witch is why i though maybe i can open it via the port but nope

Would be nice if can somehow plan to add a password via the environment but i have no idea if this can be done

Thanks for your support ![Uploading test.PNG…]()

EQUALIT-CG commented 1 year ago

test

vogler commented 1 year ago

what the ports are use for so i can tag them etc etc

From the readme:

When you need to login, go to http://localhost:6080/ (you can also connect with a VNC client on port 5900)

5900 is the default port for VNC, 6080 is noVNC (browser-based VNC client).

Would be nice if can somehow plan to add a password via the environment but i have no idea if this can be done

If you don't want to enter login data, you can just set the used environment variables (however, it usually stays logged in for me): https://github.com/vogler/free-games-claimer/blob/21a2bc01a4712276c8ac1861ef493d05a127eb3f/epic-games.js#L80-L81

EMAIL=foo@bar.baz PASSWORD=foo docker run --rm -it -p 6080:6080 -v fgc:/fgc/data ghcr.io/vogler/free-games-claimer

More info: https://kinsta.com/knowledgebase/what-is-an-environment-variable/ https://docs.docker.com/compose/environment-variables/

I'm having issues as to why i can't open the http://localhost:6080/

You can only connect via VNC while the script is running (for you it fails). I don't know what image you're using, but you're missing firefox in the container (plus the _XSERVTransmkdir: ERROR). Maybe you're using some old image with new code. In any case, I would just delete your images and containers and run the command above. You can try to make your docker compose work afterwards.

EQUALIT-CG commented 1 year ago

Hi @vogler

Thank you so much i have updated my docker-compose

version: '3.6'

services:
  free-games-claimer:
    container_name: fgc
    image:  ghcr.io/vogler/free-games-claimer
    ports:
      - "5900:5900"                 # (client-based VNC client) 
      - "6080:6080"                 # (browser-based VNC client)
    volumes:
      - /volume1/docker/test_data:/fgc/data
    restart: 'unless-stopped'
    environment:
      - TZ=Sydney/Australia
#    user: 1061:101
    environment:
      - PUID=1061
      - PGID=101

networks:
  default:
    driver: bridge

I hope my ports # look right i got it running what was wrong was my environment i should of use it like above

I'm still working on this stuff as i don't really understand it so if you can try and explain it to me in a simple term please do

Capture

I did get the browser-based VNC client working :D

How do i get / log in and Claim Amazon or the other sites will that be the same as the noVNC just google and log in with that brower

its not a bad VNC i though would be same as a Proxmox VNC but aye it works Thanks so much

Pending a review from @vogler before close this ticket as i need to work out how to log in and add a VNC password

vogler commented 1 year ago

How do i get / log in and Claim Amazon or the other sites will that be the same as the noVNC just google and log in with that brower

I don't know what you mean by google. You can log in via the terminal. For epic-games the browser is shown by default so you could also log in via noVNC, for prime-gaming, it's currently headless so you'd have to run `node prime-gaming show'. Maybe I should change the default to not run headless in the container.

i need to work out how to log in and add a VNC password

Why do you need a VNC password? If you don't open the ports in your router's firewall, it will only be reachable inside your local network while the script is running. You could also just not map the ports for the container after you've logged in.

EQUALIT-CG commented 1 year ago

Hello @vogler

Thanks for the reply

Let me re world what i was trying to say in my last post i do apologize I can't make scenes all the time

So I will start again I was able to start my docker-compose once i run it i leave it online i don't log in via terminal every day or week to check this will be on 24/7 check for games ever day / week

Now that i have it running i go to http://localhost:6080/

Capture

comes up with the above screen shot I take it that how i sing in with Epic...? How do i sing in with the rest of them games-claimer

I'm trying to work out how to setup epic-games as well as the rest for free game claimer if so how could you please explain to me how to I apologize if i don't understand how to as well as i do use 2FA on all my games clients

and last but not least I do not Expose my VNC to the World wide web I'm talking about my LAN i don't wish to leave my VNC client open to the LAN with family or what not open that all

Thanks for your help ur the boss @vogler

vogler commented 1 year ago

Please use some punctuation marks, it's hard to understand what you're trying to say.

You can sign in in the browser or in the terminal which will show prompts for email and password. Alternatively, you can set them as environment variables, but then you'd still need to enter the MFA code via the terminal.

once i run it i leave it online i don't log in via terminal every day or week to check this will be on 24/7 check for games ever day / week

It's not a server (yet), so you need to schedule runs of the container yourself (see readme).

EQUALIT-CG commented 1 year ago

Hi @vogler

I see

I will save my docker-compose and come back to this

I understand a little but I'm not all that when comes to this when this before a "server" I may try again as i don't fully understand how to do it any other way right now i can't read that well ok and follow is not the best ok

so when it comes to this i would of though this was a live server to check every 24 hours or for a push services from the game conapny so if a bot sends a Alerts that Epic has a free game the system will kick in and claim the free game

Because at this point i could just do the same as just login into the site it self aka Epic log in and claim the free game but this would automate this process if I'm busy in life that all

I think its best for me to wait for it to become a Live Services

I though it was a config i can make to fill in my login info for the docker-compose say

Epic.login.config steam.login.config xbox.login.config

but all good you may close this Support as i do have it running now

But i will not use it as i don't understand how to log in and claim it properly right now

EQUALIT-CG commented 1 year ago

Hi @vogler you may make this as Solved as the docker-compose is working

I may open another ticket later on at to how to use this properly

Cheers for your support

vogler commented 1 year ago

I though it was a config i can make to fill in my login info for the docker-compose say

You can already do that in your docker-compose.yml, just add them to the environment section:

    environment:
      - EMAIL=foo@bar.baz
      - PASSWORD=foo

You can also prefix each script with the environment variables set as shown above if you have different logins. For scheduling, you can use cronjobs, maybe Proxmox has some UI for it.

I already have it on my radar to make it more non-developer-friendly with .env file for settings, some initial CLI setup and an option to keep it running as a server with some default schedule.

EQUALIT-CG commented 1 year ago

Hi @vogler

So I see what you mean I did kind of understand that last message I just like to update you unsure if this is a me problem or being working on

anyways I added that to my docker-compose

environment:
    # Epic Account info
  - EMAIL=foo@bar.baz
  - PASSWORD=foo

The Above kind of works it fills it in as i was watching terminal and the VNC but doesn't lot in When i click login on the VNC client i clicked on the sing in as the Epic was open etc etc and then asked me for 2FA once i clicked it

Not sure if it should of auto clicked and should of asked for 2Fa or what not but that what I'm up to so i kind of got it

Also please take the time to say Thank you all to who work on this as well as your support your doing an amazing job reply and supporting this job keep it up

I would like to try and setup auto sing in and auto claim when its some but let me know i by my guess as you support

[Amazon Prime Gaming / GOG

that would be something like

environment:
    # Epic Account info
  - EMAIL=foo@bar.baz
  - PASSWORD=foo

    # GOG Account info
  - EMAIL=foo@bar.baz
  - PASSWORD=foo

    # amazon Account info
  - EMAIL=foo@bar.baz
  - PASSWORD=foo
EQUALIT-CG commented 1 year ago

Maybe because i use a 2FA Epic account it should be environment:

Epic Account info

EQUALIT-CG commented 1 year ago

Sorry my apologize i was meant to upload a screen shot of what i was on about Capture

vogler commented 1 year ago

Why does it only have .com for your email? Maybe it's easier for you to log in manually via noVNC.

You can't have a 2FA env var because the key changes every time.

I'll add different login vars for each store such that it's easier to use.

EQUALIT-CG commented 1 year ago

Hi @vogler

I added .com because i didn't wish to shear my email in the screen shot etc etc

I understand you can't add the 2FA as it changes so i though i would ask about the Key as in Authenticator Key "TOTP" not the code so since the Key auto generate a Key etc etc when its goes to lot in would get the output that the Keys gives it witch is why i asked if about how i did my docker-compose with the key above aka Authenticator Key "TOTP"

I'll add different login vars for each store such that it's easier to use. That would be cool please update me if you can

Also my issues wasn't that it because it was .com

I was trying to point out the error code etc etc when i had my info in the docker-compose with the login it didn't auto log into Epic until i clicked Login

vogler commented 1 year ago

Yea, I thought about using https://github.com/yeojz/otplib for generating OTP, but that defeats the purpose of MFA if all auth data is available in one spot. Maybe I'll add it if I come around to it.

EQUALIT-CG commented 1 year ago

Hi

what every works best adding the key not a bad idea but but I'm sure there better ways I know from other when I use LGSM they use steam login and that a one time as its knows the IP or something same with my Ubiesoft etc etc

Please if you can update me once this is worked out

one the above is all worked out please use me as a test subjected I can then post another PR i think would be really portent to go alone side this

EQUALIT-CG commented 1 year ago

Hi @vogler

this is really well done

I find this really easy to understand

image

I'm so far missing how to do the 2FA but that fine i will come back and check up on that soon

May i make a suggestion witch is my suggestion i was trying to make pass few days maybe i should make a new PR or maybe you will do that for us etc etc

Say i end up changing my login password i wish to be notification about FGC not able to log in and claim a games etc etc

so that would be with Pushover or what ever etc etc

Say it can't log into an account and I'm not thinking i need to re log into my account to claim games etc etc then i get a Pushover alert that it failed to log in for xxx that be password or 2FA etc etc

this something you can add at some point once i work out how to sing in with 2FA

Good job adding the above the screen shot that made it so much easier for myself to read and understand Cheers

vogler commented 1 year ago

I wanted to add https://github.com/caronc/apprise since it supports a lot of different notification services.

EQUALIT-CG commented 1 year ago

Hi @vogler No if that works that fine I just though i would ask / request if someone hasn't yet

that would;d be sick because i would love IFTTT

EQUALIT-CG commented 1 year ago

Hi @vogler

Please Note

When I add the following

"EG_EMAIL" "EG_Password"

Does not sign in etc etc take a look i guess this is something that needs to be added to the script

also be nice to add

"Epic_Games_EMAIL" "Epic_Games_PASSWORD"

EQUALIT-CG commented 1 year ago

I just sign up to an new Epic Account to test this out and start with auto etc etc

and got somewhat an error but not really

I have checked but would also pass this on so user can get Push alerts etc etc

snip

vogler commented 1 year ago

Don't get what you mean with the env vars. They're case-sensitive. Convention is for them to be uppercase. I'm using the same abbreviated prefixes as for commit messages and the GitHub labels which are sufficiently clear IMO and EPICGAMES would be pretty long.

vogler commented 1 year ago

I just sign up to an new Epic Account to test this out and start with auto etc etc

What do you mean by auto?

You only have to accept the license agreement once after creating an account. I think this is out of scope.

vogler commented 1 year ago

Added https://github.com/yeojz/otplib in https://github.com/vogler/free-games-claimer/commit/1a3d90f7953190a888865eafe32267fcba001cbd. Haven't tested it, but the OTPs looked ok.

vogler commented 1 year ago

Just tested that automatic login with PG_OTPKEY works. I'll close this.