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

Introduce auto update and killswitch options on plugins #5749

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Kukks
Copy link
Member

@Kukks Kukks commented Feb 13, 2024

This PR introduces 2 new features that can be toggled on installed plugins:

  • Auto update - Once a plugin is installed you get the option to enable autoupdate, which will download and schedule the install for the next restart. A notification will tell you and give you an action to restart.
  • Auto killswitch - Once a plugin is installed you get the option to enable the killswitch, where the plugin builder server can mark a specific version of a plugin as "Kill", and your instance will detect this and disable the plugin on the next restart, if the killswitch is enabled on the plugin.

Both are off by default.

@dennisreimann
Copy link
Member

dennisreimann commented Feb 14, 2024

This requires another PR for the plugin builder, which isn't there yet, right?

I'm not sure if the kill switch is intuitive like this. I get the intention, that one wouldn't want to all of a sudden get rugged by a plugin being pulled, yet I think the behaviour is counterintuitive to the term (or at least my understanding of it). The way it is implemented right now, is more like an opt-in to accept that a plugin might be pulled — from a UX standpoint I think users might not get this feature and for plugin builders it is also frustrating, because users would have to activate it for it to have an effect.

@Kukks
Copy link
Member Author

Kukks commented Feb 15, 2024

This requires another PR for the plugin builder, which isn't there yet, right?

I'm not sure if the kill switch is intuitive like this. I get the intention, that one wouldn't want to all of a sudden get rugged by a plugin being pulled, yet I think the behaviour is counterintuitive to the term (or at least my understanding of it). The way it is implemented right now, is more like an opt-in to accept that a plugin might be pulled — from a UX standpoint I think users might not get this feature and for plugin builders it is also frustrating, because users would have to activate it for it to have an effect.

Yes, haven't added that PR yet on plugin builder.

I agree, the use-case for the killswitch is really meant for killing specific vulnerable versions but is easily wide-scoped.

The UI is quite a draft until we narrow down the specifics on how to handle things. For example. currently to use any of these new features, one has to install the plugin, restart btcpay and then go back to the plugin list and toggle the feature.

@dennisreimann
Copy link
Member

currently to use any of these new features, one has to install the plugin, restart btcpay and then go back to the plugin list and toggle the feature.

Ok, I think we could schedule updating those settings with the commands, like we already schedule other actions and run everything in one go on restart.

I agree, the use-case for the killswitch is really meant for killing specific vulnerable versions but is easily wide-scoped.

Imho we should narrow down the functionality to exactly this and not make it optional to the user. Otherwise a plugin dev might want to take down a vulnerable version, but can't as most users haven't opted-in. This would defeat the purpose.

If we decide it is worth the complexity to similarily keep this functionality, I'd rather think about how to give users the option to opt-in to running a vulnerable version after it has been "killed". Pro argument here might be that otherwise a plugin they rely upon might get removed and this way they'd still have a chance to use it, knowing it might not be safe to run it. (I've heard this story before, somewhere ...)

@Kukks
Copy link
Member Author

Kukks commented Feb 15, 2024

currently to use any of these new features, one has to install the plugin, restart btcpay and then go back to the plugin list and toggle the feature.

Ok, I think we could schedule updating those settings with the commands, like we already schedule other actions and run everything in one go on restart.

I think this is more of a UI issue. we can mark plugins as auto update/killswitch on before they are even installed. the issue is when and where do we show these options?

I agree, the use-case for the killswitch is really meant for killing specific vulnerable versions but is easily wide-scoped.

Imho we should narrow down the functionality to exactly this and not make it optional to the user. Otherwise a plugin dev might want to take down a vulnerable version, but can't as most users haven't opted-in. This would defeat the purpose.

IMO killswitch should be on by default and auto-update off.

If we decide it is worth the complexity to similarily keep this functionality, I'd rather think about how to give users the option to opt-in to running a vulnerable version after it has been "killed". Pro argument here might be that otherwise a plugin they rely upon might get removed and this way they'd still have a chance to use it, knowing it might not be safe to run it. (I've heard this story before, somewhere ...)

kill switch should simply disable a plugin then. in the disabled plugin list, we should add an adjacent reason. So if a plugin was disabled via kill switch we can show the reason and a "re-enable and disable killswitch" action

@pavlenex pavlenex linked an issue Feb 16, 2024 that may be closed by this pull request
1 task
@Kukks Kukks marked this pull request as draft March 14, 2024 10:15
This PR introduces 2 new features that can be toggled on installed plugins:
* Auto update - Once a plugin is installed you get the option to enable autoupdate, which will download and schedule the install for the next restart. A notification will tell you and give you an action to restart.
* Auto killswitch - Once a plugin is installed you get the option to enable the killswitch, where the plugin builder server can mark a specific version of a plugin as "Kill", and your instance will detect this and disable the plugin on the next restart, if the killswitch is enabled on the plugin.

Both are off by default.
@Kukks Kukks marked this pull request as ready for review March 15, 2024 09:55
@Kukks
Copy link
Member Author

Kukks commented Mar 15, 2024

msedge_TVWwUVjzR6

updated with

  • better styling
  • you can configure update/killswitch right after scheduling install
  • if a plugin is disabled, a reason is shown
  • you can re-enable disabled plugins
  • default is killswitch on, auto update off
  • notifications for both update and killswitch events

Copy link
Member

@dennisreimann dennisreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK for what was testable so far. We should do some more user-testing once the RC is deployed — as far as I can tell this will also require updates for the plugin builder, which aren't present yet.

grafik

I think it would be also good to consider changing the update interval to something like every 6 hours or so:

services.AddScheduledTask<PluginUpdateFetcher>(TimeSpan.FromDays(1));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Plugins to be auto-updated to avoid breaking on new releases
3 participants