Slink是一个很新的项目,目前功能还不是很完善,只能说未来可期,如果作者不弃坑的话,将来也许能成为chevereto的替代品。。。
部署很简单,compose示例:
services: slink: image: anirdev/slink:latest container_name: slink environment: - ORIGIN=https://slink.example.com - USER_APPROVAL_REQUIRED=true - STORAGE_PROVIDER=local - IMAGE_MAX_SIZE=50M volumes: - ./slink/var/data:/app/var/data - ./slink/images:/app/slink/images ports: - "3100:3000"
建议配合反向代理使用,nginx配置示例:
server { listen 80; listen [::]:80; server_name slink.example.com; location / { proxy_pass http://127.0.0.1:3100; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; client_max_body_size 50M; } }
在ORIGIN环境变量里使用的是https协议,所以务必申请tls证书:
certbot --nginx
如果启用了USER_APPROVAL_REQUIRED,则用户注册后需要手动批准:
docker exec -it slink slink user:activate --uuid=6d33ba76-906a-4a51-853d-38800877a09b
传了几张图片试了下,基本正常。。就是偶尔会遇到这个问题:https://github.com/andrii-kryvoviaz/slink/issues/15
然后就是目前还不能批量上传。。。