fix: Consistently use overriden config paths with -config flag#1346
fix: Consistently use overriden config paths with -config flag#1346jentfoo wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
Neo - PR Security ReviewNo security issues found Highlights
Comment |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughConfiguration file handling is refactored in both client and server main modules to detect custom Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When -config is provided, goflags' Parse() still attempts to read the default config path first, causing errors like:
[FTL] Could not parse options: open /home/USER/.config/interactsh-server/config.yaml: read-only file system
This change scans os.Args for -config before Parse() and call SetConfigFilePath() so goflags uses the custom path from the start. The post-parse MergeConfigFile/FileExists checks are removed since Parse() already performs the same existence check and merge internally.
Applied to both interactsh-server and interactsh-client.
d1ec5c6 to
81f221c
Compare
When
-configis provided, goflags'Parse()still attempts to read the default config path first, causing errors like:This change scans
os.Argsfor-configbeforeParse()and callSetConfigFilePath()so goflags uses the custom path from the start. The post-parse MergeConfigFile/FileExists checks are removed sinceParse()already performs the same existence check and merge internally.Applied to both interactsh-server and interactsh-client.
Summary by CodeRabbit
-configor--configcommand-line flags are now properly recognized and loaded. Both the standard flag forms (e.g.,-config=PATHand--config=PATH) are now correctly handled before command-line option processing.