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 // uPnP
  config.Swarm.ConnMgr = config.Swarm.ConnMgr ?? {}

  config.Discovery = config.Discovery ?? {}
  config.Discovery.MDNS = config.Discovery.MDNS ?? {}
  config.Discovery.MDNS.Enabled = true

  config.AutoTLS = config.AutoTLS ?? {}
  config.AutoTLS.Enabled = true

  writeConfigFile(ipfsd, config)
}
Set default minimum and maximum of connections to maintain
by default. This must only be called for repositories created
by IPFS Desktop. Existing ones shall remain intact.

@param {import('ipfsd-ctl').Controller} ipfsd