Fix mutable defaults, security hardening, and bug fixes#623
Open
pjleduc wants to merge 4 commits intofatihak:mainfrom
Open
Fix mutable defaults, security hardening, and bug fixes#623pjleduc wants to merge 4 commits intofatihak:mainfrom
pjleduc wants to merge 4 commits intofatihak:mainfrom
Conversation
Replace dangerous mutable defaults (=[], ={}) with =None pattern
to prevent shared state bugs across function calls.
Files: display_manager, abstract_display, inky_display, mock_display,
waveshare_display, image_utils, base_plugin, app_utils, config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- apikeys.py: strip newlines to prevent .env injection - settings.py: replace os.system() with subprocess.Popen() - inkypi.py: use os.urandom() for secret key, narrow bare except - plugin.py: graceful 400 on missing plugin_id, fix mutable default Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- calendar.py: skip failed calendar URLs instead of crashing plugin - weather.py: fix Open-Meteo forecast day label off-by-one (PR fatihak#613) - model.py: remove duplicate scheduled refresh logic - refresh_task.py: add 60s timeout to prevent indefinite hangs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
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.
Summary
=[]/={}defaults with=Nonepattern across 9 files (display_manager, abstract_display, inky_display, mock_display, waveshare_display, image_utils, base_plugin, app_utils, config)os.system()withsubprocess.Popen()for reboot/shutdown, useos.urandom()for Flask secret key, narrow bareexcepttoexcept OSErrorrefresh_event.wait()to prevent indefinite hangs on manual updatesplugin_idmissing from form dataTest plan
🤖 Generated with Claude Code