feat: optional sign all files
This commit is contained in:
@ -1,13 +1,16 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/sign"
|
||||
stdpath "path"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/setting"
|
||||
"github.com/alist-org/alist/v3/internal/sign"
|
||||
)
|
||||
|
||||
func Sign(obj model.Obj, parent string, encrypt bool) string {
|
||||
if obj.IsDir() || !encrypt {
|
||||
if obj.IsDir() || (!encrypt && !setting.GetBool(conf.SignAll)) {
|
||||
return ""
|
||||
}
|
||||
return sign.Sign(stdpath.Join(parent, obj.GetName()))
|
||||
|
Reference in New Issue
Block a user