Seahub/Seafile-Server for Windows, served by NGINX on non Root Directory, with SSL Email

There are some specific items to be aware of in regards to setting up Seafile for use on Windows, served by NGINX on a non root directory. I hope someone can see this and update the Windows Manual for the parts that use this.

I used NGINX for my own server, here are my findings/details:

If you are installing on Windows, settings_seahub.py doesn’t exist anymore in the latest version - the file you need to edit is settings.py located at (i used C:\ as an example): “C:\seafile\seahub\seahub\settings.py”

To make things VERY easy, decompress your downloaded seafile-server-version**** folder into “C:\seafile” so that the contents look like this:

C:\seafile
–>C:\seafile\runtime
–>C:\seafile\seafile
–>C:\seafileseahub
–>C:\seafile\upgrade
–>C:\seafile\gc.bat
–>C:\seafile\run.bat

When you use run.bat, select the same drive letter that you extracted the server files to, (my example uses C:)

The manual doesn’t tell you too, but you need to edit “seafile.conf” located at “C:\seafile-server\conf\seafile.conf”:
change “fastcgi = false” to “fastcgi = true”. This is in addition to the standard edits it has you make (all edits it shows are correct - just ensure you are making them ALL and accurately).

The manual for enablling e-mail settings is old and doesn’t account for the fact that all new versions use django 1.8+ so you can use SSL just fine. Add lines under the # Email Sending # settings.py located at “C:\seafile\seahub\seahub\settings.py” to read the following:

SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True # Whether to send email when a system staff adding new member.
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True # Whether to send email when a system staff resetting user’s password.

EMAIL_USE_SSL = True ## the tutorial shows settings for EMAIL_USE_TLS
EMAIL_USE_TLS = False ## you shouldn’t use TLS when using SSL
EMAIL_HOST = YOURADDRESS@YOURDOMAIN.com’ # smtp server
EMAIL_HOST_USER = ‘YOURADDRESS@YOURDOMAIN.com’ # username and domain
EMAIL_HOST_PASSWORD = ‘YURPASSWORD’ # password
EMAIL_PORT = 465 ## any SSL/TLS port supported by your service - a SSL port is shown here for my provider
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER

MAKE SURE YOU RESTART THE SERVER TO SEE ANY CHANGES!!!

Kind regards,
Pyrostic

1 Like