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.
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.
@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.
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!
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.
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!
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 !
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.
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.
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
Regards,
Alessandro