Manifest is uploaded with App
Hi Guys,
Is there something that leverages the manifest file during the staging process? Or is there any other valid reason to have it uploaded with the App?
I was wondering whether it could be excluded by default from the upload process, as it may contain sensitive data - eg. env variables, which may otherwise be publicly accessible (possibly by accident).
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/68952284. This repo is managed by the 'CLI' team.
@wdneto that's a great question. The CLI is the only component that leverages manifests to the best of my knowledge, so excluding it seems like a perfectly fine idea.
We discussed adding it to the list of files that are always in .cfignore (e.g.: .git, .DS_STORE, etc) but decided against it. I don't think we considered the fact that it may contain sensitive information, so we may want to reconsider that.
I just came across this issue using a php buildpack - the manifest file contained the db info, and was publicly accessible - which is what triggered the question to be raised.
If there isn't anything that relies on the manifest once its uploaded, and things like filesystem mountpoints (which I can imagine being one use case) can be done by other means (eg env vars), then I'd suggest the manifest should be excluded by default.
Accepted the fix. Thanks again for raising the issue.
Awesome, thanks Scott.
Hello,
I think we need to reconsider this change (here's the commit that implemented it: https://github.com/cloudfoundry/cli/commit/f3a43a9ecc389a8988ae79751fdfe2ed81c13d8a#diff-3d9f53df11d5dd8eb7312d8d0634a782R77 )
This change breaks Rails apps which are locally pre-packaged (by running assets:precompile) prior to pushing. The breakage is because the buildpack attempts to re-package an already-packaged app, which will obviously fail because all the original source asset files no longer exist.
I understand this was originally done (https://www.pivotaltracker.com/story/show/68952284) for security concerns, due to possibly including env vars in the manifest.
But, I don't think that's a valid justification to not upload it. Pre-packaging is a very standard thing to do, e.g. Heroku refers to it in their docs (https://devcenter.heroku.com/articles/rails-asset-pipeline#the-rails-3-asset-pipeline). I.e., they conditionally skip asset packaging if public/manifest.yml exists.
Also, on a related note, we (the Pivotal Tracker team, I'm the anchor for getting Tracker running on CF) are wondering why there's no automated test coverage for this sort of regression. As I said, prepackaging is a standard thing to do for production apps, and it seems like there should be some automated integration test that the latest CLI builds can successfully push a "real" Rails app. Perhaps there can be a Tracker story created to address that as part of this issue?
Thanks, -- Chad
cc: @oppegard
Just to clarify, it looks like this bug was meant to exclude a cf manifest.yml. As a side-effect of implementing the fix, it's now excluding public/assets/manifest.yml from our rails app.
A workaround would be to only exclude manifests at the root of the app.
We're investigating both options. Thanks for raising the issue.
Hmm, bummer - interesting side effect. I'd say manifest exclusion has to be treated separately to other default excludes.
I'd say we'd want to continue excluding the defaults recursively by default, but as for the manifest.yml file, the cli should only exclude the manifest it used to construct the app.
@thewoolleyman @oppegard thanks for catching this and providing such a thorough breakdown of the issue. We think fixing the default cfignore to only include a top-level manifest.yml will fix the regression.
We've only recently started running integration tests and haven't added any yet for particular kinds of applications, but it's fairly clear that having them for various kinds of apps would provide a ton of value (and prevent a lot of headache). Thank you for helping nudge us in this direction.
To me, this issue is really raising the fact that manifest.yml is just too common a filename. Perhaps cf-manifest.yml or similar would be more helpful. Not only is the filename less likely to conflict, but it's also more descriptive.
We believe this is fixed in https://github.com/cloudfoundry/cli/commit/7d2b86fdc1c7e560607f2eb350c3167d0caf0001