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:
6
site-cookbooks/kosmos-ipfs/CHANGELOG.md
Normal file
6
site-cookbooks/kosmos-ipfs/CHANGELOG.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# kosmos-ipfs CHANGELOG
|
||||
|
||||
This file is used to list changes made in each version of the kosmos-ipfs cookbook.
|
||||
|
||||
## 0.1.0
|
||||
- [gregkare] - Initial release of kosmos-ipfs
|
||||
11
site-cookbooks/kosmos-ipfs/README.md
Normal file
11
site-cookbooks/kosmos-ipfs/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# kosmos-ipfs Cookbook
|
||||
|
||||
This cookbook sets up ipfs for Kosmos
|
||||
|
||||
### Chef
|
||||
|
||||
- Chef 12.0 or later
|
||||
|
||||
### Cookbooks
|
||||
|
||||
- `default` - Install ipfs and configure it for Kosmos
|
||||
9
site-cookbooks/kosmos-ipfs/metadata.rb
Normal file
9
site-cookbooks/kosmos-ipfs/metadata.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
name 'kosmos-ipfs'
|
||||
maintainer 'Kosmos'
|
||||
maintainer_email 'mail@kosmos.org'
|
||||
license 'All rights reserved'
|
||||
description 'Installs/Configures kosmos-ipfs'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '0.1.0'
|
||||
|
||||
depends 'ipfs'
|
||||
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