Refactoring plugin installation

Hi,

I noticed that public/plugins/ requires to be on a read/write mount, which is awkward as this is code under git control…
I wanted to fix that … but I got to the part where you install plugins … and I find that part a bit awkward… could you please (if you remember :slight_smile: ) tell me the rationale behind the plugin activation part here:

https://github.com/discourse/discourse/blob/d2025e33cfa1efe23328222fccee9e8f83986a64/lib/plugin/instance.rb#L457

I see you first create the target dir … then brutally clean it up … then symlink it…
In the commit messages, I see something about not breaking Jenkins … (so possibly the rationale is stale…).

I’d be happy to try and have a stab at this… (and generally going over the whole thing making sure nothing under git control is on R/W mounts).

I think I am fine for changing it so it only does the ln if for some reason the symlink does not already exist.

Also open to committing /public/plugins/.gitignore into the repo so the folder is always there and then we can get rid of the mkdir.

This is a very very fiddly change though I am not super comfortable accepting a first time PR for it.

1 Like