ESET Account Generator #721
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ESET Account Generator | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| account: | |
| description: Number of Accounts to be generated (default = 1) | |
| required: false | |
| default: '1' | |
| key: | |
| description: Number of Keys to be generated (default = 0) | |
| required: false | |
| default: '0' | |
| mail: | |
| description: Choose the mail provider to generate license | |
| required: true | |
| type: choice | |
| options: | |
| - inboxes | |
| - 1secmail | |
| - fakemail | |
| - guerrillamail | |
| - developermail | |
| # - mailticking added cloudflare captcha. | |
| # - incognitomail added cloudflare captcha. | |
| default: fakemail | |
| key_type: | |
| description: Legacy option | |
| required: true | |
| type: choice | |
| options: | |
| - --key | |
| - --small-business-key | |
| default: --key | |
| branch: | |
| description: Key-Gen Repository branch (default = main) | |
| required: false | |
| default: main | |
| schedule: | |
| - cron: '0 */8 * * *' | |
| jobs: | |
| generate-and-commit: | |
| runs-on: ubuntu-latest | |
| env: | |
| DEFAULT_ACCOUNT: '1' | |
| DEFAULT_KEY: '0' | |
| DEFAULT_MAIL: fakemail | |
| DEFAULT_KEY_TYPE: --key | |
| DEFAULT_BRANCH: main | |
| OUTPUT_FILENAME: ESET-CODES.md | |
| TEMP_OUTPUT_FILE: key_gen_output.log | |
| LOG_DIR: logs | |
| LAST_RUN_DATE_FILE: edge/assets/logs/.last_run_date | |
| steps: | |
| - name: Checkout Repository Code | |
| uses: actions/checkout@v4 | |
| - name: Create Log Directory | |
| run: | | |
| mkdir -p "${{ env.LOG_DIR }}" | |
| echo "Created directory: ${{ env.LOG_DIR }}" | |
| - name: Generate Accounts | |
| run: | | |
| ACCOUNT=${{ github.event.inputs.account || env.DEFAULT_ACCOUNT }} | |
| KEY=${{ github.event.inputs.key || env.DEFAULT_KEY }} | |
| MAIL=${{ github.event.inputs.mail || env.DEFAULT_MAIL }} | |
| KEY_TYPE=${{ github.event.inputs.key_type || env.DEFAULT_KEY_TYPE }} | |
| BRANCH=${{ github.event.inputs.branch || env.DEFAULT_BRANCH }} | |
| echo "⚙️ Configuration" | |
| echo "Triggered by: ${{ github.event_name }}" | |
| echo "Account Count: $ACCOUNT" | |
| echo "Key Count: $KEY" | |
| echo "Mail Provider: $MAIL" | |
| echo "---------------------" | |
| TEMP_OUTPUT="${{ env.TEMP_OUTPUT_FILE }}" | |
| rm -f "$TEMP_OUTPUT" | |
| echo "Cloning Key-Gen repository..." | |
| git clone -b ${BRANCH} https://github.com/rzc0d3r/ESET-KeyGen.git | |
| cd ESET-KeyGen | |
| echo "Setting up Python environment..." | |
| sudo apt-get update -y > /dev/null | |
| sudo apt-get install -y python3-pip python3-venv > /dev/null | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| pip install -r requirements.txt > /dev/null | |
| echo "Generating accounts..." | |
| if [[ ${ACCOUNT} -ne 0 ]]; then | |
| python3 main.py --auto-detect-browser --account --email-api ${MAIL} --skip-update-check --no-logo --disable-progress-bar --disable-logging --repeat ${ACCOUNT} | tee "../$TEMP_OUTPUT" | |
| fi | |
| if [[ ${KEY} -ne 0 ]]; then | |
| APPEND_FLAG="" | |
| if [[ -f "../$TEMP_OUTPUT" ]]; then | |
| APPEND_FLAG="-a" | |
| fi | |
| python3 main.py --auto-detect-browser ${KEY_TYPE} --email-api ${MAIL} --skip-update-check --no-logo --disable-progress-bar --disable-logging --repeat ${KEY} | tee $APPEND_FLAG "../$TEMP_OUTPUT" | |
| fi | |
| cd .. | |
| echo "✨ Formatting the new entry..." | |
| LICENSE_KEY=$(grep '^License Key:' "$TEMP_OUTPUT" | sed 's/^License Key: //' || true) | |
| LICENSE_OUT_DATE=$(grep '^License Out Date:' "$TEMP_OUTPUT" | sed 's/^License Out Date: //' || true) | |
| ACCOUNT_EMAIL=$(grep '^Account Email:' "$TEMP_OUTPUT" | sed 's/^Account Email: //' || true) | |
| ACCOUNT_PASSWORD=$(grep '^Account Password:' "$TEMP_OUTPUT" | sed 's/^Account Password: //' || true) | |
| NEW_ENTRY_FILE="new_entry.md.tmp" | |
| CURRENT_DATETIME_IRAN=$(TZ='Asia/Tehran' date '+%A, %d %B %Y, %H:%M IRN') | |
| { | |
| echo "### Generated On: ${CURRENT_DATETIME_IRAN}" | |
| echo "" | |
| echo "> [!IMPORTANT]" | |
| echo "> **POLICY CHANGE: ESET has discontinued free trial VPN codes.**" | |
| echo "> This generator now only creates ESET HOME accounts." | |
| echo "> No VPN codes will be provided." | |
| echo "" | |
| echo "> [!NOTE]" | |
| echo "> Triggered by: **${{ github.event_name }}**" | |
| echo "> Account licenses are valid for ~30 days." | |
| echo "" | |
| echo "<br/>" | |
| } > "$NEW_ENTRY_FILE" | |
| # <--- CHANGE: Removed the entire "if [[ -n "$VPN_CODES_LIST" ]]" block as it's now obsolete. | |
| if [[ -n "$LICENSE_KEY" ]]; then | |
| { | |
| echo "" | |
| echo "**ESET BUSINESS SECURITY LICENSE**" | |
| echo "" | |
| echo '```yml' | |
| echo "Expiry: ${LICENSE_OUT_DATE:-N/A}" | |
| echo "License Key: ${LICENSE_KEY}" | |
| echo '```' | |
| echo "<br/>" | |
| echo "" | |
| } >> "$NEW_ENTRY_FILE" | |
| fi | |
| if [[ -n "$ACCOUNT_EMAIL" ]]; then | |
| { | |
| echo "" | |
| echo "**ESET ACCOUNT Credentials**" | |
| echo "" | |
| echo '```yml' | |
| echo "Email: ${ACCOUNT_EMAIL}" | |
| echo "Password: ${ACCOUNT_PASSWORD:-N/A}" | |
| echo '```' | |
| echo "<br/>" | |
| echo "" | |
| } >> "$NEW_ENTRY_FILE" | |
| fi | |
| { | |
| echo "Everything you need to know about ESET. [^1]" | |
| echo "Credits [^2]" | |
| } >> "$NEW_ENTRY_FILE" | |
| OUTPUT_FILE="${{ env.OUTPUT_FILENAME }}" | |
| LAST_RUN_FILE="${{ env.LAST_RUN_DATE_FILE }}" | |
| CURRENT_DATE_UTC=$(date -u +'%Y-%m-%d') | |
| LAST_RUN_DATE=$(cat "$LAST_RUN_FILE" 2>/dev/null || echo "never") | |
| FOOTNOTES="<br/>\n\n[^1]: [View Full Post - Out of work](https://t.me/F_NiREvil/2113)\n\n[^2]: [ESET KeyGen - Trial-Key generator for ESET Products](https://github.com/rzc0d3r/ESET-KeyGen)" | |
| # <--- CHANGE: The daily file reset logic is commented out. The script will now always prepend. | |
| # if [[ "$CURRENT_DATE_UTC" != "$LAST_RUN_DATE" ]] || [[ ! -f "$OUTPUT_FILE" ]]; then | |
| # echo "Overwriting ${OUTPUT_FILE} (new day or file not found)." | |
| # { | |
| # echo "#" | |
| # cat "$NEW_ENTRY_FILE" | |
| # echo -e "$FOOTNOTES" | |
| # } > "$OUTPUT_FILE" | |
| # echo "$CURRENT_DATE_UTC" > "$LAST_RUN_FILE" | |
| # else | |
| echo "Prepending new entry to ${OUTPUT_FILE}." | |
| OLD_CONTENT_BODY_TMP="old_content_body.tmp" | |
| # Create the file if it doesn't exist to prevent errors | |
| touch "$OUTPUT_FILE" | |
| # Safely read the old content, ignoring the first line (header) and last lines (footnotes) | |
| tail -n +2 "$OUTPUT_FILE" | head -n -4 > "$OLD_CONTENT_BODY_TMP" | |
| { | |
| echo "## ESET Trial Accounts" | |
| cat "$NEW_ENTRY_FILE" | |
| echo "<hr><br/>" # Using a horizontal rule for better separation | |
| echo "" | |
| cat "$OLD_CONTENT_BODY_TMP" | |
| echo -e "$FOOTNOTES" | |
| } > "$OUTPUT_FILE" | |
| # fi | |
| rm -f *.tmp "${{ env.TEMP_OUTPUT_FILE }}" | |
| echo "File update complete for ${OUTPUT_FILE}." | |
| echo "Final content of ${OUTPUT_FILE} (first 20 lines):" | |
| head -n 20 "${OUTPUT_FILE}" | |
| - name: Commit and Push Generated Accounts | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: 'feat: Update ESET generated Accounts (${{ github.event_name }})' | |
| file_pattern: '${{ env.OUTPUT_FILENAME }} ${{ env.LAST_RUN_DATE_FILE }}' | |
| commit_user_name: ESET Security Bot | |
| commit_user_email: pr@eset.com | |
| commit_options: --signoff | |
| # push_options: '--force' |