From 9a3565c11fdad1319705a5299312f9d8879a51af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Tue, 15 Jun 2021 22:21:04 +0200 Subject: [PATCH 1/3] Only keep the knife-zero gem in the Gemfile The rest is already shipped with Chef Workstation --- Gemfile | 4 - Gemfile.lock | 351 ++++++++++++++++++++++++++------------------------- 2 files changed, 176 insertions(+), 179 deletions(-) diff --git a/Gemfile b/Gemfile index c858bc7..6aafbc2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,3 @@ source 'https://rubygems.org' -gem 'chef', '~> 15.3.14' -gem 'berkshelf', '~> 7.0' gem 'knife-zero' -gem 'cookstyle' -gem 'test-kitchen' diff --git a/Gemfile.lock b/Gemfile.lock index 00f3c32..555c830 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,250 +3,251 @@ GEM specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - ast (2.4.0) - bcrypt_pbkdf (1.0.1) - berkshelf (7.0.8) - chef (>= 13.6.52) - chef-config - cleanroom (~> 1.0) - concurrent-ruby (~> 1.0) - minitar (>= 0.6) - mixlib-archive (>= 0.4, < 2.0) - mixlib-config (>= 2.2.5) - mixlib-shellout (>= 2.0, < 4.0) - octokit (~> 4.0) - retryable (>= 2.0, < 4.0) - solve (~> 4.0) - thor (>= 0.20) - builder (3.2.3) - chef (15.3.14) + builder (3.2.4) + chef (17.2.29) addressable - bcrypt_pbkdf (~> 1.0) - bundler (>= 1.10) - chef-config (= 15.3.14) + chef-config (= 17.2.29) + chef-utils (= 17.2.29) + chef-vault chef-zero (>= 14.0.11) - diff-lcs (~> 1.2, >= 1.2.4) - ed25519 (~> 1.2) + diff-lcs (>= 1.2.4, < 1.4.0) erubis (~> 2.7) - ffi (~> 1.9, >= 1.9.25) - ffi-libarchive + ffi (>= 1.5.0) + ffi-libarchive (~> 1.0, >= 1.0.3) ffi-yajl (~> 2.2) - highline (>= 1.6.9, < 2) iniparse (~> 1.4) - license-acceptance (~> 1.0, >= 1.0.5) + inspec-core (~> 4.23) + license-acceptance (>= 1.0.5, < 3) mixlib-archive (>= 0.4, < 2.0) - mixlib-authentication (~> 2.1) + mixlib-authentication (>= 2.1, < 4) mixlib-cli (>= 2.1.1, < 3.0) mixlib-log (>= 2.0.3, < 4.0) - mixlib-shellout (>= 3.0.3, < 4.0) - net-sftp (~> 2.1, >= 2.1.2) - net-ssh (>= 4.2, < 6) - net-ssh-multi (~> 1.2, >= 1.2.1) - ohai (~> 15.0) + mixlib-shellout (>= 3.1.1, < 4.0) + net-sftp (>= 2.1.2, < 4.0) + ohai (~> 17.0) plist (~> 3.2) proxifier (~> 1.0) syslog-logger (~> 1.6) - train-core (~> 3.0) - train-winrm - tty-screen (~> 0.6) - uuidtools (~> 2.1.5) - chef-config (15.3.14) + train-core (~> 3.2, >= 3.2.28) + train-winrm (>= 0.2.5) + uuidtools (>= 2.1.5, < 3.0) + chef-config (17.2.29) addressable + chef-utils (= 17.2.29) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) tomlrb (~> 1.2) - chef-zero (14.0.13) + chef-telemetry (1.0.29) + chef-config + concurrent-ruby (~> 1.0) + chef-utils (17.2.29) + concurrent-ruby + chef-vault (4.1.0) + chef-zero (15.0.4) ffi-yajl (~> 2.2) - hashie (>= 2.0, < 4.0) + hashie (>= 2.0, < 5.0) mixlib-log (>= 2.0, < 4.0) rack (~> 2.0, >= 2.0.6) uuidtools (~> 2.1) - cleanroom (1.0.0) - concurrent-ruby (1.1.5) - cookstyle (5.7.0) - rubocop (= 0.72.0) + webrick + coderay (1.1.3) + concurrent-ruby (1.1.9) diff-lcs (1.3) - ed25519 (1.2.4) - equatable (0.6.1) + erubi (1.10.0) erubis (2.7.0) - faraday (0.17.0) + faraday (1.4.2) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) multipart-post (>= 1.2, < 3) - ffi (1.11.1) - ffi-libarchive (0.4.10) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.1.0) + faraday_middleware (1.0.0) + faraday (~> 1.0) + ffi (1.15.1) + ffi-libarchive (1.0.17) ffi (~> 1.0) - ffi-yajl (2.3.1) - libyajl2 (~> 1.2) + ffi-yajl (2.4.0) + libyajl2 (>= 1.2) fuzzyurl (0.9.0) - gssapi (1.3.0) + gssapi (1.3.1) ffi (>= 1.0.1) gyoku (1.3.1) builder (>= 2.1.2) - hashie (3.6.0) - highline (1.7.10) + hashie (4.1.0) httpclient (2.8.3) - iniparse (1.4.4) + iniparse (1.5.0) + inspec-core (4.37.25) + addressable (~> 2.4) + chef-telemetry (~> 1.0, >= 1.0.8) + faraday (>= 0.9.0, < 1.5) + faraday_middleware (~> 1.0) + hashie (>= 3.4, < 5.0) + license-acceptance (>= 0.2.13, < 3.0) + method_source (>= 0.8, < 2.0) + mixlib-log (~> 3.0) + multipart-post (~> 2.0) + parallel (~> 1.9) + parslet (>= 1.5, < 2.0) + pry (~> 0.13) + rspec (>= 3.9, < 3.11) + rspec-its (~> 1.2) + rubyzip (>= 1.2.2, < 3.0) + semverse (~> 3.0) + sslshake (~> 1.2) + thor (>= 0.20, < 2.0) + tomlrb (>= 1.2, < 2.1) + train-core (~> 3.0) + tty-prompt (~> 0.17) + tty-table (~> 0.10) ipaddress (0.8.3) - jaro_winkler (1.5.3) - json (2.2.0) - knife-zero (2.1.0) + json (2.5.1) + knife-zero (2.3.2) chef (>= 15.0) - libyajl2 (1.2.0) - license-acceptance (1.0.13) + libyajl2 (2.1.0) + license-acceptance (2.1.13) pastel (~> 0.7) - tomlrb (~> 1.2) - tty-box (~> 0.3) - tty-prompt (~> 0.18) + tomlrb (>= 1.2, < 3.0) + tty-box (~> 0.6) + tty-prompt (~> 0.20) little-plugger (1.1.4) - logging (2.2.2) + logging (2.3.0) little-plugger (~> 1.1) - multi_json (~> 1.10) - minitar (0.9) - mixlib-archive (1.0.1) + multi_json (~> 1.14) + method_source (1.0.0) + mixlib-archive (1.1.7) mixlib-log - mixlib-authentication (2.1.1) - mixlib-cli (2.1.1) - mixlib-config (3.0.1) + mixlib-authentication (3.0.10) + mixlib-cli (2.1.8) + mixlib-config (3.0.9) tomlrb - mixlib-install (3.11.21) - mixlib-shellout - mixlib-versioning - thor - mixlib-log (3.0.1) - mixlib-shellout (3.0.7) - mixlib-versioning (1.2.7) - molinillo (0.6.6) - multi_json (1.13.1) + mixlib-log (3.0.9) + mixlib-shellout (3.2.5) + chef-utils + multi_json (1.15.0) multipart-post (2.1.1) - necromancer (0.5.0) - net-scp (2.0.0) - net-ssh (>= 2.6.5, < 6.0.0) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (5.2.0) - net-ssh-gateway (2.0.0) - net-ssh (>= 4.0.0) - net-ssh-multi (1.2.1) - net-ssh (>= 2.6.5) - net-ssh-gateway (>= 1.2.0) + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) + net-sftp (3.0.0) + net-ssh (>= 5.0.0, < 7.0.0) + net-ssh (6.1.0) nori (2.6.0) - octokit (4.14.0) - sawyer (~> 0.8.0, >= 0.5.3) - ohai (15.3.1) - chef-config (>= 12.8, < 16) + ohai (17.1.0) + chef-config (>= 14.12, < 18) + chef-utils (>= 16.0, < 18) ffi (~> 1.9) ffi-yajl (~> 2.2) ipaddress mixlib-cli (>= 1.7.0) mixlib-config (>= 2.0, < 4.0) mixlib-log (>= 2.0.1, < 4.0) - mixlib-shellout (>= 2.0, < 4.0) + mixlib-shellout (~> 3.2, >= 3.2.5) plist (~> 3.1) - systemu (~> 2.6.4) + train-core wmi-lite (~> 1.0) - parallel (1.18.0) - parser (2.6.5.0) - ast (~> 2.4.0) - pastel (0.7.3) - equatable (~> 0.6) + parallel (1.20.1) + parslet (1.8.2) + pastel (0.8.0) tty-color (~> 0.5) - plist (3.5.0) + plist (3.6.0) proxifier (1.0.3) - public_suffix (4.0.1) - rack (2.0.7) - rainbow (3.0.0) - retryable (3.0.4) - rubocop (0.72.0) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.6) - rainbow (>= 2.2.2, < 4.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - ruby-progressbar (1.10.1) - rubyntlm (0.6.2) - rubyzip (1.3.0) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.6) + rack (2.2.3) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-its (1.3.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.10.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-support (3.10.2) + ruby2_keywords (0.0.4) + rubyntlm (0.6.3) + rubyzip (2.3.0) semverse (3.0.0) - solve (4.0.2) - molinillo (~> 0.6) - semverse (>= 1.1, < 4.0) - strings (0.1.6) - strings-ansi (~> 0.1) - unicode-display_width (~> 1.5) + sslshake (1.3.1) + strings (0.2.1) + strings-ansi (~> 0.2) + unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) - strings-ansi (0.1.0) + strings-ansi (0.2.0) syslog-logger (1.6.8) - systemu (2.6.5) - test-kitchen (2.3.3) - bcrypt_pbkdf (~> 1.0) - ed25519 (~> 1.2) - license-acceptance (~> 1.0, >= 1.0.11) - mixlib-install (~> 3.6) - mixlib-shellout (>= 1.2, < 4.0) - net-scp (>= 1.1, < 3.0) - net-ssh (>= 2.9, < 6.0) - net-ssh-gateway (>= 1.2, < 3.0) - thor (~> 0.19) - winrm (~> 2.0) - winrm-elevated (~> 1.0) - winrm-fs (~> 1.1) - thor (0.20.3) - tomlrb (1.2.8) - train-core (3.1.3) + thor (1.1.0) + tomlrb (1.3.0) + train-core (3.7.2) + addressable (~> 2.5) + ffi (!= 1.13.0) json (>= 1.8, < 3.0) mixlib-shellout (>= 2.0, < 4.0) - net-scp (>= 1.2, < 3.0) - net-ssh (>= 2.9, < 6.0) - train-winrm (0.2.5) - winrm (~> 2.0) + net-scp (>= 1.2, < 4.0) + net-ssh (>= 2.9, < 7.0) + train-winrm (0.2.12) + winrm (>= 2.3.6, < 3.0) + winrm-elevated (~> 1.2.2) winrm-fs (~> 1.0) - tty-box (0.4.1) - pastel (~> 0.7.2) - strings (~> 0.1.6) + tty-box (0.7.0) + pastel (~> 0.8) + strings (~> 0.2.0) tty-cursor (~> 0.7) - tty-color (0.5.0) - tty-cursor (0.7.0) - tty-prompt (0.19.0) - necromancer (~> 0.5.0) - pastel (~> 0.7.0) - tty-reader (~> 0.6.0) - tty-reader (0.6.0) + tty-color (0.6.0) + tty-cursor (0.7.1) + tty-prompt (0.23.1) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.9.0) tty-cursor (~> 0.7) - tty-screen (~> 0.7) - wisper (~> 2.0.0) - tty-screen (0.7.0) - unicode-display_width (1.6.0) + tty-screen (~> 0.8) + wisper (~> 2.0) + tty-screen (0.8.1) + tty-table (0.12.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-screen (~> 0.8) + unicode-display_width (2.0.0) unicode_utils (1.4.0) - uuidtools (2.1.5) - winrm (2.3.2) + uuidtools (2.2.0) + webrick (1.7.0) + winrm (2.3.6) builder (>= 2.1.2) - erubis (~> 2.7) + erubi (~> 1.8) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) logging (>= 1.6.1, < 3.0) nori (~> 2.0) - rubyntlm (~> 0.6.0, >= 0.6.1) - winrm-elevated (1.1.1) + rubyntlm (~> 0.6.0, >= 0.6.3) + winrm-elevated (1.2.3) + erubi (~> 1.8) winrm (~> 2.0) winrm-fs (~> 1.0) - winrm-fs (1.3.2) - erubis (~> 2.7) + winrm-fs (1.3.5) + erubi (~> 1.8) logging (>= 1.6.1, < 3.0) - rubyzip (~> 1.1) + rubyzip (~> 2.0) winrm (~> 2.0) - wisper (2.0.0) - wmi-lite (1.0.2) + wisper (2.0.1) + wmi-lite (1.0.5) PLATFORMS - ruby + x86_64-darwin-18 DEPENDENCIES - berkshelf (~> 7.0) - chef (~> 15.3.14) - cookstyle knife-zero - test-kitchen From bbaeeb509951df6584baf777a8c49eb9b217fdb9 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Mon, 21 Jun 2021 17:47:30 +0200 Subject: [PATCH 2/3] Upgrade Gitea to 1.14.3 Adds a new config for the repository root directory. closes #322 --- site-cookbooks/kosmos_gitea/attributes/default.rb | 4 ++-- site-cookbooks/kosmos_gitea/recipes/default.rb | 2 ++ site-cookbooks/kosmos_gitea/templates/default/app.ini.erb | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/site-cookbooks/kosmos_gitea/attributes/default.rb b/site-cookbooks/kosmos_gitea/attributes/default.rb index fff9277..88706d9 100644 --- a/site-cookbooks/kosmos_gitea/attributes/default.rb +++ b/site-cookbooks/kosmos_gitea/attributes/default.rb @@ -1,6 +1,6 @@ -gitea_version = "1.13.7" +gitea_version = "1.14.3" node.default["kosmos_gitea"]["version"] = gitea_version node.default["kosmos_gitea"]["binary_url"] = "https://dl.gitea.io/gitea/#{gitea_version}/gitea-#{gitea_version}-linux-amd64" -node.default["kosmos_gitea"]["binary_checksum"] = "f1c0d3368d49f544183ec799005e7149fa566e3fd6eca1091d67d75b3f89f716" +node.default["kosmos_gitea"]["binary_checksum"] = "50c25c094ae109f49e276cd00ddc48a0a240b7670e487ae1286cc116d4cdbcf2" node.default["kosmos_gitea"]["nginx"]["domain"] = "gitea.kosmos.org" node.default["kosmos_gitea"]["working_directory"] = "/var/lib/gitea" diff --git a/site-cookbooks/kosmos_gitea/recipes/default.rb b/site-cookbooks/kosmos_gitea/recipes/default.rb index ba39c3c..7700eef 100644 --- a/site-cookbooks/kosmos_gitea/recipes/default.rb +++ b/site-cookbooks/kosmos_gitea/recipes/default.rb @@ -30,6 +30,7 @@ domain = node["kosmos_gitea"]["nginx"]["domain"] working_directory = node["kosmos_gitea"]["working_directory"] git_home_directory = "/home/git" +repository_root_directory = "#{git_home_directory}/gitea-repositories" config_directory = "/etc/gitea" gitea_binary_path = "/usr/local/bin/gitea" gitea_data_bag_item = data_bag_item("credentials", "gitea") @@ -101,6 +102,7 @@ template "#{config_directory}/app.ini" do sensitive true variables working_directory: working_directory, git_home_directory: git_home_directory, + repository_root_directory: repository_root_directory, config_directory: config_directory, gitea_binary_path: gitea_binary_path, jwt_secret: jwt_secret, diff --git a/site-cookbooks/kosmos_gitea/templates/default/app.ini.erb b/site-cookbooks/kosmos_gitea/templates/default/app.ini.erb index 3b80419..04eab6e 100644 --- a/site-cookbooks/kosmos_gitea/templates/default/app.ini.erb +++ b/site-cookbooks/kosmos_gitea/templates/default/app.ini.erb @@ -25,6 +25,9 @@ USER = gitea PASSWD = <%= @postgresql_password %> SSL_MODE = disable +[repository] +ROOT = <%= @repository_root_directory %> + # [indexer] # ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve From b6d0bafce0fe7c00946389f150ede6f5ff775cba Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Mon, 21 Jun 2021 17:50:23 +0200 Subject: [PATCH 3/3] Remove license header, improve formatting --- .../kosmos_gitea/recipes/default.rb | 42 +++++-------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/site-cookbooks/kosmos_gitea/recipes/default.rb b/site-cookbooks/kosmos_gitea/recipes/default.rb index 7700eef..22d148e 100644 --- a/site-cookbooks/kosmos_gitea/recipes/default.rb +++ b/site-cookbooks/kosmos_gitea/recipes/default.rb @@ -2,42 +2,20 @@ # Cookbook:: kosmos_gitea # Recipe:: default # -# The MIT License (MIT) -# -# Copyright:: 2020, Kosmos Developers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. include_recipe "kosmos-nginx" -domain = node["kosmos_gitea"]["nginx"]["domain"] - -working_directory = node["kosmos_gitea"]["working_directory"] -git_home_directory = "/home/git" +domain = node["kosmos_gitea"]["nginx"]["domain"] +working_directory = node["kosmos_gitea"]["working_directory"] +git_home_directory = "/home/git" repository_root_directory = "#{git_home_directory}/gitea-repositories" -config_directory = "/etc/gitea" -gitea_binary_path = "/usr/local/bin/gitea" -gitea_data_bag_item = data_bag_item("credentials", "gitea") -smtp_credentials = data_bag_item("credentials", "smtp") -jwt_secret = gitea_data_bag_item["jwt_secret"] -internal_token = gitea_data_bag_item["internal_token"] -secret_key = gitea_data_bag_item["secret_key"] +config_directory = "/etc/gitea" +gitea_binary_path = "/usr/local/bin/gitea" +gitea_data_bag_item = data_bag_item("credentials", "gitea") +smtp_credentials = data_bag_item("credentials", "smtp") +jwt_secret = gitea_data_bag_item["jwt_secret"] +internal_token = gitea_data_bag_item["internal_token"] +secret_key = gitea_data_bag_item["secret_key"] # Dependency package "git"