import { BroadcastMessageLevel } from '@shared/models/server'
import { VideosRedundancyStrategy } from '../../shared/models'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
-// Do not use barrels, remain constants as independent as possible
import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-utils'
// Use a variable to reload the configuration if we need
STORAGE: {
TMP_DIR: buildPath(config.get<string>('storage.tmp')),
+ BIN_DIR: buildPath(config.get<string>('storage.bin')),
ACTOR_IMAGES: buildPath(config.get<string>('storage.avatars')),
LOG_DIR: buildPath(config.get<string>('storage.logs')),
VIDEOS_DIR: buildPath(config.get<string>('storage.videos')),
LEVEL: config.get<string>('log.level'),
ROTATION: {
ENABLED: config.get<boolean>('log.rotation.enabled'),
- MAX_FILE_SIZE: bytes.parse(config.get<string>('log.rotation.maxFileSize')),
- MAX_FILES: config.get<number>('log.rotation.maxFiles')
+ MAX_FILE_SIZE: bytes.parse(config.get<string>('log.rotation.max_file_size')),
+ MAX_FILES: config.get<number>('log.rotation.max_files')
},
- ANONYMIZE_IP: config.get<boolean>('log.anonymizeIP'),
+ ANONYMIZE_IP: config.get<boolean>('log.anonymize_ip'),
LOG_PING_REQUESTS: config.get<boolean>('log.log_ping_requests'),
PRETTIFY_SQL: config.get<boolean>('log.prettify_sql')
},
VIDEOS: {
REMOTE: {
MAX_AGE: parseDurationToMs(config.get('views.videos.remote.max_age'))
- }
+ },
+ LOCAL_BUFFER_UPDATE_INTERVAL: parseDurationToMs(config.get('views.videos.local_buffer_update_interval')),
+ IP_VIEW_EXPIRATION: parseDurationToMs(config.get('views.videos.ip_view_expiration'))
}
},
PLUGINS: {
},
WEBADMIN: {
CONFIGURATION: {
- EDITS: {
- ALLOWED: config.get<boolean>('webadmin.configuration.edit.allowed')
+ EDITION: {
+ ALLOWED: config.get<boolean>('webadmin.configuration.edition.allowed')
}
}
},
get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) },
get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) }
},
+ VIDEO_CHANNELS: {
+ get MAX_PER_USER () { return config.get<number>('video_channels.max_per_user') }
+ },
TRANSCODING: {
get ENABLED () { return config.get<boolean>('transcoding.enabled') },
get ALLOW_ADDITIONAL_EXTENSIONS () { return config.get<boolean>('transcoding.allow_additional_extensions') },
get PROFILE () { return config.get<string>('transcoding.profile') },
RESOLUTIONS: {
get '0p' () { return config.get<boolean>('transcoding.resolutions.0p') },
+ get '144p' () { return config.get<boolean>('transcoding.resolutions.144p') },
get '240p' () { return config.get<boolean>('transcoding.resolutions.240p') },
get '360p' () { return config.get<boolean>('transcoding.resolutions.360p') },
get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') },
get ALLOW_REPLAY () { return config.get<boolean>('live.allow_replay') },
RTMP: {
+ get ENABLED () { return config.get<boolean>('live.rtmp.enabled') },
get PORT () { return config.get<number>('live.rtmp.port') }
},
+ RTMPS: {
+ get ENABLED () { return config.get<boolean>('live.rtmps.enabled') },
+ get PORT () { return config.get<number>('live.rtmps.port') },
+ get KEY_FILE () { return config.get<string>('live.rtmps.key_file') },
+ get CERT_FILE () { return config.get<string>('live.rtmps.cert_file') }
+ },
+
TRANSCODING: {
get ENABLED () { return config.get<boolean>('live.transcoding.enabled') },
get THREADS () { return config.get<number>('live.transcoding.threads') },
get PROFILE () { return config.get<string>('live.transcoding.profile') },
RESOLUTIONS: {
+ get '144p' () { return config.get<boolean>('live.transcoding.resolutions.144p') },
get '240p' () { return config.get<boolean>('live.transcoding.resolutions.240p') },
get '360p' () { return config.get<boolean>('live.transcoding.resolutions.360p') },
get '480p' () { return config.get<boolean>('live.transcoding.resolutions.480p') },
HTTP: {
get ENABLED () { return config.get<boolean>('import.videos.http.enabled') },
- get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') },
- PROXY: {
- get ENABLED () { return config.get<boolean>('import.videos.http.proxy.enabled') },
- get URL () { return config.get<string>('import.videos.http.proxy.url') }
- }
+
+ YOUTUBE_DL_RELEASE: {
+ get URL () { return config.get<string>('import.videos.http.youtube_dl_release.url') },
+ get NAME () { return config.get<string>('import.videos.http.youtube_dl_release.name') }
+ },
+
+ get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') }
},
TORRENT: {
get ENABLED () { return config.get<boolean>('import.videos.torrent.enabled') }
function getConfigDirectories () {
if (process.env.NODE_CONFIG_DIR) {
- return process.env.NODE_CONFIG_DIR.split(":")
+ return process.env.NODE_CONFIG_DIR.split(':')
}
return [ join(root(), 'config') ]