X Tutup
Skip to content

Add servername in the output of status.php#26973

Closed
spattk wants to merge 1 commit intoowncloud:masterfrom
spattk:ISSUE-26941
Closed

Add servername in the output of status.php#26973
spattk wants to merge 1 commit intoowncloud:masterfrom
spattk:ISSUE-26941

Conversation

@spattk
Copy link

@spattk spattk commented Jan 19, 2017

Description

With the help of gethostname(), the name of server can be fetched.

Related Issue

Motivation and Context

This hels to add one more value to the status when somebody wants to know more about the owncloud-server.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2017

CLA assistant check
All committers have signed the CLA.

@DeepDiver1975
Copy link
Member

fixes #26941

@DeepDiver1975 DeepDiver1975 added this to the 10.0 milestone Jan 19, 2017
@jvillafanez
Copy link
Member

@siteshpattanaik001 Please fill the template as much as possible. This will help the reviewers and QA, and also it will help to understand why ownCloud should include your change. Thanks.

@PVince81
Copy link
Contributor

@siteshpattanaik001 I guess you're Sitesh from IRC ? Great to see you managed to send the PR 😄

@DeepDiver1975 @PhilippSchaffrath @IljaN can you guys confirm that gethostname() is enough here ?

@spattk
Copy link
Author

spattk commented Jan 20, 2017 via email

@PVince81
Copy link
Contributor

I'm also wondering if there is a risk that this would reveal internal server names to the outside @Peter-Prochaska

@peterprochaska
Copy link
Contributor

@PVince81 Why do we have status.php? Is it useful to populate the version string to all unauthenticated users and for what case do we need the hostname?

@jvillafanez
Copy link
Member

I'll play the "bad guy" role this time....

  • For small servers (only one ownCloud server), this is useless. You know where you're connecting to "mycloud.mycompany.com" so there is no need anyone tells you "you're connecting to mycould.mycompany.com" or any other internal name.
  • For servers behind load balancers (I'm not an ops guy so maybe "clustered environments" are the same), this is also useless because ideally you have no idea what server you're going to fall into. Your status call can be done to "cloud01", but the next call could be done to "cloud02".
  • I think there is a notion of "sticky sessions" in load balancers where all the requests your client does through the load balancer goes to the same server. THIS is where the PR might be useful and @siteshpattanaik001 this is what you should be selling! 😄

Does it make sense to make this conditional since this seems to be useful for such environments? Kind of "enable this at your own risk".

@peterprochaska
Copy link
Contributor

peterprochaska commented Jan 20, 2017

+1 for making this feature conditional. Default = false. And we should update the documentation that this feature should only be available from internal devices.

@PVince81
Copy link
Contributor

@siteshpattanaik001 can you make this conditional ?

Add a new value for config.php (and config.sample.php) that defaults to false.
When true, add that info to status.php

@GrendelOnCampus
Copy link

I guess, we don't need a config value. Just ripping off the domain of a server will be enough:
$servername = gethostname();
$position = strpos($servername, '.');
if ($position === false) {
$servershortname = $servername;
} else {
$servershortname = substr($servername, 0, $position);
}

and later....
'servername'=>$servershortname,

@spattk
Copy link
Author

spattk commented Feb 23, 2017 via email

@jvillafanez
Copy link
Member

@GrendelWWU I'd rather not to expose unneeded information. This could be useful to debug big installations, and as such a config switch is fine.

@GrendelOnCampus
Copy link

I understand, that exposing these information can be problematic for some installations. (known bugs in oc version x.y.z, ohh! what a shame, can lead to attacks)
I don't want to work with switches in the config to switch this or that on or off.... too complicated.
Next proposal: put a format-string with variables like $servershortname, $servername, $serverversion, $owncloudversion, $maintenance in the config file. So any admin can decide, which information to reveal in status.php.

@jvillafanez
Copy link
Member

Note that we can't change the format because clients are relying on this. ownCloud is using json because clients can easily parse it: easy to use for the server, easy to parse in the client.

At most, instead of individual switches we could provide a key in the config file to know what switchable components you want to be "on".

'status.components' => ['this', 'that', 'this_too']

The "problem" with this is that we only have one component (this new one) that can be there, and I don't think will add more in the near future.

@GrendelOnCampus
Copy link

Ok, I didn't know, that the clients are examining status.php. I really thought about obfuscating some information (like oc version) via config.php or another mechanism. Know I think, this will be a very bad idea.
To make clear, why I need some more info via status.php... We're running an own themed owncloud at three locations, each on about 14 webservers with thousands of active users. When users are experiencing trouble, we can communicate with them, ask them to use status.php when ce-creating the problem. So, we know, which server logs to examine. Fortunately our balancers are really "sticky"...

@mmattel
Copy link
Contributor

mmattel commented Feb 27, 2017

Values in status.php moved into a method, see PR #27238.
Just add the change there

@PVince81
Copy link
Contributor

Any update ?

@PVince81
Copy link
Contributor

closing due to lack of activity. If anyone wants to pick it up feel free to reopen or submit another PR

@lock
Copy link

lock bot commented Aug 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

X Tutup