##// END OF EJS Templates
system-info: expose env variables
super-admin -
r4743:9f402145 default
parent child Browse files
Show More
@@ -20,8 +20,7 b''
20
20
21 import logging
21 import logging
22 import urllib2
22 import urllib2
23
23 import os
24
25
24
26 import rhodecode
25 import rhodecode
27 from rhodecode.apps._base import BaseAppView
26 from rhodecode.apps._base import BaseAppView
@@ -40,6 +39,40 b' class AdminSystemInfoSettingsView(BaseAp'
40 c = self._get_local_tmpl_context()
39 c = self._get_local_tmpl_context()
41 return c
40 return c
42
41
42 def get_env_data(self):
43 black_list = [
44 'NIX_LDFLAGS',
45 'NIX_CFLAGS_COMPILE',
46 'propagatedBuildInputs',
47 'propagatedNativeBuildInputs',
48 'postInstall',
49 'buildInputs',
50 'buildPhase',
51 'preShellHook',
52 'preShellHook',
53 'preCheck',
54 'preBuild',
55 'postShellHook',
56 'postFixup',
57 'postCheck',
58 'nativeBuildInputs',
59 'installPhase',
60 'installCheckPhase',
61 'checkPhase',
62 'configurePhase',
63 'shellHook'
64 ]
65 secret_list = [
66 'RHODECODE_USER_PASS'
67 ]
68
69 for k, v in sorted(os.environ.items()):
70 if k in black_list:
71 continue
72 if k in secret_list:
73 v = '*****'
74 yield k, v
75
43 @LoginRequired()
76 @LoginRequired()
44 @HasPermissionAllDecorator('hg.admin')
77 @HasPermissionAllDecorator('hg.admin')
45 def settings_system_info(self):
78 def settings_system_info(self):
@@ -55,6 +88,7 b' class AdminSystemInfoSettingsView(BaseAp'
55 snapshot = str2bool(self.request.params.get('snapshot'))
88 snapshot = str2bool(self.request.params.get('snapshot'))
56
89
57 c.rhodecode_update_url = UpdateModel().get_update_url()
90 c.rhodecode_update_url = UpdateModel().get_update_url()
91 c.env_data = self.get_env_data()
58 server_info = system_info.get_system_info(self.request.environ)
92 server_info = system_info.get_system_info(self.request.environ)
59
93
60 for key, val in server_info.items():
94 for key, val in server_info.items():
@@ -62,6 +62,25 b''
62 </div>
62 </div>
63 </div>
63 </div>
64
64
65 <div class="panel panel-default">
66 <div class="panel-heading">
67 <h3 class="panel-title">${_('Env Variables')}</h3>
68 </div>
69 <div class="panel-body">
70 <table>
71 <th></th>
72 <th></th>
73 % for env_key, env_val in c.env_data:
74 <tr>
75 <td style="vertical-align: top">${env_key}</td>
76 <td>${env_val}</td>
77 </tr>
78 % endfor
79 </table>
80
81 </div>
82 </div>
83
65 <script>
84 <script>
66 $('#check_for_update').click(function(e){
85 $('#check_for_update').click(function(e){
67 $('#update_notice').show();
86 $('#update_notice').show();
General Comments 0
You need to be logged in to leave comments. Login now