]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/initializers/config.ts
7a13a136873a2a61e3835b32ce99644fb49abc61
[github/Chocobozzz/PeerTube.git] / server / initializers / config.ts
1 import bytes from 'bytes'
2 import { IConfig } from 'config'
3 import { dirname, join } from 'path'
4 import { decacheModule } from '@server/helpers/decache'
5 import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
6 import { BroadcastMessageLevel } from '@shared/models/server'
7 import { VideoPrivacy, VideosRedundancyStrategy } from '../../shared/models'
8 import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
9 import { buildPath, root } from '../../shared/core-utils'
10 import { parseBytes, parseDurationToMs } from '../helpers/core-utils'
11
12 // Use a variable to reload the configuration if we need
13 let config: IConfig = require('config')
14
15 const configChangedHandlers: Function[] = []
16
17 const CONFIG = {
18 CUSTOM_FILE: getLocalConfigFilePath(),
19 LISTEN: {
20 PORT: config.get<number>('listen.port'),
21 HOSTNAME: config.get<string>('listen.hostname')
22 },
23 DATABASE: {
24 DBNAME: config.has('database.name') ? config.get<string>('database.name') : 'peertube' + config.get<string>('database.suffix'),
25 HOSTNAME: config.get<string>('database.hostname'),
26 PORT: config.get<number>('database.port'),
27 SSL: config.get<boolean>('database.ssl'),
28 USERNAME: config.get<string>('database.username'),
29 PASSWORD: config.get<string>('database.password'),
30 POOL: {
31 MAX: config.get<number>('database.pool.max')
32 }
33 },
34 REDIS: {
35 HOSTNAME: config.has('redis.hostname') ? config.get<string>('redis.hostname') : null,
36 PORT: config.has('redis.port') ? config.get<number>('redis.port') : null,
37 SOCKET: config.has('redis.socket') ? config.get<string>('redis.socket') : null,
38 AUTH: config.has('redis.auth') ? config.get<string>('redis.auth') : null,
39 DB: config.has('redis.db') ? config.get<number>('redis.db') : null
40 },
41 SMTP: {
42 TRANSPORT: config.has('smtp.transport') ? config.get<string>('smtp.transport') : 'smtp',
43 SENDMAIL: config.has('smtp.sendmail') ? config.get<string>('smtp.sendmail') : null,
44 HOSTNAME: config.get<string>('smtp.hostname'),
45 PORT: config.get<number>('smtp.port'),
46 USERNAME: config.get<string>('smtp.username'),
47 PASSWORD: config.get<string>('smtp.password'),
48 TLS: config.get<boolean>('smtp.tls'),
49 DISABLE_STARTTLS: config.get<boolean>('smtp.disable_starttls'),
50 CA_FILE: config.get<string>('smtp.ca_file'),
51 FROM_ADDRESS: config.get<string>('smtp.from_address')
52 },
53 EMAIL: {
54 BODY: {
55 SIGNATURE: config.get<string>('email.body.signature')
56 },
57 SUBJECT: {
58 PREFIX: config.get<string>('email.subject.prefix') + ' '
59 }
60 },
61
62 CLIENT: {
63 VIDEOS: {
64 MINIATURE: {
65 get PREFER_AUTHOR_DISPLAY_NAME () { return config.get<boolean>('client.videos.miniature.prefer_author_display_name') },
66 get DISPLAY_AUTHOR_AVATAR () { return config.get<boolean>('client.videos.miniature.display_author_avatar') }
67 }
68 },
69 MENU: {
70 LOGIN: {
71 get REDIRECT_ON_SINGLE_EXTERNAL_AUTH () { return config.get<boolean>('client.menu.login.redirect_on_single_external_auth') }
72 }
73 }
74 },
75
76 DEFAULTS: {
77 PUBLISH: {
78 DOWNLOAD_ENABLED: config.get<boolean>('defaults.publish.download_enabled'),
79 COMMENTS_ENABLED: config.get<boolean>('defaults.publish.comments_enabled'),
80 PRIVACY: config.get<VideoPrivacy>('defaults.publish.privacy'),
81 LICENCE: config.get<number>('defaults.publish.licence')
82 },
83 P2P: {
84 WEBAPP: {
85 ENABLED: config.get<boolean>('defaults.p2p.webapp.enabled')
86 },
87 EMBED: {
88 ENABLED: config.get<boolean>('defaults.p2p.embed.enabled')
89 }
90 }
91 },
92
93 STORAGE: {
94 TMP_DIR: buildPath(config.get<string>('storage.tmp')),
95 BIN_DIR: buildPath(config.get<string>('storage.bin')),
96 ACTOR_IMAGES: buildPath(config.get<string>('storage.avatars')),
97 LOG_DIR: buildPath(config.get<string>('storage.logs')),
98 VIDEOS_DIR: buildPath(config.get<string>('storage.videos')),
99 STREAMING_PLAYLISTS_DIR: buildPath(config.get<string>('storage.streaming_playlists')),
100 REDUNDANCY_DIR: buildPath(config.get<string>('storage.redundancy')),
101 THUMBNAILS_DIR: buildPath(config.get<string>('storage.thumbnails')),
102 PREVIEWS_DIR: buildPath(config.get<string>('storage.previews')),
103 CAPTIONS_DIR: buildPath(config.get<string>('storage.captions')),
104 TORRENTS_DIR: buildPath(config.get<string>('storage.torrents')),
105 CACHE_DIR: buildPath(config.get<string>('storage.cache')),
106 PLUGINS_DIR: buildPath(config.get<string>('storage.plugins')),
107 CLIENT_OVERRIDES_DIR: buildPath(config.get<string>('storage.client_overrides'))
108 },
109 OBJECT_STORAGE: {
110 ENABLED: config.get<boolean>('object_storage.enabled'),
111 MAX_UPLOAD_PART: bytes.parse(config.get<string>('object_storage.max_upload_part')),
112 ENDPOINT: config.get<string>('object_storage.endpoint'),
113 REGION: config.get<string>('object_storage.region'),
114 CREDENTIALS: {
115 ACCESS_KEY_ID: config.get<string>('object_storage.credentials.access_key_id'),
116 SECRET_ACCESS_KEY: config.get<string>('object_storage.credentials.secret_access_key')
117 },
118 VIDEOS: {
119 BUCKET_NAME: config.get<string>('object_storage.videos.bucket_name'),
120 PREFIX: config.get<string>('object_storage.videos.prefix'),
121 BASE_URL: config.get<string>('object_storage.videos.base_url')
122 },
123 STREAMING_PLAYLISTS: {
124 BUCKET_NAME: config.get<string>('object_storage.streaming_playlists.bucket_name'),
125 PREFIX: config.get<string>('object_storage.streaming_playlists.prefix'),
126 BASE_URL: config.get<string>('object_storage.streaming_playlists.base_url')
127 }
128 },
129 WEBSERVER: {
130 SCHEME: config.get<boolean>('webserver.https') === true ? 'https' : 'http',
131 WS: config.get<boolean>('webserver.https') === true ? 'wss' : 'ws',
132 HOSTNAME: config.get<string>('webserver.hostname'),
133 PORT: config.get<number>('webserver.port')
134 },
135 RATES_LIMIT: {
136 API: {
137 WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.api.window')),
138 MAX: config.get<number>('rates_limit.api.max')
139 },
140 SIGNUP: {
141 WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.signup.window')),
142 MAX: config.get<number>('rates_limit.signup.max')
143 },
144 LOGIN: {
145 WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.login.window')),
146 MAX: config.get<number>('rates_limit.login.max')
147 },
148 ASK_SEND_EMAIL: {
149 WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.ask_send_email.window')),
150 MAX: config.get<number>('rates_limit.ask_send_email.max')
151 }
152 },
153 TRUST_PROXY: config.get<string[]>('trust_proxy'),
154 LOG: {
155 LEVEL: config.get<string>('log.level'),
156 ROTATION: {
157 ENABLED: config.get<boolean>('log.rotation.enabled'),
158 MAX_FILE_SIZE: bytes.parse(config.get<string>('log.rotation.max_file_size')),
159 MAX_FILES: config.get<number>('log.rotation.max_files')
160 },
161 ANONYMIZE_IP: config.get<boolean>('log.anonymize_ip'),
162 LOG_PING_REQUESTS: config.get<boolean>('log.log_ping_requests'),
163 PRETTIFY_SQL: config.get<boolean>('log.prettify_sql')
164 },
165 TRENDING: {
166 VIDEOS: {
167 INTERVAL_DAYS: config.get<number>('trending.videos.interval_days'),
168 ALGORITHMS: {
169 get ENABLED () { return config.get<string[]>('trending.videos.algorithms.enabled') },
170 get DEFAULT () { return config.get<string>('trending.videos.algorithms.default') }
171 }
172 }
173 },
174 REDUNDANCY: {
175 VIDEOS: {
176 CHECK_INTERVAL: parseDurationToMs(config.get<string>('redundancy.videos.check_interval')),
177 STRATEGIES: buildVideosRedundancy(config.get<any[]>('redundancy.videos.strategies'))
178 }
179 },
180 REMOTE_REDUNDANCY: {
181 VIDEOS: {
182 ACCEPT_FROM: config.get<VideoRedundancyConfigFilter>('remote_redundancy.videos.accept_from')
183 }
184 },
185 CSP: {
186 ENABLED: config.get<boolean>('csp.enabled'),
187 REPORT_ONLY: config.get<boolean>('csp.report_only'),
188 REPORT_URI: config.get<string>('csp.report_uri')
189 },
190 SECURITY: {
191 FRAMEGUARD: {
192 ENABLED: config.get<boolean>('security.frameguard.enabled')
193 }
194 },
195 TRACKER: {
196 ENABLED: config.get<boolean>('tracker.enabled'),
197 PRIVATE: config.get<boolean>('tracker.private'),
198 REJECT_TOO_MANY_ANNOUNCES: config.get<boolean>('tracker.reject_too_many_announces')
199 },
200 HISTORY: {
201 VIDEOS: {
202 MAX_AGE: parseDurationToMs(config.get('history.videos.max_age'))
203 }
204 },
205 VIEWS: {
206 VIDEOS: {
207 REMOTE: {
208 MAX_AGE: parseDurationToMs(config.get('views.videos.remote.max_age'))
209 },
210 LOCAL_BUFFER_UPDATE_INTERVAL: parseDurationToMs(config.get('views.videos.local_buffer_update_interval')),
211 IP_VIEW_EXPIRATION: parseDurationToMs(config.get('views.videos.ip_view_expiration'))
212 }
213 },
214 PLUGINS: {
215 INDEX: {
216 ENABLED: config.get<boolean>('plugins.index.enabled'),
217 CHECK_LATEST_VERSIONS_INTERVAL: parseDurationToMs(config.get<string>('plugins.index.check_latest_versions_interval')),
218 URL: config.get<string>('plugins.index.url')
219 }
220 },
221 FEDERATION: {
222 VIDEOS: {
223 FEDERATE_UNLISTED: config.get<boolean>('federation.videos.federate_unlisted'),
224 CLEANUP_REMOTE_INTERACTIONS: config.get<boolean>('federation.videos.cleanup_remote_interactions')
225 }
226 },
227 PEERTUBE: {
228 CHECK_LATEST_VERSION: {
229 ENABLED: config.get<boolean>('peertube.check_latest_version.enabled'),
230 URL: config.get<string>('peertube.check_latest_version.url')
231 }
232 },
233 WEBADMIN: {
234 CONFIGURATION: {
235 EDITION: {
236 ALLOWED: config.get<boolean>('webadmin.configuration.edition.allowed')
237 }
238 }
239 },
240 ADMIN: {
241 get EMAIL () { return config.get<string>('admin.email') }
242 },
243 CONTACT_FORM: {
244 get ENABLED () { return config.get<boolean>('contact_form.enabled') }
245 },
246 SIGNUP: {
247 get ENABLED () { return config.get<boolean>('signup.enabled') },
248 get LIMIT () { return config.get<number>('signup.limit') },
249 get REQUIRES_EMAIL_VERIFICATION () { return config.get<boolean>('signup.requires_email_verification') },
250 get MINIMUM_AGE () { return config.get<number>('signup.minimum_age') },
251 FILTERS: {
252 CIDR: {
253 get WHITELIST () { return config.get<string[]>('signup.filters.cidr.whitelist') },
254 get BLACKLIST () { return config.get<string[]>('signup.filters.cidr.blacklist') }
255 }
256 }
257 },
258 USER: {
259 get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) },
260 get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) }
261 },
262 VIDEO_CHANNELS: {
263 get MAX_PER_USER () { return config.get<number>('video_channels.max_per_user') }
264 },
265 TRANSCODING: {
266 get ENABLED () { return config.get<boolean>('transcoding.enabled') },
267 get ALLOW_ADDITIONAL_EXTENSIONS () { return config.get<boolean>('transcoding.allow_additional_extensions') },
268 get ALLOW_AUDIO_FILES () { return config.get<boolean>('transcoding.allow_audio_files') },
269 get THREADS () { return config.get<number>('transcoding.threads') },
270 get CONCURRENCY () { return config.get<number>('transcoding.concurrency') },
271 get PROFILE () { return config.get<string>('transcoding.profile') },
272 RESOLUTIONS: {
273 get '0p' () { return config.get<boolean>('transcoding.resolutions.0p') },
274 get '144p' () { return config.get<boolean>('transcoding.resolutions.144p') },
275 get '240p' () { return config.get<boolean>('transcoding.resolutions.240p') },
276 get '360p' () { return config.get<boolean>('transcoding.resolutions.360p') },
277 get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') },
278 get '720p' () { return config.get<boolean>('transcoding.resolutions.720p') },
279 get '1080p' () { return config.get<boolean>('transcoding.resolutions.1080p') },
280 get '1440p' () { return config.get<boolean>('transcoding.resolutions.1440p') },
281 get '2160p' () { return config.get<boolean>('transcoding.resolutions.2160p') }
282 },
283 HLS: {
284 get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') }
285 },
286 WEBTORRENT: {
287 get ENABLED () { return config.get<boolean>('transcoding.webtorrent.enabled') }
288 }
289 },
290 LIVE: {
291 get ENABLED () { return config.get<boolean>('live.enabled') },
292
293 get MAX_DURATION () { return parseDurationToMs(config.get<string>('live.max_duration')) },
294 get MAX_INSTANCE_LIVES () { return config.get<number>('live.max_instance_lives') },
295 get MAX_USER_LIVES () { return config.get<number>('live.max_user_lives') },
296
297 get ALLOW_REPLAY () { return config.get<boolean>('live.allow_replay') },
298
299 RTMP: {
300 get ENABLED () { return config.get<boolean>('live.rtmp.enabled') },
301 get PORT () { return config.get<number>('live.rtmp.port') },
302 get HOSTNAME () { return config.get<number>('live.rtmp.hostname') }
303 },
304
305 RTMPS: {
306 get ENABLED () { return config.get<boolean>('live.rtmps.enabled') },
307 get PORT () { return config.get<number>('live.rtmps.port') },
308 get HOSTNAME () { return config.get<number>('live.rtmps.hostname') },
309 get KEY_FILE () { return config.get<string>('live.rtmps.key_file') },
310 get CERT_FILE () { return config.get<string>('live.rtmps.cert_file') }
311 },
312
313 TRANSCODING: {
314 get ENABLED () { return config.get<boolean>('live.transcoding.enabled') },
315 get THREADS () { return config.get<number>('live.transcoding.threads') },
316 get PROFILE () { return config.get<string>('live.transcoding.profile') },
317
318 RESOLUTIONS: {
319 get '144p' () { return config.get<boolean>('live.transcoding.resolutions.144p') },
320 get '240p' () { return config.get<boolean>('live.transcoding.resolutions.240p') },
321 get '360p' () { return config.get<boolean>('live.transcoding.resolutions.360p') },
322 get '480p' () { return config.get<boolean>('live.transcoding.resolutions.480p') },
323 get '720p' () { return config.get<boolean>('live.transcoding.resolutions.720p') },
324 get '1080p' () { return config.get<boolean>('live.transcoding.resolutions.1080p') },
325 get '1440p' () { return config.get<boolean>('live.transcoding.resolutions.1440p') },
326 get '2160p' () { return config.get<boolean>('live.transcoding.resolutions.2160p') }
327 }
328 }
329 },
330 VIDEO_EDITOR: {
331 get ENABLED () { return config.get<boolean>('video_editor.enabled') }
332 },
333 IMPORT: {
334 VIDEOS: {
335 get CONCURRENCY () { return config.get<number>('import.videos.concurrency') },
336
337 HTTP: {
338 get ENABLED () { return config.get<boolean>('import.videos.http.enabled') },
339
340 YOUTUBE_DL_RELEASE: {
341 get URL () { return config.get<string>('import.videos.http.youtube_dl_release.url') },
342 get NAME () { return config.get<string>('import.videos.http.youtube_dl_release.name') },
343 get PYTHON_PATH () { return config.get<string>('import.videos.http.youtube_dl_release.python_path') }
344 },
345
346 get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') }
347 },
348 TORRENT: {
349 get ENABLED () { return config.get<boolean>('import.videos.torrent.enabled') }
350 }
351 }
352 },
353 AUTO_BLACKLIST: {
354 VIDEOS: {
355 OF_USERS: {
356 get ENABLED () { return config.get<boolean>('auto_blacklist.videos.of_users.enabled') }
357 }
358 }
359 },
360 CACHE: {
361 PREVIEWS: {
362 get SIZE () { return config.get<number>('cache.previews.size') }
363 },
364 VIDEO_CAPTIONS: {
365 get SIZE () { return config.get<number>('cache.captions.size') }
366 },
367 TORRENTS: {
368 get SIZE () { return config.get<number>('cache.torrents.size') }
369 }
370 },
371 INSTANCE: {
372 get NAME () { return config.get<string>('instance.name') },
373 get SHORT_DESCRIPTION () { return config.get<string>('instance.short_description') },
374 get DESCRIPTION () { return config.get<string>('instance.description') },
375 get TERMS () { return config.get<string>('instance.terms') },
376 get CODE_OF_CONDUCT () { return config.get<string>('instance.code_of_conduct') },
377
378 get CREATION_REASON () { return config.get<string>('instance.creation_reason') },
379
380 get MODERATION_INFORMATION () { return config.get<string>('instance.moderation_information') },
381 get ADMINISTRATOR () { return config.get<string>('instance.administrator') },
382 get MAINTENANCE_LIFETIME () { return config.get<string>('instance.maintenance_lifetime') },
383 get BUSINESS_MODEL () { return config.get<string>('instance.business_model') },
384 get HARDWARE_INFORMATION () { return config.get<string>('instance.hardware_information') },
385
386 get LANGUAGES () { return config.get<string[]>('instance.languages') || [] },
387 get CATEGORIES () { return config.get<number[]>('instance.categories') || [] },
388
389 get IS_NSFW () { return config.get<boolean>('instance.is_nsfw') },
390 get DEFAULT_NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') },
391
392 get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
393
394 CUSTOMIZATIONS: {
395 get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') },
396 get CSS () { return config.get<string>('instance.customizations.css') }
397 },
398 get ROBOTS () { return config.get<string>('instance.robots') },
399 get SECURITYTXT () { return config.get<string>('instance.securitytxt') },
400 get SECURITYTXT_CONTACT () { return config.get<string>('admin.email') }
401 },
402 SERVICES: {
403 TWITTER: {
404 get USERNAME () { return config.get<string>('services.twitter.username') },
405 get WHITELISTED () { return config.get<boolean>('services.twitter.whitelisted') }
406 }
407 },
408 FOLLOWERS: {
409 INSTANCE: {
410 get ENABLED () { return config.get<boolean>('followers.instance.enabled') },
411 get MANUAL_APPROVAL () { return config.get<boolean>('followers.instance.manual_approval') }
412 }
413 },
414 FOLLOWINGS: {
415 INSTANCE: {
416 AUTO_FOLLOW_BACK: {
417 get ENABLED () {
418 return config.get<boolean>('followings.instance.auto_follow_back.enabled')
419 }
420 },
421 AUTO_FOLLOW_INDEX: {
422 get ENABLED () {
423 return config.get<boolean>('followings.instance.auto_follow_index.enabled')
424 },
425 get INDEX_URL () {
426 return config.get<string>('followings.instance.auto_follow_index.index_url')
427 }
428 }
429 }
430 },
431 THEME: {
432 get DEFAULT () { return config.get<string>('theme.default') }
433 },
434 BROADCAST_MESSAGE: {
435 get ENABLED () { return config.get<boolean>('broadcast_message.enabled') },
436 get MESSAGE () { return config.get<string>('broadcast_message.message') },
437 get LEVEL () { return config.get<BroadcastMessageLevel>('broadcast_message.level') },
438 get DISMISSABLE () { return config.get<boolean>('broadcast_message.dismissable') }
439 },
440 SEARCH: {
441 REMOTE_URI: {
442 get USERS () { return config.get<boolean>('search.remote_uri.users') },
443 get ANONYMOUS () { return config.get<boolean>('search.remote_uri.anonymous') }
444 },
445 SEARCH_INDEX: {
446 get ENABLED () { return config.get<boolean>('search.search_index.enabled') },
447 get URL () { return config.get<string>('search.search_index.url') },
448 get DISABLE_LOCAL_SEARCH () { return config.get<boolean>('search.search_index.disable_local_search') },
449 get IS_DEFAULT_SEARCH () { return config.get<boolean>('search.search_index.is_default_search') }
450 }
451 }
452 }
453
454 function registerConfigChangedHandler (fun: Function) {
455 configChangedHandlers.push(fun)
456 }
457
458 function isEmailEnabled () {
459 if (CONFIG.SMTP.TRANSPORT === 'sendmail' && CONFIG.SMTP.SENDMAIL) return true
460
461 if (CONFIG.SMTP.TRANSPORT === 'smtp' && CONFIG.SMTP.HOSTNAME && CONFIG.SMTP.PORT) return true
462
463 return false
464 }
465
466 // ---------------------------------------------------------------------------
467
468 export {
469 CONFIG,
470 registerConfigChangedHandler,
471 isEmailEnabled
472 }
473
474 // ---------------------------------------------------------------------------
475
476 function getLocalConfigFilePath () {
477 const localConfigDir = getLocalConfigDir()
478
479 let filename = 'local'
480 if (process.env.NODE_ENV) filename += `-${process.env.NODE_ENV}`
481 if (process.env.NODE_APP_INSTANCE) filename += `-${process.env.NODE_APP_INSTANCE}`
482
483 return join(localConfigDir, filename + '.json')
484 }
485
486 function getLocalConfigDir () {
487 if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG
488
489 const configSources = config.util.getConfigSources()
490 if (configSources.length === 0) throw new Error('Invalid config source.')
491
492 return dirname(configSources[0].name)
493 }
494
495 function buildVideosRedundancy (objs: any[]): VideosRedundancyStrategy[] {
496 if (!objs) return []
497
498 if (!Array.isArray(objs)) return objs
499
500 return objs.map(obj => {
501 return Object.assign({}, obj, {
502 minLifetime: parseDurationToMs(obj.min_lifetime),
503 size: bytes.parse(obj.size),
504 minViews: obj.min_views
505 })
506 })
507 }
508
509 export function reloadConfig () {
510
511 function getConfigDirectories () {
512 if (process.env.NODE_CONFIG_DIR) {
513 return process.env.NODE_CONFIG_DIR.split(':')
514 }
515
516 return [ join(root(), 'config') ]
517 }
518
519 function purge () {
520 const directories = getConfigDirectories()
521
522 for (const fileName in require.cache) {
523 if (directories.some((dir) => fileName.includes(dir)) === false) {
524 continue
525 }
526
527 delete require.cache[fileName]
528 }
529
530 decacheModule('config')
531 }
532
533 purge()
534
535 config = require('config')
536
537 for (const configChangedHandler of configChangedHandlers) {
538 configChangedHandler()
539 }
540 }