I’ve been using Seafile for almost a year, and it works wonderfully, but since the very beginning I have not been able to make my avatar image appear in my current (preferred) setup. I get a 403 Forbidden error when I try to view the image directly in a browser. Furthermore, I seem to have the same problem with a custom login background. Both these images were uploaded to my server via Seafile’s settings page.
I’m using the latest Community Edition via docker (see YAML file below), with Traefik as a reverse proxy for HTTPS, but I can also access the instance via my server’s local IP on port 80. I mount the db directory locally on the docker server, and the data directory is mounted via NFS on my NAS.
I did test out a fresh install where the database and data folders are both on the server. In that case, the images work perfectly, but I’m looking to see if I can find a solution for my use case. I don’t have the space to keep the data on the same machine, but I want the server to have direct access to the database locally. Make sense?
Your tip worked perfectly, thank you so much! I even got the login background image to work by chmod-ing the whole seahub-data folder.
I also double-checked the owner and groups and made sure they were all well and set to root:root, as a few sections were set to root:nogroup, due to my NFS server settings.
Here are the commands I ran:
# /SEAHUB-DATA : recursively for avatars and login background images
chmod -R 755 seahub-data
chown -R root:root seahub-data
# /SEAFILE
chmod 755 seafile
chown root:root seafile
# /SHARED : bind mounted "data" folder
chmod 755 data
chown root:root data
Please, what are the parameters of your NFS server? My Seafile only works properly locally; as soon as I switch to NFS, I encounter issues such as unreadable videos, custom logo not displaying, etc. In my fstab, I have added this:
Hard to say exactly what your issue with NFS share is. I’ve been using autofs for quite a while. Once set up, it works wonderfully.
Here are the notes I’ve made for myself, in case they can help you:
Automount & Autofs
Be sure to unmount any previous static mounts with umount and comment out old NFS entries in /etc/fstab. A reboot may be required.
Enable NFS on client machines :
sudo apt update
sudo apt install nfs-common
Install autofs :
sudo apt install autofs
Edit /etc/auto.master :
sudo nano /etc/auto.master
# Add the following line :
/nfs /etc/auto.nfs
Note: /nfs will be the local mount directory for this examples.
Create /etc/auto.nfs
sudo nano /etc/auto.nfs
# Add as many shares as you require :
video -fstype=nfs4 192.168.0.10:/mnt/main/video
documents -fstype=nfs4 192.168.0.15:/mnt/main/documents
# Only need "-fstype=nfs4" if NFS shares use NFSv4
For NFSv4, make changes to /etc/default/nfs-common
sudo nano /etc/default/nfs-common
# make sure these settings are set
NEED_IDMAPD=yes
NEED_GSSD=no # no is default
Reload /etc/init.d/autofs
sudo service autofs reload
Now when you navigate to /nfs/videos you will see the contents of your NFS share.
Note: The mount will only be visible when the directory is accessed directly. So if you go to /nfs the folder will appear to be empty, but going directly to /nfs/videos will reveal the NFS share and will be visible in the file browser for a limited time, but accessible to apps whenever and however often they need to read/write data.
First of all, thank you for your help, and congratulations on your notes, they are very clear and comprehensive. I simply followed them and was able to install Autofs and get it working. Now, my NFS mount is done via AutoFS.
Unfortunately, the issue persists, but at least I’ve made some progress. I now know that the configuration on the Docker server side is correct, thanks to you.