Show More
@@ -67,8 +67,7 b' def get_storage_size(storage_path):' | |||||
67 | try: |
|
67 | try: | |
68 | sizes.append(os.path.getsize(storage_file)) |
|
68 | sizes.append(os.path.getsize(storage_file)) | |
69 | except OSError: |
|
69 | except OSError: | |
70 | log.exception('Failed to get size of storage file %s', |
|
70 | log.exception('Failed to get size of storage file %s', storage_file) | |
71 | storage_file) |
|
|||
72 | pass |
|
71 | pass | |
73 |
|
72 | |||
74 | return sum(sizes) |
|
73 | return sum(sizes) | |
@@ -81,6 +80,16 b' def get_resource(resource_type):' | |||||
81 | return 'NOT_SUPPORTED' |
|
80 | return 'NOT_SUPPORTED' | |
82 |
|
81 | |||
83 |
|
82 | |||
|
83 | def get_cert_path(ini_path): | |||
|
84 | default = '/etc/ssl/certs/ca-certificates.crt' | |||
|
85 | control_ca_bundle = os.path.join( | |||
|
86 | os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(ini_path)))), | |||
|
87 | '.rccontrol-profile/etc/ca-bundle.crt') | |||
|
88 | if os.path.isfile(control_ca_bundle): | |||
|
89 | default = control_ca_bundle | |||
|
90 | ||||
|
91 | return default | |||
|
92 | ||||
84 | class SysInfoRes(object): |
|
93 | class SysInfoRes(object): | |
85 | def __init__(self, value, state=None, human_value=None): |
|
94 | def __init__(self, value, state=None, human_value=None): | |
86 | self.value = value |
|
95 | self.value = value | |
@@ -604,6 +613,7 b' def rhodecode_config():' | |||||
604 | import rhodecode |
|
613 | import rhodecode | |
605 | path = rhodecode.CONFIG.get('__file__') |
|
614 | path = rhodecode.CONFIG.get('__file__') | |
606 | rhodecode_ini_safe = rhodecode.CONFIG.copy() |
|
615 | rhodecode_ini_safe = rhodecode.CONFIG.copy() | |
|
616 | cert_path = get_cert_path(path) | |||
607 |
|
617 | |||
608 | try: |
|
618 | try: | |
609 | config = configparser.ConfigParser() |
|
619 | config = configparser.ConfigParser() | |
@@ -615,10 +625,6 b' def rhodecode_config():' | |||||
615 | log.exception('Failed to read .ini file for display') |
|
625 | log.exception('Failed to read .ini file for display') | |
616 | parsed_ini = {} |
|
626 | parsed_ini = {} | |
617 |
|
627 | |||
618 | cert_path = os.path.join( |
|
|||
619 | os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(path)))), |
|
|||
620 | '.rccontrol-profile/etc/ca-bundle.crt') |
|
|||
621 |
|
||||
622 | rhodecode_ini_safe['server:main'] = parsed_ini |
|
628 | rhodecode_ini_safe['server:main'] = parsed_ini | |
623 |
|
629 | |||
624 | blacklist = [ |
|
630 | blacklist = [ |
@@ -35,7 +35,9 b' import msgpack' | |||||
35 | import requests |
|
35 | import requests | |
36 | from requests.packages.urllib3.util.retry import Retry |
|
36 | from requests.packages.urllib3.util.retry import Retry | |
37 |
|
37 | |||
38 | from . import exceptions, CurlSession |
|
38 | import rhodecode | |
|
39 | from rhodecode.lib.system_info import get_cert_path | |||
|
40 | from rhodecode.lib.vcs import exceptions, CurlSession | |||
39 |
|
41 | |||
40 |
|
42 | |||
41 | log = logging.getLogger(__name__) |
|
43 | log = logging.getLogger(__name__) | |
@@ -121,6 +123,8 b' class RemoteRepo(object):' | |||||
121 | if log.isEnabledFor(logging.DEBUG): |
|
123 | if log.isEnabledFor(logging.DEBUG): | |
122 | self._call = self._call_with_logging |
|
124 | self._call = self._call_with_logging | |
123 |
|
125 | |||
|
126 | self.cert_dir = get_cert_path(rhodecode.CONFIG.get('__file__')) | |||
|
127 | ||||
124 | def __getattr__(self, name): |
|
128 | def __getattr__(self, name): | |
125 | def f(*args, **kwargs): |
|
129 | def f(*args, **kwargs): | |
126 | return self._call(name, *args, **kwargs) |
|
130 | return self._call(name, *args, **kwargs) | |
@@ -132,6 +136,8 b' class RemoteRepo(object):' | |||||
132 | # config object is being changed for hooking scenarios |
|
136 | # config object is being changed for hooking scenarios | |
133 | wire = copy.deepcopy(self._wire) |
|
137 | wire = copy.deepcopy(self._wire) | |
134 | wire["config"] = wire["config"].serialize() |
|
138 | wire["config"] = wire["config"].serialize() | |
|
139 | ||||
|
140 | wire["config"].append(('vcs', 'ssl_dir', self.cert_dir)) | |||
135 | payload = { |
|
141 | payload = { | |
136 | 'id': str(uuid.uuid4()), |
|
142 | 'id': str(uuid.uuid4()), | |
137 | 'method': name, |
|
143 | 'method': name, |
@@ -80,14 +80,12 b' function registerRCRoutes() {' | |||||
80 | pyroutes.register('admin_settings_search', '/_admin/settings/search', []); |
|
80 | pyroutes.register('admin_settings_search', '/_admin/settings/search', []); | |
81 | pyroutes.register('admin_settings_labs', '/_admin/settings/labs', []); |
|
81 | pyroutes.register('admin_settings_labs', '/_admin/settings/labs', []); | |
82 | pyroutes.register('admin_settings_labs_update', '/_admin/settings/labs/update', []); |
|
82 | pyroutes.register('admin_settings_labs_update', '/_admin/settings/labs/update', []); | |
83 | pyroutes.register('admin_settings_automation', '/_admin/_admin/settings/automation', []); |
|
|||
84 | pyroutes.register('admin_permissions_application', '/_admin/permissions/application', []); |
|
83 | pyroutes.register('admin_permissions_application', '/_admin/permissions/application', []); | |
85 | pyroutes.register('admin_permissions_application_update', '/_admin/permissions/application/update', []); |
|
84 | pyroutes.register('admin_permissions_application_update', '/_admin/permissions/application/update', []); | |
86 | pyroutes.register('admin_permissions_global', '/_admin/permissions/global', []); |
|
85 | pyroutes.register('admin_permissions_global', '/_admin/permissions/global', []); | |
87 | pyroutes.register('admin_permissions_global_update', '/_admin/permissions/global/update', []); |
|
86 | pyroutes.register('admin_permissions_global_update', '/_admin/permissions/global/update', []); | |
88 | pyroutes.register('admin_permissions_object', '/_admin/permissions/object', []); |
|
87 | pyroutes.register('admin_permissions_object', '/_admin/permissions/object', []); | |
89 | pyroutes.register('admin_permissions_object_update', '/_admin/permissions/object/update', []); |
|
88 | pyroutes.register('admin_permissions_object_update', '/_admin/permissions/object/update', []); | |
90 | pyroutes.register('admin_permissions_branch', '/_admin/permissions/branch', []); |
|
|||
91 | pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []); |
|
89 | pyroutes.register('admin_permissions_ips', '/_admin/permissions/ips', []); | |
92 | pyroutes.register('admin_permissions_overview', '/_admin/permissions/overview', []); |
|
90 | pyroutes.register('admin_permissions_overview', '/_admin/permissions/overview', []); | |
93 | pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []); |
|
91 | pyroutes.register('admin_permissions_auth_token_access', '/_admin/permissions/auth_token_access', []); | |
@@ -106,8 +104,6 b' function registerRCRoutes() {' | |||||
106 | pyroutes.register('user_delete', '/_admin/users/%(user_id)s/delete', ['user_id']); |
|
104 | pyroutes.register('user_delete', '/_admin/users/%(user_id)s/delete', ['user_id']); | |
107 | pyroutes.register('user_force_password_reset', '/_admin/users/%(user_id)s/password_reset', ['user_id']); |
|
105 | pyroutes.register('user_force_password_reset', '/_admin/users/%(user_id)s/password_reset', ['user_id']); | |
108 | pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']); |
|
106 | pyroutes.register('user_create_personal_repo_group', '/_admin/users/%(user_id)s/create_repo_group', ['user_id']); | |
109 | pyroutes.register('edit_user_auth_tokens', '/_admin/users/%(user_id)s/edit/auth_tokens', ['user_id']); |
|
|||
110 | pyroutes.register('edit_user_auth_tokens_add', '/_admin/users/%(user_id)s/edit/auth_tokens/new', ['user_id']); |
|
|||
111 | pyroutes.register('edit_user_auth_tokens_delete', '/_admin/users/%(user_id)s/edit/auth_tokens/delete', ['user_id']); |
|
107 | pyroutes.register('edit_user_auth_tokens_delete', '/_admin/users/%(user_id)s/edit/auth_tokens/delete', ['user_id']); | |
112 | pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']); |
|
108 | pyroutes.register('edit_user_ssh_keys', '/_admin/users/%(user_id)s/edit/ssh_keys', ['user_id']); | |
113 | pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']); |
|
109 | pyroutes.register('edit_user_ssh_keys_generate_keypair', '/_admin/users/%(user_id)s/edit/ssh_keys/generate', ['user_id']); | |
@@ -139,9 +135,7 b' function registerRCRoutes() {' | |||||
139 | pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []); |
|
135 | pyroutes.register('channelstream_connect', '/_admin/channelstream/connect', []); | |
140 | pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []); |
|
136 | pyroutes.register('channelstream_subscribe', '/_admin/channelstream/subscribe', []); | |
141 | pyroutes.register('channelstream_proxy', '/_channelstream', []); |
|
137 | pyroutes.register('channelstream_proxy', '/_channelstream', []); | |
142 | pyroutes.register('login', '/_admin/login', []); |
|
|||
143 | pyroutes.register('logout', '/_admin/logout', []); |
|
138 | pyroutes.register('logout', '/_admin/logout', []); | |
144 | pyroutes.register('register', '/_admin/register', []); |
|
|||
145 | pyroutes.register('reset_password', '/_admin/password_reset', []); |
|
139 | pyroutes.register('reset_password', '/_admin/password_reset', []); | |
146 | pyroutes.register('reset_password_confirmation', '/_admin/password_reset_confirmation', []); |
|
140 | pyroutes.register('reset_password_confirmation', '/_admin/password_reset_confirmation', []); | |
147 | pyroutes.register('home', '/', []); |
|
141 | pyroutes.register('home', '/', []); | |
@@ -236,8 +230,6 b' function registerRCRoutes() {' | |||||
236 | pyroutes.register('edit_repo_advanced_hooks', '/%(repo_name)s/settings/advanced/hooks', ['repo_name']); |
|
230 | pyroutes.register('edit_repo_advanced_hooks', '/%(repo_name)s/settings/advanced/hooks', ['repo_name']); | |
237 | pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']); |
|
231 | pyroutes.register('edit_repo_caches', '/%(repo_name)s/settings/caches', ['repo_name']); | |
238 | pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']); |
|
232 | pyroutes.register('edit_repo_perms', '/%(repo_name)s/settings/permissions', ['repo_name']); | |
239 | pyroutes.register('edit_repo_perms_branch', '/%(repo_name)s/settings/branch_permissions', ['repo_name']); |
|
|||
240 | pyroutes.register('edit_repo_perms_branch_delete', '/%(repo_name)s/settings/branch_permissions/%(rule_id)s/delete', ['repo_name', 'rule_id']); |
|
|||
241 | pyroutes.register('edit_repo_maintenance', '/%(repo_name)s/settings/maintenance', ['repo_name']); |
|
233 | pyroutes.register('edit_repo_maintenance', '/%(repo_name)s/settings/maintenance', ['repo_name']); | |
242 | pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']); |
|
234 | pyroutes.register('edit_repo_maintenance_execute', '/%(repo_name)s/settings/maintenance/execute', ['repo_name']); | |
243 | pyroutes.register('edit_repo_fields', '/%(repo_name)s/settings/fields', ['repo_name']); |
|
235 | pyroutes.register('edit_repo_fields', '/%(repo_name)s/settings/fields', ['repo_name']); | |
@@ -246,7 +238,6 b' function registerRCRoutes() {' | |||||
246 | pyroutes.register('repo_edit_toggle_locking', '/%(repo_name)s/settings/toggle_locking', ['repo_name']); |
|
238 | pyroutes.register('repo_edit_toggle_locking', '/%(repo_name)s/settings/toggle_locking', ['repo_name']); | |
247 | pyroutes.register('edit_repo_remote', '/%(repo_name)s/settings/remote', ['repo_name']); |
|
239 | pyroutes.register('edit_repo_remote', '/%(repo_name)s/settings/remote', ['repo_name']); | |
248 | pyroutes.register('edit_repo_remote_pull', '/%(repo_name)s/settings/remote/pull', ['repo_name']); |
|
240 | pyroutes.register('edit_repo_remote_pull', '/%(repo_name)s/settings/remote/pull', ['repo_name']); | |
249 | pyroutes.register('edit_repo_remote_push', '/%(repo_name)s/settings/remote/push', ['repo_name']); |
|
|||
250 | pyroutes.register('edit_repo_statistics', '/%(repo_name)s/settings/statistics', ['repo_name']); |
|
241 | pyroutes.register('edit_repo_statistics', '/%(repo_name)s/settings/statistics', ['repo_name']); | |
251 | pyroutes.register('edit_repo_statistics_reset', '/%(repo_name)s/settings/statistics/update', ['repo_name']); |
|
242 | pyroutes.register('edit_repo_statistics_reset', '/%(repo_name)s/settings/statistics/update', ['repo_name']); | |
252 | pyroutes.register('edit_repo_issuetracker', '/%(repo_name)s/settings/issue_trackers', ['repo_name']); |
|
243 | pyroutes.register('edit_repo_issuetracker', '/%(repo_name)s/settings/issue_trackers', ['repo_name']); | |
@@ -258,7 +249,6 b' function registerRCRoutes() {' | |||||
258 | pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']); |
|
249 | pyroutes.register('edit_repo_vcs_svn_pattern_delete', '/%(repo_name)s/settings/vcs/svn_pattern/delete', ['repo_name']); | |
259 | pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']); |
|
250 | pyroutes.register('repo_reviewers', '/%(repo_name)s/settings/review/rules', ['repo_name']); | |
260 | pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']); |
|
251 | pyroutes.register('repo_default_reviewers_data', '/%(repo_name)s/settings/review/default-reviewers', ['repo_name']); | |
261 | pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']); |
|
|||
262 | pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']); |
|
252 | pyroutes.register('edit_repo_strip', '/%(repo_name)s/settings/strip', ['repo_name']); | |
263 | pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']); |
|
253 | pyroutes.register('strip_check', '/%(repo_name)s/settings/strip_check', ['repo_name']); | |
264 | pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']); |
|
254 | pyroutes.register('strip_execute', '/%(repo_name)s/settings/strip_execute', ['repo_name']); | |
@@ -295,8 +285,6 b' function registerRCRoutes() {' | |||||
295 | pyroutes.register('my_account_update', '/_admin/my_account/update', []); |
|
285 | pyroutes.register('my_account_update', '/_admin/my_account/update', []); | |
296 | pyroutes.register('my_account_password', '/_admin/my_account/password', []); |
|
286 | pyroutes.register('my_account_password', '/_admin/my_account/password', []); | |
297 | pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []); |
|
287 | pyroutes.register('my_account_password_update', '/_admin/my_account/password/update', []); | |
298 | pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []); |
|
|||
299 | pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []); |
|
|||
300 | pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []); |
|
288 | pyroutes.register('my_account_auth_tokens_delete', '/_admin/my_account/auth_tokens/delete', []); | |
301 | pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []); |
|
289 | pyroutes.register('my_account_ssh_keys', '/_admin/my_account/ssh_keys', []); | |
302 | pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []); |
|
290 | pyroutes.register('my_account_ssh_keys_generate', '/_admin/my_account/ssh_keys/generate', []); | |
@@ -333,4 +321,35 b' function registerRCRoutes() {' | |||||
333 | pyroutes.register('debug_style_home', '/_admin/debug_style', []); |
|
321 | pyroutes.register('debug_style_home', '/_admin/debug_style', []); | |
334 | pyroutes.register('debug_style_template', '/_admin/debug_style/t/%(t_path)s', ['t_path']); |
|
322 | pyroutes.register('debug_style_template', '/_admin/debug_style/t/%(t_path)s', ['t_path']); | |
335 | pyroutes.register('apiv2', '/_admin/api', []); |
|
323 | pyroutes.register('apiv2', '/_admin/api', []); | |
|
324 | pyroutes.register('admin_settings_license', '/_admin/settings/license', []); | |||
|
325 | pyroutes.register('admin_settings_license_unlock', '/_admin/settings/license_unlock', []); | |||
|
326 | pyroutes.register('login', '/_admin/login', []); | |||
|
327 | pyroutes.register('register', '/_admin/register', []); | |||
|
328 | pyroutes.register('repo_reviewers_review_rule_new', '/%(repo_name)s/settings/review/rules/new', ['repo_name']); | |||
|
329 | pyroutes.register('repo_reviewers_review_rule_edit', '/%(repo_name)s/settings/review/rules/%(rule_id)s', ['repo_name', 'rule_id']); | |||
|
330 | pyroutes.register('repo_reviewers_review_rule_delete', '/%(repo_name)s/settings/review/rules/%(rule_id)s/delete', ['repo_name', 'rule_id']); | |||
|
331 | pyroutes.register('plugin_admin_chat', '/_admin/plugin_admin_chat/%(action)s', ['action']); | |||
|
332 | pyroutes.register('edit_user_auth_tokens', '/_admin/users/%(user_id)s/edit/auth_tokens', ['user_id']); | |||
|
333 | pyroutes.register('edit_user_auth_tokens_add', '/_admin/users/%(user_id)s/edit/auth_tokens/new', ['user_id']); | |||
|
334 | pyroutes.register('admin_settings_scheduler_show_tasks', '/_admin/settings/scheduler/_tasks', []); | |||
|
335 | pyroutes.register('admin_settings_scheduler_show_all', '/_admin/settings/scheduler', []); | |||
|
336 | pyroutes.register('admin_settings_scheduler_new', '/_admin/settings/scheduler/new', []); | |||
|
337 | pyroutes.register('admin_settings_scheduler_create', '/_admin/settings/scheduler/create', []); | |||
|
338 | pyroutes.register('admin_settings_scheduler_edit', '/_admin/settings/scheduler/%(schedule_id)s', ['schedule_id']); | |||
|
339 | pyroutes.register('admin_settings_scheduler_update', '/_admin/settings/scheduler/%(schedule_id)s/update', ['schedule_id']); | |||
|
340 | pyroutes.register('admin_settings_scheduler_delete', '/_admin/settings/scheduler/%(schedule_id)s/delete', ['schedule_id']); | |||
|
341 | pyroutes.register('admin_settings_scheduler_execute', '/_admin/settings/scheduler/%(schedule_id)s/execute', ['schedule_id']); | |||
|
342 | pyroutes.register('admin_settings_automation', '/_admin/settings/automation', []); | |||
|
343 | pyroutes.register('admin_settings_automation_update', '/_admin/settings/automation/%(entry_id)s/update', ['entry_id']); | |||
|
344 | pyroutes.register('admin_permissions_branch', '/_admin/permissions/branch', []); | |||
|
345 | pyroutes.register('admin_permissions_branch_update', '/_admin/permissions/branch/update', []); | |||
|
346 | pyroutes.register('my_account_auth_tokens', '/_admin/my_account/auth_tokens', []); | |||
|
347 | pyroutes.register('my_account_auth_tokens_add', '/_admin/my_account/auth_tokens/new', []); | |||
|
348 | pyroutes.register('my_account_external_identity', '/_admin/my_account/external-identity', []); | |||
|
349 | pyroutes.register('my_account_external_identity_delete', '/_admin/my_account/external-identity/delete', []); | |||
|
350 | pyroutes.register('repo_automation', '/%(repo_name)s/settings/automation', ['repo_name']); | |||
|
351 | pyroutes.register('repo_automation_update', '/%(repo_name)s/settings/automation/%(entry_id)s/update', ['repo_name', 'entry_id']); | |||
|
352 | pyroutes.register('edit_repo_remote_push', '/%(repo_name)s/settings/remote/push', ['repo_name']); | |||
|
353 | pyroutes.register('edit_repo_perms_branch', '/%(repo_name)s/settings/branch_permissions', ['repo_name']); | |||
|
354 | pyroutes.register('edit_repo_perms_branch_delete', '/%(repo_name)s/settings/branch_permissions/%(rule_id)s/delete', ['repo_name', 'rule_id']); | |||
336 | } |
|
355 | } |
General Comments 0
You need to be logged in to leave comments.
Login now