server icon indicating copy to clipboard operation
server copied to clipboard

Add default value of parameters to parameter description in config.sample.php and the documentation

Open j-ed opened this issue 8 years ago • 5 comments

Expected behavior

For all configuration parameters in config.sample.php and in the documentation an information should be available what the default value of a parameter is. This would allow an administrator to reduce the size of a configuration file to a minimum because only parameters would need to be set which differ from a default value. The easiest way to recognize a default value is, by listing it at the end of a parameter description, prefixed by e.g. the wording Default to ....

Current behavior

In several posting on GitHub and on the Internet I read that someone asked "Why have you added this and that parameter to the configuration, it is the default value?" The reason seems to be, that information is missing for most of the listed parameters in config.sample.php and in the documentation, what the default value of a parameter is.

Negative example:

/**
 * When enabled, admins may install apps from the Nextcloud app store.
 */
'appstoreenabled' => true,

Positive example:

/**
 * Log file path for the Nextcloud logging type.
 * Defaults to ``[datadirectory]/nextcloud.log``
 */
'logfile' => '/var/log/nextcloud.log',

Steps to reproduce

  1. Check the config.sample.php and the documentation.

Environment

Server Configuration

OS: Linux 3.2.82 Web server: Apache2 2.4.25 Database: MariaDB 5.5.53 PHP version: 5.6.29 Nextcloud version: 10.0.2

Client Configuration

Browser: Mozilla Firefox 50.1.0 Operating system: Windows 7

j-ed avatar Jan 13 '17 16:01 j-ed

@nickvergessen I could try to add this information to the config.sample.php file based on information from the source code, but I need to get the following questions answered before I start:

  • Who can I contact if I need to ask a question concerning a specific parameter?
  • What is the default line length in the config.sample.php file, less than 75 or 80 characters?
  • How should I address contradictory default values in the source code? Should I address all my findings in one issue ticket or do I need to create separate ones for each parameter?
  • How should I address supposed missing default value assignments in the source code?
  • How should I address different writings of default value assignments in the source code? I'm not a professional software developer to judge if the found writing is always the same.

j-ed avatar Jan 13 '17 19:01 j-ed

Who can I contact if I need to ask a question concerning a specific parameter?

Me

What is the default line length in the config.sample.php file, less than 75 or 80 characters?

should be 80 chars

How should I address contradictory default values in the source code? Should I address all my findings in one issue ticket or do I need to create separate ones for each parameter?

You mean one parameter with 2 different default values? Please create an issue for each of them

How should I address supposed missing default value assignments in the source code?

Just point them out, I will then comment on them

How should I address different writings of default value assignments in the source code? I'm not a professional software developer to judge if the found writing is always the same.

Just ask if you find such cases

nickvergessen avatar Jan 16 '17 13:01 nickvergessen

@nickvergessen Should I open an issue ticket for variables that are using none and null too, to get the default values aligned? Example:

+ getSystemValue('memcache.local', 'none')
- /var/www/htdocs/nextcloud/apps/survey_client/lib/Categories/Server.php:72
- /var/www/htdocs/nextcloud/apps/serverinfo/lib/SystemStatistics.php:53

+ getSystemValue('memcache.local', null)
- /var/www/htdocs/nextcloud/settings/Controller/CheckSetupController.php:138
- /var/www/htdocs/nextcloud/lib/private/Server.php:381

j-ed avatar Jan 16 '17 17:01 j-ed

Hmm looking at a couple of issues, it seems that default doesn't really have to be the same value. E.g. the getSystemValue('memcache.local', 'none') from your previous comment, they are not actually setting up a memcache, but just want to use the string "none" if you didn't explicitly set it to any other caching.

nickvergessen avatar Jan 16 '17 18:01 nickvergessen

As far as I understood none is a fixed value assignment and null means undefined. So if the same parameter is read but different default values are assigned in the source code I would assume possible problems in the future. That's the reason why I asked for it.

j-ed avatar Jan 16 '17 19:01 j-ed