Procedure to update standard plugins

AI-generated summary

The discussion revolves around updating standard plugins in a self-hosted Discourse instance using Docker. mcmcclur explains they’ve been manually installing plugins via app.yml but now want to update the outdated MathJax version in the discourse-math plugin. merefield suggests removing the existing plugin directory and cloning a custom version, providing a code example for doing so in app.yml. mcmcclur confirms this approach will work and thanks merefield for the solution. tobiaseigen adds that the plugin update might be worth contributing back to the official repository. The conversation also includes a brief, lighthearted exchange about a front page animation.

I have a small, self-hosted Discourse site created with a standard Docker installation. I’ve installed plenty of plugins into over the years by editing the hooks at the end of containers/app.yml file to git clone a plugin repository. I’ve done a bit of plugin development, as well.

A few months ago, though, many standard plugins were merged into Discourse core. Let’s suppose I fork the whole Discourse repo, edit one of those plugins (say, discourse-math), and get the changes working beautifully in my local development environment. What’s the procedure to get this new plugin into my production Discourse instance?

out of interest - why do you need to fork any of the official plugins?

In any case in app.yml you can run a command to delete the specific plugin directory then clone your own if you absolutely need to, e.g.:

<in after_code: somewhere >
    - exec:
        cd: $home/plugins
        cmd:
          - rm -r poll
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/myaccount/myplugin-replacement.git

you might be able to do this, but check:

<in after_code: somewhere >
    - exec:
        cd: $home/plugins
        cmd:
          - rm -r poll
          - git clone https://github.com/myaccount/myplugin-replacement.git

I haven’t been that careful with spaces - make sure indentation is perfect.

Because, I’m hoping to update the outdated version of MathJax that’s used by the discourse-math plugin.

OK, it looks to me like this line is what I’m missing:

cmd:
  - rm -r poll

To be clear, though, what is poll? I would think I should remove the old discourse-math directory to prevent the conflicts that I seem to be getting. That is, something like

cmd:
  - -r plugins/discourse-math

Doesn’t look like a good command to go running willy-nilly. :slight_smile:

It doesn’t matter if you make a mistake, just rebuild if you do.

My example was with poll plugin.

Don’t repeat the plugin directory.

@merefield Incidentally, I think you might like the animation on my front page: https://discourse.marksmath.org/

I used some of your code in the process.

Ha, nice, now add a click to user card! :slight_smile:

This did the trick @merefield - thanks a lot !!!

That might be a change that is pr-welcome for the official plugin. If you are interested in talking a stab at that for the benefit of everyone relying on the plugin, start a Contribute > Feature topic to propose it.