Skip to content

Commit 3daaa19

Browse files
darnuriaChocobozzz
authored andcommitted
Add way to set root password by environment.
Add a condition test to pass by environment a predetermined root password for setting up.
1 parent 11b3f14 commit 3daaa19

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

server/initializers/installer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ async function createOAuthAdminIfNotExist () {
128128

129129
// Our password is weak so do not validate it
130130
validatePassword = false
131+
} else if (process.env.PT_INITIAL_ROOT_PASSWORD) {
132+
password = process.env.PT_INITIAL_ROOT_PASSWORD
131133
} else {
132134
password = passwordGenerator(16, true)
133135
}

support/doc/production.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ logs. You can set another password with:
204204
$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root
205205
```
206206

207+
Alternatively you can set the environment variable `PT_INITIAL_ROOT_PASSWORD`,
208+
to your own administrator password, although it must be 6 characters or more.
209+
207210
### What now?
208211

209212
Now your instance is up you can:

0 commit comments

Comments
 (0)