PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
lib
/
commands
/
doctor
/
checks
'use strict'; const path = require('path'); const errors = require('../../../errors'); const chalk = require('chalk'); const fs = require('fs'); const taskTitle = 'Checking if logged in user is directory owner'; function loggedInUserOwner(ctx) { // TODO: switch to require('os').userInfo() and output username in errors const uid = process.getuid(); const gid = process.getgroups(); const dir = process.cwd(); const dirStats = fs.lstatSync(path.join(dir)); // check if the current user is the owner of the current dir if (dirStats.uid !== uid) { if (gid.indexOf(dirStats.gid) < 0) { throw new errors.SystemError({ message: `Your user does not own the directory ${dir} and is also not a member of the owning group. You must either log in with the user that owns the directory or add your user to the owning group.`, help: `${chalk.green('https://ghost.org/docs/install/ubuntu/#create-a-new-user-')}`, task: taskTitle }); } // Yup current user is not the owner, but in the same group, so just show a warning ctx.ui.log(`Your user does not own the directory ${dir}. This might cause permission issues.`, 'yellow'); } } module.exports = { title: taskTitle, task: loggedInUserOwner, enabled: ({system}) => system.platform.linux, skip: ({instance}) => instance && instance.process.name === 'local', category: ['start', 'update'] };
[-] system-stack.js
[edit]
[-] install-folder-permissions.js
[edit]
[+]
..
[-] logged-in-ghost-user.js
[edit]
[-] validate-config.js
[edit]
[-] logged-in-user.js
[edit]
[-] check-permissions.js
[edit]
[-] binary-deps.js
[edit]
[-] folder-permissions.js
[edit]
[-] mysql.js
[edit]
[-] logged-in-user-owner.js
[edit]
[-] check-memory.js
[edit]
[-] check-directory.js
[edit]
[-] index.js
[edit]
[-] file-permissions.js
[edit]
[-] content-folder.js
[edit]
[-] node-version.js
[edit]