Giter VIP home page Giter VIP logo

epicgames-freegames-heroku's Introduction

epicgames-freegames-node on Heroku for Free!

Deploy epicgames-freegames-node in Heroku for free via Github!

GitHub Workflow Status (branch)

GitHub Workflow Status (branch)

GitHub Workflow Status (branch)

GitHub Workflow Status (branch)

CodeFactor

Features

  • Build and deploy customized EpicGames-FreeGames-node image from source to Heroku via Github Actions
  • Persistent Login Cookie stored via Redis
  • Reset stuck cookie via Github Actions
  • Maintainable updates with Git Hash for future updates
  • Easily extendable for future tweaks

Usage

Usage is simply, fast, and user friendly! The application will run each hour after being deployed!

Deployment

  1. Create a fork of this project
  2. Go to your forked repo Settings > Secrets and add secrets for:
  • HEROKU_API_KEY (your Heroku API key - can be found in Account Settings -> API Keys)
  • APP_NAME (the name of the Heroku application, this must be unique across Heroku and will fail if it is not)
  • EMAIL_ADDRESS (your Epic Games email address)
  • EPIC_GAMES_PASSWORD (your Epic Games password)
  • TEMPORARY_EMAIL_COOKIE (a base64 encoded starting cookie, please see temporary cookie generation below)
  • TOTP_MFA (your Epic Games MFA string, not your MFA code, but the string used to generate the code)
  1. Navigate to Github Actions and run the job EpicGamesFreeGamesDeploy workflow and begin deploying the app. This will take around 5-8 minutes.
  2. Congrats, you now having a fully functional EpicGames-FreeGames-node instance in Heroku!

Update

Updating is simple and can be done one of two ways:

  • Running the workflow manually via Github Actions
  • Making a commit to the main branch, forcing a Github Actions workflow to initiate an update workflow

Either one of these will force the Github Actions workflow to run and update the app. If you need to modify to enable/disable settings, you should re-run it as well.

Temporary Cookie Generation and Reset Mechanism

You should be following the instructions listed here up to and including step 4.

You will then take this cookie and base64 encode it, suggested site attached. Then add this in as a secret in your Github forked repo.

Should you have any issues with your token in running the application, you can reset the token by doing the steps above and then running the EpicGamesFreeGamesResetCookie Github Actions workflow.

Email CAPTCHA Support

Email captchas are supported with this mechanism and are supported by Mailgun. We are using Mailgun's sandboxed mode which requires you to manually verify your domain in order to prevent the service from being used as spam.

In order to verify your email address (the variable used for EMAIL_ADDRESS):

  1. Go to your app dashboard in Heroku, find the Mailgun addon.
  2. Click on the Mailgun addon to get SSO redirected to Mailgun dashboard.
  3. Then find the "Sending" tab in Mailgun.
  4. Click on the default domain (sandbox).
  5. On the right hand side, you will see a field entitled "Authorized Recipients".
  6. Enter your email address and Save Recipient.
  7. Wait for an email to arrive - THIS EMAIL WILL MOST LIKELY LAND IN YOUR SPAM BOX.
  8. Click the click in the email and then Yes on the webpage that is presented.
  9. Captcha emails will now be delivered to your email, again PLEASE CHECK IN YOUR SPAM FOLDER WHEN OUTPUT SPECIFIES CAPTCHA IS NEEDED.

Notes to consider

If you enable MFA on your Heroku account after deploying this process, you will need to regenerate the API key and update it within the Github secrets.

epicgames-freegames-heroku's People

Contributors

davidjameshowell avatar handyhat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

epicgames-freegames-heroku's Issues

Not claiming freebie game

Hi again,

I'm not sure what I'm doing wrong, but it doesn't seem like my Heroku instance is claiming the free game from Epic Games? Here's my Github Actions output:

image

On Heroku, if I click on "Open App", this is what I get:

image

I've already added my email into the Mailgun Authorized Recipients and my email is shown as "Verified". I haven't received any email captchas.

In my Heroku logs, I found this. Today's freebie is Torchlight 2, so it did find the game but it didn't actually claim it?

2020-12-31T01:59:02.181577+00:00 app[web.1]:       "Torchlight II"

2020-12-31T01:59:02.181577+00:00 app[web.1]:     ]

2020-12-31T01:59:02.342607+00:00 app[web.1]: [2020-12-31 01:59:02.342 +0000] INFO  (18 on 38117d8a-6203-4b8c-9a08-b32229f0e31a): Unpurchased free games

2020-12-31T01:59:02.342608+00:00 app[web.1]:     user: "[email protected]"

2020-12-31T01:59:02.342609+00:00 app[web.1]:     purchasableGames: []

2020-12-31T01:59:02.358405+00:00 app[web.1]: Exiting...

2020-12-31T01:59:02.359234+00:00 app[web.1]: Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.

2020-12-31T01:59:02.362902+00:00 app[web.1]: OK

2020-12-31T01:59:02.427049+00:00 heroku[web.1]: Process exited with status 0

2020-12-31T01:59:02.462512+00:00 heroku[web.1]: State changed from up to crashed

Clarification: How do I update the app?

Under the Update section, I'm a bit confused by this part: "Running the workflow manually via Github Actions".

I'm assuming its running the EpicGamesFreeGamesUpdate workflow manually. Or perhaps one of the other three workflows?

Email Error

I updated the my fork and make Mailgun setup, after that I rerun EpicGamesFreeGamesRun action, it not worked.

Heroku Logs, (I censorship my credentials):

2020-12-22T14:32:43.617148+00:00 heroku[web.1]: Starting process with command `docker-entrypoint.sh`
2020-12-22T14:32:47.342414+00:00 app[web.1]: Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
2020-12-22T14:32:47.371348+00:00 app[web.1]: Incoming env vars:
2020-12-22T14:32:47.377689+00:00 app[web.1]: RUN_ON_STARTUP: true
2020-12-22T14:32:47.378009+00:00 app[web.1]: CRON_SCHEDULE: 
2020-12-22T14:32:47.378058+00:00 app[web.1]: RUN_ONCE: true
2020-12-22T14:32:47.379445+00:00 app[web.1]: No JSON file found
2020-12-22T14:32:47.379663+00:00 app[web.1]: Setting config variables
2020-12-22T14:32:47.380183+00:00 app[web.1]: Run on startup: true
2020-12-22T14:32:47.380458+00:00 app[web.1]: Run once: true
2020-12-22T14:32:49.180856+00:00 app[web.1]: 
2020-12-22T14:32:49.180877+00:00 app[web.1]: > epicgames-freegames-node@3.0.0 start /usr/app
2020-12-22T14:32:49.180878+00:00 app[web.1]: > node dist/src/index.js
2020-12-22T14:32:49.180879+00:00 app[web.1]: 
2020-12-22T14:32:53.044779+00:00 heroku[web.1]: State changed from starting to up
2020-12-22T14:32:53.077607+00:00 app[web.1]: [2020-12-22 14:32:52.965 +0000] INFO  (18 on 9a3fc140-ec96-4f75-b125-396de63ec2f3): Checking free games for ridvanaltun@outlook.com
2020-12-22T14:32:53.079959+00:00 app[web.1]: [2020-12-22 14:32:53.079 +0000] INFO  (18 on 9a3fc140-ec96-4f75-b125-396de63ec2f3): Converting ./config/ridvanaltun@outlook.com-cookies.json cookie format
2020-12-22T14:32:54.629045+00:00 app[web.1]: [2020-12-22 14:32:54.627 +0000] ERROR (18 on 9a3fc140-ec96-4f75-b125-396de63ec2f3): Error sending email. Please check your configuration
2020-12-22T14:32:54.629058+00:00 app[web.1]:     emailConfig: {
2020-12-22T14:32:54.629059+00:00 app[web.1]:       "smtpHost": "smtp.mailgun.org",
2020-12-22T14:32:54.629060+00:00 app[web.1]:       "smtpPort": 587,
2020-12-22T14:32:54.629061+00:00 app[web.1]:       "emailSenderAddress": "[email protected]",
2020-12-22T14:32:54.629063+00:00 app[web.1]:       "emailSenderName": "[epic-games] Epic Games Free Captcha",
2020-12-22T14:32:54.629064+00:00 app[web.1]:       "emailRecipientAddress": "[email protected]",
2020-12-22T14:32:54.629065+00:00 app[web.1]:       "secure": true,
2020-12-22T14:32:54.629066+00:00 app[web.1]:       "auth": {
2020-12-22T14:32:54.629067+00:00 app[web.1]:         "user": "[email protected]",
2020-12-22T14:32:54.629067+00:00 app[web.1]:         "pass": "xxxxxxxxxxxxxxxxx"
2020-12-22T14:32:54.629068+00:00 app[web.1]:       }
2020-12-22T14:32:54.629068+00:00 app[web.1]:     }
2020-12-22T14:32:54.630954+00:00 app[web.1]: [2020-12-22 14:32:54.628 +0000] ERROR (18 on 9a3fc140-ec96-4f75-b125-396de63ec2f3): 140647282953544:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
2020-12-22T14:32:54.630955+00:00 app[web.1]: 
2020-12-22T14:32:54.630956+00:00 app[web.1]:     Error: 140647282953544:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
2020-12-22T14:32:54.630957+00:00 app[web.1]:     
2020-12-22T14:32:54.631307+00:00 app[web.1]: [2020-12-22 14:32:54.630 +0000] ERROR (18 on 9a3fc140-ec96-4f75-b125-396de63ec2f3): 140647282953544:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
2020-12-22T14:32:54.631308+00:00 app[web.1]: 
2020-12-22T14:32:54.631309+00:00 app[web.1]:     Error: 140647282953544:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
2020-12-22T14:32:54.631309+00:00 app[web.1]:     
2020-12-22T14:32:54.674790+00:00 app[web.1]: Exiting...
2020-12-22T14:32:54.678686+00:00 app[web.1]: Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
2020-12-22T14:32:54.683762+00:00 app[web.1]: OK
2020-12-22T14:32:54.814006+00:00 heroku[web.1]: Process exited with status 0
2020-12-22T14:32:54.869366+00:00 heroku[web.1]: State changed from up to crashed

In this 2020-12-22T14:32:54.629045+00:00 line the error started.

Excessive Captcha e-mails

Hey there, got everything setup last night, thank you for taking the time to put together such a comprehensive solution and readme!

However.. It worked great for the first few hours but now it's serving no purpose other than spamming me with captcha emails so far, none of which have actually had me solve a captcha. I open it I get the green successfull message, then about 2 or 3 more e-mails less than a minute later. Then silence for about an hour I think? Then we're back at it again.

Can I change the frequency that this runs to reduce these? It seemed to be working great for the first few hours but I fear the frequency at which it's running quickly causes EPIC to flag and require captcha every consecutive login there after.

How to adjust run schedule?

I modified the Github Workflow for "EpicGamesFreeGamesRun" to run the cron job every 7 days, i.e 168 hours. I ran the workflow and thought it would make a change, but I am still getting the "Epic Games Free Captcha" emails from Heroku every 4 hours or so.

It seem that I have to constantly generate a new cookie and update Github Secrets. I think if the run time is once every 7 days, it won't expire the cookie that quickly, but I can't seem to figure out why Heroku is still running the job every 4 hours.

Still unable to claim games with latest build

I've deleted my Heroku project and Github fork and set it up from scratch.

I'm still getting the same issue.

I'm not using any cookies this time.

image

2021-05-22T05:28:02.750969+00:00 app[web.1]:         at TLSSocket.SMTPConnection._onSocketData (/usr/app/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)

2021-05-22T05:28:02.750969+00:00 app[web.1]:         at TLSSocket.emit (events.js:314:20)

2021-05-22T05:28:02.750969+00:00 app[web.1]:         at addChunk (_stream_readable.js:297:12)

2021-05-22T05:28:02.750970+00:00 app[web.1]:         at readableAddChunk (_stream_readable.js:272:9)

2021-05-22T05:28:02.750970+00:00 app[web.1]:         at TLSSocket.Readable.push (_stream_readable.js:213:10)

2021-05-22T05:28:02.775704+00:00 app[web.1]: Exiting...

2021-05-22T05:28:02.776495+00:00 app[web.1]: Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.

2021-05-22T05:28:02.785798+00:00 app[web.1]: OK

2021-05-22T05:28:02.831273+00:00 heroku[web.1]: Process exited with status 0

2021-05-22T05:28:02.934913+00:00 heroku[web.1]: State changed from up to crashed


Unable to claim games

Previously, I was using the cookies and it would claim games for me (but mostly fails).

I saw that this Github project got updated, so I removed my fork and forked it again. I also removed all my Heroku instances and set up everything from scratch. This time, I'm not using the cookie and I'm just using my epic games username & password. I don't have MFA configured on my MFA account.

This is the log I get and I don't know what is wrong or how to troubleshoot it. Can someone point me in the right direction?

 Apr 15 12:08:04 epicgamesclaimeradminrl heroku/web.1 State changed from crashed to starting
Apr 15 12:08:08 epicgamesclaimeradminrl heroku/web.1 Starting process with command `docker-entrypoint.sh`
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 Incoming env vars:
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 RUN_ON_STARTUP: true
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 CRON_SCHEDULE: 
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 RUN_ONCE: true
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 No JSON file found
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 Setting config variables
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 Run on startup: true
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 Run once: true
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 > [email protected] start /usr/app
Apr 15 12:08:11 epicgamesclaimeradminrl app/web.1 > node dist/src/index.js
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1 [2021-04-15 19:08:12.203 +0000] INFO  (18 on 742d48f1-cb33-447f-85e3-3acf925794e0): Checking free games for [email protected] 
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1 [2021-04-15 19:08:12.236 +0000] ERROR (18 on 742d48f1-cb33-447f-85e3-3acf925794e0): Unexpected end of JSON input
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1     SyntaxError: Unexpected end of JSON input
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1         at JSON.parse (<anonymous>)
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1         at Object.newCookieJar (/usr/app/src/common/request.ts:49:29)
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1         at /usr/app/src/index.ts:16:29
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1         at async Promise.all (index 0)
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1         at main (/usr/app/src/index.ts:31:3)
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1 Exiting...
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Apr 15 12:08:12 epicgamesclaimeradminrl app/web.1 OK
Apr 15 12:08:12 epicgamesclaimeradminrl heroku/web.1 Process exited with status 0
Apr 15 12:08:12 epicgamesclaimeradminrl heroku/web.1 State changed from starting to crashed

MailGun needing credit card verification.

Hello,

When trying to run the workflow "EpicGamesFreeGamesDeploy" i get the following error:

image

Is it possible to to avoid this credit card verification, or am i doing something wrong?

Thanks.

Wrong Cron Job Configuration

EpicGamesFreeGamesRun is misconfigured and runs 2-3 times in every hour.

* 0-23 * * * -> Runs every minute (in EpicGamesFreeGamesRun)

0 0-23 * * * -> Runs every hour, on the hour (it should be)

There is no need to run a dyno every hour, for me it is waste of free dyno hours.

I think this definition more sense:

0 */4 * * * -> Runs on the 0, 4, 8, 12, 16 and 20th hour (runs 6 times in a day)

I didn't create a PR because I don't know which settings you will prefer.

TOTP_MFA?

Does this work if you have 2FA enabled on your Heroku account? According to Github Actions, it seems to be stuck asking for "TOTP_MFA". My Heroku has 2FA enabled, but I'm not sure how to add this as a variable into Github secrets...

image

Update:

I disabled 2FA on my Heroku account and I'm still getting the same error as above...any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.