hmgle / graftcp

A flexible tool for redirecting a given program's TCP traffic to SOCKS5 or HTTP proxy.
GNU General Public License v3.0
2.07k stars 174 forks source link

建议增加dotfiles配置 #53

Closed Nriver closed 1 year ago

Nriver commented 1 year ago

建议增加从 ~/graftcp-local/graftcp-local.conf 读取配置的选择,方便非root用户通过dotfiles管理配置

hmgle commented 1 year ago

graftcp-local 是支持 -config 指定配置路径的。 你的意思是否指默认加载 ~/graftcp-local/graftcp-local.conf 配置呢?

Nriver commented 1 year ago

是的,默认从dotfiles里读取配置。

hmgle commented 1 year ago

已增加 ~/.graftcp-local/graftcp-local.conf 配置文件加载,加载顺序请见: https://github.com/hmgle/graftcp#configuration

如有问题麻烦重新打开 issue。

hmgle commented 1 year ago

准备把 ~/.graftcp-local/graftcp-local.conf 路径更新为符合 XDG 基本路径规范 的路径:尝试读取 $XDG_CONFIG_HOME/graftcp/graftcp-local.conf 作为用户配置。

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

Nriver commented 1 year ago

$XDG_CONFIG_HOME/.graftcp/graftcp-local.conf吗? 少了一个点

hmgle commented 1 year ago

$XDG_CONFIG_HOME/.graftcp/graftcp-local.conf吗? 少了一个点

不是,因为 $XDG_CONFIG_HOME 一般已经有点了。可以用 ls -a ~/.config 看到里面大部分都是不带点的。

Nriver commented 1 year ago

哦,我试了一下Debian和manjaro都没有 $XDG_CONFIG_HOME,echo出来是空的,我cd过去就回到用户根目录了。

原来是指 .config 目录啊,那确实是不用再加点了。