Server Configuration and Customization

Note: Since Seafile Server 5.0.0, all config files are moved to the central conf folder. Read More.

This manual explains how to change various config options for Seafile server.

There are three config files in the community edition:

There is one additional config file in the pro edition:

  • seafevents.conf: contains settings for ccnet/ccnet.search and documents preview

Storage Quota Setting (seafile.conf)

You may set a default quota (e.g. 2GB) for all users. To do this, just add the following lines to seafile.conf file

  1. [quota]
  2. # default user quota in GB, integer only
  3. default = 2

This setting applies to all users. If you want to set quota for a specific user, you may log in to seahub website as administrator, then set it in “System Admin” page.

Default history length limit (seafile.conf)

If you don’t want to keep all file revision history, you may set a default history length limit for all libraries.

  1. [history]
  2. keep_days = days of history to keep

Seafile fileserver configuration (seafile.conf)

The configuration of seafile fileserver is in the [fileserver] section of the file seafile.conf

  1. [fileserver]
  2. # binding host for fileserver
  3. host = 0.0.0.0
  4. # tcp port for fileserver
  5. port = 8082

Change upload/download settings.

  1. [fileserver]
  2. # Set maximum upload file size to 200M.
  3. max_upload_size=200
  4. # Set maximum download directory size to 200M.
  5. max_download_dir_size=200

Note: You need to restart seafile and seahub so that your changes take effect.

  1. ./seahub.sh restart
  2. ./seafile.sh restart

Seahub Configurations (seahub_settings.py)

Sending Email Notifications on Seahub

A few features work better if it can send email notifications, such as notifying users about new messages.
If you want to setup email notifications, please add the following lines to seahub_settings.py (and set your email server).
See Django email documentation for the full description of these variables.

  1. EMAIL_USE_TLS = False
  2. EMAIL_HOST = 'smtp.example.com' # smpt server
  3. EMAIL_HOST_USER = 'username@example.com' # smtp authentication username
  4. EMAIL_HOST_PASSWORD = 'password' # smtp authentication password
  5. EMAIL_PORT = '25'
  6. DEFAULT_FROM_EMAIL = EMAIL_HOST_USER # value of email's From: field
  7. SERVER_EMAIL = EMAIL_HOST_USER # error-reporting emails' From: field

If you are using Gmail as email server, use following lines:

  1. EMAIL_USE_TLS = True
  2. EMAIL_HOST = 'smtp.gmail.com'
  3. EMAIL_HOST_USER = 'username@gmail.com'
  4. EMAIL_HOST_PASSWORD = 'password'
  5. EMAIL_PORT = 587
  6. DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  7. SERVER_EMAIL = EMAIL_HOST_USER

Note: If your Email service still can not work, you may checkout the log file logs/seahub.log to see what may cause the problem. For complete email notification list, please refer to Email notification list.

Note2: If you want to use the Email service without authentication leaf EMAIL_HOST_USER and EMAIL_HOST_PASSWORD blank (''). (But notice that the emails then will be sent without a From: address.)

Cache

Seahub caches items(avatars, profiles, etc) on file system by default(/tmp/seahub_cache/). You can replace with Memcached (you have to install python-memcache first).

  1. CACHES = {
  2. 'default': {
  3. 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
  4. 'LOCATION': '127.0.0.1:11211',
  5. }
  6. }

Seahub Settings

You may change seahub website’s settings by adding variables in seahub_settings.py.

  1. # Choices can be found here:
  2. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  3. # although not all choices may be available on all operating systems.
  4. # If running in a Windows environment this must be set to the same as your
  5. # system time zone.
  6. TIME_ZONE = 'UTC'
  7. # Set this to seahub website's URL. This URL is contained in email notifications.
  8. SITE_BASE = 'http://www.example.com/'
  9. # Set this to your website's name. This is contained in email notifications.
  10. SITE_NAME = 'example.com'
  11. # Set seahub website's title
  12. SITE_TITLE = 'Seafile'
  13. # If you don't want to run seahub website on your site's root path, set this option to your preferred path.
  14. # e.g. setting it to '/seahub/' would run seahub on http://example.com/seahub/.
  15. SITE_ROOT = '/'
  16. # Whether to use pdf.js to view pdf files online. Default is `True`, you can turn it off.
  17. # NOTE: since version 1.4.
  18. USE_PDFJS = True
  19. # Enalbe or disalbe registration on web. Default is `False`.
  20. # NOTE: since version 1.4.
  21. ENABLE_SIGNUP = False
  22. # Activate or deactivate user when registration complete. Default is `True`.
  23. # If set to `False`, new users need to be activated by admin in admin panel.
  24. # NOTE: since version 1.8
  25. ACTIVATE_AFTER_REGISTRATION = False
  26. # Whether to send email when a system admin adding a new member. Default is `True`.
  27. # NOTE: since version 1.4.
  28. SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True
  29. # Whether to send email when a system admin resetting a user's password. Default is `True`.
  30. # NOTE: since version 1.4.
  31. SEND_EMAIL_ON_RESETTING_USER_PASSWD = True
  32. # Hide `Organization` tab.
  33. # If you want your private seafile behave exactly like https://cloud.seafile.com/, you can set this flag.
  34. CLOUD_MODE = True
  35. # Online preview maximum file size, defaults to 30M.
  36. FILE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024
  37. # Age of cookie, in seconds (default: 2 weeks).
  38. SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2
  39. # Whether to save the session data on every request.
  40. SESSION_SAVE_EVERY_REQUEST = False
  41. # Whether a user's session cookie expires when the Web browser is closed.
  42. SESSION_EXPIRE_AT_BROWSER_CLOSE = False
  43. # Using server side crypto by default, otherwise, let user choose crypto method.
  44. FORCE_SERVER_CRYPTO = True

Note:

  • You need to restart seahub so that your changes take effect.
  • If your changes don’t take effect, You may need to delete ‘seahub_setting.pyc’. (A cache file)
  1. ./seahub.sh restart