重构架构

This commit is contained in:
2026-02-20 18:44:43 +08:00
parent aba7b68439
commit cc71248ef4
52 changed files with 1404 additions and 2360 deletions

View File

@@ -0,0 +1,14 @@
package auth
import (
"fmt"
"os"
)
// RequireRoot 检查是否以 root 身份运行
func RequireRoot() error {
if os.Geteuid() != 0 {
return fmt.Errorf("此操作需要 root 权限,请使用 sudo 或切换到 root 用户")
}
return nil
}