Server Configuration and Customization

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

    There are three config files in the community edition:

    • ccnet.conf: contains the network settings
    • : contains settings for seafile daemon and FileServer.
    • seahub_settings.py: contains settings for Seahub

    There is one additional config file in the pro edition:

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

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

    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

    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.

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

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

    Sending Email Notifications on Seahub

    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:

    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',

    Seahub Settings

    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. # NOTE: since version 1.8
    24. ACTIVATE_AFTER_REGISTRATION = False
    25. # Whether to send email when a system admin adding a new member. Default is `True`.
    26. # NOTE: since version 1.4.
    27. SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True
    28. # Whether to send email when a system admin resetting a user's password. Default is `True`.
    29. # NOTE: since version 1.4.
    30. SEND_EMAIL_ON_RESETTING_USER_PASSWD = True
    31. # Hide `Organization` tab.
    32. # If you want your private seafile behave exactly like https://cloud.seafile.com/, you can set this flag.
    33. CLOUD_MODE = True
    34. # Online preview maximum file size, defaults to 30M.
    35. FILE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024
    36. # Age of cookie, in seconds (default: 2 weeks).
    37. SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2
    38. # Whether to save the session data on every request.
    39. SESSION_SAVE_EVERY_REQUEST = False
    40. # Whether a user's session cookie expires when the Web browser is closed.
    41. SESSION_EXPIRE_AT_BROWSER_CLOSE = False
    42. 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)