mirror of
https://github.com/usememos/memos.git
synced 2025-10-20 03:07:10 +08:00
feat: add {uuid} in path template when using local storage or S3 (#2696)
Add {uuid} in path template when using local storage or S3 Add an addition tag `{uuid}` to the `replacePathTemplate`. It is a workaround to leak the public links of a resource when using S3-based object storage. Currently, all resource blobs stored in S3 (R2, OSS) are set to be public. It is insecure as the resources for the private memos are also accessible on the Internet. Using an additional {uuid} might reduce this risk. Meanwhile, it is also possible to avoid filename conflict
This commit is contained in:
parent
673809e07d
commit
3181c076b2
1 changed files with 2 additions and 0 deletions
|
@ -354,6 +354,8 @@ func replacePathTemplate(path, filename string) string {
|
|||
return fmt.Sprintf("%02d", t.Minute())
|
||||
case "{second}":
|
||||
return fmt.Sprintf("%02d", t.Second())
|
||||
case "{uuid}":
|
||||
return util.GenUUID()
|
||||
}
|
||||
return s
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue