Repository navigation
Honor ArkOS4Clone HTTP proxy settings across sudo - #347
Merged
Merged
Conversation
PortMaster.sh is a stub since PortsMaster#350; the launch loop is in utils/pm_launch.txt. Takes main's stub, the proxy import is reworked in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
Reworks the launcher-side import onto the restructured launcher (PortsMaster#350). Instead of a helper run before sudo and passed through `env` on the GUI's launch line, harbourmaster.util.setup_proxy() runs at the start of both main()s: - pugwash's (the GUI and fifo_control, so autoinstall's runtime downloads too) and harbourmaster's CLI, which the launch line alone missed. - No extra python process on every launch, on every CFW. - es_settings.cfg is found from SUDO_USER's home, then HOME, then /home/ark. Kept from the original: the multi-root XML parsing, HTTP only (no PySocks), host/port/control character checks, credentials kept out of the log, and a proxy already in the environment (even an empty one) winning, with an explicit no_proxy kept. A host with a bad port of its own ("proxy:abc") is now refused even when ProxyPort is set. Tests move to pytest (tests/test_proxy.py), including that the bundled requests picks the proxy up and that both main()s set it up before HarbourMaster. conftest keeps main() away from the real settings files. Co-Authored-By: Linyu Yang <yly1228@foxmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
Member
|
Thanks for this, it's a real problem, and your validation, logging and precedence rules all carried over. I've pushed a rework onto your branch. The launcher was restructured in #350 (
Tested on a device through a real HTTP proxy, with the device's default route removed: a port installs through the proxy, and fails without the settings. |
Contributor
Author
|
Thanks for reviewing and merging this! |
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.
When an HTTP proxy is enabled in ArkOS4Clone's Wi-Fi settings, PortMaster can still attempt direct connections and time out downloading games. This was reproduced on an XF40H running ArkOS4Clone 09152026 with PortMaster 2026.07.28-1212 beta.
EmulationStation saves the proxy in es_settings.cfg and applies it to its own curl requests, without exporting standard proxy variables. PortMaster's sudo launch also filters inherited proxy variables.
This change reads enabled ArkOS HTTP settings before privilege escalation and passes the resulting proxy/bypass assignments to pugwash through env after sudo. Existing explicitly supplied HTTP(S)/ALL_PROXY variables take precedence and are passed through, including empty values; explicit bypass variables are also preserved. Missing or disabled settings leave the importer inactive.
The helper uses only the Python standard library, handles ES settings with multiple XML roots, and validates host/port and control characters before emitting any assignments. Bash passes values as array elements without evaluating shell text. Configuration errors do not abort startup, and warnings do not log proxy values or credentials. The helper is outside pylibs so it is available before pugwash extracts pylibs.zip, and is included by the existing release packaging.
Validation:
Scope: the ArkOS settings importer supports HTTP proxies. SOCKS5 import is deliberately excluded because PySocks is not bundled. No read-timeout change is included. Full graphical startup and an uninterrupted large download through the patched GUI have not been tested.