]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/installer.ts
Fix test
[github/Chocobozzz/PeerTube.git] / server / initializers / installer.ts
index 865495722feb71523380ac0ceab31ceb8708dde5..9545160571457f63decf73fb9d55ec3f316407f9 100644 (file)
@@ -6,6 +6,7 @@ import { createLocalAccountWithoutKeys } from '../lib/user'
 import { applicationExist, clientsExist, usersExist } from './checker'
 import { CACHE, CONFIG, LAST_MIGRATION_VERSION, SERVER_ACCOUNT_NAME } from './constants'
 import { database as db } from './database'
+import { createPrivateAndPublicKeys } from '../helpers/peertube-crypto'
 
 async function installApplication () {
   try {
@@ -136,5 +137,11 @@ async function createApplicationIfNotExist () {
 
   logger.info('Creating application account.')
 
-  return createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined)
+  const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined)
+
+  const { publicKey, privateKey } = await createPrivateAndPublicKeys()
+  accountCreated.set('publicKey', publicKey)
+  accountCreated.set('privateKey', privateKey)
+
+  return accountCreated.save()
 }