...
 
Commits (3)
  • Lance Albertson's avatar
    Cinc stable patches · 812f0f19
    Lance Albertson authored
    812f0f19
  • Lance Albertson's avatar
    Cinc omnibus patches · 9e19cb6f
    Lance Albertson authored
    This pulls in changes that were originally in the client repository. The idea is
    that we can easily rebase the changes here from upstream and merge any future
    conflicts more easily.
    
    Some other notable changes:
    
    - Update omnibus Gemfile to use a patched version of omnibus-software which includes
      changes in the chef software and adds our rebranded chef-zero
    - Add support for Angry Cinc Client (useful for our build infrastructure)
    - Update Copyright to add "Cinc Project" to attribute our edits
    9e19cb6f
  • Lance Albertson's avatar
    Use cinc-auditor-core-bin instead of inspec-core-bin · 7d032f77
    Lance Albertson authored
    This properly pulls in cinc-auditor into our cinc client build. In addition, it
    properly pulls in our patched version of chef-zero.
    7d032f77
......@@ -26,11 +26,14 @@ gem "cheffish", "~> 14"
group(:omnibus_package) do
gem "appbundler"
gem "rb-readline"
gem "inspec-core", "~> 4.18"
gem "inspec-core-bin", "~> 4.18" # need to provide the binaries for inspec
gem "inspec-core", "~> 4.18",
source: "https://packagecloud.io/cinc-project/stable"
gem "cinc-auditor-core-bin", "~> 4.18", # need to provide the binaries for inspec
source: "https://packagecloud.io/cinc-project/stable"
gem "chef-vault"
gem "ed25519" # ed25519 ssh key support done here as it's a native gem we can't put in train
gem "bcrypt_pbkdf" # ed25519 ssh key support done here as it's a native gem we can't put in train
gem "chef-zero", source: "https://packagecloud.io/cinc-project/stable"
end
group(:omnibus_package, :pry) do
......
......@@ -21,4 +21,4 @@
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "chef/application/apply"
Chef::Application::Apply.new.run(enforce_license: true)
Chef::Application::Apply.new.run(enforce_license: false)
......@@ -22,4 +22,4 @@ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "chef"
require "chef/application/client"
Chef::Application::Client.new.run(enforce_license: true)
Chef::Application::Client.new.run(enforce_license: false)
......@@ -34,5 +34,5 @@ if Chef::Platform.windows?
}
Chef::Application::WindowsServiceManager.new(chef_client_service).run
else
puts "chef-service-manager is only available on Windows platforms."
puts "cinc-service-manager is only available on Windows platforms."
end
......@@ -21,4 +21,4 @@
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "chef/application/solo"
Chef::Application::Solo.new.run(enforce_license: true)
Chef::Application::Solo.new.run(enforce_license: false)
......@@ -30,5 +30,5 @@ require "chef/application/windows_service"
if Chef::Platform.windows?
Chef::Application::WindowsService.mainloop
else
puts "chef-windows-service is only available on Windows platforms."
puts "chef-cinc-service is only available on Windows platforms."
end
......@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
Dir.glob("{lib}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
spec.bindir = "bin"
spec.executables = %w{ chef-apply chef-client chef-resource-inspector chef-service-manager chef-shell chef-solo chef-windows-service }
spec.executables = %w{ cinc-apply cinc-client cinc-resource-inspector cinc-service-manager cinc-shell cinc-solo cinc-windows-service }
end
module ChefConfig
class Dist
# The chef executable name.
EXEC = "chef".freeze
EXEC = "cinc".freeze
# The client's alias (chef-client)
CLIENT = "chef-client".freeze
CLIENT = "cinc-client".freeze
# A short name for the product
SHORT = "chef".freeze
SHORT = "cinc".freeze
# The suffix for Chef's /etc/chef, /var/chef and C:\\Chef directories
# "cinc" => /etc/cinc, /var/cinc, C:\\cinc
DIR_SUFFIX = "chef".freeze
DIR_SUFFIX = "cinc".freeze
# The user's configuration directory
USER_CONF_DIR = ".chef".freeze
USER_CONF_DIR = ".cinc".freeze
end
end
......@@ -5,48 +5,48 @@ class Chef
# This class is not fully implemented, depending on it is not recommended!
# When referencing a product directly, like Chef (Now Chef Infra)
PRODUCT = "Chef Infra Client".freeze
PRODUCT = "Cinc Client".freeze
# A short designation for the product, used in Windows event logs
# and some nomenclature.
SHORT = ChefConfig::Dist::SHORT.freeze
# The name of the server product
SERVER_PRODUCT = "Chef Infra Server".freeze
SERVER_PRODUCT = "Cinc Server".freeze
# The client's alias (chef-client)
CLIENT = ChefConfig::Dist::CLIENT.freeze
# name of the automate product
AUTOMATE = "Chef Automate".freeze
AUTOMATE = "Cinc Dashboard".freeze
# The chef executable, as in `chef gem install` or `chef generate cookbook`
EXEC = ChefConfig::Dist::EXEC.freeze
# product website address
WEBSITE = "https://chef.io".freeze
WEBSITE = "https://gitlab.com/cinc-project/organization-subjects/wikis/home".freeze
# Chef-Zero's product name
ZERO = "Chef Infra Zero".freeze
ZERO = "Cinc Zero".freeze
# Chef-Solo's product name
SOLO = "Chef Infra Solo".freeze
SOLO = "Cinc Solo".freeze
# The chef-zero executable (local mode)
ZEROEXEC = "chef-zero".freeze
ZEROEXEC = "cinc-zero".freeze
# The chef-solo executable (legacy local mode)
SOLOEXEC = "chef-solo".freeze
SOLOEXEC = "cinc-solo".freeze
# The chef-shell executable
SHELL = "chef-shell".freeze
SHELL = "cinc-shell".freeze
# The chef-apply executable
APPLY = "chef-apply".freeze
# Configuration related constants
# The chef-shell configuration file
SHELL_CONF = "chef_shell.rb".freeze
SHELL_CONF = "cinc_shell.rb".freeze
# The configuration directory
CONF_DIR = ChefConfig::Config.etc_chef_dir.freeze
......@@ -55,6 +55,6 @@ class Chef
USER_CONF_DIR = ChefConfig::Dist::USER_CONF_DIR.freeze
# The server's configuration directory
SERVER_CONF_DIR = "/etc/chef-server".freeze
SERVER_CONF_DIR = "/etc/cinc-server".freeze
end
end
source "https://rubygems.org"
gem "omnibus", git: "https://github.com/chef/omnibus", branch: "master"
gem "omnibus-software", git: "https://github.com/chef/omnibus-software", branch: "master"
gem "omnibus-software", path: "../../omnibus-software"
gem "artifactory"
gem "pedump"
......
#
# Copyright 2012-2016, Chef Software, Inc.
# Copyright 2019, Cinc Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -20,23 +21,23 @@
# `config/project/chef.rb`.
#
current_file = __FILE__
chef_project_contents = IO.read(File.expand_path("../chef.rb", __FILE__))
chef_project_contents = IO.read(File.expand_path("../cinc.rb", __FILE__))
instance_eval chef_project_contents
name "angrychef"
friendly_name "Angry Chef Client"
name "angrycinc"
friendly_name "Angry Cinc Client"
if windows?
# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files"
# Native gems will use gcc which will barf on files with spaces,
# which is only fixable if everyone in the world fixes their Makefiles
install_dir "#{default_root}/opscode/#{name}"
package_name "angrychef"
install_dir "#{default_root}/cinc-project/#{name}"
package_name "angrycinc"
else
install_dir "#{default_root}/#{name}"
end
resources_path "#{resources_path}/../chef"
resources_path "#{resources_path}/../cinc"
msi_upgrade_code = "D7FDDC1A-7668-404E-AD2F-61F875632A9C"
project_location_dir = "angrychef"
project_location_dir = "angrycinc"
#
# Copyright 2012-2018, Chef Software Inc.
# Copyright 2019, Cinc Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -14,12 +15,12 @@
# limitations under the License.
#
name "chef"
friendly_name "Chef Infra Client"
maintainer "Chef Software, Inc. <maintainers@chef.io>"
homepage "https://www.chef.io"
license "Chef EULA"
license_file "CHEF-EULA.md"
name "cinc"
friendly_name "Cinc Client"
maintainer "Cinc Project <maintainers@cinc.sh>"
homepage "https://www.cinc.sh"
license "Apache-2.0"
license_file "../LICENSE"
build_iteration 1
# Do not use __FILE__ after this point, use current_file. If you use __FILE__
......@@ -33,8 +34,8 @@ if windows?
# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files"
# Native gems will use gcc which will barf on files with spaces,
# which is only fixable if everyone in the world fixes their Makefiles
install_dir "#{default_root}/opscode/#{name}"
package_name "chef-client"
install_dir "#{default_root}/cinc-project/#{name}"
package_name "cinc"
else
install_dir "#{default_root}/#{name}"
end
......@@ -71,7 +72,7 @@ end
dependency "ruby-cleanup"
package :rpm do
signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"]
# signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"]
compression_level 1
compression_type :xz
end
......@@ -83,8 +84,8 @@ end
proj_to_work_around_cleanroom = self # wat voodoo hackery is this?
package :pkg do
identifier "com.getchef.pkg.#{proj_to_work_around_cleanroom.name}"
signing_identity "Chef Software, Inc. (EU3VF8YLX2)"
identifier "com.cinc-project.pkg.#{proj_to_work_around_cleanroom.name}"
# signing_identity "Developer ID Installer: Chef Software, Inc. (EU3VF8YLX2)"
end
compress :dmg
......@@ -95,11 +96,11 @@ package :msi do
upgrade_code msi_upgrade_code
wix_candle_extension "WixUtilExtension"
wix_light_extension "WixUtilExtension"
signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
parameters ChefLogDllPath: windows_safe_path(gem_path("chef-[0-9]*-mingw32/ext/win32-eventlog/chef-log.dll")),
# signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
parameters CincLogDllPath: windows_safe_path(gem_path("chef-[0-9]*-mingw32/ext/win32-eventlog/chef-log.dll")),
ProjectLocationDir: project_location_dir
end
package :appx do
signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
# signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
end
......@@ -11,8 +11,8 @@
#
PROGNAME=`basename $0`
INSTALLER_DIR=/opt/chef
CONFIG_DIR=/etc/chef
INSTALLER_DIR=/opt/cinc
CONFIG_DIR=/etc/cinc
USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])"
error_exit()
......@@ -87,25 +87,34 @@ rm -f $PREFIX/bin/chef-shell
rm -f $PREFIX/bin/knife
rm -f $PREFIX/bin/ohai
ln -sf $INSTALLER_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin"
if [ -f "$INSTALLER_DIR/bin/chef-apply" ]; then
ln -sf $INSTALLER_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin"
ln -sf $INSTALLER_DIR/bin/cinc-solo $PREFIX/bin || error_exit "Cannot link cinc-solo to $PREFIX/bin"
if [ -f "$INSTALLER_DIR/bin/cinc-apply" ]; then
ln -sf $INSTALLER_DIR/bin/cinc-apply $PREFIX/bin || error_exit "Cannot link cinc-apply to $PREFIX/bin"
fi
if [ -f "$INSTALLER_DIR/bin/chef-shell" ]; then
ln -sf $INSTALLER_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin"
if [ -f "$INSTALLER_DIR/bin/cinc-shell" ]; then
ln -sf $INSTALLER_DIR/bin/cinc-shell $PREFIX/bin || error_exit "Cannot link cinc-shell to $PREFIX/bin"
fi
ln -sf $INSTALLER_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin"
ln -sf $INSTALLER_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin"
# We test for the presence of /usr/bin/chef-client to know if this script succeeds, so this
# We test for the presence of /usr/bin/cinc-client to know if this script succeeds, so this
# must appear as the last real action in the script
ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin"
ln -sf $INSTALLER_DIR/bin/cinc-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin"
wrapper_links="chef-apply chef-client chef-shell chef-solo"
link_target="cinc-wrapper"
for link in $wrapper_links; do
if [ ! -e $PREFIX/bin/$link ]; then
echo "Symlinking $link command to cinc-wrapper for compatibility..."
ln -sf $INSTALLER_DIR/bin/$link_target $PREFIX/bin/$link || error_exit "Cannot link $link_target to $PREFIX/bin/$link"
fi
done
# Ensure all files/directories in $INSTALLER_DIR are owned by root. This
# has been fixed on new installs but upgrades from old installs need to
# be manually fixed.
chown -Rh 0:0 $INSTALLER_DIR
echo "Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io"
echo "Thank you for installing Cinc Client, the community build based on Chef Infra Client!"
exit 0
......@@ -33,10 +33,19 @@ else
fi
cleanup_symlinks() {
binaries="chef-client chef-solo chef-apply chef-shell knife ohai"
binaries="cinc-client cinc-solo cinc-apply cinc-shell knife ohai"
for binary in $binaries; do
rm -f $PREFIX/bin/$binary
done
wrapper_links="chef-apply chef-client chef-shell chef-solo"
link_target="cinc-wrapper"
for link in $wrapper_links; do
if [ -L $PREFIX/bin/$link -a "$(readlink $PREFIX/bin/$link)" = "$INSTALLER_DIR/bin/$link_target" ]; then
echo "Removing $link compatibility symlink..."
rm -f $PREFIX/bin/$link
fi
done
}
# Clean up binary symlinks if they exist
......
......@@ -7,12 +7,12 @@
# this programming language. do not touch.
# - if you are under 40, get peer review from your elders.
INSTALLER_DIR=/opt/chef
INSTALLER_DIR=/opt/cinc
if [ -e $INSTALLER_DIR ]; then
echo "removing $INSTALLER_DIR..."
# have to do this dance of moving /opt/chef to a tmp dir since files may be in use
tmp_dir="/opt/.chef.$$"
# have to do this dance of moving /opt/cinc to a tmp dir since files may be in use
tmp_dir="/opt/.cinc.$$"
# if we can't create the tmp_dir then fail hard to prevent any possible security hole
(umask 077 && mkdir $tmp_dir) || exit 1
# now we can clean up the tmp_dir we created safely
......