Skip to content
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

Feature request: Be able to set owner of directories #28

Closed
tarjei opened this issue Nov 4, 2016 · 2 comments
Closed

Feature request: Be able to set owner of directories #28

tarjei opened this issue Nov 4, 2016 · 2 comments

Comments

@tarjei
Copy link

tarjei commented Nov 4, 2016

Hi, great package!

It would be really swell to have a simple way to chown all or some directories to the installing user so that tmp dirs etc can be setup within the package.

Regards,
Tarjei

@heartsucker
Copy link
Owner

Hey @tarjei. Thanks for the suggestion, but as I mentioned in #26, I think this will start to add a bit too much to this tool. For example, if you had a directory tree like:

/dir
|----/sub1
|   |----file1.txt
|   |----file2.txt
|   |----file3.txt
|----/sub2
    |----fileA.txt
    |----fileB.txt
    |----fileC.txt

The syntax in the node_deb object in package.json would have to be something like:

{
  "permissions": {
    "/var/lib/my-app-name/": "0750:my-user:my-group",
    "/var/lib/my-app-name/dir": "0750:my-user:my-group",
    "/var/lib/my-app-name/dir/sub1": "0750:my-user:my-group",
    "/var/lib/my-app-name/dir/sub1/file1": "0640:my-user:my-group",
    ...
  }
}

While itself not hard to implement, this would bloat the package.json and I don't think anything beyond basic Debian packing should be a first class feature of node-deb.

However, because of the --template-postinst flag, you could override the default postinst script that is run on package installation and include a series of chown and chmod commands to handle your specific needs.

I also think this job of permissions is best handled by a tool like ansible or chef, so when we've used this, the workflow has been something like:

  1. Build Debian package via CI tool
  2. Push to Debian repo
  3. Trigger deployment scripts
  4. Configure server, install .deb, configure some more

@tarjei
Copy link
Author

tarjei commented Nov 4, 2016

Good call. I like your suggerstion of using a postinst script.
T

2016-11-04 11:01 GMT+01:00 heartsucker notifications@github.com:

Hey @tarjei https://github.com/tarjei. Thanks for the suggestion, but
as I mentioned in #26 #26,
I think this will start to add a bit too much to this tool. For example, if
you had a directory tree like:

/dir
|----/sub1
| |----file1.txt
| |----file2.txt
| |----file3.txt
|----/sub2
|----fileA.txt
|----fileB.txt
|----fileC.txt

The syntax in the node_deb object in package.json would have to be
something like:

{
"permissions": {
"/var/lib/my-app-name/": "0750:my-user:my-group",
"/var/lib/my-app-name/dir": "0750:my-user:my-group",
"/var/lib/my-app-name/dir/sub1": "0750:my-user:my-group",
"/var/lib/my-app-name/dir/sub1/file1": "0640:my-user:my-group",
...
}
}

While itself not hard to implement, this would bloat the package.json and
I don't think anything beyond basic Debian packing should be a first class
feature of node-deb.

However, because of the --template-postinst flag, you could override the
default postinst script that is run on package installation and include a
series of chown and chmod commands to handle your specific needs.

I also think this job of permissions is best handled by a tool like
ansible or chef, so when we've used this, the workflow has been something
like:

  1. Build Debian package via CI tool
  2. Push to Debian repo
  3. Trigger deployment scripts
  4. Configure server, install .deb, configure some more


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#28 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAM5P42WMX3rBr7c2DAmlm-r4Ci4LnjIks5q6wKWgaJpZM4KpQ9h
.


Tarjei Huse
Mobil: 920 63 413

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

No branches or pull requests

2 participants