aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/installer.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-17 09:12:03 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:52 +0100
commit1b3989b0961d22a5a45ad16239e3c3f58f66180c (patch)
tree34ef5ede12a7f29ead32caec45d7e73082dfa445 /server/initializers/installer.ts
parent47e0652b4a98916d4a1d012fbec61afd73a30565 (diff)
downloadPeerTube-1b3989b0961d22a5a45ad16239e3c3f58f66180c.tar.gz
PeerTube-1b3989b0961d22a5a45ad16239e3c3f58f66180c.tar.zst
PeerTube-1b3989b0961d22a5a45ad16239e3c3f58f66180c.zip
Generate application keys too
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r--server/initializers/installer.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts
index 865495722..954516057 100644
--- a/server/initializers/installer.ts
+++ b/server/initializers/installer.ts
@@ -6,6 +6,7 @@ import { createLocalAccountWithoutKeys } from '../lib/user'
6import { applicationExist, clientsExist, usersExist } from './checker' 6import { applicationExist, clientsExist, usersExist } from './checker'
7import { CACHE, CONFIG, LAST_MIGRATION_VERSION, SERVER_ACCOUNT_NAME } from './constants' 7import { CACHE, CONFIG, LAST_MIGRATION_VERSION, SERVER_ACCOUNT_NAME } from './constants'
8import { database as db } from './database' 8import { database as db } from './database'
9import { createPrivateAndPublicKeys } from '../helpers/peertube-crypto'
9 10
10async function installApplication () { 11async function installApplication () {
11 try { 12 try {
@@ -136,5 +137,11 @@ async function createApplicationIfNotExist () {
136 137
137 logger.info('Creating application account.') 138 logger.info('Creating application account.')
138 139
139 return createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined) 140 const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined)
141
142 const { publicKey, privateKey } = await createPrivateAndPublicKeys()
143 accountCreated.set('publicKey', publicKey)
144 accountCreated.set('privateKey', privateKey)
145
146 return accountCreated.save()
140} 147}