mina icon indicating copy to clipboard operation
mina copied to clipboard

Current path symlink

Open luckyraul opened this issue 8 years ago • 7 comments

I've started to update our deploy script from 0.3 to 1.x and have noticed that now the current symlink use a global path. In 0.3 it was a relative.

It breaks FTP clients connection through the current folder.

luckyraul avatar Dec 26 '16 11:12 luckyraul

@d4be4st ping

luckyraul avatar Jan 23 '17 10:01 luckyraul

@luckyraul How does ftp relate to mina?

stereodenis avatar Mar 10 '17 09:03 stereodenis

@stereodenis

Problem is not in the FTP, it is in the new way of creating symlink for the current folder

mina 0.3 use a relative path in the symlink for the current mina 1.0 use a absolute path in the symlink for the current

Ftp client in our case can't resolve absolute paths because of a chroot enviroment.

luckyraul avatar Mar 10 '17 09:03 luckyraul

In my case, it hinders obtaining Let's Encrypt certificates for LXC containers. I could run:

certbot certonly --webroot -w /var/lib/lxc/container/rootfs/home/user/app/current/public -d example.com

But current doesn't work outside of a container. In other words, absolute symlinks doesn't work outside of any chroot.

x-yuri avatar Jun 13 '17 11:06 x-yuri

What would you do about all other linked paths?

For example the stuff that ends up in shared folder? They can have multiple parent folders and we would need to do some "calculations" for them and it links would end up like: ../../shared/public/assets to work

Or are you only interested in current folder?

@x-yuri @luckyraul

d4be4st avatar Oct 06 '17 07:10 d4be4st

If you are only interested in current folder there is an easy solution:

set :releases_path, -> { "releases" }

Override releases path. One caveat here is that you need to wrap all tasks that use fetch(:releases) path in in_path fetch(:deploy_do) do (in default mina only deploy:cleanup and rollback

in_path fetch(:deploy_to) do
  invoke :'deploy:cleanup'
end

d4be4st avatar Oct 06 '17 07:10 d4be4st

I see no advantage to absolute symlinks over relative ones. I asked about it on Stack Overflow, but the best I could get is that absolute symlinks are easier to create. So I think it's best to switch to relative symlinks by default.

x-yuri avatar Oct 06 '17 07:10 x-yuri