seafile 头像不能正常显示的解决方法
~~~~~~
原文链接:https://oripoin.me/blog/?p=60
私人网盘seafile提供了自定义用户头像的功能,可以在网页右上角和PC客户端显示自定义头像。一开始设置头像并成功上传后,并不能成功显示,使用开发人员工具查看,发现是nginx反向代理的IP和地址,而该地址不能正常访问,但是在网盘设置里面已经修改了SERVER_URL这一变量。搜索更多解决办法后,确认了配置文件中已经没有该地址的值,而是全部修改为了域名。
grep -rn "Your IP" seafile-dir/
而后查询seafile在MySQL建立的数据库,发现已经重新修改成功,没有使用127.0.0.1或者IP的地址。
解决方法:刷新seafile的缓存。需要确认关于avatars的链接全部正确之后,刷新 /tmp/seahub_cache/ 路径下面的缓存。然后刷新网页,重新启动PC端即可显示头像。
rm -rf /tmp/seahub_cache/*
该方法有在seafile的服务器手册中提到,但是并没有在官网找到该手册,所以带来了一些麻烦: https://seafile.gitbook.io/seafile-server-manual/faq/server#avatar-pictures-vanished-after-upgrading-the-server-what-can-i-do.
Avatar pictures vanished after upgrading the server, what can I do?
You need to check whether the “avatars” symbolic link under seahub/media/ is linking to …/…/…/seahub-data/avatars. If not, you need to correct the link according to the “minor upgrade” section in Upgrading-Seafile-Server.
If your avatars link is correct, and avatars are still broken, you may need to refresh Seahub cache using rm -rf /tmp/seahub_cache/* or by restarting memcached if being used.