🎨 Support local file system sync & backup (#13663)

* 🎨 Use local file system sync & backup

* ⬆️ dejavu

* 🎨 Add the settings panel of local file system sync & backup

* 📝 Update user guides of local file system sync & backup

* 🎨 Adjust supported runtime environments
This commit is contained in:
Yingyi / 颖逸 2024-12-31 21:06:13 +08:00 committed by GitHub
parent 0386bc9ebd
commit 6ee4705e2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 408 additions and 32 deletions

View file

@ -20,6 +20,7 @@ import (
"net"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
@ -73,14 +74,19 @@ func IsLocalOrigin(origin string) bool {
}
func IsOnline(checkURL string, skipTlsVerify bool, timeout int) bool {
_, err := url.Parse(checkURL)
if "" == checkURL {
return false
}
u, err := url.Parse(checkURL)
if err != nil {
logging.LogWarnf("invalid check URL [%s]", checkURL)
return false
}
if "" == checkURL {
return false
if u.Scheme == "file" {
filePath := strings.TrimPrefix(checkURL, "file://")
_, err := os.Stat(filePath)
return err == nil
}
if isOnline(checkURL, skipTlsVerify, timeout) {