##// END OF EJS Templates
config: set default file-based sessions if not specified. This will prevent memory session to kick-in
super-admin -
r5185:0b667669 default
parent child Browse files
Show More
@@ -478,6 +478,7 b' def sanitize_settings_and_apply_defaults'
478 This piece would later be split up per topic to avoid a big fat monster
478 This piece would later be split up per topic to avoid a big fat monster
479 function.
479 function.
480 """
480 """
481 jn = os.path.join
481
482
482 global_settings_maker = SettingsMaker(global_config)
483 global_settings_maker = SettingsMaker(global_config)
483 global_settings_maker.make_setting('debug', default=False, parser='bool')
484 global_settings_maker.make_setting('debug', default=False, parser='bool')
@@ -490,7 +491,7 b' def sanitize_settings_and_apply_defaults'
490 default=False,
491 default=False,
491 parser='bool')
492 parser='bool')
492
493
493 logging_conf = os.path.join(os.path.dirname(global_config.get('__file__')), 'logging.ini')
494 logging_conf = jn(os.path.dirname(global_config.get('__file__')), 'logging.ini')
494 settings_maker.enable_logging(logging_conf, level='INFO' if debug_enabled else 'DEBUG')
495 settings_maker.enable_logging(logging_conf, level='INFO' if debug_enabled else 'DEBUG')
495
496
496 # Default includes, possible to change as a user
497 # Default includes, possible to change as a user
@@ -565,7 +566,7 b' def sanitize_settings_and_apply_defaults'
565 settings_maker.make_setting('appenlight', False, parser='bool')
566 settings_maker.make_setting('appenlight', False, parser='bool')
566
567
567 temp_store = tempfile.gettempdir()
568 temp_store = tempfile.gettempdir()
568 tmp_cache_dir = os.path.join(temp_store, 'rc_cache')
569 tmp_cache_dir = jn(temp_store, 'rc_cache')
569
570
570 # save default, cache dir, and use it for all backends later.
571 # save default, cache dir, and use it for all backends later.
571 default_cache_dir = settings_maker.make_setting(
572 default_cache_dir = settings_maker.make_setting(
@@ -576,38 +577,42 b' def sanitize_settings_and_apply_defaults'
576 # exception store cache
577 # exception store cache
577 settings_maker.make_setting(
578 settings_maker.make_setting(
578 'exception_tracker.store_path',
579 'exception_tracker.store_path',
579 default=os.path.join(default_cache_dir, 'exc_store'), default_when_empty=True,
580 default=jn(default_cache_dir, 'exc_store'), default_when_empty=True,
580 parser='dir:ensured'
581 parser='dir:ensured'
581 )
582 )
582
583
583 settings_maker.make_setting(
584 settings_maker.make_setting(
584 'celerybeat-schedule.path',
585 'celerybeat-schedule.path',
585 default=os.path.join(default_cache_dir, 'celerybeat_schedule', 'celerybeat-schedule.db'), default_when_empty=True,
586 default=jn(default_cache_dir, 'celerybeat_schedule', 'celerybeat-schedule.db'), default_when_empty=True,
586 parser='file:ensured'
587 parser='file:ensured'
587 )
588 )
588
589
589 settings_maker.make_setting('exception_tracker.send_email', False, parser='bool')
590 settings_maker.make_setting('exception_tracker.send_email', False, parser='bool')
590 settings_maker.make_setting('exception_tracker.email_prefix', '[RHODECODE ERROR]', default_when_empty=True)
591 settings_maker.make_setting('exception_tracker.email_prefix', '[RHODECODE ERROR]', default_when_empty=True)
591
592
593 # sessions, ensure file since no-value is memory
594 settings_maker.make_setting('beaker.session.type', 'file')
595 settings_maker.make_setting('beaker.session.data_dir', jn(default_cache_dir, 'session_data'))
596
592 # cache_general
597 # cache_general
593 settings_maker.make_setting('rc_cache.cache_general.backend', 'dogpile.cache.rc.file_namespace')
598 settings_maker.make_setting('rc_cache.cache_general.backend', 'dogpile.cache.rc.file_namespace')
594 settings_maker.make_setting('rc_cache.cache_general.expiration_time', 60 * 60 * 12, parser='int')
599 settings_maker.make_setting('rc_cache.cache_general.expiration_time', 60 * 60 * 12, parser='int')
595 settings_maker.make_setting('rc_cache.cache_general.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_general.db'))
600 settings_maker.make_setting('rc_cache.cache_general.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_general.db'))
596
601
597 # cache_perms
602 # cache_perms
598 settings_maker.make_setting('rc_cache.cache_perms.backend', 'dogpile.cache.rc.file_namespace')
603 settings_maker.make_setting('rc_cache.cache_perms.backend', 'dogpile.cache.rc.file_namespace')
599 settings_maker.make_setting('rc_cache.cache_perms.expiration_time', 60 * 60, parser='int')
604 settings_maker.make_setting('rc_cache.cache_perms.expiration_time', 60 * 60, parser='int')
600 settings_maker.make_setting('rc_cache.cache_perms.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_perms_db'))
605 settings_maker.make_setting('rc_cache.cache_perms.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_perms_db'))
601
606
602 # cache_repo
607 # cache_repo
603 settings_maker.make_setting('rc_cache.cache_repo.backend', 'dogpile.cache.rc.file_namespace')
608 settings_maker.make_setting('rc_cache.cache_repo.backend', 'dogpile.cache.rc.file_namespace')
604 settings_maker.make_setting('rc_cache.cache_repo.expiration_time', 60 * 60 * 24 * 30, parser='int')
609 settings_maker.make_setting('rc_cache.cache_repo.expiration_time', 60 * 60 * 24 * 30, parser='int')
605 settings_maker.make_setting('rc_cache.cache_repo.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_repo_db'))
610 settings_maker.make_setting('rc_cache.cache_repo.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_repo_db'))
606
611
607 # cache_license
612 # cache_license
608 settings_maker.make_setting('rc_cache.cache_license.backend', 'dogpile.cache.rc.file_namespace')
613 settings_maker.make_setting('rc_cache.cache_license.backend', 'dogpile.cache.rc.file_namespace')
609 settings_maker.make_setting('rc_cache.cache_license.expiration_time', 60 * 5, parser='int')
614 settings_maker.make_setting('rc_cache.cache_license.expiration_time', 60 * 5, parser='int')
610 settings_maker.make_setting('rc_cache.cache_license.arguments.filename', os.path.join(default_cache_dir, 'rhodecode_cache_license_db'))
615 settings_maker.make_setting('rc_cache.cache_license.arguments.filename', jn(default_cache_dir, 'rhodecode_cache_license_db'))
611
616
612 # cache_repo_longterm memory, 96H
617 # cache_repo_longterm memory, 96H
613 settings_maker.make_setting('rc_cache.cache_repo_longterm.backend', 'dogpile.cache.rc.memory_lru')
618 settings_maker.make_setting('rc_cache.cache_repo_longterm.backend', 'dogpile.cache.rc.memory_lru')
@@ -620,7 +625,7 b' def sanitize_settings_and_apply_defaults'
620 settings_maker.make_setting('rc_cache.sql_cache_short.max_size', 10000, parser='int')
625 settings_maker.make_setting('rc_cache.sql_cache_short.max_size', 10000, parser='int')
621
626
622 # archive_cache
627 # archive_cache
623 settings_maker.make_setting('archive_cache.store_dir', os.path.join(default_cache_dir, 'archive_cache'), default_when_empty=True,)
628 settings_maker.make_setting('archive_cache.store_dir', jn(default_cache_dir, 'archive_cache'), default_when_empty=True,)
624 settings_maker.make_setting('archive_cache.cache_size_gb', 10, parser='float')
629 settings_maker.make_setting('archive_cache.cache_size_gb', 10, parser='float')
625 settings_maker.make_setting('archive_cache.cache_shards', 10, parser='int')
630 settings_maker.make_setting('archive_cache.cache_shards', 10, parser='int')
626
631
General Comments 0
You need to be logged in to leave comments. Login now