diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-14 17:31:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (patch) | |
tree | f4191f3c04a5230fcf8ca3d6ca3248643fc4151d /server/initializers/installer.ts | |
parent | e34c85e527100c0b5c44567bd951e95be41b8d7e (diff) | |
download | PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.gz PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.zst PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.zip |
Follow works
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r-- | server/initializers/installer.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 5221b81a5..c3521a9e4 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -3,8 +3,8 @@ import { UserRole } from '../../shared' | |||
3 | import { logger, mkdirpPromise, rimrafPromise } from '../helpers' | 3 | import { logger, mkdirpPromise, rimrafPromise } from '../helpers' |
4 | import { createUserAccountAndChannel } from '../lib' | 4 | import { createUserAccountAndChannel } from '../lib' |
5 | import { createLocalAccount } from '../lib/user' | 5 | import { createLocalAccount } from '../lib/user' |
6 | import { clientsExist, usersExist } from './checker' | 6 | import { applicationExist, clientsExist, usersExist } from './checker' |
7 | import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants' | 7 | import { CACHE, CONFIG, LAST_MIGRATION_VERSION, SERVER_ACCOUNT_NAME } from './constants' |
8 | 8 | ||
9 | import { database as db } from './database' | 9 | import { database as db } from './database' |
10 | 10 | ||
@@ -128,9 +128,13 @@ async function createOAuthAdminIfNotExist () { | |||
128 | } | 128 | } |
129 | 129 | ||
130 | async function createApplicationIfNotExist () { | 130 | async function createApplicationIfNotExist () { |
131 | const exist = await applicationExist(db.Application) | ||
132 | // Nothing to do, application already exist | ||
133 | if (exist === true) return undefined | ||
134 | |||
131 | logger.info('Creating Application table.') | 135 | logger.info('Creating Application table.') |
132 | const applicationInstance = await db.Application.create({ migrationVersion: LAST_MIGRATION_VERSION }) | 136 | const applicationInstance = await db.Application.create({ migrationVersion: LAST_MIGRATION_VERSION }) |
133 | 137 | ||
134 | logger.info('Creating application account.') | 138 | logger.info('Creating application account.') |
135 | return createLocalAccount('peertube', null, applicationInstance.id, undefined) | 139 | return createLocalAccount(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined) |
136 | } | 140 | } |