使用Debian 11+Caddy v2+MariaDB部署Seafile 9.0.4踩坑
in with 0 comment

使用Debian 11+Caddy v2+MariaDB部署Seafile 9.0.4踩坑

in with 0 comment

以前总觉得Seafile难以配置,昨天才发现是文档有问题……在此记录一下踩到的坑。这不是教程,没写的部分按照文档操作就好。

文档错误

Seafile的中文文档英语文档内容是不一致的,应当根据英语版本操作。区别在于后者多安装了cffi==1.14.0模块,不安装的话Seahub启动时就会无报错自动退出……

pip install时可能会遇到缺少依赖的情况,需要自行搜索解决。

Caddy v2配置

官网上只提供了Nginx和Apache的配置文件,我照葫芦画瓢重新写了一份Caddy v2的Caddyfile,请将example.com替换为自己的域名。

example.com {
        reverse_proxy 127.0.0.1:8000
        handle_path /seafhttp/* {
                reverse_proxy * 127.0.0.1:8082
        }
        handle_path /media/* {
                root * /opt/seafile/seafile-server-latest/seahub
                file_server
        }
        encode zstd gzip
}

无需header_up,因为Caddy v2中默认通过所有headers。

reload之后在Seahub的系统设置里将FILE_SERVER_ROOT设置成https://example.com/seafhttp即可。