Do not vendor cookbooks using Berkshelf anymore
Instead, use the Berkshelf support in knife-solo and the vagrant-berkshelf plugin on Vagrant
This commit is contained in:
@@ -1 +0,0 @@
|
||||
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
|
||||
1
cookbooks/ipfs/.gitignore
vendored
1
cookbooks/ipfs/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/.kitchen/
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
driver:
|
||||
name: dokken
|
||||
privileged: true # because Docker and SystemD/Upstart
|
||||
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
|
||||
|
||||
transport:
|
||||
name: dokken
|
||||
|
||||
provisioner:
|
||||
name: dokken
|
||||
deprecations_as_errors: true
|
||||
|
||||
verifier:
|
||||
name: inspec
|
||||
|
||||
platforms:
|
||||
- name: ubuntu-16.04
|
||||
driver:
|
||||
image: dokken/ubuntu-16.04
|
||||
pid_one_command: /bin/systemd
|
||||
- name: ubuntu-18.04
|
||||
driver:
|
||||
image: dokken/ubuntu-18.04
|
||||
pid_one_command: /bin/systemd
|
||||
- name: debian-9
|
||||
driver:
|
||||
image: dokken/debian-9
|
||||
pid_one_command: /bin/systemd
|
||||
|
||||
suites:
|
||||
- name: default
|
||||
run_list:
|
||||
- recipe[ipfs::default]
|
||||
attributes:
|
||||
- name: cluster
|
||||
run_list:
|
||||
- recipe[ipfs::cluster]
|
||||
- recipe[ipfs::cluster_service]
|
||||
attributes:
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
driver:
|
||||
name: vagrant
|
||||
|
||||
provisioner:
|
||||
name: chef_zero
|
||||
|
||||
platforms:
|
||||
- name: ubuntu-16.04
|
||||
- name: ubuntu-18.04
|
||||
- name: debian-9
|
||||
|
||||
suites:
|
||||
- name: default
|
||||
run_list:
|
||||
- recipe[ipfs::default]
|
||||
attributes:
|
||||
- name: cluster
|
||||
run_list:
|
||||
- recipe[ipfs::cluster]
|
||||
- recipe[ipfs::cluster_service]
|
||||
attributes:
|
||||
@@ -1,39 +0,0 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- chef-current-trusty
|
||||
packages:
|
||||
- chefdk
|
||||
|
||||
# Don't `bundle install` which takes about 1.5 mins
|
||||
install: echo "skip bundle install"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
services: docker
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- INSTANCE=default-debian-9
|
||||
- INSTANCE=default-ubuntu-1604
|
||||
- INSTANCE=default-ubuntu-1804
|
||||
|
||||
before_script:
|
||||
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
|
||||
- eval "$(chef shell-init bash)"
|
||||
- chef --version
|
||||
- cookstyle --version
|
||||
- foodcritic --version
|
||||
|
||||
script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml CHEF_VERSION=13.10.4 kitchen verify ${INSTANCE}
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- script:
|
||||
- chef exec delivery local all
|
||||
env: UNIT_AND_LINT=1
|
||||
@@ -1,3 +0,0 @@
|
||||
source 'https://api.berkshelf.com'
|
||||
|
||||
metadata
|
||||
@@ -1,19 +0,0 @@
|
||||
DEPENDENCIES
|
||||
ipfs
|
||||
path: .
|
||||
metadata: true
|
||||
|
||||
GRAPH
|
||||
ark (4.0.0)
|
||||
build-essential (>= 0.0.0)
|
||||
seven_zip (>= 0.0.0)
|
||||
build-essential (8.1.1)
|
||||
mingw (>= 1.1)
|
||||
seven_zip (>= 0.0.0)
|
||||
ipfs (0.1.0)
|
||||
ark (>= 0.0.0)
|
||||
mingw (2.1.0)
|
||||
seven_zip (>= 0.0.0)
|
||||
seven_zip (3.0.0)
|
||||
windows (>= 0.0.0)
|
||||
windows (5.0.0)
|
||||
@@ -1,4 +0,0 @@
|
||||
# ipfs CHANGELOG
|
||||
|
||||
## 0.1.0
|
||||
- [gregkare] - Initial release of ipfs
|
||||
@@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Kosmos Developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,93 +0,0 @@
|
||||
# ipfs Cookbook
|
||||
|
||||
This cookbook installs ipfs and starts it as a daemon
|
||||
|
||||
## Requirements
|
||||
|
||||
### Platforms
|
||||
|
||||
This cookbook is tested on Ubuntu 16.06, 14.04 and Debian 8 using Test Kitchen.
|
||||
It currently only supports 64bit platforms
|
||||
|
||||
### Chef
|
||||
|
||||
- Chef 12.5 or later (we are providing a
|
||||
[Custom Resource](https://docs.chef.io/custom_resources.html) to configure
|
||||
IPFS)
|
||||
|
||||
### Cookbook dependencies
|
||||
|
||||
- `ark` to download and uncompress the Go IPFS package
|
||||
|
||||
## Usage
|
||||
|
||||
### ipfs::default
|
||||
|
||||
Just include `ipfs` in your node's `run_list`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name":"my_node",
|
||||
"run_list": [
|
||||
"recipe[ipfs]"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Attributes
|
||||
|
||||
- `node.['ipfs']['version']` - the Go IPFS version to download from the official
|
||||
site (64bit)
|
||||
- `node['ipfs']['checksum']` - the SHA256 checksum for the package
|
||||
- `node['ipfs']['config']['swarm']['addr_filter']` - the network ranges to not
|
||||
connect to. This will stop platforms like Hetzner to block your server
|
||||
(https://github.com/ipfs/go-ipfs/issues/1226)
|
||||
|
||||
## Resources
|
||||
|
||||
`ipfs_config` sets the config. Supports hashes, arrays, booleans and strings.
|
||||
Does not change anything if the config already has that value, and restarts
|
||||
the server automatically
|
||||
|
||||
```ruby
|
||||
ipfs_config "Gateway.Writable" do
|
||||
value "true"
|
||||
end
|
||||
```
|
||||
|
||||
## Running the specs and integrations tests
|
||||
|
||||
Install the latest [Chef DK](https://downloads.chef.io/chefdk).
|
||||
|
||||
```
|
||||
chef exec delivery local all # Run the linting check, syntax check and unit tests
|
||||
kitchen verify # Run the integration tests for Ubuntu 16.04, 18.06 and Debian 9
|
||||
```
|
||||
|
||||
## License and Authors
|
||||
|
||||
Authors: Kosmos Developers mail@kosmos.org
|
||||
Copyright: 2018, [Kosmos Developers](https://kredits.kosmos.org/)
|
||||
|
||||
```
|
||||
Unless otherwise noted, all files are released under the MIT license, possible
|
||||
exceptions will contain licensing information in them.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env rake
|
||||
|
||||
# Style tests. cookstyle (rubocop) and Foodcritic
|
||||
namespace :style do
|
||||
begin
|
||||
require 'cookstyle'
|
||||
require 'rubocop/rake_task'
|
||||
|
||||
desc 'Run Ruby style checks'
|
||||
RuboCop::RakeTask.new(:ruby)
|
||||
rescue LoadError => e
|
||||
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
||||
end
|
||||
|
||||
begin
|
||||
require 'foodcritic'
|
||||
|
||||
desc 'Run Chef style checks'
|
||||
FoodCritic::Rake::LintTask.new(:chef) do |t|
|
||||
t.options = {
|
||||
fail_tags: ['any'],
|
||||
progress: true,
|
||||
}
|
||||
end
|
||||
rescue LoadError
|
||||
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run all style checks'
|
||||
task style: ['style:chef', 'style:ruby']
|
||||
|
||||
# ChefSpec
|
||||
begin
|
||||
desc 'Run ChefSpec examples'
|
||||
require 'rspec/core/rake_task'
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
rescue LoadError => e
|
||||
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
||||
end
|
||||
|
||||
# Integration tests. Kitchen.ci
|
||||
namespace :integration do
|
||||
begin
|
||||
require 'kitchen/rake_tasks'
|
||||
|
||||
desc 'Run kitchen integration tests'
|
||||
Kitchen::RakeTasks.new
|
||||
rescue StandardError => e
|
||||
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
||||
end
|
||||
end
|
||||
|
||||
namespace :supermarket do
|
||||
begin
|
||||
desc 'Publish cookbook to Supermarket with Stove'
|
||||
require 'stove/rake_task'
|
||||
Stove::RakeTask.new
|
||||
rescue LoadError => e
|
||||
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
||||
end
|
||||
end
|
||||
|
||||
# Default
|
||||
task default: %w(style spec)
|
||||
@@ -1,7 +0,0 @@
|
||||
node.default['ipfs']['version'] = '0.4.17'
|
||||
node.default['ipfs']['checksum'] = '1bb1050ebe74f9042ac721eb1b71f92e1b0e78e54c59dadfde13080facb2901c'
|
||||
# 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']['cluster']['version'] = '0.4.0'
|
||||
@@ -1 +0,0 @@
|
||||
.kitchen
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"name": "ipfs",
|
||||
"description": "Installs/Configures ipfs",
|
||||
"long_description": "# ipfs Cookbook\n\nThis cookbook installs ipfs and starts it as a daemon\n\n## Requirements\n\n### Platforms\n\nThis cookbook is tested on Ubuntu 16.06, 14.04 and Debian 8 using Test Kitchen.\nIt currently only supports 64bit platforms\n\n### Chef\n\n- Chef 12.5 or later (we are providing a\n [Custom Resource](https://docs.chef.io/custom_resources.html) to configure\n IPFS)\n\n### Cookbook dependencies\n\n- `ark` to download and uncompress the Go IPFS package\n\n## Usage\n\n### ipfs::default\n\nJust include `ipfs` in your node's `run_list`:\n\n```json\n{\n \"name\":\"my_node\",\n \"run_list\": [\n \"recipe[ipfs]\"\n ]\n}\n```\n\n## Attributes\n\n- `node.['ipfs']['version']` - the Go IPFS version to download from the official\nsite (64bit)\n- `node['ipfs']['checksum']` - the SHA256 checksum for the package\n- `node['ipfs']['config']['swarm']['addr_filter']` - the network ranges to not\nconnect to. This will stop platforms like Hetzner to block your server\n(https://github.com/ipfs/go-ipfs/issues/1226)\n\n## Resources\n\n`ipfs_config` sets the config. Supports hashes, arrays, booleans and strings.\nDoes not change anything if the config already has that value, and restarts\nthe server automatically\n\n```ruby\nipfs_config \"Gateway.Writable\" do\n value \"true\"\n end\n```\n\n## Running the specs and integrations tests\n\nInstall the latest [Chef DK](https://downloads.chef.io/chefdk).\n\n```\nchef exec delivery local all # Run the linting check, syntax check and unit tests\nkitchen verify # Run the integration tests for Ubuntu 16.04, 18.06 and Debian 9\n```\n\n## License and Authors\n\nAuthors: Kosmos Developers mail@kosmos.org\nCopyright: 2018, [Kosmos Developers](https://kredits.kosmos.org/)\n\n```\nUnless otherwise noted, all files are released under the MIT license, possible\nexceptions will contain licensing information in them.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n",
|
||||
"maintainer": "Kosmos Developers",
|
||||
"maintainer_email": "mail@kosmos.org",
|
||||
"license": "MIT",
|
||||
"platforms": {
|
||||
"[\"ubuntu\", \"debian\"]": ">= 0.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ark": ">= 0.0.0"
|
||||
},
|
||||
"providing": {
|
||||
|
||||
},
|
||||
"attributes": {
|
||||
|
||||
},
|
||||
"recipes": {
|
||||
|
||||
},
|
||||
"version": "0.1.2",
|
||||
"source_url": "https://github.com/67P/ipfs-cookbook",
|
||||
"issues_url": "https://github.com/67P/ipfs-cookbook/issues",
|
||||
"privacy": false,
|
||||
"chef_versions": [
|
||||
[
|
||||
">= 12.14"
|
||||
]
|
||||
],
|
||||
"ohai_versions": [
|
||||
|
||||
],
|
||||
"gems": [
|
||||
|
||||
]
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
name 'ipfs'
|
||||
maintainer 'Kosmos Developers'
|
||||
maintainer_email 'mail@kosmos.org'
|
||||
license 'MIT'
|
||||
description 'Installs/Configures ipfs'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '0.1.2'
|
||||
|
||||
supports %w(ubuntu debian)
|
||||
|
||||
depends 'ark'
|
||||
|
||||
source_url 'https://github.com/67P/ipfs-cookbook'
|
||||
issues_url 'https://github.com/67P/ipfs-cookbook/issues'
|
||||
chef_version '>= 12.14' if respond_to?(:chef_version)
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# Cookbook Name:: ipfs
|
||||
# Recipe:: _user
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
group 'ipfs' do
|
||||
gid 4737
|
||||
end
|
||||
|
||||
user 'ipfs' do
|
||||
comment 'ipfs'
|
||||
uid 4737
|
||||
gid 4737
|
||||
home '/home/ipfs'
|
||||
shell '/bin/bash'
|
||||
manage_home true
|
||||
end
|
||||
@@ -1,48 +0,0 @@
|
||||
#
|
||||
# Cookbook Name:: ipfs
|
||||
# Recipe:: cluster
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
include_recipe 'ipfs::_user'
|
||||
|
||||
version = node['ipfs']['cluster']['version']
|
||||
|
||||
ark 'ipfs-cluster-service' do
|
||||
url "https://dist.ipfs.io/ipfs-cluster-service/v#{version}/ipfs-cluster-service_v#{version}_linux-amd64.tar.gz"
|
||||
has_binaries ['ipfs-cluster-service']
|
||||
end
|
||||
|
||||
ark 'ipfs-cluster-ctl' do
|
||||
url "https://dist.ipfs.io/ipfs-cluster-ctl/v#{version}/ipfs-cluster-ctl_v#{version}_linux-amd64.tar.gz"
|
||||
has_binaries ['ipfs-cluster-ctl']
|
||||
end
|
||||
|
||||
credentials = data_bag_item('credentials', 'ipfs_cluster')
|
||||
|
||||
execute 'ipfs-cluster-service init' do
|
||||
user 'ipfs'
|
||||
environment 'CLUSTER_SECRET' => credentials['secret'],
|
||||
'IPFS_CLUSTER_PATH' => '/home/ipfs/.ipfs-cluster'
|
||||
not_if { File.exist? '/home/ipfs/.ipfs-cluster/service.json' }
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
#
|
||||
# Cookbook Name:: ipfs
|
||||
# Recipe:: cluster_bootstrap
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
include_recipe 'ipfs::_user'
|
||||
|
||||
execute "ipfs-cluster-service daemon --bootstrap #{peer}" do
|
||||
user 'ipfs'
|
||||
environment 'IPFS_CLUSTER_PATH' => '/home/ipfs/.ipfs-cluster'
|
||||
not_if { File.exist? '/home/ipfs/.ipfs-cluster/service.json' }
|
||||
end
|
||||
@@ -1,64 +0,0 @@
|
||||
#
|
||||
# Cookbook Name:: ipfs
|
||||
# Recipe:: cluster_service
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
if platform?('ubuntu') && node['platform_version'].to_f < 15.04 ||
|
||||
platform?('debian') && node['platform_version'].to_f < 8
|
||||
template 'ipfs.initd-cluster.service.erb' do
|
||||
path '/etc/init.d/ipfs-cluster'
|
||||
source 'ipfs-cluster.initd.service.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0750'
|
||||
notifies :restart, 'service[ipfs-cluster]', :delayed
|
||||
end
|
||||
|
||||
service 'ipfs-cluster' do
|
||||
provider Chef::Provider::Service::Init::Debian
|
||||
action [:enable]
|
||||
supports start: true, stop: true, restart: true, reload: false, status: true
|
||||
end
|
||||
|
||||
else
|
||||
execute 'systemctl daemon-reload' do
|
||||
command 'systemctl daemon-reload'
|
||||
action :nothing
|
||||
end
|
||||
|
||||
template 'ipfs-cluster.systemd.service.erb' do
|
||||
path '/lib/systemd/system/ipfs-cluster.service'
|
||||
source 'ipfs-cluster.systemd.service.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
notifies :run, 'execute[systemctl daemon-reload]', :delayed
|
||||
notifies :restart, 'service[ipfs-cluster]', :delayed
|
||||
end
|
||||
|
||||
service 'ipfs-cluster' do
|
||||
provider Chef::Provider::Service::Systemd
|
||||
action [:enable]
|
||||
end
|
||||
end
|
||||
@@ -1,85 +0,0 @@
|
||||
#
|
||||
# Cookbook Name:: ipfs
|
||||
# Recipe:: default
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
include_recipe 'ipfs::_user'
|
||||
|
||||
version = node['ipfs']['version']
|
||||
|
||||
ark 'ipfs' do
|
||||
url "https://dist.ipfs.io/go-ipfs/v#{version}/go-ipfs_v#{version}_linux-amd64.tar.gz"
|
||||
checksum node['ipfs']['checksum']
|
||||
has_binaries ['ipfs']
|
||||
end
|
||||
|
||||
execute 'ipfs init --empty-repo' do
|
||||
environment 'IPFS_PATH' => '/home/ipfs/.ipfs'
|
||||
user 'ipfs'
|
||||
not_if { File.directory? '/home/ipfs/.ipfs' }
|
||||
end
|
||||
|
||||
if platform?('ubuntu') && node['platform_version'].to_f < 15.04 ||
|
||||
platform?('debian') && node['platform_version'].to_f < 8
|
||||
template 'ipfs.initd.service.erb' do
|
||||
path '/etc/init.d/ipfs'
|
||||
source 'ipfs.initd.service.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0750'
|
||||
notifies :restart, 'service[ipfs]', :delayed
|
||||
end
|
||||
|
||||
service 'ipfs' do
|
||||
provider Chef::Provider::Service::Init::Debian
|
||||
action [:enable]
|
||||
supports start: true, stop: true, restart: true, reload: false, status: true
|
||||
end
|
||||
|
||||
else
|
||||
execute 'systemctl daemon-reload' do
|
||||
command 'systemctl daemon-reload'
|
||||
action :nothing
|
||||
end
|
||||
|
||||
template 'ipfs.systemd.service.erb' do
|
||||
path '/lib/systemd/system/ipfs.service'
|
||||
source 'ipfs.systemd.service.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
notifies :run, 'execute[systemctl daemon-reload]', :delayed
|
||||
notifies :restart, 'service[ipfs]', :delayed
|
||||
end
|
||||
|
||||
service 'ipfs' do
|
||||
provider Chef::Provider::Service::Systemd
|
||||
action [:enable]
|
||||
end
|
||||
end
|
||||
|
||||
# Configure ipfs to not contact local network addresses
|
||||
ipfs_config 'Swarm.AddrFilters' do
|
||||
value node['ipfs']['config']['swarm']['addr_filter']
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
require 'json'
|
||||
require 'mixlib/shellout'
|
||||
|
||||
property :key, String, name_property: true
|
||||
property :value, [String, Hash, Array, TrueClass, FalseClass], required: true
|
||||
|
||||
action :create do
|
||||
include_recipe 'ipfs'
|
||||
|
||||
execute "ipfs config --json #{new_resource.key} '#{JSON.generate(new_resource.value)}'" do
|
||||
environment 'IPFS_PATH' => '/home/ipfs/.ipfs'
|
||||
user 'ipfs'
|
||||
not_if do
|
||||
cmd = Mixlib::ShellOut.new('ipfs', 'config', new_resource.key,
|
||||
user: 'ipfs',
|
||||
env: { 'IPFS_PATH' => '/home/ipfs/.ipfs' })
|
||||
cmd.run_command
|
||||
begin
|
||||
JSON.parse(cmd.stdout) == JSON.parse(JSON.generate(new_resource.value))
|
||||
rescue JSON::ParserError
|
||||
cmd.stdout.include?(new_resource.value.to_s)
|
||||
end
|
||||
end
|
||||
notifies :restart, 'service[ipfs]', :delayed
|
||||
end
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
require 'chefspec'
|
||||
require 'chefspec/berkshelf'
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# Cookbook:: ipfs
|
||||
# Spec:: default
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'ipfs::cluster_service' do
|
||||
context 'When all attributes are default, on Ubuntu 16.04' do
|
||||
let(:chef_run) do
|
||||
# for a complete list of available platforms and versions see:
|
||||
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
|
||||
runner = ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04')
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'enables the service' do
|
||||
expect(chef_run).to enable_service('ipfs-cluster')
|
||||
end
|
||||
end
|
||||
|
||||
context 'When all attributes are default, on Ubuntu 18.04' do
|
||||
let(:chef_run) do
|
||||
# for a complete list of available platforms and versions see:
|
||||
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
|
||||
runner = ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '18.04')
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'enables the service' do
|
||||
expect(chef_run).to enable_service('ipfs-cluster')
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# Cookbook:: ipfs
|
||||
# Spec:: default
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright:: 2018, Kosmos Developers
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'ipfs::default' do
|
||||
context 'When all attributes are default, on Ubuntu 16.04' do
|
||||
let(:chef_run) do
|
||||
# for a complete list of available platforms and versions see:
|
||||
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
|
||||
runner = ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04')
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'converges successfully' do
|
||||
expect { chef_run }.to_not raise_error
|
||||
end
|
||||
end
|
||||
|
||||
context 'When all attributes are default, on Ubuntu 18.04' do
|
||||
let(:chef_run) do
|
||||
# for a complete list of available platforms and versions see:
|
||||
# https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
|
||||
runner = ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '18.04')
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'converges successfully' do
|
||||
expect { chef_run }.to_not raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,102 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipfs-cluster daemon
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog $named
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog $named
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Starts the ipfs-cluster daemon
|
||||
# Description: Starts the ipfs-cluster daemon using the start-stop-daemon
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Dylan Powers <dylan.kyle.powers@gmail.com
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
||||
DESC="ipfs-cluster daemon"
|
||||
NAME=ipfs-cluster
|
||||
DAEMON=/usr/local/bin/ipfs-cluster-service
|
||||
DAEMON_ARGS="daemon --upgrade"
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
IPFS_PATH=/home/ipfs/.ipfs
|
||||
IPFS_USER=ipfs
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
# and status_of_proc is working.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start() {
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test >/dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
|
||||
--background --chuid $IPFS_USER --no-close \
|
||||
--exec /usr/bin/env IPFS_PATH="$IPFS_PATH" $DAEMON 2>>$IPFS_PATH/daemon.log 1>/dev/null \
|
||||
-- $DAEMON_ARGS \
|
||||
|| return 2
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop() {
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
|
||||
# Delete the pid
|
||||
rm -f $PIDFILE
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
restart)
|
||||
do_stop
|
||||
do_start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
@@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start ipfs-cluster
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/ipfs-cluster-service daemon --upgrade
|
||||
User=ipfs
|
||||
Group=ipfs
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,102 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipfs daemon
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog $named
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog $named
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Starts the ipfs daemon
|
||||
# Description: Starts the ipfs daemon using the start-stop-daemon
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Dylan Powers <dylan.kyle.powers@gmail.com
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
||||
DESC="ipfs daemon"
|
||||
NAME=ipfs
|
||||
DAEMON=/usr/local/bin/ipfs
|
||||
DAEMON_ARGS="daemon --mount --migrate"
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
IPFS_PATH=/home/ipfs/.ipfs
|
||||
IPFS_USER=ipfs
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
# and status_of_proc is working.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start() {
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test >/dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
|
||||
--background --chuid $IPFS_USER --no-close \
|
||||
--exec /usr/bin/env IPFS_PATH="$IPFS_PATH" $DAEMON 2>>$IPFS_PATH/daemon.log 1>/dev/null \
|
||||
-- $DAEMON_ARGS \
|
||||
|| return 2
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop() {
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
|
||||
# Delete the pid
|
||||
rm -f $PIDFILE
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
restart)
|
||||
do_stop
|
||||
do_start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
@@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start ipfs
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/ipfs daemon --migrate
|
||||
User=ipfs
|
||||
Group=ipfs
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,27 +0,0 @@
|
||||
require 'serverspec'
|
||||
|
||||
# Required by serverspec
|
||||
set :backend, :exec
|
||||
|
||||
describe 'ipfs-cluster-ctl' do
|
||||
# It is in the PATH
|
||||
describe command('which ipfs-cluster-ctl') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'ipfs-cluster-service' do
|
||||
# It is in the PATH
|
||||
describe command('which ipfs-cluster-service') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
it 'is listening on port 9096' do
|
||||
expect(port(9096)).to be_listening
|
||||
end
|
||||
|
||||
it 'runs the ipfs-cluster-service' do
|
||||
expect(service('ipfs-cluster')).to be_running
|
||||
expect(service('ipfs-cluster')).to be_enabled
|
||||
end
|
||||
end
|
||||
@@ -1,30 +0,0 @@
|
||||
I, [2018-08-10T16:28:48.996619 #26331] INFO -- Kitchen: -----> Starting Kitchen (v1.15.0)
|
||||
E, [2018-08-10T16:28:48.997042 #26331] ERROR -- Kitchen: ------Exception-------
|
||||
E, [2018-08-10T16:28:48.997089 #26331] ERROR -- Kitchen: Class: Kitchen::UserError
|
||||
E, [2018-08-10T16:28:48.997122 #26331] ERROR -- Kitchen: Message: Kitchen YAML file /Users/kare/code/kosmos/cookbooks/ipfs/test/integration/data_bags/.kitchen.yml does not exist.
|
||||
E, [2018-08-10T16:28:48.997151 #26331] ERROR -- Kitchen: ----------------------
|
||||
E, [2018-08-10T16:28:48.997178 #26331] ERROR -- Kitchen: ------Backtrace-------
|
||||
E, [2018-08-10T16:28:48.997205 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/loader/yaml.rb:71:in `read'
|
||||
E, [2018-08-10T16:28:48.997239 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/config.rb:152:in `data'
|
||||
E, [2018-08-10T16:28:48.997266 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/config.rb:131:in `suites'
|
||||
E, [2018-08-10T16:28:48.997294 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/config.rb:182:in `filter_instances'
|
||||
E, [2018-08-10T16:28:48.997321 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/config.rb:141:in `build_instances'
|
||||
E, [2018-08-10T16:28:48.997347 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/config.rb:117:in `instances'
|
||||
E, [2018-08-10T16:28:48.997374 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/command.rb:112:in `filtered_instances'
|
||||
E, [2018-08-10T16:28:48.997402 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/command.rb:142:in `parse_subcommand'
|
||||
E, [2018-08-10T16:28:48.997431 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/command/action.rb:35:in `block in call'
|
||||
E, [2018-08-10T16:28:48.997459 #26331] ERROR -- Kitchen: /Users/kare/.rubies/ruby-2.4.2/lib/ruby/2.4.0/benchmark.rb:293:in `measure'
|
||||
E, [2018-08-10T16:28:48.997515 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/command/action.rb:34:in `call'
|
||||
E, [2018-08-10T16:28:48.997566 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/cli.rb:53:in `perform'
|
||||
E, [2018-08-10T16:28:48.997600 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/cli.rb:187:in `block (2 levels) in <class:CLI>'
|
||||
E, [2018-08-10T16:28:48.997631 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
|
||||
E, [2018-08-10T16:28:48.997666 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
|
||||
E, [2018-08-10T16:28:48.997696 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/cli.rb:334:in `invoke_task'
|
||||
E, [2018-08-10T16:28:48.997726 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
|
||||
E, [2018-08-10T16:28:48.997766 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
|
||||
E, [2018-08-10T16:28:48.997796 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/bin/kitchen:13:in `block in <top (required)>'
|
||||
E, [2018-08-10T16:28:48.997826 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/lib/kitchen/errors.rb:171:in `with_friendly_errors'
|
||||
E, [2018-08-10T16:28:48.997855 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/gems/test-kitchen-1.15.0/bin/kitchen:13:in `<top (required)>'
|
||||
E, [2018-08-10T16:28:48.997882 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/bin/kitchen:23:in `load'
|
||||
E, [2018-08-10T16:28:48.997918 #26331] ERROR -- Kitchen: /Users/kare/.gem/ruby/2.4.2/bin/kitchen:23:in `<main>'
|
||||
E, [2018-08-10T16:28:48.997949 #26331] ERROR -- Kitchen: ----End Backtrace-----
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"id": "ipfs_cluster",
|
||||
"secret": "d9de2f31ca7e9989949010fed2e704f42b8e96fa1e8e60a0ad26611f0a01cf07"
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
require 'serverspec'
|
||||
|
||||
# Required by serverspec
|
||||
set :backend, :exec
|
||||
|
||||
describe 'IPFS' do
|
||||
# It is in the PATH
|
||||
describe command('which ipfs') do
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
it 'is listening on port 4001' do
|
||||
expect(port(4001)).to be_listening
|
||||
end
|
||||
|
||||
it 'is listening on port 8080 (gateway)' do
|
||||
expect(port(8080)).to be_listening
|
||||
end
|
||||
|
||||
it 'has a running service of ipfs' do
|
||||
expect(service('ipfs')).to be_running
|
||||
expect(service('ipfs')).to be_enabled
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user