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

**URL:** https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647
**Category:** Feature
**Tags:** rfc
**Created:** [11월 7, 2016, 11:59오후 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647 "2016-11-07T23:59:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11월 7, 2016, 11:59오후 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/1 "2016-11-07T23:59:29Z")

</div>

One common problem with Discourse installs:

- you update to the latest version

- due to internal Discourse changes, one of your plugins breaks

- the plugin doesn’t just break, it breaks your entire site which now has JS errors or maybe even a white screen

- you open a meta support topic about how updating Discourse broke your whole site :sadpanda:

- we ask “hmm, did you try disabling all third party plugins”

 ![](https://global.discourse-cdn.com/meta/original/3X/e/e/ee7b0c1d407afc7e9a0affb314d780cddec8d487.jpg)

We need a **much easier way for people to enter ‘[safe mode](https://meta.discourse.org/t/53504?silent=true)’ where only official Discourse plugins that are bundled with Discourse during a clean install are loaded**.

I am open to whatever implementation makes sense, but switching to “[safe mode](https://meta.discourse.org/t/53504?silent=true)” needs to be much easier to stem the flood of support topics on Discourse updates breaking third party plugins.

(This is on the [official 1.7 release list](https://meta.discourse.org/t/discourse-version-1-7/41842) as well.)

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [11월 8, 2016, 9:10오전 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/2 "2016-11-08T09:10:41Z")

</div>

At risk of revealing my gross ignorance, please correct my assumptions about the processes.

1. rebuild is initiated
2. Discourse git pulled in
3. plugin gits pulled in
4. plugin Ruby gets added in
5. plugin assets get compiled
6. plugin may or may not be enabled

I’m guessing breakage caused by plugins can happen in a few places from either or both bad Ruby code / bad Ember code

I think it might be fairly easy to disable plugins after an upgrade forcing re-enabling one-by-one and checking for Ember errors at that point.

But I don’t know how / where isolating the plugin Ruby and asset compiling should be approached.

Maybe if plugins have rspec and qunit tests editing travis.yml “`before_install:`” in addition to editing app.yml could work?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [11월 8, 2016, 9:36오전 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/3 "2016-11-08T09:36:57Z")

</div>

The **_easiest_** would be to add a new “`--safe`” parameter to the launcher (eg “`./launcher rebuild --safe`”).  
That parameter would then be passed to Discourse which would not load any of the _non-blessed_ plugins.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 8, 2016, 5:57오후 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/4 "2016-11-08T17:57:35Z")

</div>

It’s my understanding that we’re trying to keep `./launcher` at least sort-of Discourse agnostic. My _ **easiest** _ recommendation would be to have either `./discourse-setup` or some other new command that would comment out all non-blessed plugins and rebuild. I think it should have two modes, one that disables non-blessed plugins (is that as simple as the ones from the discourse github account?) and another that would disable **all** plugins.

A more complex solution would be a `./plugins` script that would provide a way to install and remove individual plugins as well as disable them.

I started thinking about a `./help` script that would do things like check available memory and ram, offer suggestions (e.g., suggest `./launcher cleanup`), and print out disk and memory specs that could be pasted into a plea for help.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [11월 14, 2016, 1:09오전 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/5 "2016-11-14T01:09:26Z")

</div>

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

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](https://meta.discourse.org/t/53504?silent=true): `DISCOURSE_SAFE_MODE=1` if set then only supported plugins are installed

4. Add a new ENV var for booting in “super [safe mode](https://meta.discourse.org/t/53504?silent=true)”: `DISCOURSE_SAFE_MODE=NO-PLUGINS` if set no plugins at all are loaded

5. If booted in [safe mode](https://meta.discourse.org/t/53504?silent=true), display a banner to all staff (or something along those lines) showing that site is in [safe mode](https://meta.discourse.org/t/53504?silent=true). Banner will link to docker manager page where you can quit [safe mode](https://meta.discourse.org/t/53504?silent=true)

6. Amend [Docker Manager](https://github.com/discourse/docker_manager) to allow you to “reload Discourse in [Safe Mode](https://meta.discourse.org/t/53504?silent=true)” and “Exit [Safe Mode](https://meta.discourse.org/t/53504?silent=true)”

* * *

Points I am thinking about:

1. In [safe mode](https://meta.discourse.org/t/53504?silent=true) 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](https://meta.discourse.org/t/53504?silent=true).

2. In [safe mode](https://meta.discourse.org/t/53504?silent=true) 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](https://meta.discourse.org/t/53504?silent=true)” 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…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 14, 2016, 8:14오후 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/6 "2016-11-14T20:14:56Z")

</div>

> [@sam](#):
>
> Distribute a file with Discourse that lists the names of all “officially supported” plugins.

As someone who might write a “disable all 3rd party plugins” script before this grand plan gets implemented, could it be the case that “officially supported” and "live at github under the discourse account be synonymous?

> [@sam](#):
>
> New structure will allow you to “preview in JavaScript [safe mode](https://meta.discourse.org/t/53504?silent=true)” 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…

This seems like a fine idea, and given that there’s a means to preview and see not-yet-turned-on customizations, it should be easy enough to implement.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11월 26, 2016, 7:47오전 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/7 "2016-11-26T07:47:13Z")

</div>

Looks like this is complete, so closing.

> [@Using Safe Mode to troubleshoot issues with themes and plugins](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504):
>
> bookmark This guide explains how to use Discourse’s [Safe Mode](https://meta.discourse.org/t/53504?silent=true) to troubleshoot issues with themes and plugins. person_raising_hand Required user level: All users Discourse offers a “JavaScript [Safe Mode](https://meta.discourse.org/t/53504?silent=true)” that allows any user to isolate the root cause of JavaScript issues caused by plugins, themes, or theme components. This feature is particularly useful for troubleshooting problems on your Discourse site. Accessing [Safe Mode](https://meta.discourse.org/t/53504?silent=true) To access [Safe Mode](https://meta.discourse.org/t/53504?silent=true), follow these steps: Open a new browse…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11월 26, 2016, 7:47오전 UTC](https://meta.discourse.org/t/a-safe-mode-to-easily-disable-all-third-party-plugins/52647/8 "2016-11-26T07:47:21Z")

</div>


