diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -478,6 +478,7 @@ def sanitize_settings_and_apply_defaults This piece would later be split up per topic to avoid a big fat monster function. """ + jn = os.path.join global_settings_maker = SettingsMaker(global_config) global_settings_maker.make_setting('debug', default=False, parser='bool') @@ -490,7 +491,7 @@ def sanitize_settings_and_apply_defaults default=False, parser='bool') - logging_conf = os.path.join(os.path.dirname(global_config.get('__file__')), 'logging.ini') + logging_conf = jn(os.path.dirname(global_config.get('__file__')), 'logging.ini') settings_maker.enable_logging(logging_conf, level='INFO' if debug_enabled else 'DEBUG') # Default includes, possible to change as a user @@ -565,7 +566,7 @@ def sanitize_settings_and_apply_defaults settings_maker.make_setting('appenlight', False, parser='bool') temp_store = tempfile.gettempdir() - tmp_cache_dir = os.path.join(temp_store, 'rc_cache') + tmp_cache_dir = jn(temp_store, 'rc_cache') # save default, cache dir, and use it for all backends later. default_cache_dir = settings_maker.make_setting( @@ -576,38 +577,42 @@ def sanitize_settings_and_apply_defaults # exception store cache settings_maker.make_setting( 'exception_tracker.store_path', - default=os.path.join(default_cache_dir, 'exc_store'), default_when_empty=True, + default=jn(default_cache_dir, 'exc_store'), default_when_empty=True, parser='dir:ensured' ) settings_maker.make_setting( 'celerybeat-schedule.path', - default=os.path.join(default_cache_dir, 'celerybeat_schedule', 'celerybeat-schedule.db'), default_when_empty=True, + default=jn(default_cache_dir, 'celerybeat_schedule', 'celerybeat-schedule.db'), default_when_empty=True, parser='file:ensured' ) settings_maker.make_setting('exception_tracker.send_email', False, parser='bool') settings_maker.make_setting('exception_tracker.email_prefix', '[RHODECODE ERROR]', default_when_empty=True) + # sessions, ensure file since no-value is memory + settings_maker.make_setting('beaker.session.type', 'file') + settings_maker.make_setting('beaker.session.data_dir', jn(default_cache_dir, 'session_data')) + # cache_general settings_maker.make_setting('rc_cache.cache_general.backend', 'dogpile.cache.rc.file_namespace') settings_maker.make_setting('rc_cache.cache_general.expiration_time', 60 * 60 * 12, parser='int') - settings_maker.make_setting('rc_cache.cache_general.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_general.db')) + settings_maker.make_setting('rc_cache.cache_general.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_general.db')) # cache_perms settings_maker.make_setting('rc_cache.cache_perms.backend', 'dogpile.cache.rc.file_namespace') settings_maker.make_setting('rc_cache.cache_perms.expiration_time', 60 * 60, parser='int') - settings_maker.make_setting('rc_cache.cache_perms.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_perms_db')) + settings_maker.make_setting('rc_cache.cache_perms.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_perms_db')) # cache_repo settings_maker.make_setting('rc_cache.cache_repo.backend', 'dogpile.cache.rc.file_namespace') settings_maker.make_setting('rc_cache.cache_repo.expiration_time', 60 * 60 * 24 * 30, parser='int') - settings_maker.make_setting('rc_cache.cache_repo.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_repo_db')) + settings_maker.make_setting('rc_cache.cache_repo.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_repo_db')) # cache_license settings_maker.make_setting('rc_cache.cache_license.backend', 'dogpile.cache.rc.file_namespace') settings_maker.make_setting('rc_cache.cache_license.expiration_time', 60 * 5, parser='int') - settings_maker.make_setting('rc_cache.cache_license.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_license_db')) + settings_maker.make_setting('rc_cache.cache_license.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_license_db')) # cache_repo_longterm memory, 96H settings_maker.make_setting('rc_cache.cache_repo_longterm.backend', 'dogpile.cache.rc.memory_lru') @@ -620,7 +625,7 @@ def sanitize_settings_and_apply_defaults settings_maker.make_setting('rc_cache.sql_cache_short.max_size', 10000, parser='int') # archive_cache - settings_maker.make_setting('archive_cache.store_dir', os.path.join(default_cache_dir, 'archive_cache'), default_when_empty=True,) + settings_maker.make_setting('archive_cache.store_dir', jn(default_cache_dir, 'archive_cache'), default_when_empty=True,) settings_maker.make_setting('archive_cache.cache_size_gb', 10, parser='float') settings_maker.make_setting('archive_cache.cache_shards', 10, parser='int')