Skip to content

[uiBundles/resetBundleDir] force del() if bundleDir is outside cwd#22981

Merged
spalger merged 1 commit intoelastic:masterfrom
spalger:fix/reset-bundle-dir-cwd
Sep 13, 2018
Merged

[uiBundles/resetBundleDir] force del() if bundleDir is outside cwd#22981
spalger merged 1 commit intoelastic:masterfrom
spalger:fix/reset-bundle-dir-cwd

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Sep 12, 2018

The UiBundlesController.resetBundleDir() method deletes old bundle assets when necessary using del(), which by default limits deletes to directories within process.cwd. This is normally very helpful, but in our case we don't want to limit the optimize.bundleDir to the current working directory, so we must use the force: true config to disable this check.

release notes: Trying to run a Kibana optimization (usually after installing or disabling a plugin) from a directory that is not a parent of the optimize.bundleDir configuration or the Kibana installation will no longer fail with "Cannot delete files/folders outside the current working directory".

@spalger spalger added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// release_note:fix v7.0.0 v6.5.0 v6.4.1 labels Sep 12, 2018
@spalger spalger requested review from epixa and jbudz September 12, 2018 23:00
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@jbudz
Copy link
Copy Markdown
Contributor

jbudz commented Sep 13, 2018

Do you know if we can make the pattern more specific? I know this is a start time config but I'd feel better if we made it more specific to add some protection against an incorrect path.

maybe bundles/*? or *.{js,css}?

@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Sep 13, 2018

Well the bundle includes images, fonts, etc, but that directory is created by the optimizer so I don't think there's any risk in emptying it completely

@spalger spalger merged commit 0938382 into elastic:master Sep 13, 2018
spalger pushed a commit to spalger/kibana that referenced this pull request Sep 13, 2018
…lastic#22981)

The `UiBundlesController.resetBundleDir()` method deletes old bundle assets when necessary using `del()`, which by default limits deletes to directories within `process.cwd`. This is normally very helpful, but in our case we don't want to limit the `optimize.bundleDir` to the current working directory, so we must use the `force: true` config to disable this check.

release notes: Trying to run a Kibana optimization (usually after installing or disabling a plugin) from a directory that is not a parent of the `optimize.bundleDir` configuration or the Kibana installation will no longer fail with "Cannot delete files/folders outside the current working directory".
spalger pushed a commit to spalger/kibana that referenced this pull request Sep 13, 2018
…lastic#22981)

The `UiBundlesController.resetBundleDir()` method deletes old bundle assets when necessary using `del()`, which by default limits deletes to directories within `process.cwd`. This is normally very helpful, but in our case we don't want to limit the `optimize.bundleDir` to the current working directory, so we must use the `force: true` config to disable this check.

release notes: Trying to run a Kibana optimization (usually after installing or disabling a plugin) from a directory that is not a parent of the `optimize.bundleDir` configuration or the Kibana installation will no longer fail with "Cannot delete files/folders outside the current working directory".
spalger pushed a commit that referenced this pull request Sep 13, 2018
…cwd (#22981) (#23002)

Backports the following commits to 6.x:
 - [uiBundles/resetBundleDir] force del() if bundleDir is outside cwd  (#22981)
spalger pushed a commit that referenced this pull request Sep 13, 2018
…cwd (#22981) (#23003)

Backports the following commits to 6.4:
 - [uiBundles/resetBundleDir] force del() if bundleDir is outside cwd  (#22981)
@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Sep 13, 2018

6.x/6.5: a7abb84
6.4: 034d9c8

@spalger spalger deleted the fix/reset-bundle-dir-cwd branch September 13, 2018 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:fix Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v6.4.1 v6.5.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants