Split up kosmos config from the ipfs cookbook
Also do not connect IPFS to the local network to avoid getting our server blocked by Hetzner
This commit is contained in:
28
site-cookbooks/kosmos-ipfs/recipes/default.rb
Normal file
28
site-cookbooks/kosmos-ipfs/recipes/default.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Cookbook Name:: kosmos-ipfs
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2017, Kosmos
|
||||
#
|
||||
# All rights reserved - Do Not Redistribute
|
||||
#
|
||||
|
||||
include_recipe "ipfs"
|
||||
|
||||
# Configure ipfs
|
||||
|
||||
# The default gateway is already used by kosmos' hubot (8080)
|
||||
execute "ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/9090" do
|
||||
environment "IPFS_PATH" => "/home/ipfs/.ipfs"
|
||||
user "ipfs"
|
||||
not_if "ipfs config Addresses.Gateway | grep /ip4/127.0.0.1/tcp/9090"
|
||||
notifies :restart, "service[ipfs]", :delayed
|
||||
end
|
||||
|
||||
# Set up CORS headers
|
||||
execute "ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[\"kredits.kosmos.org\"]'" do
|
||||
environment "IPFS_PATH" => "/home/ipfs/.ipfs"
|
||||
user "ipfs"
|
||||
not_if "ipfs config API.HTTPHeaders.Access-Control-Allow-Origin | grep kredits.kosmos.org"
|
||||
notifies :restart, "service[ipfs]", :delayed
|
||||
end
|
||||
Reference in New Issue
Block a user