The discussion revolves around the idea of extending the current functionality of suspending outgoing email when a backup is restored to also override POP polling. TallTrees suggests this to prevent messages from being consumed when POP polling is enabled. RGJ agrees and proposes a broader “don’t reach out to any external service” mode that disables all external actions with permanent effects.
TallTrees and gerhard discuss the concept of an “isolation mode” that would allow for safe testing of a backup restore without impacting the running instance. gerhard provides an example of a plugin that could achieve this and notes that an alternative solution is to use the discourse restore CLI command and update site settings afterwards.
Although there is no built-in “isolation mode” feature, merefield creates a plugin, discourse-isolation, which disables emails and requires login on backup restore. This plugin solves the problem of hosting sensitive staging versions with real user emails.
It would be great if there was a “don’t reach out to any external service” mode that disables all external actions that have a permanent effect on the world outside the forum, like outgoing emails (except for those that are really essential), POP3 delete from server and triggering webhooks.
Yep - a sort of ‘isolation mode’ so that you can do a test restore of a backup (as is good practice from time to time) without any worry of impacting the running instance, or during migration you can stand up the new instance and check it over safely before making the switch (presuming the source site is in read-only mode or down etc…).
I agree. An “isolation mode” would be a useful feature. Not just after restores.
For now, something similar could be done with a simple plugin. Something like the following should work:
# name: isolation-mode
# about: Enables isolation mode after restoring backup.
# version: 1.0
after_initialize do
on(:site_settings_restored) do
SiteSetting.pop3_polling_enabled = false
WebHook.update_all(active: false)
end
end
As an alternative, you could also use the discourse restore CLI command and update site settings and whatnot afterwards with the rails runner.
Yes, nothing changed. There is no “isolation mode” feature, so disabling more than outgoing email can’t be done on restore because there’s no way to notify admins about it and give them an easy option for turning everything back on.