From e2a5262a39a61921c5a6ac6d548362a875c12afe Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 7 Jun 2018 12:29:05 +0200 Subject: [PATCH 01/23] Update IPFS, open its p2p port --- site-cookbooks/ipfs/attributes/default.rb | 4 ++-- site-cookbooks/ipfs/metadata.rb | 1 + site-cookbooks/ipfs/recipes/default.rb | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/site-cookbooks/ipfs/attributes/default.rb b/site-cookbooks/ipfs/attributes/default.rb index 0e575cc..cc8fa5f 100644 --- a/site-cookbooks/ipfs/attributes/default.rb +++ b/site-cookbooks/ipfs/attributes/default.rb @@ -1,5 +1,5 @@ -node.default['ipfs']['version'] = "0.4.9" -node.default['ipfs']['checksum'] = "ae50c760f58548adc7c6dade4cf549059b6bc73ebc25ff4ea9fece06a15ac0a6" +node.default['ipfs']['version'] = "0.4.15" +node.default['ipfs']['checksum'] = "48a81cfc34d3a12c8563dbdfae8681be6e4d23c0664d6a192bc2758c4e4ef377" # 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"]' diff --git a/site-cookbooks/ipfs/metadata.rb b/site-cookbooks/ipfs/metadata.rb index 92e7b3e..bb1868c 100644 --- a/site-cookbooks/ipfs/metadata.rb +++ b/site-cookbooks/ipfs/metadata.rb @@ -9,3 +9,4 @@ version '0.1.0' supports %w(ubuntu debian) depends 'ark' +depends 'firewall' diff --git a/site-cookbooks/ipfs/recipes/default.rb b/site-cookbooks/ipfs/recipes/default.rb index ed48382..3aa72aa 100644 --- a/site-cookbooks/ipfs/recipes/default.rb +++ b/site-cookbooks/ipfs/recipes/default.rb @@ -7,6 +7,8 @@ # All rights reserved - Do Not Redistribute # +include_recipe 'firewall' + version = node["ipfs"]["version"] ark "ipfs" do @@ -72,6 +74,12 @@ else end end +firewall_rule 'ipfs_swarm_p2p' do + port 4001 + protocol :tcp + command :allow +end + # Configure ipfs to not contact local network addresses ipfs_config "Swarm.AddrFilters" do value node['ipfs']['config']['swarm']['addr_filter'] From 7a8042e356a707ad1d8501597b08b1fa9944c6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 6 Aug 2018 18:05:44 +0200 Subject: [PATCH 02/23] Add initial IPFS Cluster support It uses an encrypted data bag to store the cluster secret that has to be the same on all members of a cluster. It installs ipfs-cluster-service and ipfs-cluster-ctl and starts the cluster Refs #25 --- data_bags/credentials/ipfs_cluster.json | 10 ++ site-cookbooks/ipfs/attributes/default.rb | 2 + site-cookbooks/ipfs/recipes/cluster.rb | 68 ++++++++++++ .../default/ipfs-cluster.initd.service.erb | 102 ++++++++++++++++++ .../default/ipfs-cluster.systemd.service.erb | 11 ++ 5 files changed, 193 insertions(+) create mode 100644 data_bags/credentials/ipfs_cluster.json create mode 100644 site-cookbooks/ipfs/recipes/cluster.rb create mode 100644 site-cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb create mode 100644 site-cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb diff --git a/data_bags/credentials/ipfs_cluster.json b/data_bags/credentials/ipfs_cluster.json new file mode 100644 index 0000000..f9b1108 --- /dev/null +++ b/data_bags/credentials/ipfs_cluster.json @@ -0,0 +1,10 @@ +{ + "id": "ipfs_cluster", + "secret": { + "encrypted_data": "oyy8QVRPvMx4YpHVqHr0WxX0D4WQMwZ43A1N+ZFa2jBlB/tzwzIz2gQv05L2\nf/2q4t4yXk6zTJRqPJ9kzcBddJCfuQPr8IzwdOZRz1UdXfE/iYY=\n", + "iv": "8+l2J0qmn6cKmGdf\n", + "auth_tag": "mgzeYpKJk6PSXjdcOP4CEg==\n", + "version": 3, + "cipher": "aes-256-gcm" + } +} \ No newline at end of file diff --git a/site-cookbooks/ipfs/attributes/default.rb b/site-cookbooks/ipfs/attributes/default.rb index 301d7c2..0186fe5 100644 --- a/site-cookbooks/ipfs/attributes/default.rb +++ b/site-cookbooks/ipfs/attributes/default.rb @@ -3,3 +3,5 @@ node.default['ipfs']['checksum'] = "ae50c760f58548adc7c6dade4cf549059b6bc73ebc25 # 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" diff --git a/site-cookbooks/ipfs/recipes/cluster.rb b/site-cookbooks/ipfs/recipes/cluster.rb new file mode 100644 index 0000000..8b68a13 --- /dev/null +++ b/site-cookbooks/ipfs/recipes/cluster.rb @@ -0,0 +1,68 @@ +# +# Cookbook Name:: ipfs +# Recipe:: cluster +# +# Copyright 2018, Kosmos +# +# All rights reserved - Do Not Redistribute +# + +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 + +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 diff --git a/site-cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb b/site-cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb new file mode 100644 index 0000000..1b8c2ff --- /dev/null +++ b/site-cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb @@ -0,0 +1,102 @@ +#!/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 = 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 diff --git a/site-cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb b/site-cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb new file mode 100644 index 0000000..08bf2f0 --- /dev/null +++ b/site-cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb @@ -0,0 +1,11 @@ +[Unit] +Description=Start ipfs-cluster + +[Service] +ExecStart=/usr/local/bin/ipfs-cluster-service daemon +User=ipfs +Group=ipfs +Restart=always + +[Install] +WantedBy=multi-user.target From b36e6a718ab1b6fe36fc7c25df39b464a4306a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 13 Aug 2018 12:03:59 +0200 Subject: [PATCH 03/23] Add a recipe that sets up the cluster and enables the firewall --- site-cookbooks/kosmos-ipfs/metadata.rb | 1 + site-cookbooks/kosmos-ipfs/recipes/cluster.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 site-cookbooks/kosmos-ipfs/recipes/cluster.rb diff --git a/site-cookbooks/kosmos-ipfs/metadata.rb b/site-cookbooks/kosmos-ipfs/metadata.rb index 73a6747..7578a26 100644 --- a/site-cookbooks/kosmos-ipfs/metadata.rb +++ b/site-cookbooks/kosmos-ipfs/metadata.rb @@ -9,3 +9,4 @@ version '0.1.0' depends 'ipfs' depends 'kosmos-base' depends 'kosmos-nginx' +depends 'firewall' diff --git a/site-cookbooks/kosmos-ipfs/recipes/cluster.rb b/site-cookbooks/kosmos-ipfs/recipes/cluster.rb new file mode 100644 index 0000000..a1ce6d7 --- /dev/null +++ b/site-cookbooks/kosmos-ipfs/recipes/cluster.rb @@ -0,0 +1,19 @@ +# +# Cookbook Name:: kosmos-ipfs +# Recipe:: cluster +# +# Copyright 2018, Kosmos +# +# All rights reserved - Do Not Redistribute +# + +include_recipe "ipfs::cluster" + +unless node.chef_environment == "development" + include_recipe "firewall" + firewall_rule 'ipfs_cluster' do + port 9096 + protocol :tcp + command :allow + end +end From de32a7c5959250a977a9312365be7b0bb25d1625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 13 Aug 2018 12:05:11 +0200 Subject: [PATCH 04/23] Remove the Let's Encrypt recipe from the default one We only need one node with a TLS cert --- site-cookbooks/kosmos-ipfs/recipes/default.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/site-cookbooks/kosmos-ipfs/recipes/default.rb b/site-cookbooks/kosmos-ipfs/recipes/default.rb index 23480d7..b35e959 100644 --- a/site-cookbooks/kosmos-ipfs/recipes/default.rb +++ b/site-cookbooks/kosmos-ipfs/recipes/default.rb @@ -32,5 +32,3 @@ end ipfs_config "API.HTTPHeaders.Access-Control-Allow-Origin" do value ["*"] end - -include_recipe "kosmos-ipfs::letsencrypt" From 741c4a5192e08cd5aeadc3eb59aece3670fb39d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 13 Aug 2018 12:05:50 +0200 Subject: [PATCH 05/23] Move the ipfs cookbook to its own GitHub repository --- Berksfile | 6 +- Berksfile.lock | 6 + cookbooks/ipfs/.delivery/project.toml | 1 + {site-cookbooks => cookbooks}/ipfs/.gitignore | 0 cookbooks/ipfs/.kitchen.dokken.yml | 40 ++++++ .../ipfs/.kitchen.yml | 9 +- cookbooks/ipfs/.travis.yml | 39 +++++ cookbooks/ipfs/Berksfile | 3 + .../ipfs/Berksfile.lock | 17 +-- .../ipfs/CHANGELOG.md | 0 {site-cookbooks => cookbooks}/ipfs/LICENSE | 0 {site-cookbooks => cookbooks}/ipfs/README.md | 9 ++ {site-cookbooks => cookbooks}/ipfs/Rakefile | 0 cookbooks/ipfs/attributes/default.rb | 7 + {site-cookbooks => cookbooks}/ipfs/chefignore | 0 cookbooks/ipfs/metadata.json | 45 ++++++ cookbooks/ipfs/recipes/_user.rb | 30 ++++ cookbooks/ipfs/recipes/cluster.rb | 41 ++++++ cookbooks/ipfs/recipes/cluster_bootstrap.rb | 26 ++++ cookbooks/ipfs/recipes/cluster_service.rb | 57 ++++++++ cookbooks/ipfs/recipes/default.rb | 78 ++++++++++ cookbooks/ipfs/resources/config.rb | 26 ++++ cookbooks/ipfs/spec/spec_helper.rb | 3 + .../spec/unit/recipes/cluster_service_spec.rb | 48 +++++++ .../ipfs/spec/unit/recipes/default_spec.rb | 48 +++++++ .../default/ipfs-cluster.initd.service.erb | 0 .../default/ipfs-cluster.systemd.service.erb | 0 .../templates/default/ipfs.initd.service.erb | 0 .../default/ipfs.systemd.service.erb | 0 .../cluster/serverspec/ipfs_cluster_spec.rb | 27 ++++ .../data_bags/.kitchen/logs/kitchen.log | 30 ++++ .../data_bags/credentials/ipfs_cluster.json | 4 + .../default/serverspec/ipfs_spec.rb | 24 ++++ site-cookbooks/ipfs/.kitchen.docker.yml | 44 ------ site-cookbooks/ipfs/.travis.yml | 50 ------- site-cookbooks/ipfs/Berksfile | 3 - site-cookbooks/ipfs/Gemfile | 6 - site-cookbooks/ipfs/Gemfile.lock | 134 ------------------ site-cookbooks/ipfs/attributes/default.rb | 7 - site-cookbooks/ipfs/metadata.rb | 11 -- site-cookbooks/ipfs/recipes/cluster.rb | 68 --------- site-cookbooks/ipfs/recipes/default.rb | 78 ---------- site-cookbooks/ipfs/resources/config.rb | 26 ---- .../default/serverspec/ipfs_spec.rb | 24 ---- 44 files changed, 610 insertions(+), 465 deletions(-) create mode 100644 cookbooks/ipfs/.delivery/project.toml rename {site-cookbooks => cookbooks}/ipfs/.gitignore (100%) create mode 100644 cookbooks/ipfs/.kitchen.dokken.yml rename {site-cookbooks => cookbooks}/ipfs/.kitchen.yml (53%) create mode 100644 cookbooks/ipfs/.travis.yml create mode 100644 cookbooks/ipfs/Berksfile rename {site-cookbooks => cookbooks}/ipfs/Berksfile.lock (52%) rename {site-cookbooks => cookbooks}/ipfs/CHANGELOG.md (100%) rename {site-cookbooks => cookbooks}/ipfs/LICENSE (100%) rename {site-cookbooks => cookbooks}/ipfs/README.md (86%) rename {site-cookbooks => cookbooks}/ipfs/Rakefile (100%) create mode 100644 cookbooks/ipfs/attributes/default.rb rename {site-cookbooks => cookbooks}/ipfs/chefignore (100%) create mode 100644 cookbooks/ipfs/metadata.json create mode 100644 cookbooks/ipfs/recipes/_user.rb create mode 100644 cookbooks/ipfs/recipes/cluster.rb create mode 100644 cookbooks/ipfs/recipes/cluster_bootstrap.rb create mode 100644 cookbooks/ipfs/recipes/cluster_service.rb create mode 100644 cookbooks/ipfs/recipes/default.rb create mode 100644 cookbooks/ipfs/resources/config.rb create mode 100644 cookbooks/ipfs/spec/spec_helper.rb create mode 100644 cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb create mode 100644 cookbooks/ipfs/spec/unit/recipes/default_spec.rb rename {site-cookbooks => cookbooks}/ipfs/templates/default/ipfs-cluster.initd.service.erb (100%) rename {site-cookbooks => cookbooks}/ipfs/templates/default/ipfs-cluster.systemd.service.erb (100%) rename {site-cookbooks => cookbooks}/ipfs/templates/default/ipfs.initd.service.erb (100%) rename {site-cookbooks => cookbooks}/ipfs/templates/default/ipfs.systemd.service.erb (100%) create mode 100644 cookbooks/ipfs/test/integration/cluster/serverspec/ipfs_cluster_spec.rb create mode 100644 cookbooks/ipfs/test/integration/data_bags/.kitchen/logs/kitchen.log create mode 100644 cookbooks/ipfs/test/integration/data_bags/credentials/ipfs_cluster.json create mode 100644 cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb delete mode 100644 site-cookbooks/ipfs/.kitchen.docker.yml delete mode 100644 site-cookbooks/ipfs/.travis.yml delete mode 100644 site-cookbooks/ipfs/Berksfile delete mode 100644 site-cookbooks/ipfs/Gemfile delete mode 100644 site-cookbooks/ipfs/Gemfile.lock delete mode 100644 site-cookbooks/ipfs/attributes/default.rb delete mode 100644 site-cookbooks/ipfs/metadata.rb delete mode 100644 site-cookbooks/ipfs/recipes/cluster.rb delete mode 100644 site-cookbooks/ipfs/recipes/default.rb delete mode 100644 site-cookbooks/ipfs/resources/config.rb delete mode 100644 site-cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb diff --git a/Berksfile b/Berksfile index 88871ab..f542d9e 100644 --- a/Berksfile +++ b/Berksfile @@ -23,7 +23,8 @@ cookbook 'application_git', '= 1.1.0' # 1.2.0 doesn't work with knife-sol cookbook 'poise', '~> 2.8.1' cookbook 'poise-languages', '~> 2.1.1' cookbook 'poise-ruby', '~> 2.4.0' -cookbook 'poise-javascript', '~> 1.2.0' +cookbook 'poise-javascript', git: 'https://github.com/poise/poise-javascript.git', + ref: 'b349e7b7e04edf495398a5f9415a4f8bb4b1badb' cookbook 'poise-archive', '~> 1.5.0' cookbook 'poise-service', '~> 1.5.2' cookbook 'users', '~> 5.3.1' @@ -61,3 +62,6 @@ cookbook 'windows', '= 3.1.1' cookbook 'iis', '= 6.7.1' cookbook 'mariadb', '= 0.3.1' cookbook 'mingw', '= 2.0.0' +cookbook 'ipfs', + git: 'https://github.com/67P/ipfs-cookbook.git', + ref: 'master' diff --git a/Berksfile.lock b/Berksfile.lock index 26823ae..f2aa4b3 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -20,6 +20,10 @@ DEPENDENCIES hostname (= 0.4.2) hostsfile (= 2.4.5) iis (= 6.7.1) + ipfs + git: https://github.com/67P/ipfs-cookbook.git + revision: 5578cada684fdab36c0b3c1e6e2acdde10f96947 + ref: master logrotate (= 2.2.0) mariadb (= 0.3.1) mediawiki @@ -116,6 +120,8 @@ GRAPH hostsfile (2.4.5) iis (6.7.1) windows (>= 2.0) + ipfs (0.1.0) + ark (>= 0.0.0) logrotate (2.2.0) mariadb (0.3.1) apt (>= 0.0.0) diff --git a/cookbooks/ipfs/.delivery/project.toml b/cookbooks/ipfs/.delivery/project.toml new file mode 100644 index 0000000..6d5e361 --- /dev/null +++ b/cookbooks/ipfs/.delivery/project.toml @@ -0,0 +1 @@ +remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml" diff --git a/site-cookbooks/ipfs/.gitignore b/cookbooks/ipfs/.gitignore similarity index 100% rename from site-cookbooks/ipfs/.gitignore rename to cookbooks/ipfs/.gitignore diff --git a/cookbooks/ipfs/.kitchen.dokken.yml b/cookbooks/ipfs/.kitchen.dokken.yml new file mode 100644 index 0000000..856fa9a --- /dev/null +++ b/cookbooks/ipfs/.kitchen.dokken.yml @@ -0,0 +1,40 @@ +--- +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: diff --git a/site-cookbooks/ipfs/.kitchen.yml b/cookbooks/ipfs/.kitchen.yml similarity index 53% rename from site-cookbooks/ipfs/.kitchen.yml rename to cookbooks/ipfs/.kitchen.yml index 493932a..5c9425c 100644 --- a/site-cookbooks/ipfs/.kitchen.yml +++ b/cookbooks/ipfs/.kitchen.yml @@ -6,12 +6,17 @@ provisioner: name: chef_zero platforms: - - name: ubuntu-14.04 - name: ubuntu-16.04 - - name: debian-8.7 + - 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: diff --git a/cookbooks/ipfs/.travis.yml b/cookbooks/ipfs/.travis.yml new file mode 100644 index 0000000..c323b91 --- /dev/null +++ b/cookbooks/ipfs/.travis.yml @@ -0,0 +1,39 @@ +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 diff --git a/cookbooks/ipfs/Berksfile b/cookbooks/ipfs/Berksfile new file mode 100644 index 0000000..44bc4fc --- /dev/null +++ b/cookbooks/ipfs/Berksfile @@ -0,0 +1,3 @@ +source 'https://api.berkshelf.com' + +metadata diff --git a/site-cookbooks/ipfs/Berksfile.lock b/cookbooks/ipfs/Berksfile.lock similarity index 52% rename from site-cookbooks/ipfs/Berksfile.lock rename to cookbooks/ipfs/Berksfile.lock index b57f089..6bea0a7 100644 --- a/site-cookbooks/ipfs/Berksfile.lock +++ b/cookbooks/ipfs/Berksfile.lock @@ -4,21 +4,16 @@ DEPENDENCIES metadata: true GRAPH - ark (2.2.1) + ark (4.0.0) build-essential (>= 0.0.0) seven_zip (>= 0.0.0) - windows (>= 0.0.0) - build-essential (8.0.0) + build-essential (8.1.1) mingw (>= 1.1) seven_zip (>= 0.0.0) - compat_resource (12.16.3) ipfs (0.1.0) ark (>= 0.0.0) - mingw (1.2.5) - compat_resource (>= 12.16.3) + mingw (2.1.0) seven_zip (>= 0.0.0) - ohai (5.0.0) - seven_zip (2.0.2) - windows (>= 1.2.2) - windows (2.1.1) - ohai (>= 4.0.0) + seven_zip (3.0.0) + windows (>= 0.0.0) + windows (5.0.0) diff --git a/site-cookbooks/ipfs/CHANGELOG.md b/cookbooks/ipfs/CHANGELOG.md similarity index 100% rename from site-cookbooks/ipfs/CHANGELOG.md rename to cookbooks/ipfs/CHANGELOG.md diff --git a/site-cookbooks/ipfs/LICENSE b/cookbooks/ipfs/LICENSE similarity index 100% rename from site-cookbooks/ipfs/LICENSE rename to cookbooks/ipfs/LICENSE diff --git a/site-cookbooks/ipfs/README.md b/cookbooks/ipfs/README.md similarity index 86% rename from site-cookbooks/ipfs/README.md rename to cookbooks/ipfs/README.md index ed9024b..9c48257 100644 --- a/site-cookbooks/ipfs/README.md +++ b/cookbooks/ipfs/README.md @@ -55,6 +55,15 @@ ipfs_config "Gateway.Writable" do 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 diff --git a/site-cookbooks/ipfs/Rakefile b/cookbooks/ipfs/Rakefile similarity index 100% rename from site-cookbooks/ipfs/Rakefile rename to cookbooks/ipfs/Rakefile diff --git a/cookbooks/ipfs/attributes/default.rb b/cookbooks/ipfs/attributes/default.rb new file mode 100644 index 0000000..f6e82fb --- /dev/null +++ b/cookbooks/ipfs/attributes/default.rb @@ -0,0 +1,7 @@ +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']['cluster']['version'] = '0.4.0' diff --git a/site-cookbooks/ipfs/chefignore b/cookbooks/ipfs/chefignore similarity index 100% rename from site-cookbooks/ipfs/chefignore rename to cookbooks/ipfs/chefignore diff --git a/cookbooks/ipfs/metadata.json b/cookbooks/ipfs/metadata.json new file mode 100644 index 0000000..356d4f1 --- /dev/null +++ b/cookbooks/ipfs/metadata.json @@ -0,0 +1,45 @@ +{ + "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 [https://docs.chef.io/custom_resources.html](Custom Resource) 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\n\n```\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n", + "maintainer": "Kosmos", + "maintainer_email": "mail@kosmos.org", + "license": "Apache-2.0", + "platforms": { + "[\"ubuntu\", \"debian\"]": ">= 0.0.0" + }, + "dependencies": { + "ark": ">= 0.0.0" + }, + "recommendations": { + }, + "suggestions": { + }, + "conflicting": { + }, + "providing": { + }, + "replacing": { + }, + "attributes": { + }, + "groupings": { + }, + "recipes": { + }, + "version": "0.1.0", + "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": [ + + ] +} \ No newline at end of file diff --git a/cookbooks/ipfs/recipes/_user.rb b/cookbooks/ipfs/recipes/_user.rb new file mode 100644 index 0000000..d4da731 --- /dev/null +++ b/cookbooks/ipfs/recipes/_user.rb @@ -0,0 +1,30 @@ +# +# Cookbook Name:: ipfs +# Recipe:: _user +# +# Copyright 2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +group 'ipfs' do + gid 4737 +end + +user 'ipfs' do + comment 'ipfs' + uid 4737 + gid 4737 + home '/home/ipfs' + manage_home true +end diff --git a/cookbooks/ipfs/recipes/cluster.rb b/cookbooks/ipfs/recipes/cluster.rb new file mode 100644 index 0000000..fde4cae --- /dev/null +++ b/cookbooks/ipfs/recipes/cluster.rb @@ -0,0 +1,41 @@ +# +# Cookbook Name:: ipfs +# Recipe:: cluster +# +# Copyright 2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +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 diff --git a/cookbooks/ipfs/recipes/cluster_bootstrap.rb b/cookbooks/ipfs/recipes/cluster_bootstrap.rb new file mode 100644 index 0000000..1d784a0 --- /dev/null +++ b/cookbooks/ipfs/recipes/cluster_bootstrap.rb @@ -0,0 +1,26 @@ +# +# Cookbook Name:: ipfs +# Recipe:: cluster_bootstrap +# +# Copyright 2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +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 diff --git a/cookbooks/ipfs/recipes/cluster_service.rb b/cookbooks/ipfs/recipes/cluster_service.rb new file mode 100644 index 0000000..c2a73f0 --- /dev/null +++ b/cookbooks/ipfs/recipes/cluster_service.rb @@ -0,0 +1,57 @@ +# +# Cookbook Name:: ipfs +# Recipe:: cluster_service +# +# Copyright 2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +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 diff --git a/cookbooks/ipfs/recipes/default.rb b/cookbooks/ipfs/recipes/default.rb new file mode 100644 index 0000000..97be32b --- /dev/null +++ b/cookbooks/ipfs/recipes/default.rb @@ -0,0 +1,78 @@ +# +# Cookbook Name:: ipfs +# Recipe:: default +# +# Copyright 2017-2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +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 diff --git a/cookbooks/ipfs/resources/config.rb b/cookbooks/ipfs/resources/config.rb new file mode 100644 index 0000000..67d4756 --- /dev/null +++ b/cookbooks/ipfs/resources/config.rb @@ -0,0 +1,26 @@ +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 diff --git a/cookbooks/ipfs/spec/spec_helper.rb b/cookbooks/ipfs/spec/spec_helper.rb new file mode 100644 index 0000000..052d78a --- /dev/null +++ b/cookbooks/ipfs/spec/spec_helper.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true +require 'chefspec' +require 'chefspec/berkshelf' diff --git a/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb b/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb new file mode 100644 index 0000000..f4f7047 --- /dev/null +++ b/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb @@ -0,0 +1,48 @@ +# +# Cookbook:: ipfs +# Spec:: default +# +# Copyright 2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +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 diff --git a/cookbooks/ipfs/spec/unit/recipes/default_spec.rb b/cookbooks/ipfs/spec/unit/recipes/default_spec.rb new file mode 100644 index 0000000..4c9264b --- /dev/null +++ b/cookbooks/ipfs/spec/unit/recipes/default_spec.rb @@ -0,0 +1,48 @@ +# +# Cookbook:: ipfs +# Spec:: default +# +# Copyright 2018, Kosmos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +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 diff --git a/site-cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb b/cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb similarity index 100% rename from site-cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb rename to cookbooks/ipfs/templates/default/ipfs-cluster.initd.service.erb diff --git a/site-cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb b/cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb similarity index 100% rename from site-cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb rename to cookbooks/ipfs/templates/default/ipfs-cluster.systemd.service.erb diff --git a/site-cookbooks/ipfs/templates/default/ipfs.initd.service.erb b/cookbooks/ipfs/templates/default/ipfs.initd.service.erb similarity index 100% rename from site-cookbooks/ipfs/templates/default/ipfs.initd.service.erb rename to cookbooks/ipfs/templates/default/ipfs.initd.service.erb diff --git a/site-cookbooks/ipfs/templates/default/ipfs.systemd.service.erb b/cookbooks/ipfs/templates/default/ipfs.systemd.service.erb similarity index 100% rename from site-cookbooks/ipfs/templates/default/ipfs.systemd.service.erb rename to cookbooks/ipfs/templates/default/ipfs.systemd.service.erb diff --git a/cookbooks/ipfs/test/integration/cluster/serverspec/ipfs_cluster_spec.rb b/cookbooks/ipfs/test/integration/cluster/serverspec/ipfs_cluster_spec.rb new file mode 100644 index 0000000..23ba688 --- /dev/null +++ b/cookbooks/ipfs/test/integration/cluster/serverspec/ipfs_cluster_spec.rb @@ -0,0 +1,27 @@ +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 diff --git a/cookbooks/ipfs/test/integration/data_bags/.kitchen/logs/kitchen.log b/cookbooks/ipfs/test/integration/data_bags/.kitchen/logs/kitchen.log new file mode 100644 index 0000000..3f6cf59 --- /dev/null +++ b/cookbooks/ipfs/test/integration/data_bags/.kitchen/logs/kitchen.log @@ -0,0 +1,30 @@ +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 ' +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 ' +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 `' +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 `
' +E, [2018-08-10T16:28:48.997949 #26331] ERROR -- Kitchen: ----End Backtrace----- diff --git a/cookbooks/ipfs/test/integration/data_bags/credentials/ipfs_cluster.json b/cookbooks/ipfs/test/integration/data_bags/credentials/ipfs_cluster.json new file mode 100644 index 0000000..d2458b2 --- /dev/null +++ b/cookbooks/ipfs/test/integration/data_bags/credentials/ipfs_cluster.json @@ -0,0 +1,4 @@ +{ + "id": "ipfs_cluster", + "secret": "d9de2f31ca7e9989949010fed2e704f42b8e96fa1e8e60a0ad26611f0a01cf07" +} diff --git a/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb b/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb new file mode 100644 index 0000000..7db110d --- /dev/null +++ b/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb @@ -0,0 +1,24 @@ +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 diff --git a/site-cookbooks/ipfs/.kitchen.docker.yml b/site-cookbooks/ipfs/.kitchen.docker.yml deleted file mode 100644 index 2eacee8..0000000 --- a/site-cookbooks/ipfs/.kitchen.docker.yml +++ /dev/null @@ -1,44 +0,0 @@ -me: dokken - privileged: true # because Docker and SystemD/Upstart - chef_image: chef/chef - chef_version: current - -transport: - name: dokken - -provisioner: - name: dokken - -platforms: -- name: debian-7 - driver: - image: debian:7 - pid_one_command: /sbin/init - intermediate_instructions: - - RUN /usr/bin/apt-get update - -- name: debian-8 - driver: - image: debian:8 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update - -- name: ubuntu-14.04 - driver: - image: ubuntu-upstart:14.04 - pid_one_command: /sbin/init - intermediate_instructions: - - RUN /usr/bin/apt-get update - -- name: ubuntu-16.04 - driver: - image: ubuntu:16.04 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update - -suites: -- name: default - run_list: - - recipe[ipfs] diff --git a/site-cookbooks/ipfs/.travis.yml b/site-cookbooks/ipfs/.travis.yml deleted file mode 100644 index 4ec0c53..0000000 --- a/site-cookbooks/ipfs/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: required -dist: trusty - -# install the pre-release chef-dk. Use chef-stable-trusty to install the stable release -addons: - apt: - sources: - - chef-stable-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-centos-5 times out for no reason - - INSTANCE=default-centos-6 - - INSTANCE=default-centos-7 - - INSTANCE=default-debian-7 - - INSTANCE=default-debian-8 - - INSTANCE=default-fedora-latest - - INSTANCE=default-opensuse-132 - - INSTANCE=default-opensuse-421 - - INSTANCE=default-ubuntu-1204 - - INSTANCE=default-ubuntu-1404 - - INSTANCE=default-ubuntu-1604 - -before_script: - - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER ) - - eval "$(/opt/chefdk/bin/chef shell-init bash)" - -script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE} - -matrix: - include: - - before_script: - - eval "$(/opt/chefdk/bin/chef shell-init bash)" - - /opt/chefdk/embedded/bin/chef --version - - /opt/chefdk/embedded/bin/cookstyle --version - - /opt/chefdk/embedded/bin/foodcritic --version - - script: - - /opt/chefdk/bin/chef exec rake -env: UNIT_AND_LINT=1 diff --git a/site-cookbooks/ipfs/Berksfile b/site-cookbooks/ipfs/Berksfile deleted file mode 100644 index 2e1a070..0000000 --- a/site-cookbooks/ipfs/Berksfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://api.berkshelf.com" - -metadata diff --git a/site-cookbooks/ipfs/Gemfile b/site-cookbooks/ipfs/Gemfile deleted file mode 100644 index 01382a5..0000000 --- a/site-cookbooks/ipfs/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gem "rake" -gem "test-kitchen" -gem "kitchen-vagrant" -gem "berkshelf" diff --git a/site-cookbooks/ipfs/Gemfile.lock b/site-cookbooks/ipfs/Gemfile.lock deleted file mode 100644 index e760d2b..0000000 --- a/site-cookbooks/ipfs/Gemfile.lock +++ /dev/null @@ -1,134 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.5.0) - public_suffix (~> 2.0, >= 2.0.2) - artifactory (2.7.0) - berkshelf (5.2.0) - addressable (~> 2.3, >= 2.3.4) - berkshelf-api-client (>= 2.0.2, < 4.0) - buff-config (~> 2.0) - buff-extensions (~> 2.0) - buff-shell_out (~> 1.0) - cleanroom (~> 1.0) - faraday (~> 0.9) - httpclient (~> 2.7) - minitar (~> 0.5, >= 0.5.4) - mixlib-archive (~> 0.1) - octokit (~> 4.0) - retryable (~> 2.0) - ridley (~> 5.0) - solve (> 2.0, < 4.0) - thor (~> 0.19) - berkshelf-api-client (3.0.0) - faraday (~> 0.9) - httpclient (~> 2.7) - ridley (>= 4.5, < 6.0) - buff-config (2.0.0) - buff-extensions (~> 2.0) - varia_model (~> 0.6) - buff-extensions (2.0.0) - buff-ignore (1.2.0) - buff-ruby_engine (1.0.0) - buff-shell_out (1.1.0) - buff-ruby_engine (~> 1.0) - celluloid (0.16.0) - timers (~> 4.0.0) - celluloid-io (0.16.2) - celluloid (>= 0.16.0) - nio4r (>= 1.1.0) - chef-config (12.19.36) - addressable - fuzzyurl - mixlib-config (~> 2.0) - mixlib-shellout (~> 2.0) - cleanroom (1.0.0) - erubis (2.7.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - fuzzyurl (0.9.0) - hashie (3.5.5) - hitimes (1.2.4) - httpclient (2.8.3) - json (2.0.3) - kitchen-vagrant (1.0.2) - test-kitchen (~> 1.4) - minitar (0.6.1) - mixlib-archive (0.4.1) - mixlib-log - mixlib-authentication (1.4.1) - mixlib-log - mixlib-config (2.2.4) - mixlib-install (2.1.12) - artifactory - mixlib-shellout - mixlib-versioning - thor - mixlib-log (1.7.1) - mixlib-shellout (2.2.7) - mixlib-versioning (1.1.0) - molinillo (0.5.6) - multipart-post (2.0.0) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (4.1.0) - net-ssh-gateway (1.3.0) - net-ssh (>= 2.6.5) - nio4r (2.0.0) - octokit (4.6.2) - sawyer (~> 0.8.0, >= 0.5.3) - public_suffix (2.0.5) - rake (11.3.0) - retryable (2.0.4) - ridley (5.1.0) - addressable - buff-config (~> 2.0) - buff-extensions (~> 2.0) - buff-ignore (~> 1.2) - buff-shell_out (~> 1.0) - celluloid (~> 0.16.0) - celluloid-io (~> 0.16.1) - chef-config (>= 12.5.0) - erubis - faraday (~> 0.9.0) - hashie (>= 2.0.2, < 4.0.0) - httpclient (~> 2.7) - json (>= 1.7.7) - mixlib-authentication (>= 1.3.0) - retryable (~> 2.0) - semverse (~> 2.0) - varia_model (~> 0.6) - safe_yaml (1.0.4) - sawyer (0.8.1) - addressable (>= 2.3.5, < 2.6) - faraday (~> 0.8, < 1.0) - semverse (2.0.0) - solve (3.1.0) - molinillo (>= 0.5) - semverse (>= 1.1, < 3.0) - test-kitchen (1.15.0) - mixlib-install (>= 1.2, < 3.0) - mixlib-shellout (>= 1.2, < 3.0) - net-scp (~> 1.1) - net-ssh (>= 2.9, < 5.0) - net-ssh-gateway (~> 1.2) - safe_yaml (~> 1.0) - thor (~> 0.18) - thor (0.19.4) - timers (4.0.4) - hitimes - varia_model (0.6.0) - buff-extensions (~> 2.0) - hashie (>= 2.0.2, < 4.0.0) - -PLATFORMS - ruby - -DEPENDENCIES - berkshelf - kitchen-vagrant - rake - test-kitchen - -BUNDLED WITH - 1.14.3 diff --git a/site-cookbooks/ipfs/attributes/default.rb b/site-cookbooks/ipfs/attributes/default.rb deleted file mode 100644 index 0186fe5..0000000 --- a/site-cookbooks/ipfs/attributes/default.rb +++ /dev/null @@ -1,7 +0,0 @@ -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']['cluster']['version'] = "0.4.0" diff --git a/site-cookbooks/ipfs/metadata.rb b/site-cookbooks/ipfs/metadata.rb deleted file mode 100644 index 92e7b3e..0000000 --- a/site-cookbooks/ipfs/metadata.rb +++ /dev/null @@ -1,11 +0,0 @@ -name 'ipfs' -maintainer 'Kosmos' -maintainer_email 'mail@kosmos.org' -license 'Apache 2.0' -description 'Installs/Configures ipfs' -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.1.0' - -supports %w(ubuntu debian) - -depends 'ark' diff --git a/site-cookbooks/ipfs/recipes/cluster.rb b/site-cookbooks/ipfs/recipes/cluster.rb deleted file mode 100644 index 8b68a13..0000000 --- a/site-cookbooks/ipfs/recipes/cluster.rb +++ /dev/null @@ -1,68 +0,0 @@ -# -# Cookbook Name:: ipfs -# Recipe:: cluster -# -# Copyright 2018, Kosmos -# -# All rights reserved - Do Not Redistribute -# - -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 - -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 diff --git a/site-cookbooks/ipfs/recipes/default.rb b/site-cookbooks/ipfs/recipes/default.rb deleted file mode 100644 index ed48382..0000000 --- a/site-cookbooks/ipfs/recipes/default.rb +++ /dev/null @@ -1,78 +0,0 @@ -# -# Cookbook Name:: ipfs -# Recipe:: default -# -# Copyright 2017, Kosmos -# -# All rights reserved - Do Not Redistribute -# - -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 - -group "ipfs" do - gid 4737 -end - -user "ipfs" do - comment "ipfs" - uid 4737 - gid 4737 - home "/home/ipfs" - manage_home true -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 diff --git a/site-cookbooks/ipfs/resources/config.rb b/site-cookbooks/ipfs/resources/config.rb deleted file mode 100644 index 1bdc74c..0000000 --- a/site-cookbooks/ipfs/resources/config.rb +++ /dev/null @@ -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 #{key} '#{JSON.generate(value)}'" do - environment "IPFS_PATH" => "/home/ipfs/.ipfs" - user "ipfs" - not_if do - cmd = Mixlib::ShellOut.new("ipfs", "config", key, - user: 'ipfs', - env: { "IPFS_PATH" => "/home/ipfs/.ipfs" }) - cmd.run_command - begin - JSON.parse(cmd.stdout) == JSON.parse(JSON.generate(value)) - rescue JSON::ParserError - cmd.stdout.include?("#{value}") - end - end - notifies :restart, "service[ipfs]", :delayed - end -end diff --git a/site-cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb b/site-cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb deleted file mode 100644 index ab11365..0000000 --- a/site-cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb +++ /dev/null @@ -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 From f31322ab816b71ae7afc9262b6d428bad5b14094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 16 Aug 2018 15:59:06 +0200 Subject: [PATCH 06/23] Move the firewall rule for ipfs p2p to the right recipe --- site-cookbooks/kosmos-hubot/recipes/default.rb | 5 ----- site-cookbooks/kosmos-ipfs/recipes/default.rb | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/site-cookbooks/kosmos-hubot/recipes/default.rb b/site-cookbooks/kosmos-hubot/recipes/default.rb index 3b2fa45..5560692 100644 --- a/site-cookbooks/kosmos-hubot/recipes/default.rb +++ b/site-cookbooks/kosmos-hubot/recipes/default.rb @@ -14,11 +14,6 @@ unless node.chef_environment == "development" protocol :tcp command :allow end - firewall_rule 'ipfs_swarm_p2p' do - port 4001 - protocol :tcp - command :allow - end end include_recipe "kosmos-nodejs" diff --git a/site-cookbooks/kosmos-ipfs/recipes/default.rb b/site-cookbooks/kosmos-ipfs/recipes/default.rb index b35e959..2cf553d 100644 --- a/site-cookbooks/kosmos-ipfs/recipes/default.rb +++ b/site-cookbooks/kosmos-ipfs/recipes/default.rb @@ -32,3 +32,12 @@ end ipfs_config "API.HTTPHeaders.Access-Control-Allow-Origin" do value ["*"] end + +unless node.chef_environment == "development" + include_recipe 'firewall' + firewall_rule 'ipfs_swarm_p2p' do + port 4001 + protocol :tcp + command :allow + end +end 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 07/23] 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 From f6261318686999286d5e682866414ca40c057407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 16 Aug 2018 16:00:44 +0200 Subject: [PATCH 08/23] Build a cluster node on Andromeda --- nodes/andromeda.kosmos.org.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes/andromeda.kosmos.org.json b/nodes/andromeda.kosmos.org.json index 797ac0f..d979e2c 100644 --- a/nodes/andromeda.kosmos.org.json +++ b/nodes/andromeda.kosmos.org.json @@ -2,7 +2,7 @@ "run_list": [ "kosmos-base", "kosmos-base::andromeda_firewall", - "kosmos-ipfs" + "role[ipfs_cluster_with_tls]" ], "automatic": { "ipaddress": "andromeda.kosmos.org" From 1f528a832d87da56eeb8c81cab0d6c318a2239fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 16 Aug 2018 16:01:24 +0200 Subject: [PATCH 09/23] Add a role to set up a cluster node with TLS --- roles/ipfs_cluster_with_tls.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 roles/ipfs_cluster_with_tls.rb diff --git a/roles/ipfs_cluster_with_tls.rb b/roles/ipfs_cluster_with_tls.rb new file mode 100644 index 0000000..70e3901 --- /dev/null +++ b/roles/ipfs_cluster_with_tls.rb @@ -0,0 +1,15 @@ +name "ipfs_cluster_with_tls" + +run_list %w( + kosmos-ipfs + kosmos-ipfs::cluster + kosmos-ipfs::letsencrypt +) + +override_attributes( + 'kosmos-ipfs' => { + 'nginx' => { + 'api_port' => 9095 + } + } +) From 4bccf4dd887cc9746b438c99bf94bb75d0747a65 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 8 Sep 2018 12:54:51 +0800 Subject: [PATCH 10/23] Fix missing Mastodon/PosgreSQL backups The backup cookbook was incomplete, and also there was no database configured to be backed up. --- site-cookbooks/backup/attributes/default.rb | 5 +++++ .../backup/templates/default/backup.rb.erb | 6 +++++- .../backup/templates/default/config.rb.erb | 13 +++---------- site-cookbooks/kosmos-mastodon/recipes/default.rb | 10 +++++++++- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/site-cookbooks/backup/attributes/default.rb b/site-cookbooks/backup/attributes/default.rb index 81b334d..7df43a5 100644 --- a/site-cookbooks/backup/attributes/default.rb +++ b/site-cookbooks/backup/attributes/default.rb @@ -26,6 +26,11 @@ set_unless["backup"]["mysql"]["databases"] = [] set_unless["backup"]["mysql"]["username"] = "root" set_unless["backup"]["mysql"]["host"] = "localhost" +# PostgreSQL default settings +set_unless["backup"]["postgresql"]["databases"] = [] +set_unless["backup"]["postgresql"]["host"] = "localhost" +set_unless["backup"]["postgresql"]["port"] = 5432 + # Redis default settings set_unless["backup"]["redis"]["databases"] = [] set_unless["backup"]["redis"]["host"] = "localhost" diff --git a/site-cookbooks/backup/templates/default/backup.rb.erb b/site-cookbooks/backup/templates/default/backup.rb.erb index 836fbc3..d844c20 100644 --- a/site-cookbooks/backup/templates/default/backup.rb.erb +++ b/site-cookbooks/backup/templates/default/backup.rb.erb @@ -17,7 +17,11 @@ KosmosBackup.new(:default, 'default backup') do <%- end -%> <%- if node["backup"]["postgresql"] -%> - database PostgreSQL +<%- node["backup"]["postgresql"]["databases"].each do |db_name| -%> + database PostgreSQL, :"<%= db_name.to_sym %>" do |db| + db.name = "<%= db_name %>" + end +<%- end -%> <%- end -%> <%- if node["mongodb"] -%> diff --git a/site-cookbooks/backup/templates/default/config.rb.erb b/site-cookbooks/backup/templates/default/config.rb.erb index 11c7814..2e10774 100644 --- a/site-cookbooks/backup/templates/default/config.rb.erb +++ b/site-cookbooks/backup/templates/default/config.rb.erb @@ -45,15 +45,7 @@ Database::MySQL.defaults do |db| end <%- end -%> -<%- if node["backup"]["mysql"] -%> -Database::MySQL.defaults do |db| - db.host = "<%= node["backup"]["mysql"]["host"] %>" - db.username = "<%= node["backup"]["mysql"]["username"] %>" - db.password = "<%= node["backup"]["mysql"]["password"] %>" - db.additional_options = ['--quick', '--single-transaction'] -end -<%- end -%> - +<%- if node["backup"]["redis"] -%> Database::Redis.defaults do |db| db.host = "<%= node["backup"]["redis"]["host"] %>" db.port = 6379 @@ -61,13 +53,14 @@ Database::Redis.defaults do |db| <%# db.password = "my_password"%> <%# db.socket = "/tmp/redis.sock"%> end +<%- end -%> <%- if node["backup"]["postgresql"] -%> Database::PostgreSQL.defaults do |db| db.username = "<%= node["backup"]["postgresql"]["username"] %>" db.password = "<%= node["backup"]["postgresql"]["password"] %>" db.host = "<%= node["backup"]["postgresql"]["host"] %>" - db.port = 5432 + db.port = "<%= node["backup"]["postgresql"]["port"] %>" # db.socket = "/var/run/postgresql/.s.PGSQL.5432" # When dumping all databases, `skip_tables` and `only_tables` are ignored. db.skip_tables = [] diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index baeb5b3..f8ae051 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -180,10 +180,18 @@ application mastodon_path do end end +# +# Backup +# + unless node.chef_environment == "development" - # Backup the database to S3 node.override["backup"]["postgresql"]["host"] = "localhost" node.override["backup"]["postgresql"]["username"] = "postgres" node.override["backup"]["postgresql"]["password"] = node['postgresql']['password']['postgres'] + unless node["backup"]["postgresql"]["databases"].include? 'mastodon' + node.override["backup"]["postgresql"]["databases"] = + node["backup"]["postgresql"]["databases"].to_a << "mastodon" + end + include_recipe "backup" end From 35772d16410a3b100a0fd3d50045f86861ce527b Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 8 Sep 2018 12:56:43 +0800 Subject: [PATCH 11/23] Remove IPFS role, because it's not just IPFS This recipe is trying to set up the entire public gateway for ipfs.kosmos.org, including getting an LE cert, which obviously fails on machines not hosting the domain. Setting up a public gateway should not be part of a default IPFS recipe. --- nodes/dev.kosmos.org.json | 1 - 1 file changed, 1 deletion(-) diff --git a/nodes/dev.kosmos.org.json b/nodes/dev.kosmos.org.json index 9c5c6f4..271ba1c 100644 --- a/nodes/dev.kosmos.org.json +++ b/nodes/dev.kosmos.org.json @@ -9,7 +9,6 @@ "5apps-xmpp_server", "5apps-hubot::xmpp_schlupp", "5apps-hubot::xmpp_botka", - "kosmos-ipfs", "kosmos-mastodon", "kosmos-mastodon::nginx" ], From 8da7ebbef0506bf85bf0cfc1c7b49bab0ce8c363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 4 Oct 2018 18:56:05 +0200 Subject: [PATCH 12/23] Add initial docs for ejabberd --- doc/ejabberd.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/ejabberd.md diff --git a/doc/ejabberd.md b/doc/ejabberd.md new file mode 100644 index 0000000..d67884a --- /dev/null +++ b/doc/ejabberd.md @@ -0,0 +1,17 @@ +# ejabberd + +The kosmos.org XMPP server is running on Andromeda + +[ejabberdctl reference](https://docs.ejabberd.im/admin/guide/managing/#ejabberdctl-commands) + +## Create a user account + + sudo /opt/ejabberd-18.06/bin/ejabberdctl register username kosmos.org password + +## Change a user's password + + sudo /opt/ejabberd-18.06/bin/ejabberdctl change_password username kosmos.org new_password + +## List users + + sudo /opt/ejabberd-18.06/bin/ejabberdctl registered_users kosmos.org From 293d1a8a8a5f613345e33032e695e1cfaf34355d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 4 Oct 2018 18:59:30 +0200 Subject: [PATCH 13/23] Fix formatting --- doc/ejabberd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ejabberd.md b/doc/ejabberd.md index d67884a..a091d8e 100644 --- a/doc/ejabberd.md +++ b/doc/ejabberd.md @@ -14,4 +14,4 @@ The kosmos.org XMPP server is running on Andromeda ## List users - sudo /opt/ejabberd-18.06/bin/ejabberdctl registered_users kosmos.org + sudo /opt/ejabberd-18.06/bin/ejabberdctl registered_users kosmos.org From d236d138dc6d5d63c4d43c01a811e3de0481d744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 13:38:12 +0200 Subject: [PATCH 14/23] Set the S3 credentials to write the new oncall file --- data_bags/credentials/5apps_schlupp_xmpp.json | 42 +++++++++++-------- .../5apps-hubot/recipes/xmpp_schlupp.rb | 5 ++- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/data_bags/credentials/5apps_schlupp_xmpp.json b/data_bags/credentials/5apps_schlupp_xmpp.json index 52b7adb..006dbac 100644 --- a/data_bags/credentials/5apps_schlupp_xmpp.json +++ b/data_bags/credentials/5apps_schlupp_xmpp.json @@ -1,44 +1,50 @@ { "id": "5apps_schlupp_xmpp", "password": { - "encrypted_data": "vdpA+JHaQryqZcoFkEdny7+InZDz99xV8iu/LKU8YGFBYXdWXts4sfH4WyVg\nbTfM\n", - "iv": "WHfrC1kzs6/xKXwuwlwPqw==\n", + "encrypted_data": "PoT+Wn5X9/509Rt2XVHrvBk8khF9cbxluwQlgHI/PVSLWZ+JlcnvO1YF0xal\ng0hd\n", + "iv": "kJPRQDvdPT0V9bHQeV/lrA==\n", "version": 1, "cipher": "aes-256-cbc" }, "webhook_token": { - "encrypted_data": "9Ir6EU4vbA49+L0zUxaEBxSCF7Wzx20/vg40YSM6hVrH2Mg7ZF5bprdni4mP\n1KmI\n", - "iv": "6g9kOLaeb1cmhp7wlC1XPg==\n", + "encrypted_data": "Gg4/3dSVtWmXq/Ce5fCDg+4AKPPjy90CI0Lp7DnPV4R+j+T467LEYYtgp038\nplyi\n", + "iv": "FEhVZWtxFt85DeJcp2E6jA==\n", "version": 1, "cipher": "aes-256-cbc" }, "rs_logger_token": { - "encrypted_data": "KRwgLSHbfwiLMI4sV9ZWP5VnT/kWFe89WGbsYLYAPSseOYFrvH+YEH0A1sB/\nS6aafrCsK+q5WawLSmfTg8DOtw==\n", - "iv": "5asejj0oTTKWVgDdpBmbmg==\n", - "version": 1, - "cipher": "aes-256-cbc" - }, - "rs_ops_token": { - "encrypted_data": "GkfRyCO6Ctj2Tls4HFOTHt/y+3a6rrd84+siDr6c8+1ydsOT7vA+hDP7fHvq\nU8JnDca/Pd7yRMLACV4fdY0dQQ==\n", - "iv": "ES0LLnsEaC2SgHr7Rv1wFw==\n", + "encrypted_data": "5S6I1cenYT2qTvjtuXlgIestyI6tHcPzKw6Hvwe9b7tZ3tHF2j8gsCfqCPQR\nx3xhRJnH4PyhVkbCzr6dApNNZA==\n", + "iv": "GWtGG5jqapw65Oes4zG4Xw==\n", "version": 1, "cipher": "aes-256-cbc" }, "deploy_key": { - "encrypted_data": "JuNDHLnOVwMUCvjkFVheR8eb+8gCqKe/eywGjppdLwAgHQdJlnMeqbyGDTes\njJeuildjKXrsuSfcMO+JP4Q53ZrL3V7pAHKHC3Ck7y9DZ78cZNgdJazsm/Ov\niQ++ZjZTDXFJLi8X9IwI9W4O+gAxycyA3C17Jtr1M/2EHHLBB/K/WvCzRIAi\ncCeOxPMCa5bwaeVXj5z1FRYezhbGIGyF/ddXU1knSwtxk0zRT3FhRcOVj/iw\n6nx5c+YEf38Qg+jM7IEi60wgBeT1g6U5jARKUN3GUR3chtDI43KKFB0h0nlv\nnNc/p/FXk6XeGebrdJElSbCiH0bH1E/KHicP7jCTARVuyx67WZRHAEzEuVbd\nUtbHy+KF0eqTVKuLABQaiqpiGjlYi+4xlr4NwKwqzfo7qGYUNn2JJ4lLicyW\nBbf+jxYBRt4g9+NtSiAdtA7y5/o3GKMMzDxs+H6H2yrFnXLlpzk/1fXT+Vmg\nxPQ3rPW2FsPTFmuRr9QtbjSfKtIyyrUC8lGWJHR4T6fEe1TDVDASs80e15Cx\nKyKoJzToIGi4iXwproDsEyWH9gIutNuhT7Qerg+gJVFpid4k6Iqugt4sNrGH\nV68MNt5mHihsGCeZO0YTl6b/kvk63rcbl1jBqA7iayfjuKekM3p5Dmp6tbpA\nluF+hHC0vdUFyFHB4keW8a4FlsQxyOAlSxNxkKXaeHgssd7pouHN/KdlrWax\nZGxOclGMqARqa3VzExgEGFaavSBB+4eHfECHgYGeREXYREDzr7ZrDcLGOh2J\nd+NiP+rb9zut61qPdRanZQV3KuA2iRBo+kDLxFaPAgHvVjeEOVRga1P8zJXE\n3gwqAbZUWOd9jkl8XtDGHM2lmLxiqv2LPhU2VubCJWWFhzfOLjntbPqeLLKC\nq+9ddzpxyJb7+0PEpMX/J+kEh5aQVlPgxnCZzPFf+Hj+I083tWxIqwD+lujN\nQduZ2GaF56/i2bRCIE5nfrcQf05OLIhb+BZkMw9haW850Jf/b3doVyyekyVw\nJxMY8qDZB9YcvrPrFmdThTkPDMiZOCTu5k18YNl4trqtv20S6+J2sMvN3FjE\n0LkqDTy3jYlH6cis7aiZhpQi9zusCczQepBOnBrqCfiVKkNeGmoXCFl0DYc3\nwYUZyluFGB3bkc97T9uOn1n6arHs/0O2yXWk5AZIiExf0NS/bcOGMJeeIByr\nK3NLWPdLK280AqzRqjg7ZeO3iD2HUfRpjU5MXiTau/5ttKoNIwgKjDVzSOvi\nB850ph4l6owXmQz14/JQrAWLswyLL37euK2FYtPMGEqzBdwg+lwWQK4nDw17\n9pN/3yBlPDC5NAfi51C9vEyxDuchAoekeXIjEQauSaxelDH7m+4ytKcR8P1Y\nGqlrxax+6SpA//JHvqzJcgfX/G7FwSE1WB7jES2jVo8jQJN+y15ZRglPCkAl\nISSR6pEug50nmmKK02S1jtGjRS5r/rzZh4ZIWUwMBX0lxcXyYEoEDjZptTF6\n6iOkgwr1EC4s2XujcOOoj0EUmGfdS5EFDakymmM8T/xOGZ4/HzVjlXC5y0ZE\nrbhwJ2DhYQgmLSe3Ih8xSKxbmVdNCU5nzm9A4EB2FvFac244CfRcbGeTz9HA\nRKi7Kf3HLcSWMYJm4W+Dz88Kl8R3b4vTVmfy6BZevBnO8dleCeAh0Me6DWaq\nJM6jRsABxxuF/hpaLf0kDYbfkdoDvpxHcVkFNqYnSfM0JP969nRyb+kRnUCJ\npVKYGUVKvo3xgOFgK7qV/d/MP6GCu8H9LG6CEdBRnC9Ahof5RBuJIzlntqwo\nIjq33pfdJaVXbuAUyTBekzsYbQtlo0kzUxBNt3hFnK7MbEKhlXbMjqmn/JA5\nbcKc2IpMrAaX5FC88k5OgJKl7OObDyuKMEZI7lSR/iV0wIWpJEW8sFZtchEc\njcp17jD+n5MlJ9ezm9Bm2/XBCDcy46kPG4hsXZ/RbRJ5x349xp0VimLr0lVB\ni83eyPeM8LnTKNmoxk8b+q0GXzefJZJBePtI6hZkmtKTxkzLmORaOUYYUV/A\nJy7vdgktl6G9qGPl3q16eGLBv8Is/0iOvSUhKsF21Zd0rO3plhCP4g67iT6R\np00ANOPqpkDIksNrpBPeM5DBpxAn1I4t1XejL3AIgyHI9zJZ34JymkFLL9OR\n+Ar8e3PXrDSdlYqBF8GZYYsjOoCxLthZXMvhaubT8Z1B4KrKHdYYRBoJ2A+0\nxhcpfPBHSz/KQPR+zOGU11acCD8lcNHv+Bn2J/mbjqKqth8PmZijtzSE+52t\nNirK6cK/bWZzRjN/W6nJ9PrO\n", - "iv": "JSVBvNn1cvdCQYAAFv1f4g==\n", + "encrypted_data": "8nvIpT8zGVbs0JZvcDD8CPhdUVlZbwKBIbaXmnntKrCPun7iqMrixTIXN5Qu\nAlrhErok7bJ8SiHg8K6OTnLia2JcHHrWJ2CpdEjl1kUDNrtmaSq+CPgb2+RA\ngdD87k9eYUJW7DqQ89NNBCZGuaiR6FO2Bz2Q0tCTXGzeauBO+3P0YrqZfMZX\nzpozAGi5GdFsTPKKT5AX/KpfP7CREsoXDDI6uJJ+1tWoOi0vbjIegCnfFUFS\niUHWeyv4yKMNKOAkk7cyZRbcDxkuHk4Q/148rzzE/Q0bQqpHiRjLNNxckw8i\nfAdGnSLv8VMWifroPmGfL992/k3/0XTrkttSLc+LZ+TGj/dq3LSTHiz3k16G\nmSmsRw1ckccmhAC//mAFjtI+mmqxQwO6mnl7PlXgo8040fQJModDP/xJledp\nvPrzUH1QWynn/MXTJDeK4IZB3LA/0CEwQoLqfNKCiJNERXNHG6/YxZVgiB9E\nrykXCvRxCcWLEv1pBoLDbDaODaqMVFcSq7Xlszv6lOvGI15Gy7wCD6/Ixb2W\n5Lsmv4bbgkU6vOQewUFC8PWJdKwhZSbXLvVnmCZ4y/I3zes2TGQ9AtJFDsR/\nhcL97PCNV82aiC3/RpqxDy7X8sMJIHEppz8NBcumW3npwXfDOGK8ewNB2hDM\nAqmN7jFbd3ySD+0el1rY9uODkhaR+d8KUy4VfL+WTtSFUjT6oxm736n/MYXA\ngzEXllmg/kTzleuzi2caJyAMJEHauBVfAbaPFwHxFfxAb7ALDhGujGpglL0Y\na3nFd0chPcHGQ8vkqQIHwn6s1lz2I+4CEt08w4a4PNk66sqm6+t3WHRac/Jz\nb3BIVIAUCLgQ1DXbiIMr/3EHDSC5J7QW6BSmCH46QalNw33wHLY2Zv3mA4kB\nb0O9Niv5lMIuqkt89o/Jb1B/dDZCw+v6NNSp0ltYnfnSiAJrxMI4IE/zjrrp\nmDEW56HbOwflX4kaUQSscgaFMIKIQDz/mYmsDd/nxbf/PBYzp6cbz/3lvNUW\ntc2Grr2LcSZaVOwj8TmQxuk9QT/5de+kdUmj4X+bt8Ibg0jCZ94AqTIM09le\nB88n2yfTz2KhZkS2tTC18FkrMcbrK5lEK92HWSmePKOZr2Hl3G3QzEMjPyQi\nXJgZOHzKts8TPxUcEYr4dgsFC3V0LOwNUJuNAtN9F8gKUjYkgKinXWmw4YG2\nm006PEDLQqwpIPbyOKuaPRMSZOW20tVic4Rq0uAmAcXGUxnsAas378YI0Dtq\nfalD3lu+3cOQacP5ZrnJ/QW/V//s9o+w9o2n81gtBXP//7nT1pkbskyRQEy5\nfQCcOKuHogMP6sl2sP3IqrhyPVo5zG3OAGJNP7iouFYwbX3B1+ncA97XZNvd\ng1iw9ybSEuIrx6lsIsn5zVGqmwJFP+hYK3+PY+PAjAKT5Y+1UzRGaDB/87tU\n5avjgNhnYiGFYwjwrdvG/Wzbx27kW8a5fUwhwvDI5SURYrFaE8rKIkvbAQQY\nS+d3RKu2/p9m+6A4UyU8+px10GE6sm1qjV6kBWlS7sIyIsbGYbzbbFq05Afx\nT5ph5SzO7Aa44cWDhH/Bdno7mEXqOEAYP8dXMq3q9/IlGqy8P/oVsM8X7jcZ\neOTV9jC2oLpckY4mAFKJ31AJ6BiG/jsheZQY8d29hTpzauK9qo7mDAZwem50\n3x4pTLdRNDbSCOEALsNvGtmZr2UgVXCteMO0CFi7uPy5cU4e39D0/wBJ4/mT\nnVGX8aiAPBSOeoUcWg9qEzTums6ctSMluIHrafuxn6pJR6h0y8kh2oy3KiUE\nN1x4J/aXe3WYzBPoBDw60rnLht4XHXAWueK8mGLTC5vZstamvgDNXREL1aM3\nWDcfLleer9Rbde784Kpa6x5QgYcTV51ecPVnYweugFgLIVQNkEBbAn4V84HX\nK4XcOo4tJy+f4P3tAgIE9CoLd7Q9V8yuZplw20LykecuzBOCaP4um4KSLlTn\nTp5NwKU1ijQ5nefEeMbESJ9TFBxH8K6Y7EUUBBGNCJ3LlNbpsawCtrMgKqMh\n0kP2geQwf7ARBwWa3MHdebL0FUUaQjpGKOxJ2PtEI3t2vQmzr7go1fpVOmeJ\n3dDI1ecLpd7VelQlJVT1nKv+07aHPdSE1+hMZi8CVARCAEyOqufEs+KcHeHK\nhUI9cjjqy3kXrBR1Gw7jMUvbfTqfrV3oo+RqNorF+6ZyFtkivKih2POMHRjS\njHY7ag0sQYYe/O5DLhR9WIIhxkKMKYed8mywTEg0YWAxBCXUIl9M+GH6T7WU\n8Ajg3k1paLzi09ypwLVWOzq+\n", + "iv": "//Oik8zYVxlYLCJ/5zk2Jw==\n", "version": 1, "cipher": "aes-256-cbc" }, "airtable_api_key": { - "encrypted_data": "WOQ/IJwVSiu5cUumLZcBE5dyKCxojHpBVFEVFcWax9jHvcLgIz2d7U/X1XeI\nZJ6W\n", - "iv": "67fXeOD2OTRhWeG5YsqdRg==\n", + "encrypted_data": "qDEztKIUYN6qU6dAbXi7leapA/+fK0beTZpEvFxvP9+0IrfSQ0mjagIU33ne\nkM/Y\n", + "iv": "MdfLft5aSoC/yzZe7BRCyg==\n", "version": 1, "cipher": "aes-256-cbc" }, "github_token": { - "encrypted_data": "KDZ3TzVjX05aeL9dyCeIuEa3XpItIduovEpEu+eDRA+eyCW1Yg5mdBARLoqO\n8elA0sO9EYrxJAo/o6tE+rLmFw==\n", - "iv": "BXflyLpEh5eZtiU1pEJPzA==\n", + "encrypted_data": "Rp1icQX6fbE8WImrY3NxkLcq10+CcCOG0nSED3ALtVaiY9gXtLb4mEPhgz6B\nqepZ5bG35W08ORxjBskpPudKMQ==\n", + "iv": "9JTZWHikvB9+dfyht5UYmQ==\n", + "version": 1, + "cipher": "aes-256-cbc" + }, + "aws_access_key_id": { + "encrypted_data": "J7sNPOtA+lzj+7FjZlneadNcLZxBGz2x1JNeX0j0Rl/pSU7QZCaPFy8KCGj+\nIh8v\n", + "iv": "K29ZdZdSAd+yJS8yNxkjpg==\n", + "version": 1, + "cipher": "aes-256-cbc" + }, + "aws_secret_access_key": { + "encrypted_data": "UFLVmj81LAMZheItVvEioQhecPYXLU9tzQVRFLOO1NKZLRK6oDNDPbvey5vO\ndzw1UiGD6LcrAFRPDYuwsQrteg==\n", + "iv": "RCSCMBxVC8oF02R3l2ASxg==\n", "version": 1, "cipher": "aes-256-cbc" } diff --git a/site-cookbooks/5apps-hubot/recipes/xmpp_schlupp.rb b/site-cookbooks/5apps-hubot/recipes/xmpp_schlupp.rb index 4018eca..f35ec1e 100644 --- a/site-cookbooks/5apps-hubot/recipes/xmpp_schlupp.rb +++ b/site-cookbooks/5apps-hubot/recipes/xmpp_schlupp.rb @@ -94,10 +94,11 @@ application schlupp_xmpp_path do "HUBOT_RSS_HEADER" => "Update:", "HUBOT_AUTH_ADMIN" => "basti,garret,greg", "REDIS_URL" => "redis://localhost:6379/5apps_schlupp_xmpp", - "RS_OPS_TOKEN" => schlupp_xmpp_data_bag_item['rs_ops_token'], "WEBHOOK_TOKEN" => schlupp_xmpp_data_bag_item['webhook_token'], "AIRTABLE_API_KEY" => schlupp_xmpp_data_bag_item['airtable_api_key'], - "GITHUB_TOKEN" => schlupp_xmpp_data_bag_item['github_token'] } + "GITHUB_TOKEN" => schlupp_xmpp_data_bag_item['github_token'], + "AWS_ACCESS_KEY_ID" => schlupp_xmpp_data_bag_item['aws_access_key_id'], + "AWS_SECRET_ACCESS_KEY" => schlupp_xmpp_data_bag_item['aws_secret_access_key'] } ) notifies :run, "execute[systemctl daemon-reload]", :delayed From f0542bdf2ef2af0732b7cf6576f0d5ec38758e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 17:02:30 +0200 Subject: [PATCH 15/23] Update the ipfs cookbook --- cookbooks/ipfs/LICENSE | 214 ++---------------- cookbooks/ipfs/README.md | 30 ++- cookbooks/ipfs/attributes/default.rb | 4 +- cookbooks/ipfs/metadata.json | 6 +- cookbooks/ipfs/recipes/_user.rb | 27 ++- cookbooks/ipfs/recipes/cluster.rb | 27 ++- cookbooks/ipfs/recipes/cluster_bootstrap.rb | 27 ++- cookbooks/ipfs/recipes/cluster_service.rb | 27 ++- cookbooks/ipfs/recipes/default.rb | 27 ++- .../spec/unit/recipes/cluster_service_spec.rb | 27 ++- .../ipfs/spec/unit/recipes/default_spec.rb | 27 ++- 11 files changed, 161 insertions(+), 282 deletions(-) diff --git a/cookbooks/ipfs/LICENSE b/cookbooks/ipfs/LICENSE index 41c8973..deca87d 100644 --- a/cookbooks/ipfs/LICENSE +++ b/cookbooks/ipfs/LICENSE @@ -1,201 +1,21 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +The MIT License (MIT) - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +Copyright (c) 2018 Kosmos Developers - 1. Definitions. +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: - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Kosmos - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +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. diff --git a/cookbooks/ipfs/README.md b/cookbooks/ipfs/README.md index 9c48257..7d1d5f1 100644 --- a/cookbooks/ipfs/README.md +++ b/cookbooks/ipfs/README.md @@ -66,18 +66,28 @@ kitchen verify # Run the integration tests for Ubuntu 16.04, 18.06 and Debian 9 ## License and Authors -Authors: Kosmos +Authors: Kosmos Developers mail@kosmos.org +Copyright: 2018, [Kosmos Developers](https://kredits.kosmos.org/) ``` -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at +Unless otherwise noted, all files are released under the MIT license, possible +exceptions will contain licensing information in them. - http://www.apache.org/licenses/LICENSE-2.0 +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: -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +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. ``` diff --git a/cookbooks/ipfs/attributes/default.rb b/cookbooks/ipfs/attributes/default.rb index f6e82fb..77649c2 100644 --- a/cookbooks/ipfs/attributes/default.rb +++ b/cookbooks/ipfs/attributes/default.rb @@ -1,5 +1,5 @@ -node.default['ipfs']['version'] = '0.4.9' -node.default['ipfs']['checksum'] = 'ae50c760f58548adc7c6dade4cf549059b6bc73ebc25ff4ea9fece06a15ac0a6' +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'] diff --git a/cookbooks/ipfs/metadata.json b/cookbooks/ipfs/metadata.json index 356d4f1..49820a9 100644 --- a/cookbooks/ipfs/metadata.json +++ b/cookbooks/ipfs/metadata.json @@ -1,10 +1,10 @@ { "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 [https://docs.chef.io/custom_resources.html](Custom Resource) 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\n\n```\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n", - "maintainer": "Kosmos", + "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 [https://docs.chef.io/custom_resources.html](Custom Resource) 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": "Apache-2.0", + "license": "MIT", "platforms": { "[\"ubuntu\", \"debian\"]": ">= 0.0.0" }, diff --git a/cookbooks/ipfs/recipes/_user.rb b/cookbooks/ipfs/recipes/_user.rb index d4da731..3614d42 100644 --- a/cookbooks/ipfs/recipes/_user.rb +++ b/cookbooks/ipfs/recipes/_user.rb @@ -2,20 +2,27 @@ # Cookbook Name:: ipfs # Recipe:: _user # -# Copyright 2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 diff --git a/cookbooks/ipfs/recipes/cluster.rb b/cookbooks/ipfs/recipes/cluster.rb index fde4cae..37b40df 100644 --- a/cookbooks/ipfs/recipes/cluster.rb +++ b/cookbooks/ipfs/recipes/cluster.rb @@ -2,20 +2,27 @@ # Cookbook Name:: ipfs # Recipe:: cluster # -# Copyright 2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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' diff --git a/cookbooks/ipfs/recipes/cluster_bootstrap.rb b/cookbooks/ipfs/recipes/cluster_bootstrap.rb index 1d784a0..295ee0f 100644 --- a/cookbooks/ipfs/recipes/cluster_bootstrap.rb +++ b/cookbooks/ipfs/recipes/cluster_bootstrap.rb @@ -2,20 +2,27 @@ # Cookbook Name:: ipfs # Recipe:: cluster_bootstrap # -# Copyright 2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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' diff --git a/cookbooks/ipfs/recipes/cluster_service.rb b/cookbooks/ipfs/recipes/cluster_service.rb index c2a73f0..ad682db 100644 --- a/cookbooks/ipfs/recipes/cluster_service.rb +++ b/cookbooks/ipfs/recipes/cluster_service.rb @@ -2,20 +2,27 @@ # Cookbook Name:: ipfs # Recipe:: cluster_service # -# Copyright 2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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 diff --git a/cookbooks/ipfs/recipes/default.rb b/cookbooks/ipfs/recipes/default.rb index 97be32b..ab5652b 100644 --- a/cookbooks/ipfs/recipes/default.rb +++ b/cookbooks/ipfs/recipes/default.rb @@ -2,20 +2,27 @@ # Cookbook Name:: ipfs # Recipe:: default # -# Copyright 2017-2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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' diff --git a/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb b/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb index f4f7047..ddefa44 100644 --- a/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb +++ b/cookbooks/ipfs/spec/unit/recipes/cluster_service_spec.rb @@ -2,20 +2,27 @@ # Cookbook:: ipfs # Spec:: default # -# Copyright 2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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' diff --git a/cookbooks/ipfs/spec/unit/recipes/default_spec.rb b/cookbooks/ipfs/spec/unit/recipes/default_spec.rb index 4c9264b..9a43132 100644 --- a/cookbooks/ipfs/spec/unit/recipes/default_spec.rb +++ b/cookbooks/ipfs/spec/unit/recipes/default_spec.rb @@ -2,20 +2,27 @@ # Cookbook:: ipfs # Spec:: default # -# Copyright 2018, Kosmos +# The MIT License (MIT) # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright:: 2018, Kosmos Developers # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# 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' From 4c7dc764a47d91165bac79907387cc25672e54fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 17:06:03 +0200 Subject: [PATCH 16/23] Add the updated Berksfile.lock --- Berksfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Berksfile.lock b/Berksfile.lock index f2aa4b3..de82422 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -22,7 +22,7 @@ DEPENDENCIES iis (= 6.7.1) ipfs git: https://github.com/67P/ipfs-cookbook.git - revision: 5578cada684fdab36c0b3c1e6e2acdde10f96947 + revision: ec2cda08f617e7ea617c40e8d2df4e450d84f92e ref: master logrotate (= 2.2.0) mariadb (= 0.3.1) From c0358f5c9bd90a2ec6203470b6bb7a771e771612 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 9 Sep 2018 16:20:24 +0800 Subject: [PATCH 17/23] Split hubot into separate recipes, add ipfs to hal8000 --- site-cookbooks/kosmos-hubot/metadata.rb | 5 +- .../kosmos-hubot/recipes/botka_freenode.rb | 129 ++++++++++ .../kosmos-hubot/recipes/default.rb | 240 +----------------- .../kosmos-hubot/recipes/hal8000.rb | 121 +++++++++ 4 files changed, 256 insertions(+), 239 deletions(-) create mode 100644 site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb create mode 100644 site-cookbooks/kosmos-hubot/recipes/hal8000.rb diff --git a/site-cookbooks/kosmos-hubot/metadata.rb b/site-cookbooks/kosmos-hubot/metadata.rb index a41559b..16bea56 100644 --- a/site-cookbooks/kosmos-hubot/metadata.rb +++ b/site-cookbooks/kosmos-hubot/metadata.rb @@ -1,8 +1,8 @@ name 'kosmos-hubot' maintainer 'Kosmos' maintainer_email 'mail@kosmos.org' -license 'All rights reserved' -description 'Installs/Configures kosmos-hubot' +license 'MIT' +description 'Configures Kosmos chat bots' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' @@ -10,3 +10,4 @@ depends 'kosmos-nodejs' depends 'kosmos-redis' depends 'firewall' depends 'application_javascript' +depends 'ipfs' diff --git a/site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb b/site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb new file mode 100644 index 0000000..e9b4f6b --- /dev/null +++ b/site-cookbooks/kosmos-hubot/recipes/botka_freenode.rb @@ -0,0 +1,129 @@ +# +# Cookbook Name:: kosmos-hubot +# Recipe:: botka_freenode +# +# Copyright 2017-2018, Kosmos +# +include_recipe "kosmos-nodejs" +include_recipe "kosmos-redis" + +botka_freenode_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', 'botka_freenode') + +botka_freenode_path = "/opt/botka_freenode" +application botka_freenode_path do + owner "hubot" + group "hubot" + + git do + user "hubot" + group "hubot" + repository "https://github.com/67P/botka.git" + revision "master" + end + + file "#{name}/external-scripts.json" do + mode "0640" + owner "hubot" + group "hubot" + content [ + "hubot-help", + "hubot-redis-brain", + "hubot-remotestorage-logger", + "hubot-web-push-notifications", + ].to_json + end + + npm_install do + user "hubot" + end + + execute "systemctl daemon-reload" do + command "systemctl daemon-reload" + action :nothing + end + + template "/lib/systemd/system/botka_freenode_nodejs.service" do + source 'nodejs.systemd.service.erb' + owner 'root' + group 'root' + mode '0644' + variables( + user: "hubot", + group: "hubot", + app_dir: botka_freenode_path, + entry: "#{botka_freenode_path}/bin/hubot -a irc", + environment: { + "HUBOT_IRC_SERVER" => "irc.freenode.net", + "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub,#opensourcedesign,#openknot,#emberjs,#mastodon,#indieweb,#lnd", + "HUBOT_IRC_NICK" => "botka", + "HUBOT_IRC_NICKSERV_USERNAME" => "botka", + "HUBOT_IRC_NICKSERV_PASSWORD" => botka_freenode_data_bag_item['nickserv_password'], + "HUBOT_IRC_UNFLOOD" => "100", + "HUBOT_RSS_PRINTSUMMARY" => "false", + "HUBOT_RSS_PRINTERROR" => "false", + "HUBOT_RSS_IRCCOLORS" => "true", + # "HUBOT_LOG_LEVEL" => "error", + "EXPRESS_PORT" => "8081", + "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,jaaan,slvrbckt,raucao", + "RS_LOGGER_USER" => "kosmos@5apps.com", + "RS_LOGGER_TOKEN" => botka_freenode_data_bag_item['rs_logger_token'], + "RS_LOGGER_SERVER_NAME" => "freenode", + "RS_LOGGER_PUBLIC" => "true", + "GCM_API_KEY" => botka_freenode_data_bag_item['gcm_api_key'], + "VAPID_SUBJECT" => "https://kosmos.org", + "VAPID_PUBLIC_KEY" => botka_freenode_data_bag_item['vapid_public_key'], + "VAPID_PRIVATE_KEY" => botka_freenode_data_bag_item['vapid_private_key'] + } + ) + notifies :run, "execute[systemctl daemon-reload]", :delayed + notifies :restart, "service[botka_freenode_nodejs]", :delayed + end + + service "botka_freenode_nodejs" do + action [:enable, :start] + end +end + +# +# Nginx reverse proxy +# +unless node.chef_environment == "development" + express_port = 8081 + express_domain = "freenode.botka.kosmos.org" + + include_recipe "kosmos-base::letsencrypt" + + include_recipe 'kosmos-nginx' + + directory "/var/www/#{express_domain}/.well-known/acme-challenge" do + owner node["nginx"]["user"] + group node["nginx"]["group"] + recursive true + action :create + end + + template "#{node['nginx']['dir']}/sites-available/#{express_domain}" do + source 'nginx_conf_hubot.erb' + owner node["nginx"]["user"] + mode 0640 + variables express_port: express_port, + server_name: express_domain, + ssl_cert: "/etc/letsencrypt/live/#{express_domain}/fullchain.pem", + ssl_key: "/etc/letsencrypt/live/#{express_domain}/privkey.pem" + notifies :reload, 'service[nginx]', :delayed + end + + nginx_site express_domain do + enable true + end + + # FIXME This doesn't actually work on the first run. Apparently nginx is not + # reloaded after adding the vhost or sth, because it does work on the second + # run. + execute "letsencrypt cert for #{express_domain}" do + command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path /var/www/#{express_domain} -d #{express_domain} -n" + cwd "/usr/local/certbot" + not_if { File.exist? "/etc/letsencrypt/live/#{express_domain}/fullchain.pem" } + notifies :create, "template[#{node['nginx']['dir']}/sites-available/#{express_domain}]", :immediately + end +end diff --git a/site-cookbooks/kosmos-hubot/recipes/default.rb b/site-cookbooks/kosmos-hubot/recipes/default.rb index 3b2fa45..3dff8a5 100644 --- a/site-cookbooks/kosmos-hubot/recipes/default.rb +++ b/site-cookbooks/kosmos-hubot/recipes/default.rb @@ -2,27 +2,8 @@ # Cookbook Name:: kosmos-hubot # Recipe:: default # -# Copyright 2017, Kosmos +# Copyright 2017-2018, Kosmos # -# All rights reserved - Do Not Redistribute -# - -unless node.chef_environment == "development" - include_recipe 'firewall' - firewall_rule 'hubot_express_hal8000_freenode' do - port 8080 - protocol :tcp - command :allow - end - firewall_rule 'ipfs_swarm_p2p' do - port 4001 - protocol :tcp - command :allow - end -end - -include_recipe "kosmos-nodejs" -include_recipe "kosmos-redis" group "hubot" do gid 48268 @@ -35,220 +16,5 @@ user "hubot" do shell "/bin/bash" end -hal8000_freenode_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', 'hal8000_freenode') - -hal8000_path = "/opt/hal8000" -application hal8000_path do - owner "hubot" - group "hubot" - - git do - user "hubot" - group "hubot" - repository "https://github.com/67P/hal8000.git" - revision "master" - end - - file "#{name}/external-scripts.json" do - mode "0640" - owner "hubot" - group "hubot" - content [ - "hubot-help", - "hubot-read-tweet", - "hubot-redis-brain", - "hubot-rules", - "hubot-shipit", - "hubot-plusplus", - "hubot-tell", - "hubot-seen", - "hubot-rss-reader", - "hubot-incoming-webhook", - "hubot-auth", - "hubot-kredits", - ].to_json - end - - npm_install do - user "hubot" - end - - execute "systemctl daemon-reload" do - command "systemctl daemon-reload" - action :nothing - end - - template "/lib/systemd/system/hal8000_nodejs.service" do - source 'nodejs.systemd.service.erb' - owner 'root' - group 'root' - mode '0644' - variables( - user: "hubot", - group: "hubot", - app_dir: hal8000_path, - entry: "#{hal8000_path}/bin/hubot -a irc", - environment: { - # "HUBOT_LOG_LEVEL" => "error", - "HUBOT_IRC_SERVER" => "irc.freenode.net", - "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub", - "HUBOT_IRC_NICK" => "hal8000", - "HUBOT_IRC_NICKSERV_USERNAME" => "hal8000", - "HUBOT_IRC_NICKSERV_PASSWORD" => hal8000_freenode_data_bag_item['nickserv_password'], - "HUBOT_IRC_UNFLOOD" => "100", - "HUBOT_RSS_PRINTSUMMARY" => "false", - "HUBOT_RSS_PRINTERROR" => "false", - "HUBOT_RSS_IRCCOLORS" => "true", - "HUBOT_PLUSPLUS_POINTS_TERM" => "karma,karma", - "EXPRESS_PORT" => "8080", - "HUBOT_RSS_HEADER" => "Update:", - "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,slvrbckt,raucao", - "WEBHOOK_TOKEN" => hal8000_freenode_data_bag_item['webhook_token'], - "IPFS_API_HOST" => node['hal8000']['kredits']['ipfs_host'], - "IPFS_API_PORT" => node['hal8000']['kredits']['ipfs_port'], - "IPFS_API_PROTOCOL" => node['hal8000']['kredits']['ipfs_protocol'], - "KREDITS_ROOM" => node['hal8000']['kredits']['room'], - "KREDITS_WEBHOOK_TOKEN" => hal8000_freenode_data_bag_item['kredits_webhook_token'], - "KREDITS_PROVIDER_URL" => node['hal8000']['kredits']['provider_url'], - "KREDITS_NETWORK_ID" => node['hal8000']['kredits']['network_id'], - "KREDITS_WALLET_PATH" => node['hal8000']['kredits']['wallet_path'], - "KREDITS_WALLET_PASSWORD" => hal8000_freenode_data_bag_item['kredits_wallet_password'], - "KREDITS_MEDIAWIKI_URL" => node['hal8000']['kredits']['mediawiki_url'], - "KREDITS_GITHUB_REPO_BLACKLIST" => node['hal8000']['kredits']['github_repo_blacklist'] - } - ) - notifies :run, "execute[systemctl daemon-reload]", :delayed - notifies :restart, "service[hal8000_nodejs]", :delayed - end - - cookbook_file "#{name}/wallet.json" do - source "wallet.json" - end - - service "hal8000_nodejs" do - action [:enable, :start] - end -end - -botka_freenode_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', 'botka_freenode') - -botka_freenode_path = "/opt/botka_freenode" -application botka_freenode_path do - owner "hubot" - group "hubot" - - git do - user "hubot" - group "hubot" - repository "https://github.com/67P/botka.git" - revision "master" - end - - file "#{name}/external-scripts.json" do - mode "0640" - owner "hubot" - group "hubot" - content [ - "hubot-help", - "hubot-redis-brain", - "hubot-remotestorage-logger", - "hubot-web-push-notifications", - ].to_json - end - - npm_install do - user "hubot" - end - - execute "systemctl daemon-reload" do - command "systemctl daemon-reload" - action :nothing - end - - template "/lib/systemd/system/botka_freenode_nodejs.service" do - source 'nodejs.systemd.service.erb' - owner 'root' - group 'root' - mode '0644' - variables( - user: "hubot", - group: "hubot", - app_dir: botka_freenode_path, - entry: "#{botka_freenode_path}/bin/hubot -a irc", - environment: { - "HUBOT_IRC_SERVER" => "irc.freenode.net", - "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub,#opensourcedesign,#openknot,#emberjs,#mastodon,#indieweb,#lnd", - "HUBOT_IRC_NICK" => "botka", - "HUBOT_IRC_NICKSERV_USERNAME" => "botka", - "HUBOT_IRC_NICKSERV_PASSWORD" => botka_freenode_data_bag_item['nickserv_password'], - "HUBOT_IRC_UNFLOOD" => "100", - "HUBOT_RSS_PRINTSUMMARY" => "false", - "HUBOT_RSS_PRINTERROR" => "false", - "HUBOT_RSS_IRCCOLORS" => "true", - # "HUBOT_LOG_LEVEL" => "error", - "EXPRESS_PORT" => "8081", - "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,jaaan,slvrbckt,raucao", - "RS_LOGGER_USER" => "kosmos@5apps.com", - "RS_LOGGER_TOKEN" => botka_freenode_data_bag_item['rs_logger_token'], - "RS_LOGGER_SERVER_NAME" => "freenode", - "RS_LOGGER_PUBLIC" => "true", - "GCM_API_KEY" => botka_freenode_data_bag_item['gcm_api_key'], - "VAPID_SUBJECT" => "https://kosmos.org", - "VAPID_PUBLIC_KEY" => botka_freenode_data_bag_item['vapid_public_key'], - "VAPID_PRIVATE_KEY" => botka_freenode_data_bag_item['vapid_private_key'] - } - ) - notifies :run, "execute[systemctl daemon-reload]", :delayed - notifies :restart, "service[botka_freenode_nodejs]", :delayed - end - - service "botka_freenode_nodejs" do - action [:enable, :start] - end -end - -# -# Nginx reverse proxy -# -express_port = 8081 -express_domain = "freenode.botka.kosmos.org" - -unless node.chef_environment == "development" - include_recipe "kosmos-base::letsencrypt" -end - -include_recipe 'kosmos-nginx' - -directory "/var/www/#{express_domain}/.well-known/acme-challenge" do - owner node["nginx"]["user"] - group node["nginx"]["group"] - recursive true - action :create -end - -template "#{node['nginx']['dir']}/sites-available/#{express_domain}" do - source 'nginx_conf_hubot.erb' - owner node["nginx"]["user"] - mode 0640 - variables express_port: express_port, - server_name: express_domain, - ssl_cert: "/etc/letsencrypt/live/#{express_domain}/fullchain.pem", - ssl_key: "/etc/letsencrypt/live/#{express_domain}/privkey.pem" - notifies :reload, 'service[nginx]', :delayed -end - -nginx_site express_domain do - enable true -end - -# FIXME This doesn't actually work on the first run. Apparently nginx is not -# reloaded after adding the vhost or sth, because it does work on the second -# run. -unless node.chef_environment == "development" - execute "letsencrypt cert for #{express_domain}" do - command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path /var/www/#{express_domain} -d #{express_domain} -n" - cwd "/usr/local/certbot" - not_if { File.exist? "/etc/letsencrypt/live/#{express_domain}/fullchain.pem" } - notifies :create, "template[#{node['nginx']['dir']}/sites-available/#{express_domain}]", :immediately - end -end +include_recipe "kosmos-hubot::hal8000" +include_recipe "kosmos-hubot::botka_freenode" diff --git a/site-cookbooks/kosmos-hubot/recipes/hal8000.rb b/site-cookbooks/kosmos-hubot/recipes/hal8000.rb new file mode 100644 index 0000000..3162107 --- /dev/null +++ b/site-cookbooks/kosmos-hubot/recipes/hal8000.rb @@ -0,0 +1,121 @@ +# +# Cookbook Name:: kosmos-hubot +# Recipe:: hal8000 +# +# Copyright 2017-2018, Kosmos +# +include_recipe "kosmos-nodejs" +include_recipe "kosmos-redis" + +# Needed for hubot-kredits +include_recipe "ipfs" + +unless node.chef_environment == "development" + include_recipe 'firewall' + firewall_rule 'hubot_express_hal8000_freenode' do + port 8080 + protocol :tcp + command :allow + end + firewall_rule 'ipfs_swarm_p2p' do + port 4001 + protocol :tcp + command :allow + end +end + +hal8000_freenode_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', 'hal8000_freenode') + +hal8000_path = "/opt/hal8000" +application hal8000_path do + owner "hubot" + group "hubot" + + git do + user "hubot" + group "hubot" + repository "https://github.com/67P/hal8000.git" + revision "master" + end + + file "#{name}/external-scripts.json" do + mode "0640" + owner "hubot" + group "hubot" + content [ + "hubot-help", + "hubot-read-tweet", + "hubot-redis-brain", + "hubot-rules", + "hubot-shipit", + "hubot-plusplus", + "hubot-tell", + "hubot-seen", + "hubot-rss-reader", + "hubot-incoming-webhook", + "hubot-auth", + "hubot-kredits", + ].to_json + end + + npm_install do + user "hubot" + end + + execute "systemctl daemon-reload" do + command "systemctl daemon-reload" + action :nothing + end + + template "/lib/systemd/system/hal8000_nodejs.service" do + source 'nodejs.systemd.service.erb' + owner 'root' + group 'root' + mode '0644' + variables( + user: "hubot", + group: "hubot", + app_dir: hal8000_path, + entry: "#{hal8000_path}/bin/hubot -a irc", + environment: { + # "HUBOT_LOG_LEVEL" => "error", + "HUBOT_IRC_SERVER" => "irc.freenode.net", + "HUBOT_IRC_ROOMS" => "#5apps,#kosmos,#kosmos-dev,#kosmos-random,#remotestorage,#hackerbeach,#unhosted,#sockethub", + "HUBOT_IRC_NICK" => "hal8000", + "HUBOT_IRC_NICKSERV_USERNAME" => "hal8000", + "HUBOT_IRC_NICKSERV_PASSWORD" => hal8000_freenode_data_bag_item['nickserv_password'], + "HUBOT_IRC_UNFLOOD" => "100", + "HUBOT_RSS_PRINTSUMMARY" => "false", + "HUBOT_RSS_PRINTERROR" => "false", + "HUBOT_RSS_IRCCOLORS" => "true", + "HUBOT_PLUSPLUS_POINTS_TERM" => "karma,karma", + "EXPRESS_PORT" => "8080", + "HUBOT_RSS_HEADER" => "Update:", + "HUBOT_AUTH_ADMIN" => "bkero,derbumi,galfert,gregkare,slvrbckt,raucao", + "WEBHOOK_TOKEN" => hal8000_freenode_data_bag_item['webhook_token'], + "IPFS_API_HOST" => node['hal8000']['kredits']['ipfs_host'], + "IPFS_API_PORT" => node['hal8000']['kredits']['ipfs_port'], + "IPFS_API_PROTOCOL" => node['hal8000']['kredits']['ipfs_protocol'], + "KREDITS_ROOM" => node['hal8000']['kredits']['room'], + "KREDITS_WEBHOOK_TOKEN" => hal8000_freenode_data_bag_item['kredits_webhook_token'], + "KREDITS_PROVIDER_URL" => node['hal8000']['kredits']['provider_url'], + "KREDITS_NETWORK_ID" => node['hal8000']['kredits']['network_id'], + "KREDITS_WALLET_PATH" => node['hal8000']['kredits']['wallet_path'], + "KREDITS_WALLET_PASSWORD" => hal8000_freenode_data_bag_item['kredits_wallet_password'], + "KREDITS_MEDIAWIKI_URL" => node['hal8000']['kredits']['mediawiki_url'], + "KREDITS_GITHUB_REPO_BLACKLIST" => node['hal8000']['kredits']['github_repo_blacklist'] + } + ) + notifies :run, "execute[systemctl daemon-reload]", :delayed + notifies :restart, "service[hal8000_nodejs]", :delayed + end + + cookbook_file "#{name}/wallet.json" do + source "wallet.json" + end + + service "hal8000_nodejs" do + action [:enable, :start] + end +end + From a7871770b8aed2143a0cef3c8f24a18c7600f751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 17:46:47 +0200 Subject: [PATCH 18/23] Remove an unnecessary require and letsencrypt recipe This way kosmos-ipfs::default can be used without adding the Let's Encrypt certificate --- site-cookbooks/kosmos-ipfs/recipes/default.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/site-cookbooks/kosmos-ipfs/recipes/default.rb b/site-cookbooks/kosmos-ipfs/recipes/default.rb index 23480d7..8096a48 100644 --- a/site-cookbooks/kosmos-ipfs/recipes/default.rb +++ b/site-cookbooks/kosmos-ipfs/recipes/default.rb @@ -7,7 +7,6 @@ # All rights reserved - Do Not Redistribute # -require 'json' include_recipe "ipfs" # Configure ipfs @@ -32,5 +31,3 @@ end ipfs_config "API.HTTPHeaders.Access-Control-Allow-Origin" do value ["*"] end - -include_recipe "kosmos-ipfs::letsencrypt" From 5e973b68751995964f69b1db1682d0a6ec5d5d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 17:49:06 +0200 Subject: [PATCH 19/23] Use the kosmos-ipfs recipe in the hal8000 recipe This changes the port to not conflict with hubot and sets the gateway to be writable --- site-cookbooks/kosmos-hubot/recipes/hal8000.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos-hubot/recipes/hal8000.rb b/site-cookbooks/kosmos-hubot/recipes/hal8000.rb index 3162107..def41cf 100644 --- a/site-cookbooks/kosmos-hubot/recipes/hal8000.rb +++ b/site-cookbooks/kosmos-hubot/recipes/hal8000.rb @@ -8,7 +8,7 @@ include_recipe "kosmos-nodejs" include_recipe "kosmos-redis" # Needed for hubot-kredits -include_recipe "ipfs" +include_recipe "kosmos-ipfs" unless node.chef_environment == "development" include_recipe 'firewall' From edfe891f48a8eb5d58735d5db0cf27abcf03e4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 17:51:16 +0200 Subject: [PATCH 20/23] Add the kosmos-ipfs::letsencrypt recipe to Andromeda It has been extracted from the ipfs-kosmos::default recipe --- nodes/andromeda.kosmos.org.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes/andromeda.kosmos.org.json b/nodes/andromeda.kosmos.org.json index 797ac0f..e1d4907 100644 --- a/nodes/andromeda.kosmos.org.json +++ b/nodes/andromeda.kosmos.org.json @@ -2,7 +2,8 @@ "run_list": [ "kosmos-base", "kosmos-base::andromeda_firewall", - "kosmos-ipfs" + "kosmos-ipfs", + "kosmos-ipfs::letsencrypt" ], "automatic": { "ipaddress": "andromeda.kosmos.org" From bb7dc26f43f81f616def321f0aa636b92b9970d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Fri, 26 Oct 2018 18:29:57 +0200 Subject: [PATCH 21/23] Run IPFS Cluster on dev too --- nodes/dev.kosmos.org.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes/dev.kosmos.org.json b/nodes/dev.kosmos.org.json index 271ba1c..a596b6e 100644 --- a/nodes/dev.kosmos.org.json +++ b/nodes/dev.kosmos.org.json @@ -10,7 +10,8 @@ "5apps-hubot::xmpp_schlupp", "5apps-hubot::xmpp_botka", "kosmos-mastodon", - "kosmos-mastodon::nginx" + "kosmos-mastodon::nginx", + "kosmos-ipfs::cluster" ], "normal": { "postgresql": { From 90851fb7de561ca37dbcdc4bc4414fc635a2f79a Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 1 Nov 2018 12:19:30 +0100 Subject: [PATCH 22/23] Update Mastodon's Ruby --- site-cookbooks/kosmos-mastodon/recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index f8ae051..2e14300 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -48,7 +48,7 @@ npm_package "yarn" do version "1.6.0" end -ruby_version = "2.5.1" +ruby_version = "2.5.3" application mastodon_path do owner "mastodon" From 36a4beaed91e2d02f2760f66ea5bf6cd6fc990ac Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 1 Nov 2018 12:19:39 +0100 Subject: [PATCH 23/23] Update knife-solo for being able to update net-ssh --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 20940bd..dc7ee1e 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' gem 'chef', '~> 12.21.1' gem 'berkshelf', '~> 6.3' -gem 'knife-solo' +gem 'knife-solo', '>= 0.7.0.pre3' gem 'knife-solo_data_bag' gem 'cookstyle' gem 'test-kitchen' diff --git a/Gemfile.lock b/Gemfile.lock index cf1c1e4..a83e313 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,10 +94,10 @@ GEM iniparse (1.4.4) ipaddress (0.8.3) json (2.1.0) - knife-solo (0.6.0) + knife-solo (0.7.0.pre3) chef (>= 10.20) erubis (~> 2.7.0) - net-ssh (>= 2.7, < 4.0) + net-ssh (>= 2.7) knife-solo_data_bag (2.1.0) libyajl2 (1.2.0) minitar (0.6.1) @@ -122,7 +122,7 @@ GEM net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) - net-ssh (3.2.0) + net-ssh (4.2.0) net-ssh-gateway (1.3.0) net-ssh (>= 2.6.5) net-ssh-multi (1.2.1) @@ -245,9 +245,9 @@ DEPENDENCIES berkshelf (~> 6.3) chef (~> 12.21.1) cookstyle - knife-solo + knife-solo (>= 0.7.0.pre3) knife-solo_data_bag test-kitchen BUNDLED WITH - 1.16.1 + 1.17.1