Skip to content
This repository was archived by the owner on Jul 15, 2022. It is now read-only.
This repository was archived by the owner on Jul 15, 2022. It is now read-only.

Refuse to run as root #1

@aral

Description

@aral

From lib/Util.js:

static refuseToRunAsRoot () {
  // Refuse to run if this is the root account.
  if (process.env.USER === 'root' && process.env.SUDO_USER === undefined) {
    // This is an attempt to run Site.js from the root account.
    // Reject for security reasons.
    console.log(`\n   ❌    ${clr('❨site.js❩ Error:', 'red')} Refusing to run from the root account for security reasons.\n`)
    console.log(`         ${clr('Please create and use an account with regular privileges to run Site.js.', 'yellow')}\n`)
    process.exit(1)
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions