Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add way to set root password by environment.

Axel Viala3daaa1927474
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts
index 127449577a..33970f0fae 100644
--- a/server/initializers/installer.ts
+++ b/server/initializers/installer.ts
@@ -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)
}
diff --git a/support/doc/production.md b/support/doc/production.md
index 2eba6e6a37..4f20cf140f 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -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: