diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/initializers/installer.ts | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip |
Type models
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) { |