aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAxel Viala <axel.viala@darnuria.eu>2019-05-15 00:18:48 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-05-16 09:17:10 +0200
commit3daaa1927474869f8dbaddd6b94b4c071e314e10 (patch)
treeba754d4eacda93e3e3e573b0c3e0a1b7e680114e
parent11b3f14c758e57f9cb5f32d8140fa043094bb3d7 (diff)
downloadPeerTube-3daaa1927474869f8dbaddd6b94b4c071e314e10.tar.gz
PeerTube-3daaa1927474869f8dbaddd6b94b4c071e314e10.tar.zst
PeerTube-3daaa1927474869f8dbaddd6b94b4c071e314e10.zip
Add way to set root password by environment.
Add a condition test to pass by environment a predetermined root password for setting up.
-rw-r--r--server/initializers/installer.ts2
-rw-r--r--support/doc/production.md3
2 files changed, 5 insertions, 0 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts
index 127449577..33970f0fa 100644
--- a/server/initializers/installer.ts
+++ b/server/initializers/installer.ts
@@ -128,6 +128,8 @@ async function createOAuthAdminIfNotExist () {
128 128
129 // Our password is weak so do not validate it 129 // Our password is weak so do not validate it
130 validatePassword = false 130 validatePassword = false
131 } else if (process.env.PT_INITIAL_ROOT_PASSWORD) {
132 password = process.env.PT_INITIAL_ROOT_PASSWORD
131 } else { 133 } else {
132 password = passwordGenerator(16, true) 134 password = passwordGenerator(16, true)
133 } 135 }
diff --git a/support/doc/production.md b/support/doc/production.md
index 2eba6e6a3..4f20cf140 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -204,6 +204,9 @@ logs. You can set another password with:
204$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root 204$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root
205``` 205```
206 206
207Alternatively you can set the environment variable `PT_INITIAL_ROOT_PASSWORD`,
208to your own administrator password, although it must be 6 characters or more.
209
207### What now? 210### What now?
208 211
209Now your instance is up you can: 212Now your instance is up you can: