Skip to content

Conversation

@h-sigma
Copy link
Contributor

@h-sigma h-sigma commented Oct 16, 2025

By using dirs::config_dir, we use a more common standard for finding/storing config files, one that doesn't pollute the end-user's home directory. Examples:

Linux: /home/h-sigma/.config/.rustscan.toml # $XDG_CONFIG_HOME or $HOME/.config
MacOS: /Users/h-sigma/Library/Application\ Support/.rustscan.toml # $HOME/Library/Application Support
Windows: C:\Users\h-sigma\AppData\Roaming # {FOLDERID_RoamingAppData}

I have kept the old path in the output messages and the code, for backwards compatibility, and if the config_dir doesn't have the config file, the code checks for the current solution /home/$USER/.rustscan.toml.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates RustScan's configuration file location from the user's home directory to platform-specific configuration directories using the dirs::config_dir() function. The change provides better adherence to OS-specific standards while maintaining backward compatibility.

  • Uses dirs::config_dir() for the new default config path (e.g., ~/.config/.rustscan.toml on Linux)
  • Implements fallback logic to check the old home directory location if the new path doesn't exist
  • Adds informational messages to notify users about both the primary and fallback config locations

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/input.rs Adds old_default_config_path() function, updates default_config_path() to use dirs::config_dir(), implements fallback logic in Config::read()
src/main.rs Adds informational message about the old config path for backwards compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@bee-san bee-san merged commit 4c056a9 into bee-san:master Nov 27, 2025
0 of 3 checks passed
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.

2 participants