Hello,
I have set up a Raspi with Seafile and radicale. Radicale works like a charm, but I have some problems with seafile. Basically the server runs and syncs with the desktop clients and webDAV on my phone.
The problems I have:
- In the Seafile app I see all my libraries, but when I open them I get an error.
- I can log in the web interface but when I enter a library I get a small “Fehler” (error) notification in the window with no further information.
- I cannot see my avatar. Instead it says “avatar”. When I edit it, though, I can see the picture. When I open the file (https://xxx.mooo.com:8000/media/avatars/7/5/xxx/resized/72/xxx.png) directly I get a network timeout. But I can open all avatars when using port 443 or no specified port ( e.g. https://xxx.mooo.com/media/avatars/7/5/xxx/resized/72/xxx.png)
I am unsure whether or not these errors are related. At least the last one looks like a nginx configuration problem. I have searched both in the community manual and in the forum and already tried some things which worked for others with apparently similar problems.
Here are some of my config files:
/etc/nginx/sites-enabled/seahub
server {
listen 80;
server_name xxx.mooo.com;
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
server_tokens off;
}
server {
listen 443;
ssl on;
ssl_certificate xxx/xxx.crt; # path to your cacert.pem
ssl_certificate_key xxx/xxx.key; # path to your privkey.pem
server_name xxx.mooo.com;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:5m;
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
ssl_dhparam xxx/dhparam.pem;
# secure settings (A+ at SSL Labs ssltest at time of writing)
# see https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'xxx'
ssl_prefer_server_ciphers on;
proxy_set_header X-Forwarded-For $remote_addr;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
server_tokens off;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto https;
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;
proxy_read_timeout 1200s;
client_max_body_size 0;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
}
location /seafdav {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
# This option is only available for Nginx >= 1.8.0. See more details below.
client_max_body_size 0;
proxy_request_buffering off;
access_log /var/log/nginx/seafdav.access.log;
error_log /var/log/nginx/seafdav.error.log;
}
location /radicale/ {
proxy_pass http://localhost:5232/;
include proxy_params;
proxy_set_header X-Script-Name /radicale;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Authorization;
proxy_ssl_certificate xxx/xxx.crt;
proxy_ssl_certificate_key xxx/xxx.key;
}
}
ccnet.conf
[General]
USER_NAME = xxx
ID = xxx
NAME = xxx
SERVICE_URL = https://xxx.mooo.com # had :8000 specified before, makes no difference
[Client]
PORT = 13419
gnuicorn.conf
import os
daemon = True
workers = 5
# default localhost:8000
bind = "0.0.0.0:8000"
# Pid
pids_dir = '/home/seafile/pids'
pidfile = os.path.join(pids_dir, 'seahub.pid')
# for file upload, we need a longer timeout value (default is only 30s, too sho$
timeout = 1200
limit_request_line = 8190
seahub_settings.py
# -*- coding: utf-8 -*-
SECRET_KEY = "xxx"
FILE_SERVER_ROOT = 'https://xxx.mooo.com/seafhttp'
#### added new
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
In the seahub.log I find a lot of django uncaught exceptions:
2020-02-18 12:45:21,966 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/9484d688-045d-409a-89a0-ab5ae7773078/dir/
seafdav.log is full of those, although it seems to work
[2020-02-19 09:19:06,047]: Init seahub database...
[2020-02-19 09:19:06,051]: Failed to init seahub db: No module named seahub_settings.
It would be great if somebody could push me into the right direction with these errors!