6.39 Pro with docker Cannot login, CSRF error 403

I install seafile pro 6.39 with docker and my own SSL certificate.but when I input username and password and click login ,there is a csrf error .

Forbidden (403)
CSRF verification failed. Request aborted.
More information is available with DEBUG=True.

the docker runs well.SSL certificate also works well.

docker parameters:
-e SEAFILE_SERVER_LETSENCRYPT=true
-e SEAFILE_SERVER_HOSTNAME=cloud.example.com
-e SEAFILE_ADMIN_EMAIL=root
-e SEAFILE_ADMIN_PASSWORD=123456
-v /data/seafile:/shared
-p 8443:443 \

I dont know why,anyone can help?

same with

The problem is this line here:

-p 8443:443

the re-routing of the port from 8443 to 443 triggers the Cross-Site Request Forgery checks.

If you use -p 443:443 it will work

Unfortunately the ports 80 and 443 are currently hard coded in the docket image. To allow a differet port to 433 this needs tweaking in the template script for the nginx configuration so that either you can change the line

proxy_set_header Host $host;

to be

proxy_set_header Host $host:;

where can be passed via an environment variable

or better allow the http and https ports to be configured by environment variable in the nginx template (e.g. -e SEAFILE_SERVER_HTTP_PORT=80 -e SEAFILE_SERVER_HTTPS_PORT=443)

Matthew

I’ve made a suggestion in github to allow configuration of the http and https ports rather than hardcoding them in the image.

1 Like