Comments (5)
我们需要MinIO启用Virtual Hosted-Style,所以使用Minio的时候需要绑定一个域名,然后需要给MinIO设置环境变量MINIO_DOMAIN=minio.localhost。 https://stackoverflow.com/questions/59693471/how-to-setup-minio-server-to-use-virtual-hosted-style
最后把zpan配置文件中的endpoint设置为 http://minio.localhost 即可
from zpan.
修改了配置 可以上传,图床 预览好像还有问题
provider:
name: s3
bucket: zpan
endpoint: http://mao3.c:9000
accessKey: minioadmin
accessSecret: minioadmin
minio 配置了 MINIO_DOMAIN="mao3.c"
docker run -d --name minio -e MINIO_DOMAIN="mao3.c" -p 9000:9000 jessestuart/minio server /usr/local/minio/storage
图床 ->添加图片->缩略图错误,在 “全部文件->图片” 下点击查看没有问题
from zpan.
这里确实没注意,应该是权限问题,图床的链接是不带签名的,得需要MinIO支持公开访问。可以查下能不能配置
from zpan.
配置策略可行,但图床的图片和其它非公开都放置到一个目录 无法区分设置策略
mc config host add minio http://xxxxx:9000 xxxx xxxx --api s3v4
mc policy set public minio/zpan
https://docs.min.io/docs/minio-client-complete-guide#policy
https://docs.min.io/cn/minio-server-limits-per-tenant.html临时方案解决:
修改源码 rest/bind/file.go 使用一个固定目录存储图床,再配置策略:mc policy set public minio/zpan/.pics
prefix := timeutil.Format(time.Now(), "YYYYMMDD")
if p.Public {
m.ACL = model.AclPublic
prefix = ".pics"
}
m.Object = fmt.Sprintf("%s/%s%s", prefix, m.Alias, filepath.Ext(p.Name))
较好的做法应该是在配置文件中支持这个可选配置并修改provider/provider_s3.go的SignedPutURL方法,可否考虑下?
from zpan.
确实 目前图床文件没有单独存储到一个独立的目录 后续我们看下怎么优化下
from zpan.
Related Issues (20)
- 建议增加用户上传文件审计 HOT 1
- docker-compose 部署报错 HOT 1
- 可以支持自定义oidc和oauth2.0登录吗 HOT 2
- 上传文件没有扩展名时失败 HOT 1
- 回收站删除空文件夹时错误 HOT 1
- 可以设置针对某些用户共享某个人的文件夹吗 HOT 1
- 能否增加本地文件夹映射 HOT 3
- 最新版图片上传失败 HOT 1
- MinIO云存储不能带端口吗? HOT 1
- 希望添加webdav云存储 HOT 1
- 演示站点无法登录 HOT 1
- 可以增加对 dogecloud.com 的便宜云存储的支持吗 HOT 1
- 增加一个插件中心!下载插件,自由选择,以更好地服务每一个人。 HOT 1
- 分享功能是否可以增加直链分享
- 群晖 Docker 部署最新镜像错误
- Can Cloudflare R2 be supported ?
- 按照文档的StartWithMinIO部署以后,一直提示网络错误
- 怎么适配移动端的网页 HOT 1
- 支持本地文件夹,网络SMB/NFS 共享文件夹 HOT 1
- 支持直连分享,文件/文件夹共享密码保护,下载次数保护设置
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zpan.