Skip to content

Commit

Permalink
Rename chef_nginx back to nginx so we can merge them
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Sep 17, 2017
1 parent 8845afd commit 169e6e0
Show file tree
Hide file tree
Showing 48 changed files with 150 additions and 148 deletions.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This file is used to list changes made in each version of the nginx cookbook.

## UNRELEASED

### Breaking Changes

- This release of the nginx cookbook merges all changes that occurred within the chef_nginx fork from 2.8 - 6.2\. This includes multiple breaking changes along with a large number of improvements and bug fixes. If you're upgrading from 2.7 to current make sure to read the whole changelog to make sure you're ready.

## 6.2.0 (2017-09-12)

- Install basic configuration before starting the nginx service
Expand All @@ -23,14 +29,13 @@ This file is used to list changes made in each version of the nginx cookbook.
- Add attributes for setting the repository URLs
- Fix support for Amazon Linux repos on Chef 13+


## 6.0.3 (2017-06-05)

- Correctly compare nginx versions with multiple digits so 1.10 is properly recognized as coming after 1.2.

## 6.0.2 (2017-04-27)

- Resolve name conflicts in the resource
- Resolve name conflicts in the resource

## 6.0.1 (2017-04-04)

Expand All @@ -45,7 +50,7 @@ This file is used to list changes made in each version of the nginx cookbook.
### Other changes

- Install nginx 1.10.3 for source based installs
- Remove freebsd cookbook from testing as its not necessary anymore
- Remove freebsd cookbook from testing as it's not necessary anymore
- Bump OpenSSL to 1.0.2k

## 5.1.3 (2017-03-24)
Expand Down Expand Up @@ -93,13 +98,14 @@ This file is used to list changes made in each version of the nginx cookbook.
- Properly disable the default site with nginx.org packages

## 5.0.2 (2016-12-22)

- Requite the latest compat_resource

## 5.0.1 (2016-12-13)

- Use multipackage in pagespeed module recipe to speed up installs
- Simplify the distro repo setup logic to ensure we're using the correct repos under all conditions. Previously the upstream repo was being missed on Suse systems
- Determine pidfile location correctly via a helper so we correctly set pidfiles when using Upstream packages on Ubuntu 14.04 / 16.04. This involved removing the attribute for the pidfile location, which may cause issues if you relied on that attribute.
- Determine pidfile location correctly via a helper so we correctly set pidfiles when using Upstream packages on Ubuntu 14.04 / 16.04\. This involved removing the attribute for the pidfile location, which may cause issues if you relied on that attribute.
- Testing improvements to make sure all suites run and the suites are testing the correct conditions

## 5.0.0 (2016-12-07)
Expand All @@ -115,12 +121,14 @@ This file is used to list changes made in each version of the nginx cookbook.
- Better document how to compile modules

## 4.0.2 (2016-12-01)

- Default to openssl 1.0.2j with source installs
- Add cookbook property to the nginx_site resource to allow using templates defined in other cookbooks
- Prevent default docroot index.html on bad url in status
- Readme improvements

## 4.0.1 (2016-10-31)

- Fix a version check in the realip recipe
- Align the config with the default config a bit
- Fix the ChefSpec matchers now that nginx_site is a custom resource
Expand Down
72 changes: 33 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# nginx Cookbook

[![Cookbook](http://img.shields.io/cookbook/v/chef_nginx.svg)](https://supermarket.chef.io/cookbooks/chef_nginx) [![Build Status](https://travis-ci.org/chef-cookbooks/chef_nginx.svg?branch=master)](https://travis-ci.org/chef-cookbooks/chef_nginx)
[![Cookbook](http://img.shields.io/cookbook/v/nginx.svg)](https://supermarket.chef.io/cookbooks/nginx) [![Build Status](https://travis-ci.org/chef-cookbooks/nginx.svg?branch=master)](https://travis-ci.org/chef-cookbooks/nginx)

Installs nginx from package OR source code and sets up configuration handling similar to Debian's Apache2 scripts.

## nginx vs. chef_nginx

This cookbook is a fork from the 2.7.x branch of the [community nginx cookbook](https://github.com/miketheman/nginx).

This fork will be actively supported by Chef Software and we will continue to migrate the cookbook to a more resource driven model, with incremental changes following the SemVer model.

## Requirements

### Cookbooks
Expand Down Expand Up @@ -42,14 +36,14 @@ Other Debian and RHEL family distributions are assumed to work.

Node attributes for this cookbook are logically separated into different files. Some attributes are set only via a specific recipe.

### chef_nginx::auth_request
### nginx::auth_request

These attributes are used in the `chef_nginx::auth_request` recipe.
These attributes are used in the `nginx::auth_request` recipe.

- `node['nginx']['auth_request']['url']` - The url to the auth_request module tar.gz file
- `node['nginx']['auth_request']['checksum']` - The checksum of the auth_request module tar.gz file

### chef_nginx::default
### nginx::default

Generally used attributes. Some have platform specific values. See `attributes/default.rb`. "The Config" refers to "nginx.conf" the main config file.

Expand All @@ -62,7 +56,7 @@ Generally used attributes. Some have platform specific values. See `attributes/d
- `node['nginx']['group']` - Group for nginx.
- `node['nginx']['port']` - Port for nginx to listen on.
- `node['nginx']['binary']` - Path to the nginx binary.
- `node['nginx']['init_style']` - How to run nginx as a service when using `chef_nginx::source`. Values can be "upstart", "systemd", or "init". This attribute is not used in the `package` recipe because the package manager's init script style for the platform is assumed.
- `node['nginx']['init_style']` - How to run nginx as a service when using `nginx::source`. Values can be "upstart", "systemd", or "init". This attribute is not used in the `package` recipe because the package manager's init script style for the platform is assumed.
- `node['nginx']['upstart']['foreground']` - Set this to true if you want upstart to run nginx in the foreground, set to false if you want upstart to detach and track the process via pid.
- `node['nginx']['upstart']['runlevels']` - String of runlevels in the format '2345' which determines which runlevels nginx will start at when entering and stop at when leaving.
- `node['nginx']['upstart']['respawn_limit']` - Respawn limit in upstart stanza format, count followed by space followed by interval in seconds.
Expand Down Expand Up @@ -92,7 +86,7 @@ Generally used attributes. Some have platform specific values. See `attributes/d
- `node['nginx']['proxy_read_timeout']` - defines a timeout (between two successive read operations) for reading a response from the proxied server.
- `node['nginx']['client_body_buffer_size']` - used for config value of `client_body_buffer_size`.
- `node['nginx']['client_max_body_size']` - specifies the maximum accepted body size of a client request, as indicated by the request header Content-Length.
- `node['nginx']['repo_source']` - when installed from a package this attribute affects which yum repositories, if any, will be added before installing the nginx package. The default value of 'epel' will use the `yum-epel` cookbook, 'nginx' will use the `chef_nginx::repo` recipe, 'passenger' will use the 'chef_nginx::repo_passenger' recipe, and setting no value will not add any additional repositories.
- `node['nginx']['repo_source']` - when installed from a package this attribute affects which yum repositories, if any, will be added before installing the nginx package. The default value of 'epel' will use the `yum-epel` cookbook, 'nginx' will use the `nginx::repo` recipe, 'passenger' will use the 'nginx::repo_passenger' recipe, and setting no value will not add any additional repositories.
- `node['nginx']['sts_max_age']` - Enable Strict Transport Security for all apps (See: <http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security>). This attribute adds the following header: Strict-Transport-Security max-age=SECONDS to all incoming requests and takes an integer (in seconds) as its argument.
- `node['nginx']['default']['modules']` - Array specifying which modules to enable via the conf-enabled config include function. Currently the only valid value is "socketproxy".
- `node['nginx']['load_modules']` - Array of paths to modules to dynamically load on nginx startup using the `load_module` directive. Default is `[]`.
Expand All @@ -119,25 +113,25 @@ Generally used attributes. Some have platform specific values. See `attributes/d

- `node['nginx']['extra_configs']` - a Hash of key/values to nginx configuration.

### chef_nginx::devel
### nginx::devel

These attributes are used in the `chef_nginx::ngx_devel_module` recipe.
These attributes are used in the `nginx::ngx_devel_module` recipe.

- `node['nginx']['devel']['version']` - The version of the nginx devel module
- `node['nginx']['devel']['url']` - The URL of the nginx devel module tar.gz file
- `node['nginx']['devel']['checksum']` - The checksum of the nginx devel module tar.gz file

### chef_nginx::echo
### nginx::echo

These attributes are used in the `chef_nginx::http_echo_module` recipe.
These attributes are used in the `nginx::http_echo_module` recipe.

- `node['nginx']['echo']['version']` - The version of `http_echo` you want (default: 0.59)
- `node['nginx']['echo']['url']` - URL for the tarball.
- `node['nginx']['echo']['checksum']` - Checksum of the tarball.

### chef_nginx::geoip
### nginx::geoip

These attributes are used in the `chef_nginx::http_geoip_module` recipe. Please note that the `country_dat_checksum` and `city_dat_checksum` are based on downloads from a datacenter in Fremont, CA, USA. You really should override these with checksums for the geo tarballs from your node location.
These attributes are used in the `nginx::http_geoip_module` recipe. Please note that the `country_dat_checksum` and `city_dat_checksum` are based on downloads from a datacenter in Fremont, CA, USA. You really should override these with checksums for the geo tarballs from your node location.

**Note** The upstream, maxmind.com, may block access for repeated downloads of the data files. It is recommended that you download and host the data files, and change the URLs in the attributes.

Expand All @@ -151,24 +145,24 @@ These attributes are used in the `chef_nginx::http_geoip_module` recipe. Please
- `node['nginx']['geoip']['lib_url']` - (Versioned) Tarball URL of the GeoIP library
- `node['nginx']['geoip']['lib_checksum']` - Checksum of the GeoIP library tarball

### chef_nginx::http_realip_module
### nginx::http_realip_module

From: <http://nginx.org/en/docs/http/ngx_http_realip_module.html>

- `node['nginx']['realip']['header']` - Header to use for the RealIp Module; only accepts "X-Forwarded-For" or "X-Real-IP"
- `node['nginx']['realip']['addresses']` - Addresses to use for the `http_realip` configuration.
- `node['nginx']['realip']['real_ip_recursive']` - If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field. Can be on "on" or "off" (default).

### chef_nginx::openssl_source
### nginx::openssl_source

These attributes are used in the `chef_nginx::openssl_source` recipe.
These attributes are used in the `nginx::openssl_source` recipe.

- `node['nginx']['openssl_source']['version']` - The version of OpenSSL you want to download and use (default: 1.0.1t)
- `node['nginx']['openssl_source']['url']` - The url for the OpenSSL source

### chef_nginx::passenger
### nginx::passenger

These attributes are used in the `chef_nginx::passenger` recipe.
These attributes are used in the `nginx::passenger` recipe.

- `node['nginx']['passenger']['version']` - passenger gem version
- `node['nginx']['passenger']['root']` - passenger gem root path
Expand All @@ -191,56 +185,56 @@ Basic configuration to use the official Phusion Passenger repositories:
- `node['nginx']['package_name']` - 'nginx-extras'
- `node['nginx']['passenger']['install_method']` - 'package'

### chef_nginx::rate_limiting
### nginx::rate_limiting

- `node['nginx']['enable_rate_limiting']` - set to true to enable rate limiting (`limit_req_zone` in nginx.conf)
- `node['nginx']['rate_limiting_zone_name']` - sets the zone in `limit_req_zone`.
- `node['nginx']['rate_limiting_backoff']` - **Incorrect name, retained for compatibility reasons** - sets the size of the shared memory zone (default=`10m`, 10 megabytes)
- `node['nginx']['rate_limit']` - set the rate limit amount for `limit_req_zone`.

### chef_nginx::repo
### nginx::repo

- `node['nginx']['upstream_repository']` - the URL to use for the package repository resource; default is set based on platform type
- `node['nginx']['repo_signing_key']` - The URL from which package signing/gpg key is retrieved

### chef_nginx::socketproxy
### nginx::socketproxy

These attributes are used in the `chef_nginx::socketproxy` recipe.
These attributes are used in the `nginx::socketproxy` recipe.

- `node['nginx']['socketproxy']['root']` - The directory (on your server) where socketproxy apps are deployed.
- `node['nginx']['socketproxy']['default_app']` - Static assets directory for requests to "/" that don't meet any proxy_pass filter requirements.
- `node['nginx']['socketproxy']['apps']['app_name']['prepend_slash']` - Prepend a slash to requests to app "app_name" before sending them to the socketproxy socket.
- `node['nginx']['socketproxy']['apps']['app_name']['context_name']` - URI (e.g. "app_name" in order to achieve "<http://mydomain.com/app_name>") at which to host the application "app_name"
- `node['nginx']['socketproxy']['apps']['app_name']['subdir']` - Directory (under `node['nginx']['socketproxy']['root']`) in which to find the application.

### chef_nginx::source
### nginx::source

These attributes are used in the `chef_nginx::source` recipe. Some of them are dynamically modified during the run. See `attributes/source.rb` for default values.
These attributes are used in the `nginx::source` recipe. Some of them are dynamically modified during the run. See `attributes/source.rb` for default values.

- `node['nginx']['source']['url']` - (versioned) URL for the nginx source code. By default this will use the version specified as `node['nginx']['version']`.
- `node['nginx']['source']['prefix']` - (versioned) prefix for installing nginx from source
- `node['nginx']['source']['conf_path']` - location of the main config file, in `node['nginx']['dir']` by default.
- `node['nginx']['source']['modules']` - Array of modules that should be compiled into nginx by including their recipes in `chef_nginx::source`.
- `node['nginx']['source']['modules']` - Array of modules that should be compiled into nginx by including their recipes in `nginx::source`.
- `node['nginx']['source']['default_configure_flags']` - The default flags passed to the configure script when building nginx.
- `node['nginx']['configure_flags']` - Preserved for compatibility and dynamically generated from the `node['nginx']['source']['default_configure_flags']` in the `chef_nginx::source` recipe.
- `node['nginx']['source']['use_existing_user']` - set to `true` if you do not want `chef_nginx::source` recipe to create system user with name `node['nginx']['user']`.
- `node['nginx']['configure_flags']` - Preserved for compatibility and dynamically generated from the `node['nginx']['source']['default_configure_flags']` in the `nginx::source` recipe.
- `node['nginx']['source']['use_existing_user']` - set to `true` if you do not want `nginx::source` recipe to create system user with name `node['nginx']['user']`.

### chef_nginx::status
### nginx::status

These attributes are used in the `chef_nginx::http_stub_status_module` recipe.
These attributes are used in the `nginx::http_stub_status_module` recipe.

- `node['nginx']['status']['port']` - The port on which nginx will serve the status info (default: 8090)

### chef_nginx::syslog
### nginx::syslog

These attributes are used in the `chef_nginx::syslog_module` recipe.
These attributes are used in the `nginx::syslog_module` recipe.

- `node['nginx']['syslog']['git_repo']` - The git repository url to use for the syslog patches.
- `node['nginx']['syslog']['git_revision']` - The revision on the git repository to checkout.

### chef_nginx::upload_progress
### nginx::upload_progress

These attributes are used in the `chef_nginx::upload_progress_module` recipe.
These attributes are used in the `nginx::upload_progress_module` recipe.

- `node['nginx']['upload_progress']['url']` - URL for the tarball.
- `node['nginx']['upload_progress']['checksum']` - Checksum of the tarball.
Expand Down Expand Up @@ -278,7 +272,7 @@ In the source recipe, it is used to determine whether control attributes for bui

## Usage

This cookbook provides three distinct installation methods, all of which are controlled via attributes and executed using the chef_nginx::default recipe.
This cookbook provides three distinct installation methods, all of which are controlled via attributes and executed using the nginx::default recipe.

### Package installation using the nginx.org repositories

Expand Down
2 changes: 1 addition & 1 deletion attributes/auth_request.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: auth_request
#
# Author:: David Radcliffe (<radcliffe.david@gmail.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: default
#
# Author:: Adam Jacob (<adam@chef.io>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/devel.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: devel
#
# Author:: Arthur Freyman (<afreyman@riotgames.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/echo.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: echo
#
# Author:: Danial Pearce (<github@tigris.id.au>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/geoip.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: geoip
#
# Author:: Jamie Winsor (<jamie@vialstudios.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/headers_more.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: headers_more
#
# Author:: Lucas Jandrew (<ljandrew@riotgames.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/lua.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: lua
#
# Author:: Arthur Freyman (<afreyman@riotgames.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/naxsi.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: naxsi
#
# Author:: Artiom Lunev (<artiom.lunev@gmail.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/openssl_source.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: openssl_source
#
# Author:: David Radcliffe (<radcliffe.david@gmail.com>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/pagespeed.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Recipe:: pagespeed_module
#
default['nginx']['pagespeed']['version'] = '1.11.33.2'
Expand Down
2 changes: 1 addition & 1 deletion attributes/passenger.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attribute:: passenger
#
# Author:: Alex Dergachev (<alex@evolvingweb.ca>)
Expand Down
2 changes: 1 addition & 1 deletion attributes/rate_limiting.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attribute:: rate_limiting
#
# Copyright:: 2013-2017, Chef Software, Inc.
Expand Down
2 changes: 1 addition & 1 deletion attributes/repo.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Recipe:: repo
#
# Author:: Nick Rycar <nrycar@bluebox.net>
Expand Down
2 changes: 1 addition & 1 deletion attributes/set_misc.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: set_misc
#

Expand Down
2 changes: 1 addition & 1 deletion attributes/socketproxy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: socketproxy.rb
#

Expand Down
8 changes: 4 additions & 4 deletions attributes/source.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Cookbook:: chef_nginx
# Cookbook:: nginx
# Attributes:: source
#
# Author:: Jamie Winsor (<jamie@vialstudios.com>)
Expand All @@ -19,7 +19,7 @@
# limitations under the License.
#

include_attribute 'chef_nginx::default'
include_attribute 'nginx::default'

default['nginx']['init_style'] = if node['platform'] == 'ubuntu' && node['platform_version'].to_f <= 14.04
# init_package identifies 12.04/14.04 as init, but we should be using upstart here
Expand All @@ -43,7 +43,7 @@
default['nginx']['source']['url'] = "http://nginx.org/download/nginx-#{node['nginx']['source']['version']}.tar.gz"
default['nginx']['source']['checksum'] = '8793bf426485a30f91021b6b945a9fd8a84d87d17b566562c3797aba8fac76fb'
default['nginx']['source']['modules'] = %w(
chef_nginx::http_ssl_module
chef_nginx::http_gzip_static_module
nginx::http_ssl_module
nginx::http_gzip_static_module
)
default['nginx']['source']['use_existing_user'] = false
Loading

0 comments on commit 169e6e0

Please sign in to comment.