X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconfig.ts;h=93dd5ac046009658538c1c7632c5ae465cec45c4;hb=f479685678406a5df864d89615b33d29085ebfc6;hp=d1bbbc9a773937504bf480c1e8129fda35b6e809;hpb=677012b4ee53e5099e8c90445616644e1a6af9ef;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/config.ts b/server/initializers/config.ts index d1bbbc9a7..93dd5ac04 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts @@ -59,7 +59,7 @@ const CONFIG = { }, STORAGE: { TMP_DIR: buildPath(config.get('storage.tmp')), - AVATARS_DIR: buildPath(config.get('storage.avatars')), + ACTOR_IMAGES: buildPath(config.get('storage.avatars')), LOG_DIR: buildPath(config.get('storage.logs')), VIDEOS_DIR: buildPath(config.get('storage.videos')), STREAMING_PLAYLISTS_DIR: buildPath(config.get('storage.streaming_playlists')), @@ -104,11 +104,17 @@ const CONFIG = { MAX_FILE_SIZE: bytes.parse(config.get('log.rotation.maxFileSize')), MAX_FILES: config.get('log.rotation.maxFiles') }, - ANONYMIZE_IP: config.get('log.anonymizeIP') + ANONYMIZE_IP: config.get('log.anonymizeIP'), + LOG_PING_REQUESTS: config.get('log.log_ping_requests'), + PRETTIFY_SQL: config.get('log.prettify_sql') }, TRENDING: { VIDEOS: { - INTERVAL_DAYS: config.get('trending.videos.interval_days') + INTERVAL_DAYS: config.get('trending.videos.interval_days'), + ALGORITHMS: { + get ENABLED () { return config.get('trending.videos.algorithms.enabled') }, + get DEFAULT () { return config.get('trending.videos.algorithms.default') } + } } }, REDUNDANCY: { @@ -153,7 +159,14 @@ const CONFIG = { }, FEDERATION: { VIDEOS: { - FEDERATE_UNLISTED: config.get('federation.videos.federate_unlisted') + FEDERATE_UNLISTED: config.get('federation.videos.federate_unlisted'), + CLEANUP_REMOTE_INTERACTIONS: config.get('federation.videos.cleanup_remote_interactions') + } + }, + PEERTUBE: { + CHECK_LATEST_VERSION: { + ENABLED: config.get('peertube.check_latest_version.enabled'), + URL: config.get('peertube.check_latest_version.url') } }, ADMIN: { @@ -182,6 +195,8 @@ const CONFIG = { get ALLOW_ADDITIONAL_EXTENSIONS () { return config.get('transcoding.allow_additional_extensions') }, get ALLOW_AUDIO_FILES () { return config.get('transcoding.allow_audio_files') }, get THREADS () { return config.get('transcoding.threads') }, + get CONCURRENCY () { return config.get('transcoding.concurrency') }, + get PROFILE () { return config.get('transcoding.profile') }, RESOLUTIONS: { get '0p' () { return config.get('transcoding.resolutions.0p') }, get '240p' () { return config.get('transcoding.resolutions.240p') }, @@ -189,6 +204,7 @@ const CONFIG = { get '480p' () { return config.get('transcoding.resolutions.480p') }, get '720p' () { return config.get('transcoding.resolutions.720p') }, get '1080p' () { return config.get('transcoding.resolutions.1080p') }, + get '1440p' () { return config.get('transcoding.resolutions.1440p') }, get '2160p' () { return config.get('transcoding.resolutions.2160p') } }, HLS: { @@ -214,6 +230,7 @@ const CONFIG = { TRANSCODING: { get ENABLED () { return config.get('live.transcoding.enabled') }, get THREADS () { return config.get('live.transcoding.threads') }, + get PROFILE () { return config.get('live.transcoding.profile') }, RESOLUTIONS: { get '240p' () { return config.get('live.transcoding.resolutions.240p') }, @@ -221,17 +238,18 @@ const CONFIG = { get '480p' () { return config.get('live.transcoding.resolutions.480p') }, get '720p' () { return config.get('live.transcoding.resolutions.720p') }, get '1080p' () { return config.get('live.transcoding.resolutions.1080p') }, + get '1440p' () { return config.get('live.transcoding.resolutions.1440p') }, get '2160p' () { return config.get('live.transcoding.resolutions.2160p') } } } }, IMPORT: { VIDEOS: { + get CONCURRENCY () { return config.get('import.videos.concurrency') }, + HTTP: { get ENABLED () { return config.get('import.videos.http.enabled') }, - FORCEIPV4: { - get ENABLED () { return config.get('import.videos.http.forceipv4.enabled') } - }, + get FORCE_IPV4 () { return config.get('import.videos.http.force_ipv4') }, PROXY: { get ENABLED () { return config.get('import.videos.http.proxy.enabled') }, get URL () { return config.get('import.videos.http.proxy.url') } @@ -255,6 +273,9 @@ const CONFIG = { }, VIDEO_CAPTIONS: { get SIZE () { return config.get('cache.captions.size') } + }, + TORRENTS: { + get SIZE () { return config.get('cache.torrents.size') } } }, INSTANCE: { @@ -276,8 +297,10 @@ const CONFIG = { get CATEGORIES () { return config.get('instance.categories') || [] }, get IS_NSFW () { return config.get('instance.is_nsfw') }, - get DEFAULT_CLIENT_ROUTE () { return config.get('instance.default_client_route') }, get DEFAULT_NSFW_POLICY () { return config.get('instance.default_nsfw_policy') }, + + get DEFAULT_CLIENT_ROUTE () { return config.get('instance.default_client_route') }, + CUSTOMIZATIONS: { get JAVASCRIPT () { return config.get('instance.customizations.javascript') }, get CSS () { return config.get('instance.customizations.css') } @@ -326,8 +349,8 @@ const CONFIG = { }, SEARCH: { REMOTE_URI: { - USERS: config.get('search.remote_uri.users'), - ANONYMOUS: config.get('search.remote_uri.anonymous') + get USERS () { return config.get('search.remote_uri.users') }, + get ANONYMOUS () { return config.get('search.remote_uri.anonymous') } }, SEARCH_INDEX: { get ENABLED () { return config.get('search.search_index.enabled') }, @@ -343,7 +366,11 @@ function registerConfigChangedHandler (fun: Function) { } 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 } // ---------------------------------------------------------------------------