aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/installer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r--server/initializers/installer.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts
index cd1404d48..467164107 100644
--- a/server/initializers/installer.ts
+++ b/server/initializers/installer.ts
@@ -4,10 +4,10 @@ import { each, series } from 'async'
4import mkdirp = require('mkdirp') 4import mkdirp = require('mkdirp')
5import passwordGenerator = require('password-generator') 5import passwordGenerator = require('password-generator')
6 6
7const db = require('./database') 7import { database as db } from './database'
8import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants' 8import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants'
9import { clientsExist, usersExist } from './checker' 9import { clientsExist, usersExist } from './checker'
10import { logger, createCertsIfNotExist } from '../helpers' 10import { logger, createCertsIfNotExist, root } from '../helpers'
11 11
12function installApplication (callback) { 12function installApplication (callback) {
13 series([ 13 series([
@@ -47,7 +47,7 @@ function createDirectoriesIfNotExist (callback) {
47 47
48 each(Object.keys(storages), function (key, callbackEach) { 48 each(Object.keys(storages), function (key, callbackEach) {
49 const dir = storages[key] 49 const dir = storages[key]
50 mkdirp(join(__dirname, '..', '..', dir), callbackEach) 50 mkdirp(join(root(), dir), callbackEach)
51 }, callback) 51 }, callback)
52} 52}
53 53
@@ -65,7 +65,8 @@ function createOAuthClientIfNotExist (callback) {
65 const client = db.OAuthClient.build({ 65 const client = db.OAuthClient.build({
66 clientId: id, 66 clientId: id,
67 clientSecret: secret, 67 clientSecret: secret,
68 grants: [ 'password', 'refresh_token' ] 68 grants: [ 'password', 'refresh_token' ],
69 redirectUris: null
69 }) 70 })
70 71
71 client.save().asCallback(function (err, createdClient) { 72 client.save().asCallback(function (err, createdClient) {