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

Ensuring correct ~/.config folder ownership fails on shared hosting #867

Closed
L3o-pold opened this issue Jan 21, 2019 · 10 comments · Fixed by #878
Closed

Ensuring correct ~/.config folder ownership fails on shared hosting #867

L3o-pold opened this issue Jan 21, 2019 · 10 comments · Fixed by #878

Comments

@L3o-pold
Copy link

L3o-pold commented Jan 21, 2019

Summary

On a shared hosting we do not own root user. Ghost will fail during the install because it check that current user has right on the ~/.config folder.

I don't understand why because it don't seems to be required during the install.
I successfully install Ghost on this shared hosting by commenting this step.

Steps to Reproduce

  1. Having a user that doesn't not own the ~/.config folder.
  2. Run ghost install

Technical details

This is automatically output by Ghost-CLI if an error occurs, please copy & paste:

  • OS: Debian
  • Node Version: 8.10.0
  • Ghost-CLI Version: 1.9.9
  • Environment: production
  • Command: ghost install

Log

uid****@od-***:~/blog3$ ghost install
+ sudo chown -R ****_blog:****_blog /home/clients/*******/.config
? Sudo Password [input is hidden] 

I do not own the root password... Could we remove this check or making it optional?

@vikaspotluri123
Copy link
Member

The folder that Ghost is taking ownership of should be your (the current user) home folder. If the current user isn't able to write to their home folder, Ghost needs to make it writable because other commands depend on configuration that's stored there (e.g ghost update). On install, Ghost creates / updates a file in the referenced folder with instance information

You should be able to have ghost skip doing so by ensuring you can write to your home folder.

@L3o-pold
Copy link
Author

In this shared hosting I have right and read access on the user home folder but a .config folder already exists owned by the root user...
I understand that it may be needed for updating but it seems not used for installing.

@vikaspotluri123
Copy link
Member

I understand that it may be needed for updating but it seems not used for installing.

The only time Ghost can learn about an installation is when you install it ➡ the installation metadata is saved to in the .config folder when you run ghost install [...] so other commands (e.g ghost ls and ghost stop --all) will be functional

@L3o-pold
Copy link
Author

That's sad because I CAN run Ghost on this shared hosting. But I can't install it if I don't manualy edit the pre-check.
IMO we should warn the user that some features could not work if the Ghost user doesn't have the rights on the .config folder but we should not prevent installing for that reason because it actually works!

@llakssz
Copy link

llakssz commented Feb 26, 2019

Similarly, is there any documentation about installing on shared hosting, as in no access to root/sudo?

I could do development installs 1.x but could never get production installs working, I'm not sure if 2.x is different.

@L3o-pold
Copy link
Author

@llakssz You need to edit the node_modules/ghost-cli/lib/utils/pre-check.js file to ignore this requirement.

@llakssz
Copy link

llakssz commented Feb 28, 2019

@L3o-pold Thanks, I manage to install 2.x like this:
ghost install --db sqlite3 --no-setup-linux-user
and I skip setting up nginx, systemd, and starting ghost.
I try ghost start or ghost start --no-setup-linux-user --no-setup-systemd, and I get asked for the sudo password.

The pre-checks.js file you mention is for the install process (I think), but I have completed that stage and am just trying to start ghost.
Thanks

@L3o-pold
Copy link
Author

Happy that you manage to install it.
@TryGhost we are one of the most important web hosting provider in Switzerland. It could be nice to make this check optionnal to improve the popularity of Ghost.
If you think it’s not necessary, please close this issue, we will make a fork.

@acburdine
Copy link
Member

@L3o-pold I can probably add something in that allows you to skip the pre-checks. Thinking about something similar to how you can skip the node-version check with GHOST_NODE_VERSION_CHECK=false, might add a GHOST_CLI_PRE_CHECKS=false to skip the pre-checks.

acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Mar 4, 2019
closes TryGhost#867
- add GHOST_CLI_PRE_CHECKS environment variable that can be
  set to 'false' to skip pre checks
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Mar 5, 2019
closes TryGhost#867
- add GHOST_CLI_PRE_CHECKS environment variable that can be
  set to 'false' to skip pre checks
acburdine added a commit that referenced this issue Mar 5, 2019
closes #867
- add GHOST_CLI_PRE_CHECKS environment variable that can be
  set to 'false' to skip pre checks
@acburdine
Copy link
Member

@L3o-pold added the environment variable skip in - the fix should be released as part of Ghost-CLI 1.10 once that happens (should hopefully be in the next couple of weeks)

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 a pull request may close this issue.

4 participants