Skip to content

Conversation

Krinkle
Copy link

@Krinkle Krinkle commented Aug 8, 2020

When working with a Node-based project in a secure isolated environment, it is imho best practice to only expose the working directory of that one project, and to disallow write access to .git as this would allow remote shell execution outside the environment when the developer runs git commands later (as opposed to npm commands).

Currently, when a project uses commitplease in its default configuration, this means the 'npm ci' or 'npm install' command fails as it can't write to .git/hooks.

Make it easy for these developers to individually disable 'commitplease' (and run the tests manually) by setting an env variable in their container.

For example, as part of their base environment via:

export npm_config_commitplease_nohook=1

Or ad-hoc, via npm_config_commitplease_nohook=1 npm ci.

Fixes #111

When working with a Node-based project in a secure isolated
environment, it is imho best practice to only expose the working
directory of that one project, and to disallow write access to
`.git` as this would allow remote shell execution outside the
environment when the developer runs git commands later (as opposed
to npm commands).

Currently, when a project uses commitplease in its default
configuration, this means the 'npm ci' or 'npm install' command
fails as it can't write to .git/hooks.

Make it easy for these developers to individually disable
'commitplease' (and run the tests manually) by setting an env
variable in their container.

For example, as part of their base environment via:

```
export npm_config_commitplease_nohook=1
```

Or ad-hoc, via `npm_config_commitplease_nohook=1 npm ci`.

Fixes #111
@Krinkle
Copy link
Author

Krinkle commented Sep 10, 2020

To test this, run the following in the commitplease directory:

npm_config_commitplease_nohook=1 node index.js

Then:

var cp = require('./index.js');
cp.getOptions()
//> {
//>     …,
//>     nohook: '1'
//> }

/cc @jzaefferer

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow skipping of hook at install time

1 participant