HOSTNAME: config.get<string>('listen.hostname')
},
DATABASE: {
- DBNAME: 'peertube' + config.get<string>('database.suffix'),
+ DBNAME: config.has('database.name') ? config.get<string>('database.name') : 'peertube' + config.get<string>('database.suffix'),
HOSTNAME: config.get<string>('database.hostname'),
PORT: config.get<number>('database.port'),
+ SSL: config.get<boolean>('database.ssl'),
USERNAME: config.get<string>('database.username'),
PASSWORD: config.get<string>('database.password'),
POOL: {
CAPTIONS_DIR: buildPath(config.get<string>('storage.captions')),
TORRENTS_DIR: buildPath(config.get<string>('storage.torrents')),
CACHE_DIR: buildPath(config.get<string>('storage.cache')),
- PLUGINS_DIR: buildPath(config.get<string>('storage.plugins'))
+ PLUGINS_DIR: buildPath(config.get<string>('storage.plugins')),
+ CLIENT_OVERRIDES_DIR: buildPath(config.get<string>('storage.client_overrides'))
},
WEBSERVER: {
SCHEME: config.get<boolean>('webserver.https') === true ? 'https' : 'http',
MAX_FILE_SIZE: bytes.parse(config.get<string>('log.rotation.maxFileSize')),
MAX_FILES: config.get<number>('log.rotation.maxFiles')
},
- ANONYMIZE_IP: config.get<boolean>('log.anonymizeIP')
+ ANONYMIZE_IP: config.get<boolean>('log.anonymizeIP'),
+ LOG_PING_REQUESTS: config.get<boolean>('log.log_ping_requests'),
+ PRETTIFY_SQL: config.get<boolean>('log.prettify_sql')
},
TRENDING: {
VIDEOS: {
- INTERVAL_DAYS: config.get<number>('trending.videos.interval_days')
+ INTERVAL_DAYS: config.get<number>('trending.videos.interval_days'),
+ ALGORITHMS: {
+ get ENABLED () { return config.get<string[]>('trending.videos.algorithms.enabled') },
+ get DEFAULT () { return config.get<string>('trending.videos.algorithms.default') }
+ }
}
},
REDUNDANCY: {
CSP: {
ENABLED: config.get<boolean>('csp.enabled'),
REPORT_ONLY: config.get<boolean>('csp.report_only'),
- REPORT_URI: config.get<boolean>('csp.report_uri')
+ REPORT_URI: config.get<string>('csp.report_uri')
},
TRACKER: {
ENABLED: config.get<boolean>('tracker.enabled'),
get ALLOW_ADDITIONAL_EXTENSIONS () { return config.get<boolean>('transcoding.allow_additional_extensions') },
get ALLOW_AUDIO_FILES () { return config.get<boolean>('transcoding.allow_audio_files') },
get THREADS () { return config.get<number>('transcoding.threads') },
+ get CONCURRENCY () { return config.get<number>('transcoding.concurrency') },
+ get PROFILE () { return config.get<string>('transcoding.profile') },
RESOLUTIONS: {
get '0p' () { return config.get<boolean>('transcoding.resolutions.0p') },
get '240p' () { return config.get<boolean>('transcoding.resolutions.240p') },
get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') },
get '720p' () { return config.get<boolean>('transcoding.resolutions.720p') },
get '1080p' () { return config.get<boolean>('transcoding.resolutions.1080p') },
+ get '1440p' () { return config.get<boolean>('transcoding.resolutions.1440p') },
get '2160p' () { return config.get<boolean>('transcoding.resolutions.2160p') }
},
HLS: {
get ENABLED () { return config.get<boolean>('transcoding.webtorrent.enabled') }
}
},
+ LIVE: {
+ get ENABLED () { return config.get<boolean>('live.enabled') },
+
+ get MAX_DURATION () { return parseDurationToMs(config.get<string>('live.max_duration')) },
+ get MAX_INSTANCE_LIVES () { return config.get<number>('live.max_instance_lives') },
+ get MAX_USER_LIVES () { return config.get<number>('live.max_user_lives') },
+
+ get ALLOW_REPLAY () { return config.get<boolean>('live.allow_replay') },
+
+ RTMP: {
+ get PORT () { return config.get<number>('live.rtmp.port') }
+ },
+
+ 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 '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') },
+ get '720p' () { return config.get<boolean>('live.transcoding.resolutions.720p') },
+ get '1080p' () { return config.get<boolean>('live.transcoding.resolutions.1080p') },
+ get '1440p' () { return config.get<boolean>('live.transcoding.resolutions.1440p') },
+ get '2160p' () { return config.get<boolean>('live.transcoding.resolutions.2160p') }
+ }
+ }
+ },
IMPORT: {
VIDEOS: {
+ get CONCURRENCY () { return config.get<number>('import.videos.concurrency') },
+
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') }
},
VIDEO_CAPTIONS: {
get SIZE () { return config.get<number>('cache.captions.size') }
+ },
+ TORRENTS: {
+ get SIZE () { return config.get<number>('cache.torrents.size') }
}
},
INSTANCE: {
get CATEGORIES () { return config.get<number[]>('instance.categories') || [] },
get IS_NSFW () { return config.get<boolean>('instance.is_nsfw') },
- get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
get DEFAULT_NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') },
+
+ get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
+
CUSTOMIZATIONS: {
get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') },
get CSS () { return config.get<string>('instance.customizations.css') }
},
SEARCH: {
REMOTE_URI: {
- USERS: config.get<boolean>('search.remote_uri.users'),
- ANONYMOUS: config.get<boolean>('search.remote_uri.anonymous')
+ get USERS () { return config.get<boolean>('search.remote_uri.users') },
+ get ANONYMOUS () { return config.get<boolean>('search.remote_uri.anonymous') }
},
SEARCH_INDEX: {
get ENABLED () { return config.get<boolean>('search.search_index.enabled') },
}
function isEmailEnabled () {
- return !!CONFIG.SMTP.HOSTNAME && !!CONFIG.SMTP.PORT
+ if (CONFIG.SMTP.TRANSPORT === 'sendmail' && CONFIG.SMTP.SENDMAIL) return true
+
+ if (CONFIG.SMTP.TRANSPORT === 'smtp' && CONFIG.SMTP.HOSTNAME && CONFIG.SMTP.PORT) return true
+
+ return false
}
// ---------------------------------------------------------------------------