New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symlinks in push folder #108

Closed
lukaslehmann opened this Issue Mar 7, 2014 · 8 comments

Comments

Projects
None yet
9 participants
@lukaslehmann

lukaslehmann commented Mar 7, 2014

Hi guys,

If I have a symlink in my application then this symlink will just be ignored.
Is it planned to grap the files from the target directory and include it in the generated zip file? :)

Bests,
Lukas

@cf-gitbot

This comment has been minimized.

Show comment
Hide comment
@cf-gitbot

cf-gitbot Mar 7, 2014

Collaborator

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: http://www.pivotaltracker.com/story/show/67089772

Collaborator

cf-gitbot commented Mar 7, 2014

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: http://www.pivotaltracker.com/story/show/67089772

@thecadams

This comment has been minimized.

Show comment
Hide comment
@thecadams

thecadams Mar 7, 2014

Contributor

Hi @lukaslehmann,

Thanks for raising this issue! It looks like you're correct; symlinks don't get included and this is intentional. The path where the file is located differs during staging and when the app is running, so only the most carefully crafted symlinks would actually work (they would be unable to descend outside the container). I think at some point a decision was made not to let people shoot themselves in the foot.

I just tested hardlinks (ie. links created with ln but without supplying the -s parameter) and they worked fine. You could use hardlinks for now. They will probably cause the app to be larger, but it should be OK.

I hope that helps! Is it OK to close this issue?

CF Community Team (@thecadams)

Contributor

thecadams commented Mar 7, 2014

Hi @lukaslehmann,

Thanks for raising this issue! It looks like you're correct; symlinks don't get included and this is intentional. The path where the file is located differs during staging and when the app is running, so only the most carefully crafted symlinks would actually work (they would be unable to descend outside the container). I think at some point a decision was made not to let people shoot themselves in the foot.

I just tested hardlinks (ie. links created with ln but without supplying the -s parameter) and they worked fine. You could use hardlinks for now. They will probably cause the app to be larger, but it should be OK.

I hope that helps! Is it OK to close this issue?

CF Community Team (@thecadams)

@scottruitt scottruitt closed this Mar 13, 2014

@lukaslehmann

This comment has been minimized.

Show comment
Hide comment
@lukaslehmann

lukaslehmann Mar 18, 2014

Hi guys,

sorry for the delayed response, I was not available these days :(
We use npm-link(https://www.npmjs.org/doc/cli/npm-link.html)..and this is only for symlinks.

Bests,
Lukas

lukaslehmann commented Mar 18, 2014

Hi guys,

sorry for the delayed response, I was not available these days :(
We use npm-link(https://www.npmjs.org/doc/cli/npm-link.html)..and this is only for symlinks.

Bests,
Lukas

@adrai

This comment has been minimized.

Show comment
Hide comment
@adrai

adrai Jul 2, 2014

Would be really nice to have this...
For example with an argument: cf push --follow-links

adrai commented Jul 2, 2014

Would be really nice to have this...
For example with an argument: cf push --follow-links

@gerhard

This comment has been minimized.

Show comment
Hide comment
@gerhard

gerhard Jan 4, 2015

Member

I just came across this today. My symlink was id_rsa.pub -> archer_20150104_rsa.pub. There are legit cases for symbolic links such as indirection (my case), backwards-compatibility etc.

A hard link did the trick for me, but this is definitely going on my cf snag list.

Member

gerhard commented Jan 4, 2015

I just came across this today. My symlink was id_rsa.pub -> archer_20150104_rsa.pub. There are legit cases for symbolic links such as indirection (my case), backwards-compatibility etc.

A hard link did the trick for me, but this is definitely going on my cf snag list.

@jbayer

This comment has been minimized.

Show comment
Hide comment
@jbayer
Member

jbayer commented Jan 4, 2015

/cc @goehmen

@olavmrk

This comment has been minimized.

Show comment
Hide comment
@olavmrk

olavmrk May 22, 2015

I also ran across this problem today. My use case is that I need a symlink from a directory in my web root to a specific directory in a vendor package. I cannot simply copy the directory into the web root, because that would mess up relative references in files in that directory. Instead, I was planning to use a symlink, like so:

ln --symbolic --force --no-target-directory --verbose "../$SSP_DIR/www" 'www/simplesaml'

Note that the symlink is relative, so its location in the file system does not matter.

olavmrk commented May 22, 2015

I also ran across this problem today. My use case is that I need a symlink from a directory in my web root to a specific directory in a vendor package. I cannot simply copy the directory into the web root, because that would mess up relative references in files in that directory. Instead, I was planning to use a symlink, like so:

ln --symbolic --force --no-target-directory --verbose "../$SSP_DIR/www" 'www/simplesaml'

Note that the symlink is relative, so its location in the file system does not matter.

nota-ja added a commit to nota-ja/platform that referenced this issue Sep 25, 2015

Add symbolic links omitted by CF cli
CF cli `cf` omits symbolic links when uploading
( cloudfoundry/cli#108 )
but at least one symbolic is used in this app.
@giner

This comment has been minimized.

Show comment
Hide comment
@giner

giner Nov 11, 2016

Same problem here. It should not remove relative symlinks.

giner commented Nov 11, 2016

Same problem here. It should not remove relative symlinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment