From 0e6ac38434ca57b27a20e1116c7e8a59475f3661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 5 Jul 2019 15:22:08 +0200 Subject: [PATCH] Improve the default config Enable CORS and writeable gateway by default, remove config that only applies to Kosmos Co-authored-by: Sebastian Kippe --- attributes/default.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index e47da58..02b50c4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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" => ["*"] }