mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-02-09 09:17:28 +08:00
filer: option to encrypt data on volume server
This commit is contained in:
@@ -174,7 +174,7 @@ func (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64,
|
||||
}
|
||||
|
||||
fileUrl := fmt.Sprintf("http://%s/%s", host, fileId)
|
||||
uploadResult, err := operation.Upload(fileUrl, pages.f.Name, reader, false, "", nil, auth)
|
||||
uploadResult, err := operation.Upload(fileUrl, pages.f.Name, pages.f.wfs.option.Cipher, reader, false, "", nil, auth)
|
||||
if err != nil {
|
||||
glog.V(0).Infof("upload data %v to %s: %v", pages.f.Name, fileUrl, err)
|
||||
return nil, fmt.Errorf("upload data: %v", err)
|
||||
@@ -185,11 +185,12 @@ func (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64,
|
||||
}
|
||||
|
||||
return &filer_pb.FileChunk{
|
||||
FileId: fileId,
|
||||
Offset: offset,
|
||||
Size: uint64(size),
|
||||
Mtime: time.Now().UnixNano(),
|
||||
ETag: uploadResult.ETag,
|
||||
FileId: fileId,
|
||||
Offset: offset,
|
||||
Size: uint64(size),
|
||||
Mtime: time.Now().UnixNano(),
|
||||
ETag: uploadResult.ETag,
|
||||
CipherKey: uploadResult.CipherKey,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
@@ -39,8 +39,9 @@ type Option struct {
|
||||
MountCtime time.Time
|
||||
MountMtime time.Time
|
||||
|
||||
// whether the mount runs outside SeaweedFS containers
|
||||
OutsideContainerClusterMode bool
|
||||
OutsideContainerClusterMode bool // whether the mount runs outside SeaweedFS containers
|
||||
Cipher bool // whether encrypt data on volume server
|
||||
|
||||
}
|
||||
|
||||
var _ = fs.FS(&WFS{})
|
||||
|
||||
Reference in New Issue
Block a user