DRAFT PR with all the changes from different forks#58
Draft
Fabbi wants to merge 96 commits intoFabbi:masterfrom
Draft
DRAFT PR with all the changes from different forks#58Fabbi wants to merge 96 commits intoFabbi:masterfrom
Fabbi wants to merge 96 commits intoFabbi:masterfrom
Conversation
…duce new usage instructions
created a new method of tracking redeemed keys, unique per platform
…ironment variable
…ce data path handling
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.