Skip to content

Conversation

@Fabbi
Copy link
Owner

@Fabbi Fabbi commented Sep 28, 2025

No description provided.

zarmstrong and others added 30 commits September 17, 2025 15:56
created a new method of tracking redeemed keys, unique per platform
Fixes runtime NameError ('Status' not defined) caused by moving imports into main(). Also adds missing sys import used by --dump-csv. Behavior otherwise unchanged.
…ce and shows real source

auto.py
- Bootstrap AUTOSHIFT_PROFILE from --profile *before* importing `common`, so
  DATA_DIR/data_path resolve to `data/<profile>` correctly.
- Reorder imports (import os/sys + bootstrap first, then import from `common`).
- Keep the later runtime override in main() for parity; it’s now harmless.

query.py
- Print the banner only once per run via `_BANNER_SHOWN` guard (prevents start/end “flashing”).
- Remove ANSI blink/escape so the banner doesn’t flicker in terminals.
- Show the actual source being used (`SHIFT_SOURCE`, which may be a URL or a local file path)
  instead of a hard-coded permalink; keep attribution from `meta.attribution`.

Why
- `--profile` didn’t create/use per-profile subdirs because `common` read the env
  before it was set. Moving the env bootstrap earlier fixes that.
- The banner was misleading and noisy; now it’s accurate and printed once.

Testing
- `python3 autoshift/auto.py --profile USER-1 --redeem bl4:psn` creates/uses `data/USER-1/`.
- `--shift-source data/shiftcodes.json` shows that path in the banner.
- No DB/schema changes; key parsing/redeem flow unchanged.
- If `AUTOSHIFT_PROFILE` (or `--profile`) is set, append `Profile: <name>` to
  the banner for clarity.
This pull request introduces several improvements focused on password handling, debugging, and user guidance for the autoshift tool. The main changes address shell history issues with passwords containing special characters, provide safer and more flexible ways to supply passwords, and enhance debugging and attribution output.

Password handling and security improvements:

    Updated the README with detailed guidance on safely providing passwords containing special characters (like !), recommending environment variables and container secrets over direct CLI arguments, and warning about shell history expansion issues. Also documented debugging options and autoshift's password selection heuristic.
    In auto.py, added logic to prefer environment variable passwords (SHIFT_PASS or AUTOSHIFT_PASS_RAW) over CLI arguments when the CLI password might have been truncated by shell history expansion, especially if it contains a ! and the environment value is longer.
    Added support for an environment variable (AUTOSHIFT_DEBUG_SHOW_PW) to optionally print passwords in cleartext for debugging, with clear security warnings. [1] [2]

User experience and attribution:

    Improved the banner output in query.py to show attribution, the data source, and the active profile (if set via --profile or environment variable), while ensuring the banner is only shown once per run.

Technical and compatibility updates:

    Changed the shebang in auto.py to explicitly use Python 3 for better compatibility.
    Ensured that the profile environment variable (AUTOSHIFT_PROFILE) is set early in auto.py if the --profile argument is used, before importing other modules.
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.

4 participants