refactor: use go workspace for syncthing gui (#549)

This commit is contained in:
naison
2025-04-19 12:09:06 +08:00
committed by GitHub
parent c9f1ce6522
commit 48e30b4344
15 changed files with 2072 additions and 142 deletions

View File

@@ -43,6 +43,14 @@ func init() {
if err != nil {
panic(err)
}
err = os.MkdirAll(GetSyncthingPath(), 0755)
if err != nil {
panic(err)
}
err = os.Chmod(GetSyncthingPath(), 0755)
if err != nil {
panic(err)
}
path := filepath.Join(HomePath, ConfigFile)
_, err = os.Stat(path)
@@ -74,10 +82,6 @@ func GetSyncthingPath() string {
return filepath.Join(DaemonPath, SyncthingDir)
}
func GetSyncthingGUIPath() string {
return filepath.Join(DaemonPath, SyncthingDir, SyncthingGUIDir)
}
func GetConfigFilePath() string {
return filepath.Join(HomePath, ConfigFile)
}

View File

@@ -9,8 +9,6 @@ import (
const (
SyncthingDir = "syncthing"
SyncthingGUIDir = "gui"
DefaultRemoteDir = "/kubevpn-data"
// EnvDisableSyncthingLog disable syncthing log, because it can not set output writer, only write os.Stdout or io.Discard