diff options
Diffstat (limited to 'server/initializers/installer.ts')
-rw-r--r-- | server/initializers/installer.ts | 9 |
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' | |||
4 | import mkdirp = require('mkdirp') | 4 | import mkdirp = require('mkdirp') |
5 | import passwordGenerator = require('password-generator') | 5 | import passwordGenerator = require('password-generator') |
6 | 6 | ||
7 | const db = require('./database') | 7 | import { database as db } from './database' |
8 | import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants' | 8 | import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants' |
9 | import { clientsExist, usersExist } from './checker' | 9 | import { clientsExist, usersExist } from './checker' |
10 | import { logger, createCertsIfNotExist } from '../helpers' | 10 | import { logger, createCertsIfNotExist, root } from '../helpers' |
11 | 11 | ||
12 | function installApplication (callback) { | 12 | function 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) { |