Merge branch 'feature/new_ipfs_cookbook' of kosmos/chef into master

This commit is contained in:
Râu Cao 2019-07-05 14:06:24 +00:00 committed by Gitea
commit f887a88e2d
6 changed files with 41 additions and 28 deletions

View File

@ -18,7 +18,7 @@ DEPENDENCIES
hostsfile (= 2.4.5)
ipfs
git: https://github.com/67P/ipfs-cookbook.git
revision: 3d4e9cceeaf89d30ca1b063e26a51905e8ddfd6b
revision: 1d09c151083beecb9c606805b1cb135c2619e7c5
ref: master
logrotate (= 2.2.0)
mariadb (= 0.3.1)
@ -99,7 +99,7 @@ GRAPH
hostname (0.4.2)
hostsfile (>= 0.0.0)
hostsfile (2.4.5)
ipfs (0.3.0)
ipfs (0.4.0)
ark (>= 0.0.0)
logrotate (2.2.0)
mariadb (0.3.1)

View File

@ -10,6 +10,19 @@
"role[mastodon]",
"role[ejabberd]"
],
"normal": {
"kosmos-ipfs": {
"ipfs": {
"config": {
"Swarm.ConnMgr.LowWater": 100,
"Swarm.ConnMgr.HighWater": 300
}
}
},
"ipfs": {
"memory_max": "1G"
}
},
"automatic": {
"ipaddress": "andromeda.kosmos.org"
}

View File

@ -9,6 +9,11 @@
"sockethub",
"sockethub::proxy"
],
"normal": {
"ipfs": {
"memory_max": "256M"
}
},
"automatic": {
"ipaddress": "barnard.kosmos.org"
}

View File

@ -1,5 +1,19 @@
# FIXME api_port should come from the ipfs cookbook/attributes
# It has nothing to do with nginx
node.default['kosmos-ipfs']['ipfs']['config'] = {
# 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']['gateway_port'] = 9090
node.default['kosmos-ipfs']['nginx']['external_api_port'] = 5444

View File

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

View File

@ -24,32 +24,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
node.override['ipfs']['version'] = '0.4.21'
node.override['ipfs']['checksum'] = 'a7ec5ddc4d52f818cbf3853a80f7ec17f9fde9128f039485dbe1889cf673d562'
include_recipe "ipfs"
include_recipe "kosmos-ipfs::kredits_pinner"
# Configure ipfs
# The default gateway is already used by kosmos' hubot (8080)
ipfs_config "Addresses.Gateway" do
value "/ip4/127.0.0.1/tcp/9090"
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 ["*"]
node['kosmos-ipfs']['ipfs']['config'].each do |k, v|
ipfs_config k do
value v
end
end
unless node.chef_environment == "development"