Move attributes from the ipfs cookbook to kosmos-ipfs

The default attributes set in the ipfs cookbook do not include
attributes that are specific to Kosmos anymore
This commit is contained in:
Greg Karékinian 2019-07-05 15:38:30 +02:00
parent 7803513318
commit 9c8befc179
3 changed files with 21 additions and 26 deletions

View File

@ -1,5 +1,19 @@
# FIXME api_port should come from the ipfs cookbook/attributes node.default['kosmos-ipfs']['ipfs']['config'] = {
# It has nothing to do with nginx # The default gateway is already used by kosmos' hubot (8080)
"Addresses.Gateway" => "/ip4/127.0.0.1/tcp/9090",
# 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' => 40,
# Minimum number of connections to maintain
'Swarm.ConnMgr.LowWater' => 20
}
node.default['kosmos-ipfs']['nginx']['api_port'] = 5001 node.default['kosmos-ipfs']['nginx']['api_port'] = 5001
node.default['kosmos-ipfs']['nginx']['gateway_port'] = 9090 node.default['kosmos-ipfs']['nginx']['gateway_port'] = 9090
node.default['kosmos-ipfs']['nginx']['external_api_port'] = 5444 node.default['kosmos-ipfs']['nginx']['external_api_port'] = 5444

View File

@ -4,7 +4,7 @@ maintainer_email 'mail@kosmos.org'
license 'MIT' license 'MIT'
description 'Installs/Configures kosmos-ipfs' description 'Installs/Configures kosmos-ipfs'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.3' version '0.2.0'
depends 'ipfs' depends 'ipfs'
depends 'kosmos-base' depends 'kosmos-base'

View File

@ -24,32 +24,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
node.override['ipfs']['version'] = '0.4.21'
node.override['ipfs']['checksum'] = 'a7ec5ddc4d52f818cbf3853a80f7ec17f9fde9128f039485dbe1889cf673d562'
include_recipe "ipfs" include_recipe "ipfs"
include_recipe "kosmos-ipfs::kredits_pinner" include_recipe "kosmos-ipfs::kredits_pinner"
# Configure ipfs node['kosmos-ipfs']['ipfs']['config'].each do |k, v|
ipfs_config k do
# The default gateway is already used by kosmos' hubot (8080) value v
ipfs_config "Addresses.Gateway" do
value "/ip4/127.0.0.1/tcp/9090"
end end
# Set up the Gateway to be writable
ipfs_config "Gateway.Writable" do
value true
end
# Set up CORS headers
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Credentials" do
value ["true"]
end
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Methods" do
value ["PUT", "GET", "POST"]
end
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Origin" do
value ["*"]
end end
unless node.chef_environment == "development" unless node.chef_environment == "development"