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

fix(root-user): show different error message for 1-click installs #631

Merged
merged 1 commit into from
Feb 7, 2018

Conversation

aileen
Copy link
Member

@aileen aileen commented Feb 6, 2018

no issue

  • detect DigitalOcean One-Click install and render a message how to migrate their installation to a non-root user

@aileen aileen requested a review from acburdine February 6, 2018 18:26
@coveralls
Copy link

coveralls commented Feb 6, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling b0bc7f5 on AileenCGN:root-user-message into 05a4171 on TryGhost:master.

// We have a Digitalocean one click installation
console.error(`${chalk.yellow('We discovered that you are using the Digitalocean 1-click install.')}
You need to create a user with regular account privileges and migrate your installation to use this user.
Please follow the steps here ${chalk.underline.green('https://docs.ghost.org/docs/troubleshooting#section-fix-root-user')} to fix your setup.`);

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@aileen aileen force-pushed the root-user-message branch 2 times, most recently from e55ba4e to 4dc7d07 Compare February 7, 2018 10:21
process.exit(1);
}

return;

This comment was marked as abuse.


if (!includes(allowedCommands, command)) {

This comment was marked as abuse.

You need to create a user with regular account privileges and migrate your installation to use this user.
Please follow the steps here ${chalk.underline.green('https://docs.ghost.org/docs/troubleshooting#section-fix-root-user')} to fix your setup.`);
} else if (isRootInstall()) {
console.error(`${chalk.yellow('It seems installed Ghost as root user.')}

This comment was marked as abuse.

// We have a Digitalocean one click installation
console.error(`${chalk.yellow('We discovered that you are using the Digitalocean One-Click install.')}
You need to create a user with regular account privileges and migrate your installation to use this user.
Please follow the steps here ${chalk.underline.green('https://docs.ghost.org/docs/troubleshooting#section-fix-root-user')} to fix your setup.`);

This comment was marked as abuse.

} else if (isRootInstall()) {
console.error(`${chalk.yellow('It seems installed Ghost as root user.')}
You need to create a user with regular account privileges and migrate your installation to use this user.
Please follow the steps here ${chalk.underline.green('https://docs.ghost.org/docs/troubleshooting#section-fix-root-user')} to fix your setup.`);

This comment was marked as abuse.

if (os.platform() !== 'linux') {
const isRootInstall = function isRootInstall() {
const path = require('path');

This comment was marked as abuse.

no issue

- detect DigitalOcean One-Click install and render a message how to migrate their installation to a non-root user
- detect root installs and render message to migrate their installation to a non-root user
- allow ghost `start`, `stop` and `restart` to be executed as root without exiting, but showing the error message
Copy link
Member

@acburdine acburdine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@acburdine acburdine merged commit b161432 into TryGhost:master Feb 7, 2018
@aileen aileen deleted the root-user-message branch May 10, 2018 01:50
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 this pull request may close these issues.

4 participants