mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Type models
This commit is contained in:
parent
65fcc3119c
commit
e02643f32e
76 changed files with 1710 additions and 816 deletions
|
@ -1,6 +1,9 @@
|
|||
import config = require('config')
|
||||
import { join } from 'path'
|
||||
|
||||
// Do not use barrels, remain constants as independent as possible
|
||||
import { root, isTestInstance } from '../helpers/utils'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const LAST_MIGRATION_VERSION = 50
|
||||
|
@ -44,12 +47,12 @@ const CONFIG = {
|
|||
PASSWORD: config.get<string>('database.password')
|
||||
},
|
||||
STORAGE: {
|
||||
CERT_DIR: join(__dirname, '..', '..', config.get<string>('storage.certs')),
|
||||
LOG_DIR: join(__dirname, '..', '..', config.get<string>('storage.logs')),
|
||||
VIDEOS_DIR: join(__dirname, '..', '..', config.get<string>('storage.videos')),
|
||||
THUMBNAILS_DIR: join(__dirname, '..', '..', config.get<string>('storage.thumbnails')),
|
||||
PREVIEWS_DIR: join(__dirname, '..', '..', config.get<string>('storage.previews')),
|
||||
TORRENTS_DIR: join(__dirname, '..', '..', config.get<string>('storage.torrents'))
|
||||
CERT_DIR: join(root(), config.get<string>('storage.certs')),
|
||||
LOG_DIR: join(root(), config.get<string>('storage.logs')),
|
||||
VIDEOS_DIR: join(root(), config.get<string>('storage.videos')),
|
||||
THUMBNAILS_DIR: join(root(), config.get<string>('storage.thumbnails')),
|
||||
PREVIEWS_DIR: join(root(), config.get<string>('storage.previews')),
|
||||
TORRENTS_DIR: join(root(), config.get<string>('storage.torrents'))
|
||||
},
|
||||
WEBSERVER: {
|
||||
SCHEME: config.get<boolean>('webserver.https') === true ? 'https' : 'http',
|
||||
|
@ -334,10 +337,3 @@ export {
|
|||
VIDEO_LICENCES,
|
||||
VIDEO_RATE_TYPES
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// This method exists in utils module but we want to let the constants module independent
|
||||
function isTestInstance () {
|
||||
return (process.env.NODE_ENV === 'test')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue