# HG changeset patch # User RhodeCode Admin # Date 2024-10-14 06:53:25 # Node ID f3356a6625e8aaf91aaa42295a1ecc06c1a62273 # Parent 5b9b5ed22e497e27d9737b789dc4c5de944b0349 feat(system-info): expose rhodecode config for better visibility of set settings diff --git a/rhodecode/apps/admin/views/system_info.py b/rhodecode/apps/admin/views/system_info.py --- a/rhodecode/apps/admin/views/system_info.py +++ b/rhodecode/apps/admin/views/system_info.py @@ -199,8 +199,12 @@ class AdminSystemInfoSettingsView(BaseAp ] + c.rhodecode_data_items = [ + (k, v) for k, v in sorted((val('rhodecode_server_config') or {}).items(), key=lambda x: x[0].lower()) + ] + c.vcsserver_data_items = [ - (k, v) for k, v in (val('vcs_server_config') or {}).items() + (k, v) for k, v in sorted((val('vcs_server_config') or {}).items(), key=lambda x: x[0].lower()) ] if snapshot: diff --git a/rhodecode/lib/system_info.py b/rhodecode/lib/system_info.py --- a/rhodecode/lib/system_info.py +++ b/rhodecode/lib/system_info.py @@ -665,6 +665,32 @@ def vcs_server_config(): return SysInfoRes(value=value, state=state, human_value=human_value) +@register_sysinfo +def rhodecode_server_config(): + import rhodecode + + state = STATE_OK_DEFAULT + config = rhodecode.CONFIG.copy() + + secrets_lits = [ + f'rhodecode_{LicenseModel.LICENSE_DB_KEY}', + 'sqlalchemy.db1.url', + 'channelstream.secret', + 'beaker.session.secret', + 'rhodecode.encrypted_values.secret', + 'appenlight.api_key', + 'smtp_password', + 'file_store.objectstore.secret', + 'archive_cache.objectstore.secret', + 'app.service_api.token', + ] + for k in secrets_lits: + if k in config: + config[k] = '**OBFUSCATED**' + + value = human_value = config + return SysInfoRes(value=value, state=state, human_value=human_value) + @register_sysinfo def rhodecode_app_info(): @@ -851,6 +877,7 @@ def get_system_info(environ): 'vcs_server': SysInfo(vcs_server)(), 'vcs_server_config': SysInfo(vcs_server_config)(), + 'rhodecode_server_config': SysInfo(rhodecode_server_config)(), 'git': SysInfo(git_info)(), 'hg': SysInfo(hg_info)(), diff --git a/rhodecode/templates/admin/settings/settings_system.mako b/rhodecode/templates/admin/settings/settings_system.mako --- a/rhodecode/templates/admin/settings/settings_system.mako +++ b/rhodecode/templates/admin/settings/settings_system.mako @@ -29,7 +29,21 @@
-

${_('VCS Server')}

+

${_('RhodeCode Server Config')}

+
+
+
+ % for dt, dd in c.rhodecode_data_items: +
${dt}${':' if dt else '---'}
+
${dd}${'' if dt else '---'}
+ % endfor +
+
+
+ +
+
+

${_('VCS Server Config')}