function applyDefaults (ipfsd) {
  const config = readConfigFile(ipfsd)

  // Ensure strict CORS checking
  // See: https://github.com/ipfs/js-ipfsd-ctl/issues/333
  config.API = { HTTPHeaders: {} }

  config.Swarm = config.Swarm || {}
  config.Swarm.DisableNatPortMap = false
  config.Swarm.ConnMgr = config.Swarm.ConnMgr || {}
  config.Swarm.ConnMgr.GracePeriod = '300s'
  config.Swarm.ConnMgr.LowWater = 50
  config.Swarm.ConnMgr.HighWater = 300

  config.Discovery = config.Discovery || {}
  config.Discovery.MDNS = config.Discovery.MDNS || {}
  config.Discovery.MDNS.enabled = true

  writeConfigFile(ipfsd, config)
}
// by IPFS Desktop. Existing ones shall remain intact.
by IPFS Desktop. Existing ones shall remain intact.
by IPFS Desktop . Existing ones shall remain intact .
function applyDefaults (ipfsd) {
  const config = readConfigFile(ipfsd)
  config.API = { HTTPHeaders: {} }
  config.Swarm = config.Swarm || {}
  config.Swarm.DisableNatPortMap = false
  config.Swarm.ConnMgr = config.Swarm.ConnMgr || {}
  config.Swarm.ConnMgr.GracePeriod = '300s'
  config.Swarm.ConnMgr.LowWater = 50
  config.Swarm.ConnMgr.HighWater = 300
  config.Discovery = config.Discovery || {}
  config.Discovery.MDNS = config.Discovery.MDNS || {}
  config.Discovery.MDNS.enabled = true
  writeConfigFile(ipfsd, config)
}
function applyDefaults ( ipfsd ) { const config = readConfigFile ( ipfsd ) config . API = { HTTPHeaders : { } } config . Swarm = config . Swarm || { } config . Swarm . DisableNatPortMap = false config . Swarm . ConnMgr = config . Swarm . ConnMgr || { } config . Swarm . ConnMgr . GracePeriod = '300s' config . Swarm . ConnMgr . LowWater = 50 config . Swarm . ConnMgr . HighWater = 300 config . Discovery = config . Discovery || { } config . Discovery . MDNS = config . Discovery . MDNS || { } config . Discovery . MDNS . enabled = true writeConfigFile ( ipfsd , config ) }
by IPFS Desktop.
by IPFS Desktop .
// Ensure strict CORS checking // See: https://github.com/ipfs/js-ipfsd-ctl/issues/333