Add multi-account support - #18
Conversation
Ronchy2000
left a comment
There was a problem hiding this comment.
Thanks for the update. The two compatibility concerns raised on the previous PR — the workflow timeout and fallback behavior for an invalid EPIC_ACCOUNTS value — have now been addressed.
I would like to keep this PR open and deploy the current revision to a dedicated preview branch for a short soak-testing period before merging it into master. I will run several real multi-account workflow executions and review the logs and artifacts to make sure the behavior remains stable across multiple runs.
# Conflicts: # .github/workflows/epic-gamer.yml # README.en.md # README.md
|
Thanks for the review! I've updated the branch with the latest master (the hcaptcha fixes and #20) and resolved the merge conflicts, so it's clean to merge again — a preview branch cut from the current head would include the up-to-date captcha stack for the soak runs. Let me know if anything comes up during testing. |
Summary
Adds multi-account support so a single fork can claim Epic freebies for several accounts in one run, while staying fully backward compatible with the existing single-account setup.
This is a re-submission of #15 addressing the two review points:
EPIC_EMAIL/EPIC_PASSWORDwhenEPIC_ACCOUNTSis set but contains no valid entries, so a malformed secret can't break an already-working single-account repo.Changes
app/accounts.py:parse_accounts()reads credentials fromEPIC_ACCOUNTS(multilineemail:password, one per line) with priority, and falls back toEPIC_EMAIL/EPIC_PASSWORDifEPIC_ACCOUNTSis unset or has no valid lines. Passwords may contain colons (split on first:only). Emails are masked before logging.app/deploy.py: new_run_accounts()iterates every configured account sequentially. A failure in one account is logged and the run continues to the next; the job exits non-zero only if at least one account failed, with a summary of successes/failures.app/settings.py: adds optionalEPIC_ACCOUNTSsecret;EPIC_EMAIL/EPIC_PASSWORDnow default to empty so an accounts-only setup starts cleanly..github/workflows/epic-gamer.yml:timeout-minutesnow reads theJOB_TIMEOUT_MINUTESrepository variable (default60), and passesEPIC_ACCOUNTSthrough to the run..env.example/README.md/README.en.md: document multi-account config and the timeout variable.Behavior notes
JOB_TIMEOUT_MINUTES.EPIC_ACCOUNTSis intended for GitHub Actions secrets. Local.envparsers may not support multiline values, so single-account local runs should keep usingEPIC_EMAIL/EPIC_PASSWORD(noted in.env.example).Compatibility
Existing setups that only use
EPIC_EMAIL/EPIC_PASSWORDneed no changes and behave exactly as before.