Improve the default config

Enable CORS and writeable gateway by default, remove config that only
applies to Kosmos

Co-authored-by: Sebastian Kippe <sebastian@kip.pe>
This commit is contained in:
Greg Karékinian 2019-07-05 15:22:08 +02:00
parent d54e962926
commit 0e6ac38434

View File

@ -1,6 +1,8 @@
node.default['ipfs']['version'] = '0.4.21'
node.default['ipfs']['checksum'] = 'a7ec5ddc4d52f818cbf3853a80f7ec17f9fde9128f039485dbe1889cf673d562'
node.default['ipfs']['ulimit'] = 64000
node.default['ipfs']['memory_max'] = "512M"
node.default['ipfs']['config'] = {
# Do not contact local network addresses. This will stop platforms like Hetzner
# to block your server (https://github.com/ipfs/go-ipfs/issues/1226)
@ -19,15 +21,11 @@ node.default['ipfs']['config'] = {
'/ip4/198.51.100.0/ipcidr/24',
'/ip4/203.0.113.0/ipcidr/24',
'/ip4/240.0.0.0/ipcidr/4'],
# Do not keep track of bandwidth metrics. Disabling bandwidth metrics can
# lead to a slight performance improvement, as well as a reduction in memory
# usage.
'Swarm.DisableBandwidthMetrics' => true,
# Disable the p2p-circuit relay transport
'Swarm.DisableRelay' => true,
# Number of connections that, when exceeded, will trigger a connection GC
# operation
'Swarm.ConnMgr.HighWater' => 10,
# Minimum number of connections to maintain
'Swarm.ConnMgr.LowWater' => 1,
# Set up the Gateway to be writable
"Gateway.Writable" => true,
# Set up CORS headers
"API.HTTPHeaders.Access-Control-Allow-Credentials" => ["true"],
"API.HTTPHeaders.Access-Control-Allow-Methods" => ["PUT", "GET", "POST"],
"API.HTTPHeaders.Access-Control-Allow-Origin" => ["*"]
}