You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.3 KiB

  1. --- a/seahub/settings.py
  2. +++ b/seahub/settings.py
  3. @@ -140,7 +140,7 @@ TEMPLATES = [
  4. {
  5. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  6. 'DIRS': [
  7. - os.path.join(PROJECT_ROOT, '../../seahub-data/custom/templates'),
  8. + os.path.join(os.environ.get('SEAFILE_UCI_DATA_DIR', os.path.join(PROJECT_ROOT, '../..')), 'seahub-data/custom/templates'),
  9. os.path.join(PROJECT_ROOT, 'seahub/templates'),
  10. ],
  11. 'APP_DIRS': True,
  12. @@ -633,7 +633,7 @@ CAPTCHA_IMAGE_SIZE = (90, 42)
  13. ENABLE_THUMBNAIL = True
  14. # Absolute filesystem path to the directory that will hold thumbnail files.
  15. -SEAHUB_DATA_ROOT = os.path.join(PROJECT_ROOT, '../../seahub-data')
  16. +SEAHUB_DATA_ROOT = os.path.join(os.environ.get('SEAFILE_UCI_DATA_DIR', os.path.join(PROJECT_ROOT, '../..')), 'seahub-data')
  17. if os.path.exists(SEAHUB_DATA_ROOT):
  18. THUMBNAIL_ROOT = os.path.join(SEAHUB_DATA_ROOT, 'thumbnail')
  19. else:
  20. @@ -829,7 +829,7 @@ except ImportError:
  21. pass
  22. else:
  23. # In server release, sqlite3 db file is <topdir>/seahub.db
  24. - DATABASES['default']['NAME'] = os.path.join(install_topdir, 'seahub.db')
  25. + DATABASES['default']['NAME'] = os.path.join(os.environ.get('SEAFILE_UCI_DATA_DIR', install_topdir), 'seahub.db')
  26. # In server release, gunicorn is used to deploy seahub
  27. INSTALLED_APPS += ('gunicorn', )