ioBroker.js-controller icon indicating copy to clipboard operation
ioBroker.js-controller copied to clipboard

Add new Adapter/Host "Send-Reporting-Data Flag"

Open Apollon77 opened this issue 4 years ago • 14 comments

Currently we only have one "diag" setting in "system.config" which configures if the user allows "diagnostic data reporting" at all. We use this flag for Reporting plugins but this is not that flexible as we would like it. Because of this we want to add a new Flag which indicated that an adapter instance or host is allowed to send own diagnostic/reporting/error data or not. This will then be able to be configured easiely in Admin later and depending on plugin will have priority when it comes to the question if plugin is enabled or not.

We need the following for this:

  • Define name of the flag :-) My proposal would be to use a "do not send reportingdata flag" so that it is easier to define if it is relevant or not. Name proposal would be "common.disableDataReporting = true/false" (not existing === false)
  • create CLI commands to get/set this for host object and adapter instance object:
    • create CLI command "iobroker disableDataReporting host "name|this" enable|disable|on|off" to get/set for a host
    • create CLI command "iobroker disableDataReporting adapter "instancename.nr" enable|disable|on|off" to set for a instance object
  • if last parametr is ommitted it is a "get" command and the current status (true/false) is returned
  • I enhance sentry plugin to respect the flag

Apollon77 avatar May 06 '20 05:05 Apollon77

  • "common.dontSendReportingData = true/false" (not existing === false)

I would default to true for legality reasons.

foxriver76 avatar May 06 '20 12:05 foxriver76

Admin 5 will make sure to ask the user once ...

Apollon77 avatar May 06 '20 21:05 Apollon77

Should we combine stuff like this in a single CLI class, e.g.

iobroker config [host or adapter] [hostname or instance] [set/get] [configFlag[=value]]

so we can reuse the command for more config flags in the future?

AlCalzone avatar May 07 '20 09:05 AlCalzone

why not ... like

Apollon77 avatar May 07 '20 19:05 Apollon77

I would probably construct the commands like in th plugin command

AlCalzone avatar May 07 '20 21:05 AlCalzone

you mean for adapter/instance/host? Also ok

so

iobroker config set/get configFlag[=value] [--host hostname] [--adapter name.id]

??

Apollon77 avatar May 07 '20 21:05 Apollon77

exactly

AlCalzone avatar May 07 '20 23:05 AlCalzone

agree

Apollon77 avatar May 08 '20 07:05 Apollon77

But we should limit the allowed properties to change because else a user could change "name" of the adapter object in common or such. So adapter I would allow:

  • loglevel
  • enabled (really?)
  • dontSendReportingData

for host:

  • dontSendReportingData only

Apollon77 avatar May 08 '20 12:05 Apollon77

Should we maybe name the flag sendReportingData? I don't quite like the double negation (don't send: false)

Otherwise, yes I'm absolutely for a whitelist.

AlCalzone avatar May 08 '20 13:05 AlCalzone

The default will be "send that stuff" .... thats why "Undefined" would mean true ... that swhy we more had the "do not do it" approach as being better understandable and also usable in code. but i'm ok with both

Apollon77 avatar May 08 '20 13:05 Apollon77

What about disableDataReporting

Apollon77 avatar May 08 '20 22:05 Apollon77

I'm okay with that. Although it is a negative, negating it has a clear meaning ("don't disable" instead of "don't don't" 😆 )

AlCalzone avatar May 09 '20 07:05 AlCalzone

Implemented in Sentry with that name ... we move this ticket to later ...

Apollon77 avatar May 09 '20 12:05 Apollon77