##// END OF EJS Templates
fix(ssh): added missing import
super-admin -
r5321:4e02b442 default
parent child Browse files
Show More
@@ -1,59 +1,60 b''
1 1 # Copyright (C) 2016-2023 RhodeCode GmbH
2 2 #
3 3 # This program is free software: you can redistribute it and/or modify
4 4 # it under the terms of the GNU Affero General Public License, version 3
5 5 # (only), as published by the Free Software Foundation.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU Affero General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 #
15 15 # This program is dual-licensed. If you wish to learn more about the
16 16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19 19 import logging
20 20
21 21 from . import config_keys
22 22
23 23 from rhodecode.config.settings_maker import SettingsMaker
24 24
25 25 log = logging.getLogger(__name__)
26 26
27 27
28 28 def _sanitize_settings_and_apply_defaults(settings):
29 29 """
30 30 Set defaults, convert to python types and validate settings.
31 31 """
32 32 settings_maker = SettingsMaker(settings)
33 33
34 34 settings_maker.make_setting(config_keys.generate_authorized_keyfile, False, parser='bool')
35 35 settings_maker.make_setting(config_keys.wrapper_allow_shell, False, parser='bool')
36 36 settings_maker.make_setting(config_keys.enable_debug_logging, False, parser='bool')
37 37 settings_maker.make_setting(config_keys.ssh_key_generator_enabled, True, parser='bool')
38 38
39 39 settings_maker.make_setting(config_keys.authorized_keys_file_path, '~/.ssh/authorized_keys_rhodecode')
40 40 settings_maker.make_setting(config_keys.wrapper_cmd, '')
41 41 settings_maker.make_setting(config_keys.authorized_keys_line_ssh_opts, '')
42 42
43 43 settings_maker.make_setting(config_keys.ssh_hg_bin, '/usr/local/bin/rhodecode_bin/vcs_bin/hg')
44 44 settings_maker.make_setting(config_keys.ssh_git_bin, '/usr/local/bin/rhodecode_bin/vcs_bin/git')
45 45 settings_maker.make_setting(config_keys.ssh_svn_bin, '/usr/local/bin/rhodecode_bin/vcs_bin/svnserve')
46 46
47 47 settings_maker.env_expand()
48 48
49 49
50 50 def includeme(config):
51 51 settings = config.registry.settings
52 52 _sanitize_settings_and_apply_defaults(settings)
53 53
54 54 # if we have enable generation of file, subscribe to event
55 55 if settings[config_keys.generate_authorized_keyfile]:
56 56 # lazy import here for faster code reading... via sshwrapper-v2 mode
57 57 from .subscribers import generate_ssh_authorized_keys_file_subscriber
58 from .events import SshKeyFileChangeEvent
58 59 config.add_subscriber(
59 60 generate_ssh_authorized_keys_file_subscriber, SshKeyFileChangeEvent)
General Comments 0
You need to be logged in to leave comments. Login now