Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $XDG_CONFIG_HOME on Linux #138

Closed
rapiz1 opened this issue Sep 24, 2022 · 3 comments
Closed

Use $XDG_CONFIG_HOME on Linux #138

rapiz1 opened this issue Sep 24, 2022 · 3 comments

Comments

@rapiz1
Copy link

rapiz1 commented Sep 24, 2022

Thanks for your great work! I encountered this project when I was using skk's nail-cli and wanted to switch to geoip2. It's a good enhancement. However, I noted nali still uses the config directory in a way only legacy software does.

~/.nali is a non-standard directory for configurations on Linux. The best practice is $XDG_CONFIG_HOME/nali. The main drawback for non-standard configuration directory is that it messes up with users' home directory and is not easy to organize.

To keep nali backward-compatible as well as conform with the XDG standards, I propose following solution:

  1. Support $XDG_CONFIG_HOME/nali as a config directory. When nali stars, it scans ~/.nali, $XDG_CONFIG_HOME/nali for configs and use the first hit.
  2. If none of above directory exists, create $XDG_CONFIG_HOME/nali with the default configuration.

I understand nali works on multiple platforms besides Linux. I don't know much about other platforms and they may also have similar issues.

@zu1k
Copy link
Owner

zu1k commented Sep 24, 2022

Good suggestion, nali's configuration file and ip database directory really need to be more standardized.

But I've been busy recently, if you can pull a request for this I would be very grateful.

@zu1k
Copy link
Owner

zu1k commented Sep 24, 2022

WorkDirPath = os.Getenv("NALI_HOME")

For existing versions of nali, you can change the directory via the environment variable NALI_HOME.

@zu1k
Copy link
Owner

zu1k commented Oct 17, 2022

This was modified in version v0.6.0

@zu1k zu1k closed this as completed Oct 17, 2022
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

No branches or pull requests

2 participants