Symlinked plugin does not appear in Admin

Mac OSX 11
Created a symlink to a plugin, but it does not appear in Admin/Plugins
When I copied the files, to KinstaDev, it worked.

Hi @iianev . Welcome to DevKinsta forums. Thanks for trying out DevKinsta! Iā€™m afraid at this time symlinked directories are not supported but weā€™ll look into this as a future feature.

1 Like

Hi! Any updates on this?

Hi @oleg_petcu, thanks for reaching out! Iā€™ll bring this up with our developers again. I do not see it being added to upcoming releases.

2 Likes

@Kevin This is a must have for any plugin developer, could you make a force on this? I canā€™t use your software without this.

1 Like

Hi @alexmigf weā€™re nearing the end of the 2.x.x updates. Symlink support is definitely on the list for the next set of updates.

Can you please provide an example of a use case here? Are you just creating a symlink within your filesystem/WP files to a local directory and wanting it to work with Docker/WordPress? If thatā€™s all this request is, I can research to see if thereā€™s a way to do it with Docker commands.

Hi @Kevin

I have a directory in my local machine where I have all the plugins repositories from our company and then I have multiple WP setups (now using Valet) where I have the plugins symlinked. This way I can have the same plugin distributed across multiple setups and have different plugins also in different setups. Finally I can work only from a single directory in VS Code, maintaining all the plugins from one place. This also helps for debugging, because this way I only have one Xdebug configuration.

Hope that helps!

1 Like

Hi @alexmigf and anyone trying to do this. Iā€™ve managed to get a workflow for getting Symlinks working. Please let me know if this is close enough to what you are needing and Iā€™ll ask our developers if they can work it in as a feature in the future. I realize this wonā€™t fit everyoneā€™s needs but I feel like itā€™s a good start.

Important
Symlinks can only be created within the devkinsta_fpm container. You wonā€™t be able to create a shortcut/symlink directly from your filesystem and have Docker recognize it with this solution.

image

So the idea is to create a directory like ~/DevKinsta/public/shared_plugins and add your plugin directory there. Then all you need to do is create a shortcut within ā€˜devkinsta_fpmā€™ that creates a Symlink to the plugin in ā€œshared_pluginsā€ from the appropriate site. Here is an example of a terminal command that does this with the Classic Widgets plugin that I needed to load from my site named ā€œtestingā€:

docker exec devkinsta_fpm bash -c "ln -s /www/kinsta/public/shared_plugins/classic-widgets /www/kinsta/public/testing/wp-content/plugins/classic-widgets"

After Symlink:

Please let me know if this is a viable comprise/should be made more convenient.

Now if you have a plugin directory already set up and copying your plugins to the Kinsta directory would be too much trouble, our developers would need to modify DK/Docker to allow you to mount custom locations to devkinsta_fpm on startup. Hereā€™s the documentation for that in case you want to play around with other possible solutions: Use bind mounts | Docker Documentation

Hi Kevin, Iā€™m in the exact same situation. When I run your command though, I see

ln: failed to create symbolic link ā€˜/Users/xyz/DevKinsta/public/abc/wp-content/plugins/rekindle-option-to-resetā€™: No such file or directory

How should I fix this?

Hi @rkg, so you only get that error if you are using the wrong directory/it doesnā€™t exist yet. Are you on Mac or Linux? If Linux, are you using Docker Desktop?

As a complete guess, it might be because you are trying to link to the system directory. My command is run within the Docker container so your directory/command should look more like this:

docker exec devkinsta_fpm bash -c "ln -s /www/kinsta/public/shared_plugins/rekindle-option-to-reset /www/kinsta/public/abc/wp-content/plugins/rekindle-option-to-reset"

Hi @Kevin I need to link from a system directory (where all my plugins are located) to a Docker container. Is there a way to modify your command to do that?

Thanks.

Hi @rkg, as I mentioned above my solution, this wonā€™t work with linking a system directory to the Docker container. Right now, only the DevKinsta/user home directories are mounted to the Docker container and there is no straight forward way to mount a new system directory to the Docker container. I did discuss this with our developers and they will look into a solution that allows mounting custom system directories and takes care of all this Symlinking automatically.

So for now, your best bet is to just duplicate your system plugin directory to the already mounted DevKinsta directory then follow my solution.

Also, I found this software that might make this even easier: https://freefilesync.org/
The idea would be to continue working with your system plugin directory when developing but also have you changes/saves sync to your DevKinsta directory/copy. I havenā€™t tried it yet but itā€™s just another possibility if youā€™re trying to make this workaround more smooth.

Thank you @Kevin . Iā€™ve been trying to get DevKinsta to work for a couple of years. Iā€™ve always had some trouble getting it to work on my Mac. Itā€™s finally working, and I now see how much easier it is to be working locally than having to FTP files back and forth. I appreciate the work you (personally) are doing on this forum!

1 Like

Very excited to hear that the DevKinsta devs are aware of the issue.

My use case for symlinks is I store cloned git repositories on my Mac in /Users/jamesgreenblue/repo/plugin-repo-name and would love to symlink /Users/jamesgreenblue/DevKinsta/public/greenfins/wp-content/plugins/plugin-repo-name to the original repo folder so that I donā€™t have to navigate deep into the filesystem to use git.

Echoing rkg ā€“ huge thank you for the work you are doing @Kevin !

1 Like

@Kevin

Am I misunderstanding that youā€™d need to have all of your plugins in one shared folder in order for this to work?

I have a shared folder for all my repos but they arenā€™t all plugins.

Hi @jmele, so if itā€™s convenient for you, you could move your repo directory to your DevKinsta public directory since that gets mounted within devkinsta_fpm. You would then be able to use symlinks within the Docker container to anything within your shared folder; it isnā€™t just limited to plugins. DevKinsta only cares about the site folders within ~/DevKinsta/public.

So itā€™s less about all of your plugins being in a shared folder, and more about your plugins existing within the mounted ~/DevKinsta/public directory.

If moving your repo folder isnā€™t an option, currently the only workaround would be to create a copy of your repo directory to ~/DevKinsta/public and then just make sure the files remain synced with something like https://freefilesync.org/ . You could then use symlinks within Docker.

Hmm ok. I currently use Local but wanted to test out DevKinsta with a similar setup as I have now but I donā€™t really want to move anything to avoid breakage then with my Local setup in case it doesnā€™t work out. Not loving the idea of having two copies but Iā€™ll think about it. Thanks for the info, Kevin and I appreciate you trying to solve this problem for devs.

1 Like

Hi @Kevin

We are getting there, I think your solution indeed works, but as other user mention, I donā€™t want to move my current local folder to another place to not break the current setup.

If you could implement this idea using local folders I will move for your software for sure.

Thank you for all the hard work so far.

1 Like

Is there any update on this?

Hi @jmele,

this is something our devs are interested in but as of right now, we donā€™t have a feature that would allow this. Currently, the only option is the workaround shared above :point_up_2:

Regards,
Alessandro