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
- always store resources with a relative path with forward slashes, which will be transformed as needed when the file is accessed
- fix an issue with thumbnail generation on Windows
- add several validations for local storage setting
- improve front-end error feedback when changing local storage
- add migrations to make existing resource paths relative (not needed, but improves database consistency)
* - Refactor several API routes from anonymous functions to regular definitions. Required to add parseable documentation comments.
- Add API documentation comments using Swag Declarative Comments Format
- Add echo-swagger to serve Swagger-UI at /api/index.html
- Fix error response from extraneous parameter resourceId to relatedMemoId in DELETE("/memo/:memoId/relation/:relatedMemoId/type/:relationType")
- Add an auto-generated ./docs/api/v1.md for quick reference on repo (generated by swagger-markdown)
- Add auxiliary scripts to generate docs.go and swagger.yaml
* fix: golangci-lint errors
* fix: go fmt flag in swag scripts
* Move resource blob save into a independent function
* Support save resouce blob from Telegram like HTTP API
* Support save resouce blob download from URL to LocalStorage or S3
* fix typo