heartsucker / node-deb

Debian packaging for Node.js projects
https://www.npmjs.com/package/node-deb
MIT License
206 stars 54 forks source link

add option to not create system users or groups #82

Closed mxmul closed 7 years ago

mxmul commented 7 years ago

This tool is fantastic, thanks for maintaining it! I'm using it to package CLI scripts, and have no use for the user and group that are created post install. Could we provide an option to skip creating / removing the user and group for packages with no daemon scripts?

I realize this can be accomplished by overriding some templates, but it would be really convenient if I could do something like this in my package.json:

 "node_deb": {
      "init": "none",
      "no_create_user": true,
      "entrypoints": {
        "cli": "index.js"
      }
  }
heartsucker commented 7 years ago

This is a good idea. I think it would make more sense to have the user/group not be created if there init is set to none. If the app has an init script, it needs to have a user/group, so it shouldn't be allowed to override them out of existence. Does this sound like it works for you?

mxmul commented 7 years ago

Yeah, that absolutely works for me. I assumed (since there's an example in the README of creating a CLI script with a user/group) that there was some use-case where they're wanted, but if we can make this the default behavior that's great.

heartsucker commented 7 years ago

Yeah, that example is the readme has drifted a bit from reality as I've added a few things to it over the years.