Installing a plugin twice

(Uri Laserson) #1

I would like to install this Slack plugin twice on one Discourse instance so that posts get pushed to two different Slack teams. I’m not very familiar with Ruby or Rails. In theory, if all the identifiers are namespaced, I would imagine there should be no problems in accomplishing this. I clone the plugin repo into two different directories in the plugin/ directory and for each plugin.rb file I change the name to be something unique. But it seems that there are some other things that may need to be globally unique and I’m not sure what they are. Thanks!


(Uri Laserson) #2

I should add that when I do what I described, the list of plugins contains two different “slack” plugins. But when I go to the settings section (where the “Slack” settings are at the same level as “Plugins”), only one of them shows up.

(Mittineague) #3

It would be relatively easy to have multiples of the plugin.

But not so quick to do.

You could append something unique to all names that conflict everywhere they’re used.

eg. instead of

first plugin

second plugin

they could be

first plugin

second plugin

Might not be so bad if this is a “one off” thing. but if it gets to be a chore it might be easier to modify the plugin code to work with an array of values.

(Jeff Atwood) #4

Kind of a weird use case, any thoughts @nick?

(Nick Sahler) #5

Would simply having the same info mirrored to different slack channels suffice? I could have it so that you can feed the plugin multiple slack webhooks and it will push to both whenever. Selectively doing so would be a bit of work but is also doable, but not a priority for me

(Uri Laserson) #6

Mirroring would be perfectly sufficient. We’re two research labs that share a Discourse but have separate Slack channels.

(Uri Laserson) #7

I guess just add an extra slack_url_2 config and create two http objects, one for each?

(Uri Laserson) #8

Since this is a one-off, I just used sed to change the names of the settings to be globally unique. Seems to work.