2016-07-26 10:47:45 +08:00
|
|
|
|
# Copyright (c) 2012-2016 Seafile Ltd.
|
2013-05-02 19:27:17 +08:00
|
|
|
|
# -*- coding: utf-8 -*-
|
2011-03-19 13:15:02 +08:00
|
|
|
|
# Django settings for seahub project.
|
2013-05-02 19:27:17 +08:00
|
|
|
|
|
2012-06-07 11:48:25 +08:00
|
|
|
|
import sys
|
2011-03-19 13:15:02 +08:00
|
|
|
|
import os
|
2012-06-07 11:48:25 +08:00
|
|
|
|
import re
|
2013-04-18 15:13:04 +02:00
|
|
|
|
|
2021-10-12 15:59:42 +08:00
|
|
|
|
from seaserv import FILE_SERVER_PORT
|
2013-07-25 13:30:19 +08:00
|
|
|
|
|
2013-06-04 17:39:25 +08:00
|
|
|
|
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), os.pardir)
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2015-02-11 22:36:35 +08:00
|
|
|
|
DEBUG = False
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2021-08-26 09:56:49 +08:00
|
|
|
|
SERVICE_URL = 'http://127.0.0.1:8000'
|
2021-10-12 15:59:42 +08:00
|
|
|
|
FILE_SERVER_ROOT = 'http://127.0.0.1:' + FILE_SERVER_PORT
|
2021-08-26 09:56:49 +08:00
|
|
|
|
|
2018-01-22 10:09:50 +08:00
|
|
|
|
CLOUD_MODE = False
|
|
|
|
|
|
2021-08-26 13:37:28 +08:00
|
|
|
|
MULTI_TENANCY = False
|
|
|
|
|
|
2020-07-27 14:59:18 +08:00
|
|
|
|
ADMINS = [
|
2011-03-19 13:15:02 +08:00
|
|
|
|
# ('Your Name', 'your_email@domain.com'),
|
2020-07-27 14:59:18 +08:00
|
|
|
|
]
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
|
|
|
|
MANAGERS = ADMINS
|
|
|
|
|
|
2013-01-09 10:14:39 +08:00
|
|
|
|
DATABASES = {
|
|
|
|
|
'default': {
|
2021-10-13 15:11:51 +08:00
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
|
|
|
|
|
'NAME': '%s/seahub/seahub.db' % PROJECT_ROOT, # Or path to database file if using sqlite3.
|
2013-01-09 10:14:39 +08:00
|
|
|
|
'USER': '', # Not used with sqlite3.
|
|
|
|
|
'PASSWORD': '', # Not used with sqlite3.
|
|
|
|
|
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
|
|
|
|
|
'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2021-08-27 12:01:13 +08:00
|
|
|
|
# New in Django 3.2
|
|
|
|
|
# Default primary key field type to use for models that don’t have a field with primary_key=True.
|
|
|
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
|
|
|
|
|
2011-03-19 13:15:02 +08:00
|
|
|
|
# Local time zone for this installation. Choices can be found here:
|
|
|
|
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
|
|
|
|
# although not all choices may be available on all operating systems.
|
|
|
|
|
# If running in a Windows environment this must be set to the same as your
|
|
|
|
|
# system time zone.
|
2017-01-11 13:57:55 +08:00
|
|
|
|
TIME_ZONE = 'UTC'
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
|
|
|
|
# Language code for this installation. All choices can be found here:
|
|
|
|
|
# http://www.i18nguy.com/unicode/language-identifiers.html
|
2012-10-26 19:15:52 +08:00
|
|
|
|
LANGUAGE_CODE = 'en'
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
|
|
|
|
SITE_ID = 1
|
|
|
|
|
|
|
|
|
|
# If you set this to False, Django will make some optimizations so as not
|
|
|
|
|
# to load the internationalization machinery.
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
2013-05-02 19:27:17 +08:00
|
|
|
|
# If you set this to False, Django will not format dates, numbers and
|
|
|
|
|
# calendars according to the current locale.
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
|
|
# If you set this to False, Django will not use timezone-aware datetimes.
|
|
|
|
|
USE_TZ = False
|
|
|
|
|
|
|
|
|
|
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
|
|
|
|
# Example: "/home/media/media.lawrence.com/media/"
|
2013-06-04 17:39:25 +08:00
|
|
|
|
MEDIA_ROOT = '%s/media/' % PROJECT_ROOT
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
|
|
|
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
|
|
|
|
# trailing slash if there is a path component (optional in other cases).
|
|
|
|
|
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
|
|
2013-05-02 19:27:17 +08:00
|
|
|
|
# Absolute path to the directory static files should be collected to.
|
|
|
|
|
# Don't put anything in this directory yourself; store your static files
|
|
|
|
|
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
|
|
|
|
# Example: "/home/media/media.lawrence.com/static/"
|
2015-03-21 10:57:05 +08:00
|
|
|
|
STATIC_ROOT = '%s/assets/' % MEDIA_ROOT
|
2013-05-02 19:27:17 +08:00
|
|
|
|
|
|
|
|
|
# URL prefix for static files.
|
|
|
|
|
# Example: "http://media.lawrence.com/static/"
|
2015-03-21 10:57:05 +08:00
|
|
|
|
STATIC_URL = '/media/assets/'
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2013-05-02 19:27:17 +08:00
|
|
|
|
# Additional locations of static files
|
|
|
|
|
STATICFILES_DIRS = (
|
|
|
|
|
# Put strings here, like "/home/html/static" or "C:/www/django/static".
|
|
|
|
|
# Always use forward slashes, even on Windows.
|
|
|
|
|
# Don't forget to use absolute paths, not relative paths.
|
2015-03-21 10:57:05 +08:00
|
|
|
|
'%s/static' % PROJECT_ROOT,
|
2018-05-02 14:09:58 +08:00
|
|
|
|
'%s/frontend/build' % PROJECT_ROOT,
|
2013-05-02 19:27:17 +08:00
|
|
|
|
)
|
|
|
|
|
|
2018-05-02 14:09:58 +08:00
|
|
|
|
WEBPACK_LOADER = {
|
|
|
|
|
'DEFAULT': {
|
|
|
|
|
'BUNDLE_DIR_NAME': 'frontend/',
|
|
|
|
|
'STATS_FILE': os.path.join(PROJECT_ROOT, 'frontend/webpack-stats.pro.json'),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-02 11:15:29 +08:00
|
|
|
|
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
|
2015-03-21 10:57:05 +08:00
|
|
|
|
|
2015-04-14 17:17:05 +08:00
|
|
|
|
# StaticI18N config
|
|
|
|
|
STATICI18N_ROOT = '%s/static/scripts' % PROJECT_ROOT
|
|
|
|
|
STATICI18N_OUTPUT_DIR = 'i18n'
|
|
|
|
|
|
2013-05-02 19:27:17 +08:00
|
|
|
|
# List of finder classes that know how to find static files in
|
|
|
|
|
# various locations.
|
|
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
|
|
|
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
|
|
|
|
)
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
|
|
|
|
# Make this unique, and don't share it with anybody.
|
|
|
|
|
SECRET_KEY = 'n*v0=jz-1rz@(4gx^tf%6^e7c&um@2)g-l=3_)t@19a69n1nv6'
|
|
|
|
|
|
2019-04-16 16:01:18 +08:00
|
|
|
|
ENABLE_REMOTE_USER_AUTHENTICATION = False
|
|
|
|
|
|
2013-06-04 17:39:25 +08:00
|
|
|
|
# Order is important
|
2020-07-27 14:59:18 +08:00
|
|
|
|
MIDDLEWARE = [
|
2021-09-22 09:45:35 +08:00
|
|
|
|
'seahub.base.middleware.SameSiteNoneMiddleware',
|
2011-03-19 13:15:02 +08:00
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
2013-05-04 17:38:38 +08:00
|
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
2013-06-04 17:39:25 +08:00
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
2014-07-29 16:42:08 +08:00
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
2013-05-07 10:33:26 +08:00
|
|
|
|
'seahub.auth.middleware.AuthenticationMiddleware',
|
2014-07-29 16:42:08 +08:00
|
|
|
|
'seahub.base.middleware.BaseMiddleware',
|
2013-05-02 19:27:17 +08:00
|
|
|
|
'seahub.base.middleware.InfobarMiddleware',
|
2015-11-23 17:55:42 +08:00
|
|
|
|
'seahub.password_session.middleware.CheckPasswordHash',
|
|
|
|
|
'seahub.base.middleware.ForcePasswdChangeMiddleware',
|
2016-07-18 13:04:05 +08:00
|
|
|
|
'termsandconditions.middleware.TermsAndConditionsRedirectMiddleware',
|
2017-08-21 14:02:57 +08:00
|
|
|
|
'seahub.two_factor.middleware.OTPMiddleware',
|
2018-10-16 15:32:58 +08:00
|
|
|
|
'seahub.two_factor.middleware.ForceTwoFactorAuthMiddleware',
|
2021-08-26 13:37:28 +08:00
|
|
|
|
'seahub.trusted_ip.middleware.LimitIpMiddleware',
|
|
|
|
|
'seahub.organizations.middleware.RedirectMiddleware',
|
2020-07-27 14:59:18 +08:00
|
|
|
|
]
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
|
|
|
|
SITE_ROOT_URLCONF = 'seahub.urls'
|
2015-10-12 18:36:24 +08:00
|
|
|
|
ROOT_URLCONF = 'seahub.utils.rooturl'
|
2011-03-19 13:15:02 +08:00
|
|
|
|
SITE_ROOT = '/'
|
2018-08-30 11:40:45 +08:00
|
|
|
|
CSRF_COOKIE_NAME = 'sfcsrftoken'
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2013-05-02 19:27:17 +08:00
|
|
|
|
# Python dotted path to the WSGI application used by Django's runserver.
|
|
|
|
|
WSGI_APPLICATION = 'seahub.wsgi.application'
|
|
|
|
|
|
2018-03-19 14:02:54 +08:00
|
|
|
|
TEMPLATES = [
|
|
|
|
|
{
|
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
|
'DIRS': [
|
|
|
|
|
os.path.join(PROJECT_ROOT, '../../seahub-data/custom/templates'),
|
|
|
|
|
os.path.join(PROJECT_ROOT, 'seahub/templates'),
|
|
|
|
|
],
|
|
|
|
|
'APP_DIRS': True,
|
|
|
|
|
'OPTIONS': {
|
|
|
|
|
'context_processors': [
|
|
|
|
|
'django.template.context_processors.i18n',
|
|
|
|
|
'django.template.context_processors.media',
|
|
|
|
|
'django.template.context_processors.static',
|
|
|
|
|
'django.template.context_processors.request',
|
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
|
|
|
|
|
|
'seahub.auth.context_processors.auth',
|
|
|
|
|
'seahub.base.context_processors.base',
|
|
|
|
|
'seahub.base.context_processors.debug',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2020-07-27 14:59:18 +08:00
|
|
|
|
LANGUAGES = [
|
2017-05-02 12:19:25 +08:00
|
|
|
|
# ('bg', gettext_noop(u'български език')),
|
2019-09-11 11:46:43 +08:00
|
|
|
|
('ca', 'Català'),
|
|
|
|
|
('cs', 'Čeština'),
|
2017-09-12 16:19:57 +08:00
|
|
|
|
('de', 'Deutsch'),
|
|
|
|
|
('en', 'English'),
|
|
|
|
|
('es', 'Español'),
|
|
|
|
|
('es-ar', 'Español de Argentina'),
|
|
|
|
|
('es-mx', 'Español de México'),
|
|
|
|
|
('fr', 'Français'),
|
|
|
|
|
('it', 'Italiano'),
|
|
|
|
|
('is', 'Íslenska'),
|
|
|
|
|
('lv', 'Latvian'),
|
|
|
|
|
# ('mk', 'македонски јазик'),
|
|
|
|
|
('hu', 'Magyar'),
|
|
|
|
|
('nl', 'Nederlands'),
|
|
|
|
|
('pl', 'Polski'),
|
|
|
|
|
('pt-br', 'Portuguese, Brazil'),
|
|
|
|
|
('ru', 'Русский'),
|
|
|
|
|
# ('sk', 'Slovak'),
|
|
|
|
|
('sl', 'Slovenian'),
|
|
|
|
|
('fi', 'Suomi'),
|
|
|
|
|
('sv', 'Svenska'),
|
|
|
|
|
('vi', 'Tiếng Việt'),
|
|
|
|
|
('tr', 'Türkçe'),
|
|
|
|
|
('uk', 'українська мова'),
|
|
|
|
|
('he', 'עברית'),
|
|
|
|
|
('ar', 'العربية'),
|
|
|
|
|
('el', 'ελληνικά'),
|
|
|
|
|
('th', 'ไทย'),
|
|
|
|
|
('ko', '한국어'),
|
|
|
|
|
('ja', '日本語'),
|
|
|
|
|
# ('lt', 'Lietuvių kalba'),
|
|
|
|
|
('zh-cn', '简体中文'),
|
|
|
|
|
('zh-tw', '繁體中文'),
|
2020-07-27 14:59:18 +08:00
|
|
|
|
]
|
2017-09-12 16:19:57 +08:00
|
|
|
|
|
2020-07-27 14:59:18 +08:00
|
|
|
|
LOCALE_PATHS = [
|
2013-06-04 17:39:25 +08:00
|
|
|
|
os.path.join(PROJECT_ROOT, 'locale'),
|
2017-09-18 17:02:39 +08:00
|
|
|
|
os.path.join(PROJECT_ROOT, 'seahub/trusted_ip/locale'),
|
2020-07-27 14:59:18 +08:00
|
|
|
|
]
|
2012-10-26 19:15:52 +08:00
|
|
|
|
|
2020-07-27 14:59:18 +08:00
|
|
|
|
INSTALLED_APPS = [
|
2011-03-19 13:15:02 +08:00
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
|
'django.contrib.sessions',
|
2012-06-12 10:13:14 +08:00
|
|
|
|
'django.contrib.messages',
|
2015-03-21 10:57:05 +08:00
|
|
|
|
'django.contrib.staticfiles',
|
2018-05-20 19:43:33 +08:00
|
|
|
|
|
|
|
|
|
# In order to overide command `createsuperuser`, base app *must* before auth app.
|
|
|
|
|
# ref: https://docs.djangoproject.com/en/1.11/howto/custom-management-commands/#overriding-commands
|
|
|
|
|
'seahub.base',
|
2018-03-21 16:24:39 +08:00
|
|
|
|
'django.contrib.auth',
|
2012-06-07 11:48:25 +08:00
|
|
|
|
|
2011-04-30 13:18:32 +08:00
|
|
|
|
'registration',
|
2013-10-20 00:37:41 +08:00
|
|
|
|
'captcha',
|
2015-04-14 17:17:05 +08:00
|
|
|
|
'statici18n',
|
2015-08-07 16:08:45 +08:00
|
|
|
|
'constance',
|
|
|
|
|
'constance.backends.database',
|
2016-07-18 13:04:05 +08:00
|
|
|
|
'termsandconditions',
|
2018-05-02 14:09:58 +08:00
|
|
|
|
'webpack_loader',
|
2012-08-07 19:50:10 +08:00
|
|
|
|
|
2013-05-02 19:27:17 +08:00
|
|
|
|
'seahub.api2',
|
|
|
|
|
'seahub.avatar',
|
2012-05-04 16:30:07 +08:00
|
|
|
|
'seahub.contacts',
|
2018-09-15 16:14:17 +08:00
|
|
|
|
'seahub.drafts',
|
2016-03-13 09:42:40 +08:00
|
|
|
|
'seahub.institutions',
|
2016-05-13 15:34:49 +08:00
|
|
|
|
'seahub.invitations',
|
2013-04-06 19:09:33 +08:00
|
|
|
|
'seahub.wiki',
|
2012-06-07 11:48:25 +08:00
|
|
|
|
'seahub.group',
|
2012-07-26 17:08:31 +08:00
|
|
|
|
'seahub.notifications',
|
2013-11-05 15:17:21 +08:00
|
|
|
|
'seahub.options',
|
2017-05-10 18:44:25 +08:00
|
|
|
|
'seahub.onlyoffice',
|
2012-07-26 17:08:31 +08:00
|
|
|
|
'seahub.profile',
|
2012-06-12 10:13:14 +08:00
|
|
|
|
'seahub.share',
|
2013-12-17 17:49:11 +08:00
|
|
|
|
'seahub.help',
|
2014-10-24 17:11:08 +08:00
|
|
|
|
'seahub.thumbnail',
|
2015-07-22 15:03:33 +08:00
|
|
|
|
'seahub.password_session',
|
2017-03-09 17:42:59 +08:00
|
|
|
|
'seahub.admin_log',
|
2017-04-18 14:28:56 +08:00
|
|
|
|
'seahub.wopi',
|
2017-07-11 17:45:39 +08:00
|
|
|
|
'seahub.tags',
|
2017-07-03 11:51:52 +08:00
|
|
|
|
'seahub.revision_tag',
|
2017-08-21 14:02:57 +08:00
|
|
|
|
'seahub.two_factor',
|
2017-09-09 15:27:04 +08:00
|
|
|
|
'seahub.role_permissions',
|
2017-09-18 14:21:11 +08:00
|
|
|
|
'seahub.trusted_ip',
|
2018-10-17 16:29:58 +08:00
|
|
|
|
'seahub.repo_tags',
|
2018-11-02 17:51:04 +08:00
|
|
|
|
'seahub.file_tags',
|
2018-11-24 10:12:24 +08:00
|
|
|
|
'seahub.related_files',
|
2019-05-28 11:44:19 +08:00
|
|
|
|
'seahub.work_weixin',
|
2021-04-07 12:00:33 +08:00
|
|
|
|
'seahub.dingtalk',
|
2019-06-10 16:08:45 +08:00
|
|
|
|
'seahub.file_participants',
|
2019-11-04 15:47:20 +08:00
|
|
|
|
'seahub.repo_api_tokens',
|
2019-11-05 17:46:06 +08:00
|
|
|
|
'seahub.abuse_reports',
|
2020-09-07 12:03:05 +08:00
|
|
|
|
'seahub.repo_auto_delete',
|
2020-09-24 10:57:45 +08:00
|
|
|
|
'seahub.ocm',
|
2021-09-27 17:44:23 +08:00
|
|
|
|
'seahub.ocm_via_webdav',
|
2021-08-26 13:37:28 +08:00
|
|
|
|
'seahub.search',
|
|
|
|
|
'seahub.sysadmin_extra',
|
|
|
|
|
'seahub.organizations',
|
|
|
|
|
'seahub.krb5_auth',
|
|
|
|
|
'seahub.django_cas_ng',
|
2020-07-27 14:59:18 +08:00
|
|
|
|
]
|
2011-03-19 13:15:02 +08:00
|
|
|
|
|
2020-09-07 12:03:05 +08:00
|
|
|
|
|
2019-03-13 16:50:30 +08:00
|
|
|
|
# Enable or disable view File Scan
|
2021-08-26 13:37:28 +08:00
|
|
|
|
ENABLE_FILE_SCAN = False
|
|
|
|
|
|
2017-12-19 15:41:36 +08:00
|
|
|
|
# Enable or disable multiple storage backends.
|
|
|
|
|
ENABLE_STORAGE_CLASSES = False
|
|
|
|
|
|
2018-03-16 17:30:58 +08:00
|
|
|
|
# `USER_SELECT` or `ROLE_BASED` or `REPO_ID_MAPPING`
|
|
|
|
|
STORAGE_CLASS_MAPPING_POLICY = 'USER_SELECT'
|
|
|
|
|
|
2017-12-19 15:41:36 +08:00
|
|
|
|
# Enable or disable constance(web settings).
|
2016-05-27 10:32:36 +08:00
|
|
|
|
ENABLE_SETTINGS_VIA_WEB = True
|
2015-08-07 16:08:45 +08:00
|
|
|
|
CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
|
|
|
|
|
CONSTANCE_DATABASE_CACHE_BACKEND = 'default'
|
2013-05-17 11:12:32 +08:00
|
|
|
|
|
2011-04-30 13:18:32 +08:00
|
|
|
|
AUTHENTICATION_BACKENDS = (
|
2013-05-07 10:33:26 +08:00
|
|
|
|
'seahub.base.accounts.AuthBackend',
|
2011-04-30 13:18:32 +08:00
|
|
|
|
)
|
2017-11-14 11:53:41 +08:00
|
|
|
|
|
2021-08-26 13:37:28 +08:00
|
|
|
|
ENABLE_CAS = False
|
|
|
|
|
|
|
|
|
|
ENABLE_ADFS_LOGIN = False
|
|
|
|
|
|
2017-11-14 11:53:41 +08:00
|
|
|
|
ENABLE_OAUTH = False
|
2018-08-30 19:07:51 +08:00
|
|
|
|
ENABLE_WATERMARK = False
|
2017-11-14 11:53:41 +08:00
|
|
|
|
|
2020-08-14 14:45:44 +08:00
|
|
|
|
ENABLE_SHOW_CONTACT_EMAIL_WHEN_SEARCH_USER = False
|
|
|
|
|
|
2019-07-08 15:44:38 +08:00
|
|
|
|
# enable work weixin
|
|
|
|
|
ENABLE_WORK_WEIXIN = False
|
2019-05-28 11:44:19 +08:00
|
|
|
|
|
2020-04-20 16:52:50 +08:00
|
|
|
|
# enable weixin
|
|
|
|
|
ENABLE_WEIXIN = False
|
|
|
|
|
|
2020-03-19 20:15:26 +08:00
|
|
|
|
# enable dingtalk
|
|
|
|
|
ENABLE_DINGTALK = False
|
|
|
|
|
|
2018-09-10 13:56:10 +08:00
|
|
|
|
# allow user to clean library trash
|
|
|
|
|
ENABLE_USER_CLEAN_TRASH = True
|
|
|
|
|
|
2018-11-14 16:04:50 +08:00
|
|
|
|
LOGIN_REDIRECT_URL = '/'
|
2018-05-02 11:58:14 +08:00
|
|
|
|
LOGIN_URL = '/accounts/login/'
|
2019-03-18 15:52:56 +08:00
|
|
|
|
LOGIN_ERROR_DETAILS = False
|
2017-03-29 18:30:41 +08:00
|
|
|
|
LOGOUT_REDIRECT_URL = None
|
2015-05-29 11:51:57 +08:00
|
|
|
|
|
2011-04-30 13:18:32 +08:00
|
|
|
|
ACCOUNT_ACTIVATION_DAYS = 7
|
|
|
|
|
|
2021-10-13 15:11:51 +08:00
|
|
|
|
# allow seafile admin view user's repo
|
2015-10-20 16:35:54 +08:00
|
|
|
|
ENABLE_SYS_ADMIN_VIEW_REPO = False
|
|
|
|
|
|
2021-10-13 15:11:51 +08:00
|
|
|
|
# allow seafile admin generate user auth token
|
|
|
|
|
ENABLE_SYS_ADMIN_GENERATE_USER_AUTH_TOKEN = False
|
|
|
|
|
|
|
|
|
|
# allow search from LDAP directly during auto-completion (not only search imported users)
|
2016-01-14 13:10:24 +08:00
|
|
|
|
ENABLE_SEARCH_FROM_LDAP_DIRECTLY = False
|
|
|
|
|
|
2015-09-11 11:00:54 +08:00
|
|
|
|
# show traffic on the UI
|
|
|
|
|
SHOW_TRAFFIC = True
|
|
|
|
|
|
2013-12-06 14:02:11 +08:00
|
|
|
|
# show or hide library 'download' button
|
|
|
|
|
SHOW_REPO_DOWNLOAD_BUTTON = False
|
2013-11-05 17:03:00 +08:00
|
|
|
|
|
2014-12-02 18:54:41 +08:00
|
|
|
|
# enable 'upload folder' or not
|
2017-03-09 17:40:57 +08:00
|
|
|
|
ENABLE_UPLOAD_FOLDER = True
|
2014-12-02 18:54:41 +08:00
|
|
|
|
|
2015-08-07 15:03:59 +08:00
|
|
|
|
# enable resumable fileupload or not
|
|
|
|
|
ENABLE_RESUMABLE_FILEUPLOAD = False
|
2019-01-19 12:32:47 +08:00
|
|
|
|
RESUMABLE_UPLOAD_FILE_BLOCK_SIZE = 8
|
2015-08-07 15:03:59 +08:00
|
|
|
|
|
2016-09-14 17:35:42 +08:00
|
|
|
|
## maxNumberOfFiles for fileupload
|
2017-12-22 13:52:11 +08:00
|
|
|
|
MAX_NUMBER_OF_FILES_FOR_FILEUPLOAD = 1000
|
2016-09-14 17:35:42 +08:00
|
|
|
|
|
2015-09-24 17:20:45 +08:00
|
|
|
|
# enable encrypt library
|
2015-10-09 15:40:54 +08:00
|
|
|
|
ENABLE_ENCRYPTED_LIBRARY = True
|
2019-05-16 14:09:31 +08:00
|
|
|
|
ENCRYPTED_LIBRARY_VERSION = 2
|
2015-09-24 17:20:45 +08:00
|
|
|
|
|
2018-06-26 13:33:30 +08:00
|
|
|
|
# enable reset encrypt library's password when user forget password
|
|
|
|
|
ENABLE_RESET_ENCRYPTED_REPO_PASSWORD = False
|
|
|
|
|
|
2013-11-05 18:19:22 +08:00
|
|
|
|
# mininum length for password of encrypted library
|
2014-06-26 14:48:44 +03:00
|
|
|
|
REPO_PASSWORD_MIN_LENGTH = 8
|
2013-11-05 18:19:22 +08:00
|
|
|
|
|
2017-02-17 16:49:58 +08:00
|
|
|
|
# token length for the share link
|
|
|
|
|
SHARE_LINK_TOKEN_LENGTH = 20
|
|
|
|
|
|
2018-09-14 12:05:46 +08:00
|
|
|
|
# if limit only authenticated user can view preview share link
|
|
|
|
|
SHARE_LINK_LOGIN_REQUIRED = False
|
|
|
|
|
|
2018-08-30 16:44:34 +08:00
|
|
|
|
# min/max expire days for a share link
|
|
|
|
|
SHARE_LINK_EXPIRE_DAYS_MIN = 0 # 0 means no limit
|
|
|
|
|
SHARE_LINK_EXPIRE_DAYS_MAX = 0 # 0 means no limit
|
|
|
|
|
|
2018-11-21 17:51:48 +08:00
|
|
|
|
# default expire days should be
|
|
|
|
|
# greater than or equal to MIN and less than or equal to MAX
|
|
|
|
|
SHARE_LINK_EXPIRE_DAYS_DEFAULT = 0
|
|
|
|
|
|
2020-07-21 18:22:45 +08:00
|
|
|
|
# min/max expire days for an upload link
|
|
|
|
|
UPLOAD_LINK_EXPIRE_DAYS_MIN = 0 # 0 means no limit
|
|
|
|
|
UPLOAD_LINK_EXPIRE_DAYS_MAX = 0 # 0 means no limit
|
|
|
|
|
|
|
|
|
|
# default expire days should be
|
|
|
|
|
# greater than or equal to MIN and less than or equal to MAX
|
|
|
|
|
UPLOAD_LINK_EXPIRE_DAYS_DEFAULT = 0
|
|
|
|
|
|
2021-08-12 15:02:03 +08:00
|
|
|
|
# force use password when generate a share/upload link
|
|
|
|
|
SHARE_LINK_FORCE_USE_PASSWORD = False
|
|
|
|
|
|
|
|
|
|
# mininum length for the password of a share/upload link
|
|
|
|
|
SHARE_LINK_PASSWORD_MIN_LENGTH = 10
|
|
|
|
|
|
|
|
|
|
# LEVEL for the password of a share/upload link
|
|
|
|
|
# based on four types of input:
|
|
|
|
|
# num, upper letter, lower letter, other symbols
|
|
|
|
|
# '3' means password must have at least 3 types of the above.
|
|
|
|
|
SHARE_LINK_PASSWORD_STRENGTH_LEVEL = 1
|
2015-08-12 15:20:12 +08:00
|
|
|
|
|
2016-04-22 15:07:39 +08:00
|
|
|
|
# enable or disable share link audit
|
|
|
|
|
ENABLE_SHARE_LINK_AUDIT = False
|
|
|
|
|
|
2019-11-05 17:46:06 +08:00
|
|
|
|
# enable or disable report abuse file on share link page
|
|
|
|
|
ENABLE_SHARE_LINK_REPORT_ABUSE = False
|
|
|
|
|
|
2017-10-11 10:09:03 +08:00
|
|
|
|
# share link audit code timeout
|
|
|
|
|
SHARE_LINK_AUDIT_CODE_TIMEOUT = 60 * 60
|
|
|
|
|
|
2018-08-30 16:44:34 +08:00
|
|
|
|
# enable or disable limit ip
|
2017-09-18 14:21:11 +08:00
|
|
|
|
ENABLE_LIMIT_IPADDRESS = False
|
|
|
|
|
TRUSTED_IP_LIST = ['127.0.0.1']
|
|
|
|
|
|
2017-06-13 10:35:55 +08:00
|
|
|
|
# Control the language that send email. Default to user's current language.
|
|
|
|
|
SHARE_LINK_EMAIL_LANGUAGE = ''
|
|
|
|
|
|
2016-08-04 16:09:05 +08:00
|
|
|
|
# check virus for files uploaded form upload link
|
|
|
|
|
ENABLE_UPLOAD_LINK_VIRUS_CHECK = False
|
|
|
|
|
|
2014-07-29 16:42:08 +08:00
|
|
|
|
# mininum length for user's password
|
|
|
|
|
USER_PASSWORD_MIN_LENGTH = 6
|
|
|
|
|
|
|
|
|
|
# LEVEL based on four types of input:
|
|
|
|
|
# num, upper letter, lower letter, other symbols
|
|
|
|
|
# '3' means password must have at least 3 types of the above.
|
|
|
|
|
USER_PASSWORD_STRENGTH_LEVEL = 3
|
|
|
|
|
|
|
|
|
|
# default False, only check USER_PASSWORD_MIN_LENGTH
|
|
|
|
|
# when True, check password strength level, STRONG(or above) is allowed
|
|
|
|
|
USER_STRONG_PASSWORD_REQUIRED = False
|
|
|
|
|
|
2016-03-29 17:03:50 +08:00
|
|
|
|
# Force user to change password when admin add/reset a user.
|
|
|
|
|
FORCE_PASSWORD_CHANGE = True
|
|
|
|
|
|
2018-03-30 11:29:10 +08:00
|
|
|
|
# Enable a user to change password in 'settings' page.
|
|
|
|
|
ENABLE_CHANGE_PASSWORD = True
|
|
|
|
|
|
2020-10-23 16:18:03 +08:00
|
|
|
|
# Enable a user to get auth token in 'settings' page.
|
|
|
|
|
ENABLE_GET_AUTH_TOKEN_BY_SESSION = False
|
|
|
|
|
|
2018-12-10 16:43:37 +08:00
|
|
|
|
ENABLE_DELETE_ACCOUNT = True
|
|
|
|
|
ENABLE_UPDATE_USER_INFO = True
|
|
|
|
|
|
2014-02-13 16:57:18 +08:00
|
|
|
|
# Enable or disable repo history setting
|
|
|
|
|
ENABLE_REPO_HISTORY_SETTING = True
|
|
|
|
|
|
2016-02-17 14:13:46 +08:00
|
|
|
|
DISABLE_SYNC_WITH_ANY_FOLDER = False
|
|
|
|
|
|
2016-08-02 15:03:19 +08:00
|
|
|
|
ENABLE_TERMS_AND_CONDITIONS = False
|
|
|
|
|
|
2017-08-10 17:35:39 +08:00
|
|
|
|
# Enable or disable sharing to all groups
|
|
|
|
|
ENABLE_SHARE_TO_ALL_GROUPS = False
|
|
|
|
|
|
2021-01-13 14:11:35 +08:00
|
|
|
|
# Enable or disable sharing to departments
|
2021-02-22 10:09:46 +08:00
|
|
|
|
ENABLE_SHARE_TO_DEPARTMENT = True
|
2021-01-13 14:11:35 +08:00
|
|
|
|
|
2017-07-07 11:05:53 +08:00
|
|
|
|
# interval for request unread notifications
|
|
|
|
|
UNREAD_NOTIFICATIONS_REQUEST_INTERVAL = 3 * 60 # seconds
|
|
|
|
|
|
2018-04-18 15:05:21 +08:00
|
|
|
|
# Enable file comments
|
|
|
|
|
ENABLE_FILE_COMMENT = True
|
|
|
|
|
|
2019-04-17 10:32:32 +08:00
|
|
|
|
# Enable seafile docs
|
|
|
|
|
ENABLE_SEAFILE_DOCS = False
|
|
|
|
|
|
2012-07-04 20:32:54 +08:00
|
|
|
|
# File preview
|
2013-03-25 16:22:10 +08:00
|
|
|
|
FILE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024
|
2013-02-24 16:52:10 +08:00
|
|
|
|
FILE_ENCODING_LIST = ['auto', 'utf-8', 'gbk', 'ISO-8859-1', 'ISO-8859-5']
|
2013-02-27 15:19:24 +08:00
|
|
|
|
FILE_ENCODING_TRY_LIST = ['utf-8', 'gbk']
|
2014-07-29 16:42:08 +08:00
|
|
|
|
HIGHLIGHT_KEYWORD = False # If True, highlight the keywords in the file when the visit is via clicking a link in 'search result' page.
|
2017-06-13 13:37:02 +08:00
|
|
|
|
# extensions of previewed files
|
2019-02-15 18:52:29 +08:00
|
|
|
|
TEXT_PREVIEW_EXT = """ac, am, bat, c, cc, cmake, cpp, cs, css, diff, el, h, html, htm, java, js, json, less, make, org, php, pl, properties, py, rb, scala, script, sh, sql, txt, text, tex, vi, vim, xhtml, xml, log, csv, groovy, rst, patch, go, yml"""
|
2012-07-02 22:45:21 +08:00
|
|
|
|
|
2014-01-02 11:24:25 +08:00
|
|
|
|
# Common settings(file extension, storage) for avatar and group avatar.
|
|
|
|
|
AVATAR_FILE_STORAGE = '' # Replace with 'seahub.base.database_storage.DatabaseStorage' if save avatar files to database
|
|
|
|
|
AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png', '.jpeg', '.gif')
|
2012-07-04 20:32:54 +08:00
|
|
|
|
# Avatar
|
2012-05-24 20:19:14 +08:00
|
|
|
|
AVATAR_STORAGE_DIR = 'avatars'
|
2014-01-22 12:20:54 +08:00
|
|
|
|
AVATAR_HASH_USERDIRNAMES = True
|
2014-05-14 15:33:09 +08:00
|
|
|
|
AVATAR_HASH_FILENAMES = True
|
2012-05-24 20:19:14 +08:00
|
|
|
|
AVATAR_GRAVATAR_BACKUP = False
|
2014-01-17 13:34:55 +08:00
|
|
|
|
AVATAR_DEFAULT_URL = '/avatars/default.png'
|
2012-10-22 17:50:09 +08:00
|
|
|
|
AVATAR_DEFAULT_NON_REGISTERED_URL = '/avatars/default-non-register.jpg'
|
2012-05-25 14:14:51 +08:00
|
|
|
|
AVATAR_MAX_AVATARS_PER_USER = 1
|
2013-08-09 13:48:42 +08:00
|
|
|
|
AVATAR_CACHE_TIMEOUT = 14 * 24 * 60 * 60
|
2017-06-30 18:30:10 +08:00
|
|
|
|
AUTO_GENERATE_AVATAR_SIZES = (16, 20, 24, 28, 32, 36, 40, 42, 48, 60, 64, 72, 80, 84, 96, 128, 160)
|
2013-03-18 17:19:44 +08:00
|
|
|
|
# Group avatar
|
|
|
|
|
GROUP_AVATAR_STORAGE_DIR = 'avatars/groups'
|
|
|
|
|
GROUP_AVATAR_DEFAULT_URL = 'avatars/groups/default.png'
|
2014-02-10 16:56:19 +08:00
|
|
|
|
AUTO_GENERATE_GROUP_AVATAR_SIZES = (20, 24, 32, 36, 48, 56)
|
2011-04-30 13:31:10 +08:00
|
|
|
|
|
2013-08-05 11:38:26 +08:00
|
|
|
|
LOG_DIR = os.environ.get('SEAHUB_LOG_DIR', '/tmp')
|
2013-03-22 00:58:00 +08:00
|
|
|
|
CACHE_DIR = "/tmp"
|
2013-05-17 18:39:14 +08:00
|
|
|
|
install_topdir = os.path.expanduser(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
|
2015-10-16 10:24:43 +08:00
|
|
|
|
central_conf_dir = os.environ.get('SEAFILE_CENTRAL_CONF_DIR', '')
|
2013-03-22 00:58:00 +08:00
|
|
|
|
|
2012-07-02 10:21:17 +08:00
|
|
|
|
CACHES = {
|
|
|
|
|
'default': {
|
|
|
|
|
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
|
2013-03-22 00:58:00 +08:00
|
|
|
|
'LOCATION': os.path.join(CACHE_DIR, 'seahub_cache'),
|
2013-03-18 17:19:44 +08:00
|
|
|
|
'OPTIONS': {
|
|
|
|
|
'MAX_ENTRIES': 1000000
|
|
|
|
|
}
|
2018-05-24 11:38:15 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
# Compatible with existing `COMPRESS_CACHE_BACKEND` setting after
|
|
|
|
|
# upgrading to django-compressor v2.2.
|
|
|
|
|
# ref: https://manual.seafile.com/deploy_pro/deploy_in_a_cluster.html
|
|
|
|
|
'django.core.cache.backends.locmem.LocMemCache': {
|
|
|
|
|
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
|
|
|
|
},
|
2012-07-02 10:21:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
2012-12-28 17:14:51 +08:00
|
|
|
|
# rest_framwork
|
2012-12-26 11:03:38 +08:00
|
|
|
|
REST_FRAMEWORK = {
|
2020-08-26 11:12:28 +08:00
|
|
|
|
'DEFAULT_RENDERER_CLASSES': [
|
|
|
|
|
'rest_framework.renderers.JSONRenderer',
|
|
|
|
|
],
|
2012-12-26 11:03:38 +08:00
|
|
|
|
'DEFAULT_THROTTLE_RATES': {
|
2017-12-22 13:52:11 +08:00
|
|
|
|
'ping': '3000/minute',
|
|
|
|
|
'anon': '60/minute',
|
|
|
|
|
'user': '3000/minute',
|
2012-12-26 11:03:38 +08:00
|
|
|
|
},
|
2016-06-28 11:09:13 +08:00
|
|
|
|
# https://github.com/tomchristie/django-rest-framework/issues/2891
|
|
|
|
|
'UNICODE_JSON': False,
|
2012-12-26 11:03:38 +08:00
|
|
|
|
}
|
2017-06-05 10:02:02 +08:00
|
|
|
|
REST_FRAMEWORK_THROTTING_WHITELIST = []
|
2012-12-26 11:03:38 +08:00
|
|
|
|
|
2012-12-28 17:14:51 +08:00
|
|
|
|
# file and path
|
2017-12-11 11:18:19 +08:00
|
|
|
|
GET_FILE_HISTORY_TIMEOUT = 10 * 60 # seconds
|
2012-12-25 15:05:12 +08:00
|
|
|
|
MAX_UPLOAD_FILE_NAME_LEN = 255
|
|
|
|
|
MAX_FILE_NAME = MAX_UPLOAD_FILE_NAME_LEN
|
|
|
|
|
MAX_PATH = 4096
|
2012-07-04 20:32:54 +08:00
|
|
|
|
|
2015-07-11 10:10:31 +08:00
|
|
|
|
FILE_LOCK_EXPIRATION_DAYS = 0
|
|
|
|
|
|
2013-07-18 16:52:23 +08:00
|
|
|
|
# Whether or not activate user when registration complete.
|
|
|
|
|
# If set to ``False``, new user will be activated by admin or via activate link.
|
2012-07-04 20:32:54 +08:00
|
|
|
|
ACTIVATE_AFTER_REGISTRATION = True
|
2013-07-18 16:52:23 +08:00
|
|
|
|
# Whether or not send activation Email to user when registration complete.
|
|
|
|
|
# This option will be ignored if ``ACTIVATE_AFTER_REGISTRATION`` set to ``True``.
|
2012-07-04 20:32:54 +08:00
|
|
|
|
REGISTRATION_SEND_MAIL = False
|
|
|
|
|
|
2018-01-06 16:53:48 +08:00
|
|
|
|
# Whether or not send notify email to sytem admins when user registered or
|
|
|
|
|
# first login through Shibboleth.
|
|
|
|
|
NOTIFY_ADMIN_AFTER_REGISTRATION = False
|
|
|
|
|
|
2017-10-12 14:02:53 +08:00
|
|
|
|
# Whether or not activate inactive user on first login. Mainly used in LDAP user sync.
|
|
|
|
|
ACTIVATE_AFTER_FIRST_LOGIN = False
|
|
|
|
|
|
2013-12-18 13:56:20 +08:00
|
|
|
|
REQUIRE_DETAIL_ON_REGISTRATION = False
|
|
|
|
|
|
2012-08-06 16:30:51 +08:00
|
|
|
|
# Account initial password, for password resetting.
|
2013-04-18 15:14:20 +02:00
|
|
|
|
# INIT_PASSWD can either be a string, or a function (function has to be set without the brackets)
|
2013-04-18 15:13:04 +02:00
|
|
|
|
def genpassword():
|
2016-03-01 16:56:24 +08:00
|
|
|
|
from django.utils.crypto import get_random_string
|
|
|
|
|
return get_random_string(10)
|
2013-04-18 15:13:04 +02:00
|
|
|
|
INIT_PASSWD = genpassword
|
2012-08-06 16:30:51 +08:00
|
|
|
|
|
2012-11-07 20:39:59 +08:00
|
|
|
|
# browser tab title
|
|
|
|
|
SITE_TITLE = 'Private Seafile'
|
2012-07-04 20:32:54 +08:00
|
|
|
|
|
2021-10-01 11:35:05 +02:00
|
|
|
|
# html head meta tag for search engine preview text
|
|
|
|
|
SITE_DESCRIPTION = ''
|
|
|
|
|
|
2015-10-10 11:03:50 +08:00
|
|
|
|
# Base name used in email sending
|
2012-11-07 20:39:59 +08:00
|
|
|
|
SITE_NAME = 'Seafile'
|
2012-07-04 20:32:54 +08:00
|
|
|
|
|
2017-06-28 14:15:24 +08:00
|
|
|
|
# Path to the license file(relative to the media path)
|
2017-07-04 10:39:11 +08:00
|
|
|
|
LICENSE_PATH = os.path.join(PROJECT_ROOT, '../../seafile-license.txt')
|
2017-06-28 14:15:24 +08:00
|
|
|
|
|
2017-08-25 11:50:50 +08:00
|
|
|
|
# Path to the background image file of login page(relative to the media path)
|
|
|
|
|
LOGIN_BG_IMAGE_PATH = 'img/login-bg.jpg'
|
|
|
|
|
|
2017-03-23 16:33:09 +08:00
|
|
|
|
# Path to the favicon file (relative to the media path)
|
|
|
|
|
# tip: use a different name when modify it.
|
|
|
|
|
FAVICON_PATH = 'img/favicon.ico'
|
|
|
|
|
|
2013-04-15 04:01:28 -07:00
|
|
|
|
# Path to the Logo Imagefile (relative to the media path)
|
2016-04-06 17:49:53 +08:00
|
|
|
|
LOGO_PATH = 'img/seafile-logo.png'
|
2014-01-03 14:12:50 +08:00
|
|
|
|
# logo size. the unit is 'px'
|
2019-04-18 14:45:03 +08:00
|
|
|
|
LOGO_WIDTH = ''
|
2014-01-17 13:34:55 +08:00
|
|
|
|
LOGO_HEIGHT = 32
|
2013-04-15 04:01:28 -07:00
|
|
|
|
|
2017-08-31 14:43:25 +08:00
|
|
|
|
CUSTOM_LOGO_PATH = 'custom/mylogo.png'
|
|
|
|
|
CUSTOM_FAVICON_PATH = 'custom/favicon.ico'
|
2019-09-03 17:02:46 +08:00
|
|
|
|
CUSTOM_LOGIN_BG_PATH = 'custom/login-bg.jpg'
|
2017-08-31 14:43:25 +08:00
|
|
|
|
|
2018-07-06 22:41:25 +08:00
|
|
|
|
# used before version 6.3: the relative path of css file under seahub-data (e.g. custom/custom.css)
|
|
|
|
|
BRANDING_CSS = ''
|
|
|
|
|
|
|
|
|
|
# used in 6.3+, enable setting custom css via admin web interface
|
2018-04-08 14:11:13 +08:00
|
|
|
|
ENABLE_BRANDING_CSS = False
|
2013-04-15 04:01:28 -07:00
|
|
|
|
|
2012-12-03 21:47:27 +08:00
|
|
|
|
# Using Django to server static file. Set to `False` if deployed behide a web
|
|
|
|
|
# server.
|
|
|
|
|
SERVE_STATIC = True
|
|
|
|
|
|
2015-09-21 11:48:07 +08:00
|
|
|
|
# Enable or disable registration on web.
|
2012-12-19 14:11:32 +08:00
|
|
|
|
ENABLE_SIGNUP = False
|
2012-06-07 11:48:25 +08:00
|
|
|
|
|
2017-08-07 13:56:25 +08:00
|
|
|
|
# show 'log out' icon in top-bar or not.
|
|
|
|
|
SHOW_LOGOUT_ICON = False
|
|
|
|
|
|
2020-01-07 15:23:39 +08:00
|
|
|
|
# privacy policy link and service link
|
|
|
|
|
PRIVACY_POLICY_LINK = ''
|
|
|
|
|
TERMS_OF_SERVICE_LINK = ''
|
|
|
|
|
|
2013-05-20 10:33:39 +08:00
|
|
|
|
# For security consideration, please set to match the host/domain of your site, e.g., ALLOWED_HOSTS = ['.example.com'].
|
|
|
|
|
# Please refer https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts for details.
|
|
|
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
|
|
2012-12-27 20:48:38 +08:00
|
|
|
|
# Logging
|
|
|
|
|
LOGGING = {
|
|
|
|
|
'version': 1,
|
2018-01-19 12:03:36 +08:00
|
|
|
|
|
|
|
|
|
# Enable existing loggers so that gunicorn errors will be bubbled up when
|
|
|
|
|
# server side error page "Internal Server Error" occurs.
|
|
|
|
|
# ref: https://www.caktusgroup.com/blog/2015/01/27/Django-Logging-Configuration-logging_config-default-settings-logger/
|
|
|
|
|
'disable_existing_loggers': False,
|
|
|
|
|
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'formatters': {
|
|
|
|
|
'standard': {
|
2013-01-09 17:28:56 +08:00
|
|
|
|
'format': '%(asctime)s [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(message)s'
|
2012-12-27 20:48:38 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
2013-06-01 16:03:58 +08:00
|
|
|
|
'filters': {
|
|
|
|
|
'require_debug_false': {
|
|
|
|
|
'()': 'django.utils.log.RequireDebugFalse'
|
2018-02-07 11:23:09 +08:00
|
|
|
|
},
|
|
|
|
|
'require_debug_true': {
|
|
|
|
|
'()': 'django.utils.log.RequireDebugTrue'
|
|
|
|
|
},
|
2017-09-05 16:21:20 +08:00
|
|
|
|
},
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'handlers': {
|
2018-02-07 11:23:09 +08:00
|
|
|
|
'console': {
|
|
|
|
|
'level': 'DEBUG',
|
|
|
|
|
'filters': ['require_debug_true'],
|
|
|
|
|
'class': 'logging.StreamHandler',
|
|
|
|
|
'formatter': 'standard',
|
|
|
|
|
},
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'default': {
|
2017-09-05 16:21:20 +08:00
|
|
|
|
'level': 'INFO',
|
|
|
|
|
'class': 'logging.handlers.RotatingFileHandler',
|
2013-03-22 00:58:00 +08:00
|
|
|
|
'filename': os.path.join(LOG_DIR, 'seahub.log'),
|
2017-09-05 16:21:20 +08:00
|
|
|
|
'maxBytes': 1024*1024*100, # 100 MB
|
|
|
|
|
'backupCount': 5,
|
|
|
|
|
'formatter': 'standard',
|
2014-07-29 16:42:08 +08:00
|
|
|
|
},
|
2021-07-02 16:53:40 +08:00
|
|
|
|
'onlyoffice_handler': {
|
|
|
|
|
'level': 'INFO',
|
|
|
|
|
'class': 'logging.handlers.RotatingFileHandler',
|
|
|
|
|
'filename': os.path.join(LOG_DIR, 'onlyoffice.log'),
|
|
|
|
|
'maxBytes': 1024*1024*100, # 100 MB
|
|
|
|
|
'backupCount': 5,
|
|
|
|
|
'formatter': 'standard',
|
|
|
|
|
},
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'mail_admins': {
|
|
|
|
|
'level': 'ERROR',
|
2013-06-01 16:03:58 +08:00
|
|
|
|
'filters': ['require_debug_false'],
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'class': 'django.utils.log.AdminEmailHandler'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
'loggers': {
|
|
|
|
|
'': {
|
|
|
|
|
'handlers': ['default'],
|
2016-04-09 11:49:04 +08:00
|
|
|
|
'level': 'INFO',
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'propagate': True
|
|
|
|
|
},
|
|
|
|
|
'django.request': {
|
2018-01-19 12:03:36 +08:00
|
|
|
|
'handlers': ['default', 'mail_admins'],
|
2016-04-09 11:49:04 +08:00
|
|
|
|
'level': 'INFO',
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'propagate': False
|
|
|
|
|
},
|
2018-02-07 11:23:09 +08:00
|
|
|
|
'py.warnings': {
|
|
|
|
|
'handlers': ['console', ],
|
2016-04-09 11:49:04 +08:00
|
|
|
|
'level': 'INFO',
|
2012-12-27 20:48:38 +08:00
|
|
|
|
'propagate': False
|
|
|
|
|
},
|
2021-07-02 16:53:40 +08:00
|
|
|
|
'onlyoffice': {
|
|
|
|
|
'handlers': ['onlyoffice_handler', ],
|
|
|
|
|
'level': 'INFO',
|
|
|
|
|
'propagate': False
|
|
|
|
|
},
|
2012-12-27 20:48:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-20 00:37:41 +08:00
|
|
|
|
#Login Attempt
|
2018-01-05 11:56:47 +08:00
|
|
|
|
LOGIN_ATTEMPT_LIMIT = 5
|
2013-11-09 10:33:53 +08:00
|
|
|
|
LOGIN_ATTEMPT_TIMEOUT = 15 * 60 # in seconds (default: 15 minutes)
|
2016-04-19 15:33:48 +08:00
|
|
|
|
FREEZE_USER_ON_LOGIN_FAILED = False # deactivate user account when login attempts exceed limit
|
2013-10-20 00:37:41 +08:00
|
|
|
|
|
2014-01-02 16:20:39 +08:00
|
|
|
|
# Age of cookie, in seconds (default: 1 day).
|
2014-01-03 11:34:11 +08:00
|
|
|
|
SESSION_COOKIE_AGE = 24 * 60 * 60
|
|
|
|
|
|
|
|
|
|
# Days of remembered login info (deafult: 7 days)
|
|
|
|
|
LOGIN_REMEMBER_DAYS = 7
|
2014-01-02 16:20:39 +08:00
|
|
|
|
|
2018-08-14 14:48:29 +08:00
|
|
|
|
SEAFILE_VERSION = '6.3.3'
|
2014-01-22 14:01:02 +08:00
|
|
|
|
|
2018-05-11 11:59:17 +08:00
|
|
|
|
CAPTCHA_IMAGE_SIZE = (90, 42)
|
2015-04-09 17:05:01 +08:00
|
|
|
|
|
2014-12-23 17:34:36 +08:00
|
|
|
|
###################
|
|
|
|
|
# Image Thumbnail #
|
|
|
|
|
###################
|
|
|
|
|
|
|
|
|
|
# Absolute filesystem path to the directory that will hold thumbnail files.
|
2015-02-12 11:04:41 +08:00
|
|
|
|
SEAHUB_DATA_ROOT = os.path.join(PROJECT_ROOT, '../../seahub-data')
|
|
|
|
|
if os.path.exists(SEAHUB_DATA_ROOT):
|
|
|
|
|
THUMBNAIL_ROOT = os.path.join(SEAHUB_DATA_ROOT, 'thumbnail')
|
|
|
|
|
else:
|
|
|
|
|
THUMBNAIL_ROOT = os.path.join(PROJECT_ROOT, 'seahub/thumbnail/thumb')
|
2014-12-23 17:34:36 +08:00
|
|
|
|
|
|
|
|
|
THUMBNAIL_EXTENSION = 'png'
|
2015-03-13 15:28:29 +08:00
|
|
|
|
|
|
|
|
|
# for thumbnail: height(px) and width(px)
|
2015-07-25 16:30:11 +08:00
|
|
|
|
THUMBNAIL_DEFAULT_SIZE = 48
|
2015-10-29 17:17:40 +08:00
|
|
|
|
THUMBNAIL_SIZE_FOR_GRID = 192
|
2017-05-31 16:08:44 +08:00
|
|
|
|
THUMBNAIL_SIZE_FOR_ORIGINAL = 1024
|
2015-10-29 17:17:40 +08:00
|
|
|
|
|
2015-07-15 17:57:09 +08:00
|
|
|
|
# size(MB) limit for generate thumbnail
|
2017-07-17 18:13:59 +08:00
|
|
|
|
THUMBNAIL_IMAGE_SIZE_LIMIT = 30
|
2015-07-15 17:57:09 +08:00
|
|
|
|
THUMBNAIL_IMAGE_ORIGINAL_SIZE_LIMIT = 256
|
2015-03-13 15:28:29 +08:00
|
|
|
|
|
2017-05-22 12:15:38 +08:00
|
|
|
|
# video thumbnails
|
|
|
|
|
ENABLE_VIDEO_THUMBNAIL = False
|
|
|
|
|
THUMBNAIL_VIDEO_FRAME_TIME = 5 # use the frame at 5 second as thumbnail
|
|
|
|
|
|
2016-12-15 13:50:04 +08:00
|
|
|
|
# template for create new office file
|
|
|
|
|
OFFICE_TEMPLATE_ROOT = os.path.join(MEDIA_ROOT, 'office-template')
|
|
|
|
|
|
2018-11-22 16:46:03 +08:00
|
|
|
|
ENABLE_WEBDAV_SECRET = False
|
2019-03-14 19:04:32 +08:00
|
|
|
|
ENABLE_USER_SET_CONTACT_EMAIL = False
|
2018-11-22 16:46:03 +08:00
|
|
|
|
|
2015-06-10 18:42:10 +08:00
|
|
|
|
#####################
|
2015-06-12 17:48:23 +08:00
|
|
|
|
# Global AddressBook #
|
2015-06-10 18:42:10 +08:00
|
|
|
|
#####################
|
2015-06-13 17:52:05 +08:00
|
|
|
|
ENABLE_GLOBAL_ADDRESSBOOK = True
|
2017-08-12 15:10:08 +08:00
|
|
|
|
ENABLE_ADDRESSBOOK_OPT_IN = False
|
2015-06-10 18:42:10 +08:00
|
|
|
|
|
2016-05-20 15:14:06 +08:00
|
|
|
|
####################
|
2016-09-05 14:43:00 +08:00
|
|
|
|
# Guest Invite #
|
2016-05-20 15:14:06 +08:00
|
|
|
|
####################
|
2016-07-20 15:30:39 +08:00
|
|
|
|
ENABLE_GUEST_INVITATION = False
|
2016-12-19 16:12:47 +08:00
|
|
|
|
INVITATION_ACCEPTER_BLACKLIST = []
|
2016-07-20 15:30:39 +08:00
|
|
|
|
|
2018-08-30 14:14:17 +08:00
|
|
|
|
########################
|
|
|
|
|
# Security Enhancements #
|
|
|
|
|
########################
|
|
|
|
|
|
2015-05-04 15:38:53 +08:00
|
|
|
|
ENABLE_SUDO_MODE = True
|
2018-08-30 14:14:17 +08:00
|
|
|
|
FILESERVER_TOKEN_ONCE_ONLY = True
|
2015-05-04 15:38:53 +08:00
|
|
|
|
|
2013-01-09 17:28:56 +08:00
|
|
|
|
#################
|
|
|
|
|
# Email sending #
|
|
|
|
|
#################
|
|
|
|
|
|
2013-01-10 17:28:56 +08:00
|
|
|
|
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True # Whether to send email when a system staff adding new member.
|
2013-01-09 17:28:56 +08:00
|
|
|
|
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True # Whether to send email when a system staff resetting user's password.
|
|
|
|
|
|
2013-05-17 11:12:32 +08:00
|
|
|
|
##########################
|
|
|
|
|
# Settings for Extra App #
|
|
|
|
|
##########################
|
|
|
|
|
|
2018-07-27 11:48:21 +08:00
|
|
|
|
##########################
|
|
|
|
|
# Settings for frontend #
|
|
|
|
|
##########################
|
|
|
|
|
|
|
|
|
|
SEAFILE_COLLAB_SERVER = ''
|
|
|
|
|
|
2019-10-08 17:28:15 +08:00
|
|
|
|
##########################
|
|
|
|
|
# Settings for dtable web #
|
|
|
|
|
##########################
|
|
|
|
|
|
|
|
|
|
DTABLE_WEB_SERVER = ''
|
|
|
|
|
|
2014-07-08 18:16:56 +08:00
|
|
|
|
############################
|
|
|
|
|
# Settings for Seahub Priv #
|
|
|
|
|
############################
|
|
|
|
|
|
|
|
|
|
# Replace from email to current user instead of email sender.
|
|
|
|
|
REPLACE_FROM_EMAIL = False
|
|
|
|
|
|
|
|
|
|
# Add ``Reply-to`` header, see RFC #822.
|
|
|
|
|
ADD_REPLY_TO_HEADER = False
|
|
|
|
|
|
2018-03-14 17:22:05 +08:00
|
|
|
|
ENABLE_DEMO_USER = False
|
2015-03-30 10:47:33 +08:00
|
|
|
|
CLOUD_DEMO_USER = 'demo@seafile.com'
|
|
|
|
|
|
2016-04-15 09:08:22 +08:00
|
|
|
|
ENABLE_TWO_FACTOR_AUTH = False
|
2016-07-15 14:39:23 +08:00
|
|
|
|
OTP_LOGIN_URL = '/profile/two_factor_authentication/setup/'
|
2017-12-15 11:33:00 +08:00
|
|
|
|
TWO_FACTOR_DEVICE_REMEMBER_DAYS = 90
|
2019-09-09 16:12:05 +08:00
|
|
|
|
ENABLE_FORCE_2FA_TO_ALL_USERS = False
|
2016-04-15 09:08:22 +08:00
|
|
|
|
|
2019-11-07 19:39:05 +08:00
|
|
|
|
# Enable wiki
|
2019-05-18 13:25:53 +08:00
|
|
|
|
ENABLE_WIKI = True
|
2017-03-25 14:30:11 +08:00
|
|
|
|
|
2017-07-20 14:10:09 +08:00
|
|
|
|
# Enable 'repo snapshot label' feature
|
|
|
|
|
ENABLE_REPO_SNAPSHOT_LABEL = False
|
|
|
|
|
|
2018-09-12 10:32:31 +08:00
|
|
|
|
# Repo wiki mode
|
|
|
|
|
ENABLE_REPO_WIKI_MODE = True
|
|
|
|
|
|
2020-03-25 18:03:04 +08:00
|
|
|
|
############################
|
2020-04-01 17:55:59 +08:00
|
|
|
|
# HU berlin additional #
|
2020-03-25 18:03:04 +08:00
|
|
|
|
############################
|
|
|
|
|
|
2020-04-01 17:55:59 +08:00
|
|
|
|
# ADDITIONAL_SHARE_DIALOG_NOTE = {
|
2020-03-25 18:03:04 +08:00
|
|
|
|
# 'title': 'Attention! Read before shareing files:',
|
|
|
|
|
# 'content': 'Do not share personal or confidential official data with **.'
|
|
|
|
|
# }
|
2020-04-01 17:55:59 +08:00
|
|
|
|
ADDITIONAL_SHARE_DIALOG_NOTE = None
|
2020-03-25 18:03:04 +08:00
|
|
|
|
|
2020-04-01 17:55:59 +08:00
|
|
|
|
# ADDITIONAL_APP_BOTTOM_LINKS = {
|
2020-03-25 18:03:04 +08:00
|
|
|
|
# 'seafile': 'http://dev.seahub.com/seahub',
|
|
|
|
|
# 'dtable-web': 'http://dev.seahub.com/dtable-web'
|
|
|
|
|
# }
|
2020-04-01 17:55:59 +08:00
|
|
|
|
ADDITIONAL_APP_BOTTOM_LINKS = None
|
2020-03-25 18:03:04 +08:00
|
|
|
|
|
2020-04-01 17:55:59 +08:00
|
|
|
|
# ADDITIONAL_ABOUT_DIALOG_LINKS = {
|
2020-03-25 18:03:04 +08:00
|
|
|
|
# 'seafile': 'http://dev.seahub.com/seahub',
|
|
|
|
|
# 'dtable-web': 'http://dev.seahub.com/dtable-web'
|
|
|
|
|
# }
|
2020-04-01 17:55:59 +08:00
|
|
|
|
ADDITIONAL_ABOUT_DIALOG_LINKS = None
|
2020-03-25 18:03:04 +08:00
|
|
|
|
|
2019-01-30 14:06:51 +08:00
|
|
|
|
############################
|
|
|
|
|
# Settings for SeafileDocs #
|
|
|
|
|
############################
|
|
|
|
|
if os.environ.get('SEAFILE_DOCS', None):
|
|
|
|
|
LOGO_PATH = 'img/seafile-docs-logo.png'
|
|
|
|
|
LOGO_WIDTH = ''
|
|
|
|
|
ENABLE_WIKI = True
|
|
|
|
|
|
2019-01-10 13:44:29 +08:00
|
|
|
|
d = os.path.dirname
|
|
|
|
|
EVENTS_CONFIG_FILE = os.environ.get(
|
|
|
|
|
'EVENTS_CONFIG_FILE',
|
|
|
|
|
os.path.join(
|
|
|
|
|
d(d(d(d(os.path.abspath(__file__))))), 'conf', 'seafevents.conf'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
del d
|
|
|
|
|
if not os.path.exists(EVENTS_CONFIG_FILE):
|
|
|
|
|
del EVENTS_CONFIG_FILE
|
|
|
|
|
|
2013-01-09 17:28:56 +08:00
|
|
|
|
#####################
|
|
|
|
|
# External settings #
|
|
|
|
|
#####################
|
|
|
|
|
|
2012-06-07 11:48:25 +08:00
|
|
|
|
def load_local_settings(module):
|
|
|
|
|
'''Import any symbols that begin with A-Z. Append to lists any symbols
|
|
|
|
|
that begin with "EXTRA_".
|
|
|
|
|
|
|
|
|
|
'''
|
2014-07-01 11:48:35 +08:00
|
|
|
|
if hasattr(module, 'HTTP_SERVER_ROOT'):
|
|
|
|
|
if not hasattr(module, 'FILE_SERVER_ROOT'):
|
|
|
|
|
module.FILE_SERVER_ROOT = module.HTTP_SERVER_ROOT
|
|
|
|
|
del module.HTTP_SERVER_ROOT
|
2012-06-07 11:48:25 +08:00
|
|
|
|
for attr in dir(module):
|
2012-07-04 20:32:54 +08:00
|
|
|
|
match = re.search('^EXTRA_(\w+)', attr)
|
|
|
|
|
if match:
|
|
|
|
|
name = match.group(1)
|
2012-06-07 11:48:25 +08:00
|
|
|
|
value = getattr(module, attr)
|
2012-07-04 20:32:54 +08:00
|
|
|
|
try:
|
|
|
|
|
globals()[name] += value
|
|
|
|
|
except KeyError:
|
|
|
|
|
globals()[name] = value
|
|
|
|
|
elif re.search('^[A-Z]', attr):
|
2012-06-07 11:48:25 +08:00
|
|
|
|
globals()[attr] = getattr(module, attr)
|
2012-07-04 20:32:54 +08:00
|
|
|
|
|
2013-05-30 11:31:02 +08:00
|
|
|
|
# Load local_settings.py
|
|
|
|
|
try:
|
|
|
|
|
import seahub.local_settings
|
|
|
|
|
except ImportError:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
load_local_settings(seahub.local_settings)
|
|
|
|
|
del seahub.local_settings
|
2013-03-23 17:38:42 +08:00
|
|
|
|
|
2012-06-07 11:48:25 +08:00
|
|
|
|
# Load seahub_settings.py in server release
|
|
|
|
|
try:
|
2015-10-16 10:24:43 +08:00
|
|
|
|
if os.path.exists(central_conf_dir):
|
|
|
|
|
sys.path.insert(0, central_conf_dir)
|
2012-06-07 11:48:25 +08:00
|
|
|
|
import seahub_settings
|
|
|
|
|
except ImportError:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
2014-07-29 16:42:08 +08:00
|
|
|
|
# In server release, sqlite3 db file is <topdir>/seahub.db
|
2013-01-09 10:14:39 +08:00
|
|
|
|
DATABASES['default']['NAME'] = os.path.join(install_topdir, 'seahub.db')
|
2019-11-27 13:24:26 +08:00
|
|
|
|
|
|
|
|
|
# In server release, gunicorn is used to deploy seahub
|
2020-07-27 14:59:18 +08:00
|
|
|
|
INSTALLED_APPS.append('gunicorn')
|
2013-03-23 17:38:42 +08:00
|
|
|
|
|
2012-06-07 11:48:25 +08:00
|
|
|
|
load_local_settings(seahub_settings)
|
|
|
|
|
del seahub_settings
|
|
|
|
|
|
|
|
|
|
# Remove install_topdir from path
|
2012-12-26 10:20:34 +08:00
|
|
|
|
sys.path.pop(0)
|
2012-12-27 20:48:38 +08:00
|
|
|
|
|
2016-05-27 10:32:36 +08:00
|
|
|
|
# Following settings are private, can not be overwrite.
|
2014-07-01 11:48:35 +08:00
|
|
|
|
INNER_FILE_SERVER_ROOT = 'http://127.0.0.1:' + FILE_SERVER_PORT
|
2015-08-07 16:08:45 +08:00
|
|
|
|
|
2016-05-27 10:32:36 +08:00
|
|
|
|
CONSTANCE_ENABLED = ENABLE_SETTINGS_VIA_WEB
|
2015-08-07 16:08:45 +08:00
|
|
|
|
CONSTANCE_CONFIG = {
|
2019-09-11 11:46:43 +08:00
|
|
|
|
'SERVICE_URL': (SERVICE_URL, ''),
|
|
|
|
|
'FILE_SERVER_ROOT': (FILE_SERVER_ROOT, ''),
|
|
|
|
|
'DISABLE_SYNC_WITH_ANY_FOLDER': (DISABLE_SYNC_WITH_ANY_FOLDER, ''),
|
|
|
|
|
|
|
|
|
|
'ENABLE_SIGNUP': (ENABLE_SIGNUP, ''),
|
|
|
|
|
'ACTIVATE_AFTER_REGISTRATION': (ACTIVATE_AFTER_REGISTRATION, ''),
|
|
|
|
|
'REGISTRATION_SEND_MAIL': (REGISTRATION_SEND_MAIL, ''),
|
|
|
|
|
'LOGIN_REMEMBER_DAYS': (LOGIN_REMEMBER_DAYS, ''),
|
2016-04-19 15:33:48 +08:00
|
|
|
|
'LOGIN_ATTEMPT_LIMIT': (LOGIN_ATTEMPT_LIMIT, ''),
|
|
|
|
|
'FREEZE_USER_ON_LOGIN_FAILED': (FREEZE_USER_ON_LOGIN_FAILED, ''),
|
|
|
|
|
|
2019-09-11 11:46:43 +08:00
|
|
|
|
'ENABLE_ENCRYPTED_LIBRARY': (ENABLE_ENCRYPTED_LIBRARY, ''),
|
|
|
|
|
'REPO_PASSWORD_MIN_LENGTH': (REPO_PASSWORD_MIN_LENGTH, ''),
|
|
|
|
|
'ENABLE_REPO_HISTORY_SETTING': (ENABLE_REPO_HISTORY_SETTING, ''),
|
2016-03-29 17:03:50 +08:00
|
|
|
|
'FORCE_PASSWORD_CHANGE': (FORCE_PASSWORD_CHANGE, ''),
|
2015-09-21 11:48:07 +08:00
|
|
|
|
|
2019-09-11 11:46:43 +08:00
|
|
|
|
'USER_STRONG_PASSWORD_REQUIRED': (USER_STRONG_PASSWORD_REQUIRED, ''),
|
|
|
|
|
'USER_PASSWORD_MIN_LENGTH': (USER_PASSWORD_MIN_LENGTH, ''),
|
|
|
|
|
'USER_PASSWORD_STRENGTH_LEVEL': (USER_PASSWORD_STRENGTH_LEVEL, ''),
|
2015-10-19 17:20:15 +08:00
|
|
|
|
|
2017-02-17 16:49:58 +08:00
|
|
|
|
'SHARE_LINK_TOKEN_LENGTH': (SHARE_LINK_TOKEN_LENGTH, ''),
|
2021-08-12 15:02:03 +08:00
|
|
|
|
'SHARE_LINK_FORCE_USE_PASSWORD': (SHARE_LINK_FORCE_USE_PASSWORD, ''),
|
2019-09-11 11:46:43 +08:00
|
|
|
|
'SHARE_LINK_PASSWORD_MIN_LENGTH': (SHARE_LINK_PASSWORD_MIN_LENGTH, ''),
|
2021-08-12 15:02:03 +08:00
|
|
|
|
'SHARE_LINK_PASSWORD_STRENGTH_LEVEL': (SHARE_LINK_PASSWORD_STRENGTH_LEVEL, ''),
|
2019-09-11 11:46:43 +08:00
|
|
|
|
'ENABLE_TWO_FACTOR_AUTH': (ENABLE_TWO_FACTOR_AUTH, ''),
|
2017-06-09 16:13:06 +08:00
|
|
|
|
|
|
|
|
|
'TEXT_PREVIEW_EXT': (TEXT_PREVIEW_EXT, ''),
|
2017-08-10 17:35:39 +08:00
|
|
|
|
'ENABLE_SHARE_TO_ALL_GROUPS': (ENABLE_SHARE_TO_ALL_GROUPS, ''),
|
2018-04-08 12:48:51 +08:00
|
|
|
|
|
|
|
|
|
'SITE_NAME': (SITE_NAME, ''),
|
|
|
|
|
'SITE_TITLE': (SITE_TITLE, ''),
|
2018-04-08 14:11:13 +08:00
|
|
|
|
|
|
|
|
|
'ENABLE_BRANDING_CSS': (ENABLE_BRANDING_CSS, ''),
|
|
|
|
|
'CUSTOM_CSS': ('', ''),
|
2018-06-05 17:32:48 +08:00
|
|
|
|
|
|
|
|
|
'ENABLE_TERMS_AND_CONDITIONS': (ENABLE_TERMS_AND_CONDITIONS, ''),
|
2018-09-10 13:56:10 +08:00
|
|
|
|
'ENABLE_USER_CLEAN_TRASH': (ENABLE_USER_CLEAN_TRASH, ''),
|
2015-08-07 16:08:45 +08:00
|
|
|
|
}
|
2019-04-16 16:01:18 +08:00
|
|
|
|
|
|
|
|
|
# if Seafile admin enable remote user authentication in conf/seahub_settings.py
|
|
|
|
|
# then add 'seahub.auth.middleware.SeafileRemoteUserMiddleware' and
|
|
|
|
|
# 'seahub.auth.backends.SeafileRemoteUserBackend' to settings.
|
|
|
|
|
if ENABLE_REMOTE_USER_AUTHENTICATION:
|
2020-07-27 14:59:18 +08:00
|
|
|
|
MIDDLEWARE.append('seahub.auth.middleware.SeafileRemoteUserMiddleware')
|
2019-04-16 16:01:18 +08:00
|
|
|
|
AUTHENTICATION_BACKENDS += ('seahub.auth.backends.SeafileRemoteUserBackend',)
|
2019-04-17 12:11:07 +08:00
|
|
|
|
|
2020-04-20 16:52:50 +08:00
|
|
|
|
if ENABLE_OAUTH or ENABLE_WORK_WEIXIN or ENABLE_WEIXIN or ENABLE_DINGTALK:
|
2019-04-17 12:11:07 +08:00
|
|
|
|
AUTHENTICATION_BACKENDS += ('seahub.oauth.backends.OauthRemoteUserBackend',)
|
2019-09-11 13:39:49 +08:00
|
|
|
|
|
2021-08-26 13:37:28 +08:00
|
|
|
|
if ENABLE_CAS:
|
|
|
|
|
AUTHENTICATION_BACKENDS += ('seahub.django_cas_ng.backends.CASBackend',)
|
|
|
|
|
|
|
|
|
|
if ENABLE_ADFS_LOGIN:
|
|
|
|
|
AUTHENTICATION_BACKENDS += ('seahub.adfs_auth.backends.Saml2Backend',)
|
|
|
|
|
|
2019-09-11 13:39:49 +08:00
|
|
|
|
#####################
|
|
|
|
|
# Custom Nav Items #
|
|
|
|
|
#####################
|
|
|
|
|
# an example:
|
|
|
|
|
# CUSTOM_NAV_ITEMS = [
|
2020-02-10 09:25:17 +08:00
|
|
|
|
# {'icon': 'sf2-icon-star',
|
|
|
|
|
# 'desc': 'test custom name',
|
|
|
|
|
# 'link': 'http://127.0.0.1:8000/shared-libs/',
|
2019-09-11 13:39:49 +08:00
|
|
|
|
# },
|
|
|
|
|
# ]
|