This commit is contained in:
link 2023-03-06 02:21:06 +00:00
parent a6df45dd79
commit 5f3c356106
4 changed files with 9 additions and 11 deletions

View File

@ -25,7 +25,7 @@ GetNetCard() {
fi fi
else else
if [ -d "/sys/devices/virtual/net" ] && [ -d "/sys/class/net" ]; then if [ -d "/sys/devices/virtual/net" ] && [ -d "/sys/class/net" ]; then
ls /sys/class/net/ | grep -v "$(ls /sys/devices/virtual/net/)" ls /sys/class/net/ | grep -v "$(ls /sys/devices/virtual/net/)" -w
fi fi
fi fi
} }

10
main.go
View File

@ -16,7 +16,6 @@ import (
"github.com/IceWhaleTech/CasaOS-Common/utils/constants" "github.com/IceWhaleTech/CasaOS-Common/utils/constants"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger" "github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/rclone/rclone/cmd/mountlib" "github.com/rclone/rclone/cmd/mountlib"
"github.com/rclone/rclone/fs/config/configfile"
util_http "github.com/IceWhaleTech/CasaOS-Common/utils/http" util_http "github.com/IceWhaleTech/CasaOS-Common/utils/http"
@ -83,7 +82,7 @@ func init() {
service.GetCPUThermalZone() service.GetCPUThermalZone()
service.MyService.Storages().InitStorages() service.MyService.Storages().InitStorages()
route.InitFunction() route.InitFunction()
configfile.Install() //configfile.Install()
service.MountLists = make(map[string]*mountlib.MountPoint) service.MountLists = make(map[string]*mountlib.MountPoint)
} }
@ -146,9 +145,9 @@ func main() {
"/v1/image", "/v1/image",
"/v1/samba", "/v1/samba",
"/v1/notify", "/v1/notify",
"/v1/driver", //"/v1/driver",
"/v1/cloud", //"/v1/cloud",
"/v1/recover", //"/v1/recover",
"/v1/other", "/v1/other",
route.V2APIPath, route.V2APIPath,
route.V2DocPath, route.V2DocPath,
@ -167,7 +166,6 @@ func main() {
} }
var events []message_bus.EventType var events []message_bus.EventType
events = append(events, message_bus.EventType{Name: "casaos:system:utilization", SourceID: common.SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}}) events = append(events, message_bus.EventType{Name: "casaos:system:utilization", SourceID: common.SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}})
events = append(events, message_bus.EventType{Name: "casaos:file:recover", SourceID: common.SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}})
events = append(events, message_bus.EventType{Name: "casaos:file:operate", SourceID: common.SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}}) events = append(events, message_bus.EventType{Name: "casaos:file:operate", SourceID: common.SERVICENAME, PropertyTypeList: []message_bus.PropertyType{}})
// register at message bus // register at message bus
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {

View File

@ -36,7 +36,7 @@ func InitV1Router() *gin.Engine {
r.GET("/ping", func(ctx *gin.Context) { r.GET("/ping", func(ctx *gin.Context) {
ctx.String(200, "pong") ctx.String(200, "pong")
}) })
r.GET("/v1/recover/:type", v1.GetRecoverStorage)
v1Group := r.Group("/v1") v1Group := r.Group("/v1")
v1Group.Use(jwt.ExceptLocalhost()) v1Group.Use(jwt.ExceptLocalhost())

View File

@ -68,9 +68,9 @@ func (s *storageStruct) MountStorage(mountPoint, deviceName string) error {
DirCacheTime: 5 * 60 * time.Second, DirCacheTime: 5 * 60 * time.Second,
PollInterval: time.Minute, PollInterval: time.Minute,
ReadOnly: false, ReadOnly: false,
Umask: 0, Umask: 18,
UID: ^uint32(0), // these values instruct WinFSP-FUSE to use the current user UID: 0,
GID: ^uint32(0), // overridden for non windows in mount_unix.go GID: 0,
DirPerms: os.FileMode(0777), DirPerms: os.FileMode(0777),
FilePerms: os.FileMode(0666), FilePerms: os.FileMode(0666),
CacheMode: 3, CacheMode: 3,