Skip to content

Commit

Permalink
Add way to set root password by environment.
Browse files Browse the repository at this point in the history
Add a condition test to pass by environment a predetermined
root password for setting up.
  • Loading branch information
darnuria authored and Chocobozzz committed May 16, 2019
1 parent 11b3f14 commit 3daaa19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/initializers/installer.ts
Expand Up @@ -128,6 +128,8 @@ async function createOAuthAdminIfNotExist () {

// Our password is weak so do not validate it
validatePassword = false
} else if (process.env.PT_INITIAL_ROOT_PASSWORD) {
password = process.env.PT_INITIAL_ROOT_PASSWORD
} else {
password = passwordGenerator(16, true)
}
Expand Down
3 changes: 3 additions & 0 deletions support/doc/production.md
Expand Up @@ -204,6 +204,9 @@ logs. You can set another password with:
$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root
```

Alternatively you can set the environment variable `PT_INITIAL_ROOT_PASSWORD`,
to your own administrator password, although it must be 6 characters or more.

### What now?

Now your instance is up you can:
Expand Down

0 comments on commit 3daaa19

Please sign in to comment.