From 2f87e7c07c6225350d560a8ba3a6b8258c39b462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 16 Aug 2018 15:59:44 +0200 Subject: [PATCH] Add the ability to override the IPFS port that nginx connects to This allows us to use the API proxy from the cluster --- site-cookbooks/kosmos-ipfs/attributes/default.rb | 3 +++ site-cookbooks/kosmos-ipfs/recipes/cluster.rb | 1 + site-cookbooks/kosmos-ipfs/recipes/letsencrypt.rb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 site-cookbooks/kosmos-ipfs/attributes/default.rb diff --git a/site-cookbooks/kosmos-ipfs/attributes/default.rb b/site-cookbooks/kosmos-ipfs/attributes/default.rb new file mode 100644 index 0000000..7cf96de --- /dev/null +++ b/site-cookbooks/kosmos-ipfs/attributes/default.rb @@ -0,0 +1,3 @@ +# Override to connect to the IPFS cluster proxy on port 9095 +# (https://cluster.ipfs.io/documentation/composite-clusters/) +node.default['kosmos-ipfs']['nginx']['api_port'] = 5001 diff --git a/site-cookbooks/kosmos-ipfs/recipes/cluster.rb b/site-cookbooks/kosmos-ipfs/recipes/cluster.rb index a1ce6d7..cf23b7f 100644 --- a/site-cookbooks/kosmos-ipfs/recipes/cluster.rb +++ b/site-cookbooks/kosmos-ipfs/recipes/cluster.rb @@ -8,6 +8,7 @@ # include_recipe "ipfs::cluster" +include_recipe "ipfs::cluster_service" unless node.chef_environment == "development" include_recipe "firewall" diff --git a/site-cookbooks/kosmos-ipfs/recipes/letsencrypt.rb b/site-cookbooks/kosmos-ipfs/recipes/letsencrypt.rb index b620739..65839d7 100644 --- a/site-cookbooks/kosmos-ipfs/recipes/letsencrypt.rb +++ b/site-cookbooks/kosmos-ipfs/recipes/letsencrypt.rb @@ -31,7 +31,7 @@ template "#{node['nginx']['dir']}/sites-available/ipfs.kosmos.org" do root_directory: root_directory, ssl_cert: "/etc/letsencrypt/live/ipfs.kosmos.org/fullchain.pem", ssl_key: "/etc/letsencrypt/live/ipfs.kosmos.org/privkey.pem", - ipfs_api_port: 5001, + ipfs_api_port: node['kosmos-ipfs']['nginx']['api_port'], ipfs_external_api_port: 5444 notifies :reload, 'service[nginx]', :delayed