Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebased download system/environment information #7129

Closed
wants to merge 19 commits into from

Conversation

phproberto
Copy link
Contributor

This is a rebased version of #6021 See description there

I have added suggestions by @roland-d and small code style fixes.


#6021
Implementing a possibility to download system/environment information for support purposes.
The output is a text file which is probably not the best solution. Hope for some input.
It adds a button in "administrator/index.php?option=com_admin&view=sysinfo" which allows to create a text file with all relevant settings.
All sensitive informations should have been removed.

@dgrammatiko
Copy link
Contributor

@phproberto I get both on json and txt the following error code in the beginning of the files:

<br />
<font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line <i>424</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0008</td><td bgcolor='#eeeeec' align='right'>249968</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/administrator/index.php' bgcolor='#eeeeec'>../index.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0791</td><td bgcolor='#eeeeec' align='right'>3301872</td><td bgcolor='#eeeeec'>JApplicationCms->execute(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/administrator/index.php' bgcolor='#eeeeec'>../index.php<b>:</b>47</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0791</td><td bgcolor='#eeeeec' align='right'>3302176</td><td bgcolor='#eeeeec'>JApplicationAdministrator->doExecute(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/cms/application/cms.php' bgcolor='#eeeeec'>../cms.php<b>:</b>252</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.1283</td><td bgcolor='#eeeeec' align='right'>5060400</td><td bgcolor='#eeeeec'>JApplicationAdministrator->dispatch(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/cms/application/administrator.php' bgcolor='#eeeeec'>../administrator.php<b>:</b>152</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.1316</td><td bgcolor='#eeeeec' align='right'>5185216</td><td bgcolor='#eeeeec'>JComponentHelper::renderComponent(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/cms/application/administrator.php' bgcolor='#eeeeec'>../administrator.php<b>:</b>98</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.1379</td><td bgcolor='#eeeeec' align='right'>5280664</td><td bgcolor='#eeeeec'>JComponentHelper::executeComponent(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/cms/component/helper.php' bgcolor='#eeeeec'>../helper.php<b>:</b>372</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.1383</td><td bgcolor='#eeeeec' align='right'>5301608</td><td bgcolor='#eeeeec'>require_once( <font color='#00bb00'>'/Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/admin.php'</font> )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/cms/component/helper.php' bgcolor='#eeeeec'>../helper.php<b>:</b>392</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.1564</td><td bgcolor='#eeeeec' align='right'>6111072</td><td bgcolor='#eeeeec'>JControllerLegacy->execute(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/admin.php' bgcolor='#eeeeec'>../admin.php<b>:</b>16</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.1564</td><td bgcolor='#eeeeec' align='right'>6111552</td><td bgcolor='#eeeeec'>JControllerLegacy->display(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/legacy/controller/legacy.php' bgcolor='#eeeeec'>../legacy.php<b>:</b>728</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>10</td><td bgcolor='#eeeeec' align='center'>0.1706</td><td bgcolor='#eeeeec' align='right'>6706704</td><td bgcolor='#eeeeec'>AdminViewSysinfo->display(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/libraries/legacy/controller/legacy.php' bgcolor='#eeeeec'>../legacy.php<b>:</b>690</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>11</td><td bgcolor='#eeeeec' align='center'>0.1707</td><td bgcolor='#eeeeec' align='right'>6707248</td><td bgcolor='#eeeeec'>AdminViewSysinfo->getLayoutData(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/views/sysinfo/view.text.php' bgcolor='#eeeeec'>../view.text.php<b>:</b>40</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>12</td><td bgcolor='#eeeeec' align='center'>0.2160</td><td bgcolor='#eeeeec' align='right'>7192304</td><td bgcolor='#eeeeec'>AdminModelSysInfo->getSafeData(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/views/sysinfo/view.text.php' bgcolor='#eeeeec'>../view.text.php<b>:</b>80</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>13</td><td bgcolor='#eeeeec' align='center'>0.2160</td><td bgcolor='#eeeeec' align='right'>7192784</td><td bgcolor='#eeeeec'>AdminModelSysInfo->getExtensions(  )</td><td title='/Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php' bgcolor='#eeeeec'>../sysinfo.php<b>:</b>318</td></tr>
</table></font>

or simplified:
Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line 424 Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line 425 Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line 426 Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line 427 Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line 428 Notice: Trying to get property of non-object in /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_admin/models/sysinfo.php on line 429

@dgrammatiko
Copy link
Contributor

@phproberto take a look at phproberto#1

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-staging labels Jun 6, 2015
@phproberto
Copy link
Contributor Author

@dgt41 I have a applied a different fix in c50f6ef after realising that some extensions manifest may not be cached in the database.

The best example I found was plg_weblinks on my own website

@phproberto phproberto closed this Jun 6, 2015
@wilsonge wilsonge reopened this Jun 6, 2015
@dgrammatiko
Copy link
Contributor

@test ok Thanks @Radek-Suski @phproberto

@zero-24 zero-24 added the Feature label Jun 6, 2015
@zero-24 zero-24 added this to the Joomla! 3.5.0 milestone Jun 6, 2015
@roland-d
Copy link
Contributor

roland-d commented Jun 9, 2015

@phproberto Should we be outputting the host paths in the PATH, SystemRoot, COMSPEC, WINDIR, error_log, extension_dir, include_path, upload_tmp_dir, and session.save_path variables?

@phproberto
Copy link
Contributor Author

@phproberto Should we be outputting the host paths in the PATH, SystemRoot, COMSPEC, WINDIR, error_log, extension_dir, include_path, upload_tmp_dir, and session.save_path variables?

@roland-d in my opinion anything that gets private info that may involve security issues should be skipped. I don't see issues with paths relative to system libs. Maybe Phil Taylor (I forgot his github username) can help us here. I'll ping him to see if he can check it.

  • PATH. Already disabled
  • SystemRoot. I need more info. Windows thing?
  • WINDIR. I need more info. Windows thing?
  • error_log. Already disabled
  • extension_dir. Not dangerous IMO
  • include_path. Not dangeour IMO
  • upload_tmp_dir. Already disabled
  • session.save_path. Already disabled

@PhilETaylor

This comment was marked as abuse.

@wilsonge
Copy link
Contributor

@PhilETaylor this is information to export. So I'd see the most likely use case as a user giving this info to extension dev's to replicate environments etc

@PhilETaylor

This comment was marked as abuse.

@Radek-Suski
Copy link
Contributor

I was trying to remove all security relevant data from the output. I agree with Phil. The issue is when someone will post these data in forum etc

@phproberto
Copy link
Contributor Author

I have removed the information that won't help in any way to replicate enviroments. I think is better that we are more restrictive and then wait for someone asking that some information would be useful.

I'd like that a Windows user confirms that there is no private information shared there.

@phproberto
Copy link
Contributor Author

BTW thanks @PhilETaylor for checking it!

@PhilETaylor

This comment was marked as abuse.

@brianteeman
Copy link
Contributor

Tested and it works BUT

  1. Is there a reason that the order of each section in the download does not match the order of the tabs.
  2. I think it would be better if the name of each section matched the name of the tabs
  3. When hiding information in the download sometimes xxxxxx is used and sometimes set I think it is better to be consistent and use xxxxxx or was there a specific reason to do this differently that I missed
    This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7129.

@phproberto
Copy link
Contributor Author

Thanks for the feedback @brianteeman.

I have rebased the PR against latest staging and based in your comments:

  • Both text + json sections now follow the tabs order.
  • Text file sections now use same titles than the tabs + additional string for Extensons.
  • JSON still uses same keys instead of titles because using translatable titles here would make harder process the file with external tools.
  • For consistency I replaced set with xxxxxx. Old not set strings will just be empty. That way is easier to track all the information that has been set as private.

@infograf768
Copy link
Member

Any reason not to translate the number of seconds used in the title of the file produced to a real date as this number looks like it is the time elapsed since the epoch time?

@infograf768
Copy link
Member

Something like:


$today = date("Y-m-d_H-i-s");  // or $today = date("c");
[...]
header('Content-Disposition: attachment; filename="systeminfo-' . $today . '.txt"');

@roland-d
Copy link
Contributor

@phproberto Can you follow up on @infograf768 question? Thanks.

… for support purposes.

The output is a text file which is probably not the best solution. Hope for some input
… for support purposes.

The output is a text file which is probably not the best solution. Hope for some input
… for support purposes.

The output is a text file which is probably not the best solution. Hope for some input
@phproberto
Copy link
Contributor Author

PR updated and @infograf768 's suggestion to get a human readable date implemented.

Thanks!

@zero-24
Copy link
Contributor

zero-24 commented Nov 3, 2015

I have tested this item ✅ successfully on c823c3e

Works great. Filename is now something like: systeminfo-2015-11-03T09-43-44+01-00.json and systeminfo-2015-11-03T09-43-30+01-00.txt


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7129.

@peterpeter
Copy link
Contributor

I have tested this item ✅ successfully on c823c3e

Obviously the security issues are clarified. Technically it works perfekt.

As those informations are for supporters, some toughts of me as a forum moderator/supporter:

Due to extensions, important infos for supporting are (beside others of course):

  • what 3rd party extensions are installed (id > 700, #__extensions)
  • wich plugins are published and their (fire-)ordering
  • wich templates are involved/having page assignments

Core Components whow are maintained by the core are mostly irrelevant for support. And Modules too, as they 'living' all in their own 'universe', not interfere/manipulate with other extension parts. Templates who are not involved are irrelevant.

But I think that's all stuff for another rainy day 😄

But for the first implementation I would advise to add the publish state at least for plugins and modules, and ordering of the plugins groupwise + ordering ASC

Just my 20 cents. But anyway, it's a helpful feature for the future. Thanks for the work.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7129.

@zero-24
Copy link
Contributor

zero-24 commented Nov 3, 2015

Thanks lets RTC here and you can send you improvments with another PR or open a new issue for it ok? Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7129.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Nov 3, 2015
@peterpeter
Copy link
Contributor

Sure, that's what I mean with
"But I think that's all stuff for another rainy day 😄"

@roland-d roland-d closed this in f44c558 Nov 3, 2015
@wilsonge wilsonge removed the RTC This Pull Request is Ready To Commit label Jan 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet