Update IPFS to the latest release
Also fix the ipfs config
This commit is contained in:
parent
b4624cf2aa
commit
11db96b3a1
@ -51,7 +51,7 @@ the server automatically
|
||||
|
||||
```ruby
|
||||
ipfs_config "Gateway.Writable" do
|
||||
true
|
||||
value "true"
|
||||
end
|
||||
```
|
||||
|
||||
|
@ -1,21 +1,5 @@
|
||||
node.default['ipfs']['version'] = "0.4.7"
|
||||
node.default['ipfs']['checksum'] = "f2686980f3417edd543e972a623ae3d4c0727844aa7c13bae9bfd7ffe7a28e37"
|
||||
node.default['ipfs']['version'] = "0.4.9"
|
||||
node.default['ipfs']['checksum'] = "ae50c760f58548adc7c6dade4cf549059b6bc73ebc25ff4ea9fece06a15ac0a6"
|
||||
# Do not contact local network addresses. This will stop platforms like Hetzner
|
||||
# to block your server (https://github.com/ipfs/go-ipfs/issues/1226)
|
||||
node.default['ipfs']['config']['swarm']['addr_filter'] = [
|
||||
"/ip4/10.0.0.0/ipcidr/8",
|
||||
"/ip4/100.64.0.0/ipcidr/10",
|
||||
"/ip4/169.254.0.0/ipcidr/16",
|
||||
"/ip4/172.16.0.0/ipcidr/12",
|
||||
"/ip4/192.0.0.0/ipcidr/24",
|
||||
"/ip4/192.0.0.0/ipcidr/29",
|
||||
"/ip4/192.0.0.8/ipcidr/32",
|
||||
"/ip4/192.0.0.170/ipcidr/32",
|
||||
"/ip4/192.0.0.171/ipcidr/32",
|
||||
"/ip4/192.0.2.0/ipcidr/24",
|
||||
"/ip4/192.168.0.0/ipcidr/16",
|
||||
"/ip4/198.18.0.0/ipcidr/15",
|
||||
"/ip4/198.51.100.0/ipcidr/24",
|
||||
"/ip4/203.0.113.0/ipcidr/24",
|
||||
"/ip4/240.0.0.0/ipcidr/4",
|
||||
]
|
||||
node.default['ipfs']['config']['swarm']['addr_filter'] = '["/ip4/10.0.0.0/ipcidr/8","/ip4/100.64.0.0/ipcidr/10","/ip4/169.254.0.0/ipcidr/16","/ip4/172.16.0.0/ipcidr/12","/ip4/192.0.0.0/ipcidr/24","/ip4/192.0.0.0/ipcidr/29","/ip4/192.0.0.8/ipcidr/32","/ip4/192.0.0.170/ipcidr/32","/ip4/192.0.0.171/ipcidr/32","/ip4/192.0.2.0/ipcidr/24","/ip4/192.168.0.0/ipcidr/16","/ip4/198.18.0.0/ipcidr/15","/ip4/198.51.100.0/ipcidr/24","/ip4/203.0.113.0/ipcidr/24","/ip4/240.0.0.0/ipcidr/4"]'
|
||||
|
@ -8,8 +8,7 @@ end
|
||||
action :create do
|
||||
include_recipe "ipfs"
|
||||
|
||||
json_value = JSON.generate(value)
|
||||
execute "ipfs config --json #{key} #{json_value}" do
|
||||
execute "ipfs config --json #{key} '#{value}'" do
|
||||
environment "IPFS_PATH" => "/home/ipfs/.ipfs"
|
||||
user "ipfs"
|
||||
not_if do
|
||||
@ -20,9 +19,9 @@ action :create do
|
||||
env: { "IPFS_PATH" => "/home/ipfs/.ipfs" })
|
||||
cmd.run_command
|
||||
begin
|
||||
JSON.parse(cmd.stdout) == value
|
||||
JSON.parse(cmd.stdout) == JSON.parse(value)
|
||||
rescue JSON::ParserError
|
||||
cmd.stdout.include?(value)
|
||||
cmd.stdout.include?("#{value}")
|
||||
end
|
||||
end
|
||||
notifies :restart, "service[ipfs]", :delayed
|
||||
|
@ -8,3 +8,4 @@ version '0.1.0'
|
||||
|
||||
depends 'ipfs'
|
||||
depends 'kosmos-base'
|
||||
depends 'kosmos-nginx'
|
||||
|
@ -18,7 +18,7 @@ end
|
||||
|
||||
# Set up the Gateway to be writable
|
||||
ipfs_config "Gateway.Writable" do
|
||||
value true
|
||||
value "true"
|
||||
end
|
||||
|
||||
# Set up CORS headers
|
||||
@ -26,7 +26,7 @@ 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"]'
|
||||
value '["PUT","GET","POST"]'
|
||||
end
|
||||
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Origin" do
|
||||
value '["*"]'
|
||||
|
@ -12,9 +12,11 @@ unless node.chef_environment == "development"
|
||||
include_recipe "kosmos-base::letsencrypt"
|
||||
end
|
||||
|
||||
include_recipe "kosmos-nginx"
|
||||
|
||||
root_directory = "/var/www/ipfs.kosmos.org"
|
||||
|
||||
directory "#{root_directory}/.well-known" do
|
||||
directory "#{root_directory}/.well-known/acme-challenge" do
|
||||
owner node["nginx"]["user"]
|
||||
group node["nginx"]["group"]
|
||||
action :create
|
||||
|
Loading…
x
Reference in New Issue
Block a user