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

File ownership issues #18

Closed
heartsucker opened this issue Mar 21, 2016 · 4 comments
Closed

File ownership issues #18

heartsucker opened this issue Mar 21, 2016 · 4 comments

Comments

@heartsucker
Copy link
Owner

First reported by @empierre on issue #16. New ticket for organization.


also had issues of npm unpak issues, had to add this to correct the issue (clean cache and install as an unprivillegied user:

preinst:
npm cache clean

postint:
chown 'www-data:www-data' '/var/www/'
chown -R 'www-data:www-data' '/usr/share/mydomoathome'

npm_install() {
cd "/usr/share/$1/app"
if [ -e 'node_modules' ]; then
rm -rf 'node_modules'
fi
sudo -u www-data npm install --production
}

@empierre
Copy link

another remark, if installing as a user, its how directory must be writable by npm:

if ! [ -d '/var/www' ]; then
mkdir -p '/var/www'
fi
chown 'www-data:www-data' '/var/www/'

@heartsucker
Copy link
Owner Author

@empierre I'm finally getting around to looking at this, and I don't think I understand what the file issues are here. It looks like you're using a custom postinst script to put things into /var/www, so I don't think I can help you here. I did a release with a number of changes since this was reported.

So can I get you to:

  • Try it again with the latest version of node-deb
  • Report back you whole package.json and command line args and templates so I can see what may have gone wrong

@empierre
Copy link

empierre commented Jun 2, 2016

@heartsucker I wanted to use www-data user already existing, maybe not a good idea since its home does not belong to him...

I have merged with your code but had to keep the old way in case the node_modules was missing (migration issue for packages existing prior to node_modules embedded in the package.

npm_install() {
cd "/usr/share/$1/app"
sudo npm config set loglevel warn
if [ -e 'node_modules' ]; then
sudo -u www-data npm rebuild
else
sudo -u www-data npm install --production
fi
#sudo -u www-data npm config set loglevel warn
}

@heartsucker
Copy link
Owner Author

@empierre The error with node_modules went unnoticed and will be fixed in the next release. If you're using an existing user and file ownership issues happen, I think that's outside the scope of this tool. I think manually setting your templates is a sufficient workaround

I'm going to close this. If you feel like this issues was inadequately addressed, I can reopen it.

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