Giter Site home page Giter Site logo

Comments (2)

heartsucker avatar heartsucker commented on June 23, 2024

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

from node-deb.

tarjei avatar tarjei commented on June 23, 2024

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

2016-11-04 11:01 GMT+01:00 heartsucker [email protected]:

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

from node-deb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.