🎨 The cloud sync directory name (Bucket) supports up to 63 characters https://github.com/siyuan-note/siyuan/issues/9130

This commit is contained in:
Daniel 2023-09-07 11:55:43 +08:00
parent 7cd20f9999
commit 1c6222f3a6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
8 changed files with 46 additions and 15 deletions

View file

@ -322,6 +322,11 @@ func incReindex(upserts, removes []string) (upsertRootIDs, removeRootIDs []strin
}
func SetCloudSyncDir(name string) {
if !cloud.IsValidCloudDirName(name) {
util.PushErrMsg(Conf.Language(37), 5000)
return
}
if Conf.Sync.CloudName == name {
return
}
@ -379,6 +384,11 @@ func SetSyncProviderS3(s3 *conf.S3) (err error) {
s3.Region = strings.TrimSpace(s3.Region)
s3.Timeout = util.NormalizeTimeout(s3.Timeout)
if !cloud.IsValidCloudDirName(s3.Bucket) {
util.PushErrMsg(Conf.Language(37), 5000)
return
}
Conf.Sync.S3 = s3
Conf.Save()
return