Add SUBSTACK_EMAIL/SUBSTACK_PASSWORD environment variables#47
Open
io12 wants to merge 1 commit into
Open
Conversation
Currently the only way to supply premium-login credentials is by editing config.py, which is committed to the repo with placeholder values. This makes the tool awkward to use from contexts where the source isn't writable (e.g. packaged/installed rather than run from a live checkout) and encourages people to accidentally commit real credentials into config.py (as happened in PR timf34#36). SUBSTACK_EMAIL and SUBSTACK_PASSWORD now take precedence over config.py if set, and config.py itself becomes optional: the import no longer fails if the file is missing. Also fail fast with a clear error when --premium is used without --skip-login and no real credentials are configured anywhere. Previously this silently sent empty/placeholder strings into the Substack login form, launched a real browser, waited 30 seconds, and then either printed a generic "Login unsuccessful" message or, if the browser's own client-side validation blocked the empty submission, incorrectly reported success. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Currently the only way to supply premium-login credentials is by editing config.py, which is committed to the repo with placeholder values. This makes the tool awkward to use from contexts where the source isn't writable (e.g. packaged/installed rather than run from a live checkout) and encourages people to accidentally commit real credentials into config.py (as happened in PR #36).
SUBSTACK_EMAIL and SUBSTACK_PASSWORD now take precedence over config.py if set, and config.py itself becomes optional: the import no longer fails if the file is missing.
Also fail fast with a clear error when --premium is used without --skip-login and no real credentials are configured anywhere. Previously this silently sent empty/placeholder strings into the Substack login form, launched a real browser, waited 30 seconds, and then either printed a generic "Login unsuccessful" message or, if the browser's own client-side validation blocked the empty submission, incorrectly reported success.