feat: 支持多APK与渠道变体,增加自动定位的服务管理CLI
This commit is contained in:
1 parent
7984785610
commit
87652364bc
33 files changed
+1110
-42
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/user"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func permissionGuidance(path string) string {
|
||||
identity, e := user.Current()
|
||||
if e != nil {
|
||||
return "请在服务器本机检查目录、只读挂载和实际服务账户的读写权限。"
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
quote := func(v string) string { return "'" + strings.ReplaceAll(v, "'", "''") + "'" }
|
||||
return "请先确认远程目录存在,然后在远程管理员 PowerShell 为实际服务账户授予修改权限:\nicacls " + quote(path) + " /grant " + quote("*"+identity.Uid+":(OI)(CI)M")
|
||||
}
|
||||
quote := func(v string) string { return "'" + strings.ReplaceAll(v, "'", `'"'"'`) + "'" }
|
||||
return "请先确认远程目录存在且文件系统可写,再为实际服务账户授权(系统需安装 setfacl):\nsudo setfacl -m " + quote("u:"+identity.Username+":rwx") + " " + quote(path) + "\nsystemd 服务还需确保该目录位于 ReadWritePaths/BindPaths 允许范围。"
|
||||
}
|
||||
Reference in new issue
Block a user