Repository navigation
Validate config inputs: hostname (closes #8) - #29
Merged
Merged
Conversation
The host is interpolated straight into the XMRig pool URL, so validate it in parse_config: it must be set and match a hostname/FQDN/IPv4/IPv6 charset ([A-Za-z0-9._:-]). This rejects an empty/missing value, the unfilled template placeholder (<...>), and shell/URL metacharacters — failing fast with a clear message before any source patch or build. The DONATION half of #8 landed earlier in #26; this completes the issue. Co-Authored-By: Claude Opus 4.8 <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.
Problem (#8)
Config inputs were interpolated into the XMRig source patch / pool URL with no validation. The DONATION half was fixed in #26 (integer 0–100). This adds the hostname half.
Fix
parse_confignow validatesP2POOL_NODE_HOSTNAMEbefore any build:^[A-Za-z0-9._:-]+$(hostname / FQDN / IPv4 / IPv6)This also rejects the unfilled template placeholder
<P2POOL_NODE_HOSTNAME>and any shell/URL metacharacters (space,;,/,{, …) that would be unsafe in the generated pool URL.Pithead/XMRig check
The accepted charset covers every value Pithead/stratum needs — a LAN hostname, an FQDN, or an IPv4/IPv6 literal — all of which XMRig accepts as a pool
urlhost. No integration impact (the host flows to<host>:3333, unchanged).Test
Accepts
box,box.lan,10.0.0.5,fe80::1,rig-01; rejects empty, missing,bad host,evil;rm,a/b, and the<...>placeholder.make testgreen. With #26 (DONATION) already merged, this closes #8.🤖 Generated with Claude Code