clashN icon indicating copy to clipboard operation
clashN copied to clipboard

Configuration Switching Fails Due to mihomo's SAFE_PATHS Restriction

Open cf00-zywzsr opened this issue 6 months ago • 4 comments

After a recent update to mihomo , configuration switching in ClashN fails due to the new SAFE_PATHS environment variable restriction. According to the mihomo documentation, all paths in the configuration file are now limited to the working directory (workdir) or paths specified in the SAFE_PATHS environment variable (semicolon-separated on Windows). This change, introduced in mihomo v1.19.2 and enforced in later versions (e.g., alpha version 2116640), restricts the /configs RESTful API's path parameter to only allow directories within workdir or SAFE_PATHS.

cf00-zywzsr avatar May 30 '25 04:05 cf00-zywzsr

你自己设置 SAFE_PATHS 后不行?

2dust avatar May 30 '25 10:05 2dust

Thank you for your response! I’ve managed to resolve the issue, but it took considerable effort to identify the cause related to the SAFE_PATHS restriction. My goal is to share this solution with others who might face the same problem. Do you have any suggestions on the best way to document or share this fix for the community? I appreciate your guidance!

cf00-zywzsr avatar Jun 01 '25 13:06 cf00-zywzsr

Thank you for your response! I’ve managed to resolve the issue, but it took considerable effort to identify the cause related to the SAFE_PATHS restriction. My goal is to share this solution with others who might face the same problem. Do you have any suggestions on the best way to document or share this fix for the community? I appreciate your guidance!

Hi, how did you fix this issue? Could you share it here? Thank you!

zdm9981 avatar Jun 11 '25 12:06 zdm9981

The fix is in this commit: https://github.com/cf00-zywzsr/clashN/commit/9829873ca5b8abeb1a91401d80f15b59d983aa70

cf00-zywzsr avatar Jun 11 '25 15:06 cf00-zywzsr