aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/installer.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-14 10:57:56 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commite34c85e527100c0b5c44567bd951e95be41b8d7e (patch)
tree39697c5a4dda2c2e07142a8522538db783fce2fd /server/initializers/installer.ts
parent1e1265b36c09df1465aa2b4866815c957b6a532e (diff)
downloadPeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.gz
PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.zst
PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.zip
Fix issues on server start
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r--server/initializers/installer.ts20
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 @@
1import * as passwordGenerator from 'password-generator' 1import * as passwordGenerator from 'password-generator'
2import { UserRole } from '../../shared' 2import { UserRole } from '../../shared'
3import { logger, mkdirpPromise, rimrafPromise } from '../helpers' 3import { logger, mkdirpPromise, rimrafPromise } from '../helpers'
4import { createPrivateAndPublicKeys } from '../helpers/peertube-crypto'
5import { createUserAccountAndChannel } from '../lib' 4import { createUserAccountAndChannel } from '../lib'
5import { createLocalAccount } from '../lib/user'
6import { clientsExist, usersExist } from './checker' 6import { clientsExist, usersExist } from './checker'
7import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants' 7import { CACHE, CONFIG, LAST_MIGRATION_VERSION } from './constants'
8 8
9import { database as db } from './database' 9import { database as db } from './database'
10import { createLocalAccount } from '../lib/user'
11 10
12async function installApplication () { 11async 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// ---------------------------------------------------------------------------