Skip to content

Add multi-account support - #18

Open
nianshou555qiansui wants to merge 3 commits into
Ronchy2000:masterfrom
nianshou555qiansui:add-multi-account-support
Open

Add multi-account support#18
nianshou555qiansui wants to merge 3 commits into
Ronchy2000:masterfrom
nianshou555qiansui:add-multi-account-support

Conversation

@nianshou555qiansui

@nianshou555qiansui nianshou555qiansui commented Jul 6, 2026

Copy link
Copy Markdown

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:

  1. Fall back to EPIC_EMAIL / EPIC_PASSWORD when EPIC_ACCOUNTS is set but contains no valid entries, so a malformed secret can't break an already-working single-account repo.
  2. Make the job timeout configurable via a repository variable instead of a hard-coded 30 minutes.

Changes

  • New app/accounts.py: parse_accounts() reads credentials from EPIC_ACCOUNTS (multiline email:password, one per line) with priority, and falls back to EPIC_EMAIL / EPIC_PASSWORD if EPIC_ACCOUNTS is 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 optional EPIC_ACCOUNTS secret; EPIC_EMAIL / EPIC_PASSWORD now default to empty so an accounts-only setup starts cleanly.
  • .github/workflows/epic-gamer.yml: timeout-minutes now reads the JOB_TIMEOUT_MINUTES repository variable (default 60), and passes EPIC_ACCOUNTS through to the run.
  • .env.example / README.md / README.en.md: document multi-account config and the timeout variable.

Behavior notes

  • Multi-account runs are sequential, so the timeout scales with account count — hence the configurable JOB_TIMEOUT_MINUTES.
  • If any account fails, the whole job is marked failed, while still attempting every configured account first. This keeps failures visible while avoiding one broken account blocking the rest.
  • EPIC_ACCOUNTS is intended for GitHub Actions secrets. Local .env parsers may not support multiline values, so single-account local runs should keep using EPIC_EMAIL / EPIC_PASSWORD (noted in .env.example).

Compatibility

Existing setups that only use EPIC_EMAIL / EPIC_PASSWORD need no changes and behave exactly as before.

@Ronchy2000 Ronchy2000 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@nianshou555qiansui

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants