From 2c368f0f104d69f4454a146ccbed7b12ee333474 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 25 Oct 2020 12:09:01 +0100 Subject: [PATCH] Update IPFS cookbook --- Berksfile | 2 +- Berksfile.lock | 6 +++--- cookbooks/ipfs/.kitchen.dokken.yml | 11 ++--------- cookbooks/ipfs/.kitchen.yml | 9 +++------ cookbooks/ipfs/.travis.yml | 3 +-- cookbooks/ipfs/Berksfile.lock | 2 +- cookbooks/ipfs/attributes/default.rb | 4 ++-- cookbooks/ipfs/metadata.json | 4 ++-- cookbooks/ipfs/metadata.rb | 4 ++-- cookbooks/ipfs/recipes/default.rb | 1 + .../test/integration/default/serverspec/ipfs_spec.rb | 5 +---- 11 files changed, 19 insertions(+), 32 deletions(-) diff --git a/Berksfile b/Berksfile index 5420a3a..2a32b61 100644 --- a/Berksfile +++ b/Berksfile @@ -47,7 +47,7 @@ cookbook 'homebrew', '= 3.0.0' cookbook 'mariadb', '= 0.3.1' cookbook 'ipfs', git: 'https://gitea.kosmos.org/kosmos/ipfs-cookbook.git', - ref: 'v0.4.1' + ref: 'v0.7.0' cookbook 'elasticsearch', '= 4.2.0' cookbook 'java', '~> 4.3.0' cookbook 'ulimit', '~> 1.0.0' diff --git a/Berksfile.lock b/Berksfile.lock index 590945a..ce0f7d4 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -18,8 +18,8 @@ DEPENDENCIES hostsfile (= 2.4.5) ipfs git: https://gitea.kosmos.org/kosmos/ipfs-cookbook.git - revision: 5c31191ff8571bc8425375fbf938913ac64aa2ee - ref: v0.4.1 + revision: d7c25b6ce5fa490b6de3529fdc163fb64f1ece8a + ref: v0.7.0 java (~> 4.3.0) logrotate (= 2.2.0) mariadb (= 0.3.1) @@ -92,7 +92,7 @@ GRAPH hostname (0.4.2) hostsfile (>= 0.0.0) hostsfile (2.4.5) - ipfs (0.4.1) + ipfs (0.7.0) ark (>= 0.0.0) java (4.3.0) homebrew (>= 0.0.0) diff --git a/cookbooks/ipfs/.kitchen.dokken.yml b/cookbooks/ipfs/.kitchen.dokken.yml index 856fa9a..436ce57 100644 --- a/cookbooks/ipfs/.kitchen.dokken.yml +++ b/cookbooks/ipfs/.kitchen.dokken.yml @@ -13,12 +13,10 @@ provisioner: verifier: name: inspec + root_path: '/opt/verifier' # Needed for the specs to be detected in Docker + chef_license: accept 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 @@ -33,8 +31,3 @@ suites: run_list: - recipe[ipfs::default] attributes: - - name: cluster - run_list: - - recipe[ipfs::cluster] - - recipe[ipfs::cluster_service] - attributes: diff --git a/cookbooks/ipfs/.kitchen.yml b/cookbooks/ipfs/.kitchen.yml index 5c9425c..a14a206 100644 --- a/cookbooks/ipfs/.kitchen.yml +++ b/cookbooks/ipfs/.kitchen.yml @@ -6,17 +6,14 @@ provisioner: name: chef_zero platforms: - - name: ubuntu-16.04 - name: ubuntu-18.04 - name: debian-9 +verifier: + chef_license: accept + 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 index c581c93..10fb3d6 100644 --- a/cookbooks/ipfs/.travis.yml +++ b/cookbooks/ipfs/.travis.yml @@ -20,7 +20,6 @@ services: docker env: matrix: - INSTANCE=default-debian-9 - - INSTANCE=default-ubuntu-1604 - INSTANCE=default-ubuntu-1804 before_script: @@ -30,7 +29,7 @@ before_script: - cookstyle --version - foodcritic --version -script: CHEF_LICENSE=accept-no-persist KITCHEN_LOCAL_YAML=.kitchen.dokken.yml CHEF_VERSION=13.10.4 kitchen verify ${INSTANCE} +script: CHEF_LICENSE=accept-no-persist KITCHEN_LOCAL_YAML=.kitchen.dokken.yml kitchen test ${INSTANCE} matrix: include: diff --git a/cookbooks/ipfs/Berksfile.lock b/cookbooks/ipfs/Berksfile.lock index 1167417..9034595 100644 --- a/cookbooks/ipfs/Berksfile.lock +++ b/cookbooks/ipfs/Berksfile.lock @@ -10,7 +10,7 @@ GRAPH build-essential (8.1.1) mingw (>= 1.1) seven_zip (>= 0.0.0) - ipfs (0.4.0) + ipfs (0.4.2) ark (>= 0.0.0) mingw (2.1.0) seven_zip (>= 0.0.0) diff --git a/cookbooks/ipfs/attributes/default.rb b/cookbooks/ipfs/attributes/default.rb index ec65268..82a45e7 100644 --- a/cookbooks/ipfs/attributes/default.rb +++ b/cookbooks/ipfs/attributes/default.rb @@ -1,5 +1,5 @@ -node.default['ipfs']['version'] = '0.4.22' -node.default['ipfs']['checksum'] = '43431bbef105b1c8d0679350d6f496b934d005df28c13280a67f0c88054976aa' +node.default['ipfs']['version'] = '0.7.0' +node.default['ipfs']['checksum'] = 'ef7c3f1bcae94c13c6e1033855ff99bb8e19089e01ea5018437847854c8c811f' node.default['ipfs']['ulimit'] = 64000 node.default['ipfs']['memory_max'] = '512M' diff --git a/cookbooks/ipfs/metadata.json b/cookbooks/ipfs/metadata.json index 7f1ec90..a8fe82e 100644 --- a/cookbooks/ipfs/metadata.json +++ b/cookbooks/ipfs/metadata.json @@ -1,6 +1,6 @@ { "name": "ipfs", - "description": "Installs/Configures ipfs", + "description": "Installs/Configures go-ipfs", "long_description": "# IPFS Cookbook\n\nThis cookbook installs go-ipfs and starts it as a daemon\n\n## Requirements\n\n### Platforms\n\nThis cookbook is tested on Ubuntu 18.06, 16.04 and Debian 9 using Test Kitchen.\nIt currently only supports 64bit platforms\n\n### Chef\n\n- Chef 12.5 or later (the cookbook provides a\n [Custom Resource](https://docs.chef.io/custom_resources.html) to configure\n go-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']` - a hash of config options\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-2019, [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", @@ -17,7 +17,7 @@ "recipes": { }, - "version": "0.4.1", + "version": "0.7.0", "source_url": "https://github.com/67P/ipfs-cookbook", "issues_url": "https://github.com/67P/ipfs-cookbook/issues", "privacy": false, diff --git a/cookbooks/ipfs/metadata.rb b/cookbooks/ipfs/metadata.rb index 42758b4..1e8e777 100644 --- a/cookbooks/ipfs/metadata.rb +++ b/cookbooks/ipfs/metadata.rb @@ -2,9 +2,9 @@ name 'ipfs' maintainer 'Kosmos Developers' maintainer_email 'mail@kosmos.org' license 'MIT' -description 'Installs/Configures ipfs' +description 'Installs/Configures go-ipfs' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.4.1' +version '0.7.0' supports %w(ubuntu debian) diff --git a/cookbooks/ipfs/recipes/default.rb b/cookbooks/ipfs/recipes/default.rb index 73799a6..ab623b6 100644 --- a/cookbooks/ipfs/recipes/default.rb +++ b/cookbooks/ipfs/recipes/default.rb @@ -32,6 +32,7 @@ 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'] + notifies :restart, 'service[ipfs]', :delayed end execute 'ipfs init --empty-repo' do diff --git a/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb b/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb index 48cb2b4..2c6b9c5 100644 --- a/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb +++ b/cookbooks/ipfs/test/integration/default/serverspec/ipfs_spec.rb @@ -45,10 +45,7 @@ describe 'IPFS' do { 'Swarm.AddrFilters' => addr_filters.rstrip, - 'Swarm.DisableBandwidthMetrics' => true, - 'Swarm.DisableRelay' => true, - 'Swarm.ConnMgr.HighWater' => 10, - 'Swarm.ConnMgr.LowWater' => 1, + 'Gateway.Writable' => true, }.each do |k, v| describe command("IPFS_PATH=/home/ipfs/.ipfs ipfs config '#{k}'") do let(:sudo_options) { '-u ipfs -i' }