You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(utils): differentiate root command error messages for DO
no issue
Fixes an issue for DigitalOcean One-Click installs, that already moved their installation (or are using the updated image) and in both cases have the ghost folder not owned by `root`, where they would be shown the message to follow the 'fix root install' guide, rather than the normal message to not use `root` and switch to the already existing user.
Copy file name to clipboardExpand all lines: lib/utils/check-root-user.js
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,19 @@ function checkRootUser(command) {
22
22
23
23
if(isOneClickInstall){
24
24
// We have a Digitalocean one click installation
25
-
console.error(`${chalk.yellow('We discovered that you are using the Digitalocean One-Click install.')}
25
+
if(!isRootInstall()){
26
+
// CASE: the user uses either the new DO image, where installations are following our setup guid (aka not-root),
27
+
// or the user followed the fix root user guide already, but the user uses root to run the command
28
+
console.error(`${chalk.yellow('Can\'t run command as \'root\' user.')}
29
+
Please use the user you set up in the installation process, or create a new user with regular account privileges and use this user to run 'ghost ${command}'.
30
+
See ${chalk.underline.green('https://docs.ghost.org/docs/install#section-create-a-new-user')} for more information\n`);
31
+
}else{
32
+
// CASE: the ghost installation folder is owned by root. The user needs to migrate the installation
33
+
// to a non-root and follow the instructions.
34
+
console.error(`${chalk.yellow('We discovered that you are using the Digitalocean One-Click install.')}
26
35
You need to create a user with regular account privileges and migrate your installation to use this user.
27
36
Please follow the steps here: ${chalk.underline.green('https://docs.ghost.org/docs/troubleshooting#section-fix-root-user')} to fix your setup.\n`);
0 commit comments