Skip to content

fix: Consistently use overriden config paths with -config flag#1346

Open
jentfoo wants to merge 1 commit intoprojectdiscovery:devfrom
jentfoo:fix/startup-config-override
Open

fix: Consistently use overriden config paths with -config flag#1346
jentfoo wants to merge 1 commit intoprojectdiscovery:devfrom
jentfoo:fix/startup-config-override

Conversation

@jentfoo
Copy link
Copy Markdown

@jentfoo jentfoo commented Mar 13, 2026

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.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced configuration file path detection for both client and server applications. Custom configuration files specified via -config or --config command-line flags are now properly recognized and loaded. Both the standard flag forms (e.g., -config=PATH and --config=PATH) are now correctly handled before command-line option processing.

@neo-by-projectdiscovery-dev
Copy link
Copy Markdown

neo-by-projectdiscovery-dev bot commented Mar 13, 2026

Neo - PR Security Review

No security issues found

Highlights

  • Incremental review confirmed no new code modifications in this commit
  • Base branch updated from main to dev without code changes
  • Previously reviewed config path handling logic remains unchanged

Comment @pdneo help for available commands. · Open in Neo

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 39fc1a65-e3f1-4d6c-9e4b-215f58ad3de2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Configuration file handling is refactored in both client and server main modules to detect custom -config/--config flags before flag parsing rather than after, moving the configuration resolution logic earlier in the initialization sequence.

Changes

Cohort / File(s) Summary
Configuration File Pre-Parse Detection
cmd/interactsh-client/main.go, cmd/interactsh-server/main.go
Adds pre-Parse logic to detect custom config paths from -config or --config flags (including =PATH forms) and configures the flag parser accordingly. Removes post-Parse config file merging that occurred after flag parsing completed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A twitch of the nose, a configuration quest,
From after to before, we've rearranged the test,
Config flags now parse with grace so early and bright,
Detecting the paths before options take flight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: handling the -config flag override consistently across the codebase by moving config path detection before Parse() instead of after.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jentfoo jentfoo changed the base branch from main to dev March 16, 2026 05:24
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.
@jentfoo jentfoo force-pushed the fix/startup-config-override branch from d1ec5c6 to 81f221c Compare March 25, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant