A "safe mode" to easily disable all third party plugins

I will be taking this, so here is my amended spec :space_invader:

  1. Distribute a file with Discourse that lists the names of all “officially supported” plugins.

  2. Split out “plugin.js” from “application.js”, 2 assets will be split out:
    a: plugin-safe.js for all officially supported plugins
    b: plugin-third-party.js for unofficial plugins.

  3. Add a new ENV var for booting in safe mode: DISCOURSE_SAFE_MODE=1 if set then only supported plugins are installed

  4. Add a new ENV var for booting in “super safe mode”: DISCOURSE_SAFE_MODE=NO-PLUGINS if set no plugins at all are loaded

  5. If booted in safe mode, display a banner to all staff (or something along those lines) showing that site is in safe mode. Banner will link to docker manager page where you can quit safe mode

  6. Amend Docker Manager to allow you to “reload Discourse in Safe Mode” and “Exit Safe Mode”


Points I am thinking about:

  1. In safe mode what do we do about “site customizations” which can potentially break stuff? Current thinking, allow you to specify “how safe” you want stuff when entering safe mode.

  2. In safe mode what do we do about “color” customizations etc which may, in very rare cases, break stuff? Current thinking, do nothing.

  3. New structure will allow you to “preview in JavaScript safe mode” without restarting, if all you want to do is check the JS components of a plugin are not broken. Should we expose this? Current thinking, maybe…

3 curtidas