Compare commits

...
2 Commits
Author SHA1 Message Date
yisier 8be1e9f865 工作目录bug修复 2022-10-31 10:40:47 +08:00
yisier c0667e2dca Update README.md 2022-10-30 00:45:51 +08:00
3 changed files with 10 additions and 13 deletions
+2 -2
View File
@@ -12,8 +12,8 @@
## 更新日志
- 2022-10-30
***新增***:在管理面板中新增客户端时,可以多个配置黑名单IP,用于防止被肉鸡扫描端口。
***优化***:无论是否注册系统服务,直接执行 nps 时只会读取当前目录下的配置文件。0.26.12 版本还原了注册系统功能,使用方式和以前一样。
***新增***:在管理面板中新增客户端时,可以配置多个黑名单IP,用于防止被肉鸡扫描端口或被恶意攻击。
***优化***:0.26.12 版本还原了注册系统功能,使用方式和以前一样。无论是否注册了系统服务,直接执行 nps 时只会读取当前目录下的配置文件。
- 2022-10-27
+2 -9
View File
@@ -40,15 +40,8 @@ func main() {
common.PrintVersion()
return
}
if len(os.Args) <= 1 {
if err := beego.LoadAppConfig("ini", filepath.Join("./", "conf", "nps.conf")); err != nil {
log.Fatalln("load config file error", err.Error())
}
} else {
if err := beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf")); err != nil {
log.Fatalln("load config file error", err.Error())
}
if err := beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf")); err != nil {
log.Fatalln("load config file error", err.Error())
}
common.InitPProfFromFile()
+6 -2
View File
@@ -11,8 +11,12 @@ import (
//windows system, select the C:\Program Files\nps as config directory if exist, or select ./
func GetRunPath() string {
var path string
if path = GetInstallPath(); !FileExists(path) {
return GetAppPath()
if len(os.Args) <= 1 {
return "./"
} else {
if path = GetInstallPath(); !FileExists(path) {
return GetAppPath()
}
}
return path
}