diff options
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r-- | server/initializers/installer.ts | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index c617b16c9..5221b81a5 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -1,21 +1,25 @@ | |||
1 | import * as passwordGenerator from 'password-generator' | 1 | import * as passwordGenerator from 'password-generator' |
2 | import { UserRole } from '../../shared' | 2 | import { UserRole } from '../../shared' |
3 | import { logger, mkdirpPromise, rimrafPromise } from '../helpers' | 3 | import { logger, mkdirpPromise, rimrafPromise } from '../helpers' |
4 | import { createPrivateAndPublicKeys } from '../helpers/peertube-crypto' | ||
5 | import { createUserAccountAndChannel } from '../lib' | 4 | import { createUserAccountAndChannel } from '../lib' |
5 | import { createLocalAccount } from '../lib/user' | ||
6 | import { clientsExist, usersExist } from './checker' | 6 | import { clientsExist, usersExist } from './checker' |
7 | import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants' | 7 | import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants' |
8 | 8 | ||
9 | import { database as db } from './database' | 9 | import { database as db } from './database' |
10 | import { createLocalAccount } from '../lib/user' | ||
11 | 10 | ||
12 | async function installApplication () { | 11 | async function installApplication () { |
13 | await db.sequelize.sync() | 12 | try { |
14 | await removeCacheDirectories() | 13 | await db.sequelize.sync() |
15 | await createDirectoriesIfNotExist() | 14 | await removeCacheDirectories() |
16 | await createOAuthClientIfNotExist() | 15 | await createDirectoriesIfNotExist() |
17 | await createOAuthAdminIfNotExist() | 16 | await createOAuthClientIfNotExist() |
18 | await createApplicationIfNotExist() | 17 | await createOAuthAdminIfNotExist() |
18 | await createApplicationIfNotExist() | ||
19 | } catch (err) { | ||
20 | logger.error('Cannot install application.', err) | ||
21 | throw err | ||
22 | } | ||
19 | } | 23 | } |
20 | 24 | ||
21 | // --------------------------------------------------------------------------- | 25 | // --------------------------------------------------------------------------- |