Skip to content

Commit

Permalink
Merge branch 'master' into feature/plugins/es
Browse files Browse the repository at this point in the history
* master: (67 commits)
  hotfix(oauth2) fixing postgres migration
  hotfix(cli) add the shm mock hack
  release(0.9.7)
  hotfix(dao) disable old hack to resolve hostsfile
  hotfix(oauth2) safely parse body even when empty (Kong#1915)
  hotfix(conf) load custom plugins property (Kong#1910)
  hotfix(oauth2) missing migration for postgres (Kong#1911)
  hotfix(galileo) proper empty encoding as empty arr
  hotfix(cli) fix recursive calls to the startup errorhandler
  chore(ci) bump C* to 2.2.8
  docs(changelog) add missing 0.9.6 release notes
  fix(cli) honor -c flag even if config exists at default location
  fix(api) obfuscates sensitive settings from the `/` route
  chore(makefile) make lint ignores trailing whitespaces
  chore(release) bump to 0.9.6
  fix(postgres) bump pgmoon to allow SSL connections
  release(0.9.5)
  Dropping support for 1.9.15.1
  hotfix(changelog) broken link
  release(0.9.4)
  ...
  • Loading branch information
Beauli.Zhu committed Jan 17, 2017
2 parents f9c8742 + 0c75f2b commit 6bbcdec
Show file tree
Hide file tree
Showing 65 changed files with 2,495 additions and 1,154 deletions.
2 changes: 1 addition & 1 deletion .ci/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e

export BUSTED_ARGS="-o gtest -v --exclude-tags=ci"
export TEST_CMD="KONG_SERF_PATH=$SERF_INSTALL/serf bin/busted $BUSTED_ARGS"
export TEST_CMD="KONG_SERF_PATH=$SERF_PATH bin/busted $BUSTED_ARGS"

if [ "$TEST_SUITE" == "lint" ]; then
make lint
Expand Down
103 changes: 59 additions & 44 deletions .ci/setup_env.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
set -e

export OPENRESTY_INSTALL=$CACHE_DIR/openresty
export LUAROCKS_INSTALL=$CACHE_DIR/luarocks
export SERF_INSTALL=$CACHE_DIR/serf
#---------
# Download
#---------
OPENSSL_DOWNLOAD=$DOWNLOAD_CACHE/openssl-$OPENSSL
OPENRESTY_DOWNLOAD=$DOWNLOAD_CACHE/openresty-$OPENRESTY
LUAROCKS_DOWNLOAD=$DOWNLOAD_CACHE/luarocks-$LUAROCKS
SERF_DOWNLOAD=$DOWNLOAD_CACHE/serf-$SERF

mkdir -p $CACHE_DIR
mkdir -p $OPENSSL_DOWNLOAD $OPENRESTY_DOWNLOAD $LUAROCKS_DOWNLOAD $SERF_DOWNLOAD

if [ ! "$(ls -A $CACHE_DIR)" ]; then
# Not in cache
if [ ! "$(ls -A $OPENSSL_DOWNLOAD)" ]; then
pushd $DOWNLOAD_CACHE
curl -L http://www.openssl.org/source/openssl-$OPENSSL.tar.gz | tar xz
popd
fi

if [ ! "$(ls -A $OPENRESTY_DOWNLOAD)" ]; then
pushd $DOWNLOAD_CACHE
curl -L https://openresty.org/download/openresty-$OPENRESTY.tar.gz | tar xz
popd
fi

if [ ! "$(ls -A $LUAROCKS_DOWNLOAD)" ]; then
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_DOWNLOAD
fi

# ---------------
# Install OpenSSL
# ---------------
OPENSSL_BASE=openssl-$OPENSSL
curl -L http://www.openssl.org/source/$OPENSSL_BASE.tar.gz | tar xz
if [ ! "$(ls -A $SERF_DOWNLOAD)" ]; then
pushd $SERF_DOWNLOAD
wget https://releases.hashicorp.com/serf/${SERF}/serf_${SERF}_linux_amd64.zip
unzip serf_${SERF}_linux_amd64.zip
popd
fi

# -----------------
# Install OpenResty
# -----------------
OPENRESTY_BASE=openresty-$OPENRESTY
mkdir -p $OPENRESTY_INSTALL
curl -L https://openresty.org/download/$OPENRESTY_BASE.tar.gz | tar xz
#--------
# Install
#--------
OPENSSL_INSTALL=$INSTALL_CACHE/openssl-$OPENSSL
OPENRESTY_INSTALL=$INSTALL_CACHE/openresty-$OPENRESTY
LUAROCKS_INSTALL=$INSTALL_CACHE/luarocks-$LUAROCKS
SERF_INSTALL=$INSTALL_CACHE/serf-$SERF

pushd $OPENRESTY_BASE
mkdir -p $OPENSSL_INSTALL $OPENRESTY_INSTALL $LUAROCKS_INSTALL $SERF_INSTALL

if [ ! "$(ls -A $OPENSSL_INSTALL)" ]; then
pushd $OPENSSL_DOWNLOAD
./config shared --prefix=$OPENSSL_INSTALL
make
make install
popd
fi

if [ ! "$(ls -A $OPENRESTY_INSTALL)" ]; then
pushd $OPENRESTY_DOWNLOAD
./configure \
--prefix=$OPENRESTY_INSTALL \
--with-openssl=../$OPENSSL_BASE \
--with-openssl=$OPENSSL_DOWNLOAD \
--with-ipv6 \
--with-pcre-jit \
--with-http_ssl_module \
Expand All @@ -34,17 +64,10 @@ if [ ! "$(ls -A $CACHE_DIR)" ]; then
make
make install
popd
fi

rm -rf $OPENRESTY_BASE

# ----------------
# Install Luarocks
# ----------------
LUAROCKS_BASE=luarocks-$LUAROCKS
mkdir -p $LUAROCKS_INSTALL
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE

pushd $LUAROCKS_BASE
if [ ! "$(ls -A $LUAROCKS_INSTALL)" ]; then
pushd $LUAROCKS_DOWNLOAD
git checkout v$LUAROCKS
./configure \
--prefix=$LUAROCKS_INSTALL \
Expand All @@ -54,19 +77,15 @@ if [ ! "$(ls -A $CACHE_DIR)" ]; then
make build
make install
popd
fi

rm -rf $LUAROCKS_BASE

# ------------
# Install Serf
# ------------
mkdir -p $SERF_INSTALL
pushd $SERF_INSTALL
wget https://releases.hashicorp.com/serf/${SERF}/serf_${SERF}_linux_amd64.zip
unzip serf_${SERF}_linux_amd64.zip
popd
if [ ! "$(ls -A $SERF_INSTALL)" ]; then
ln -s $SERF_DOWNLOAD/serf $SERF_INSTALL/serf
fi

export OPENSSL_DIR=$OPENSSL_INSTALL # for LuaSec install
export SERF_PATH=$SERF_INSTALL/serf # for our test instance (not in default bin/sh $PATH)

export PATH=$PATH:$OPENRESTY_INSTALL/nginx/sbin:$OPENRESTY_INSTALL/bin:$LUAROCKS_INSTALL/bin:$SERF_INSTALL

eval `luarocks path`
Expand All @@ -75,11 +94,7 @@ eval `luarocks path`
# Install ccm & setup Cassandra cluster
# -------------------------------------
if [[ "$TEST_SUITE" != "unit" ]] && [[ "$TEST_SUITE" != "lint" ]]; then
pip install --user PyYAML six
git clone https://github.com/pcmanus/ccm.git
pushd ccm
./setup.py install --user
popd
pip install --user PyYAML six ccm==2.4.6
ccm create test -v binary:$CASSANDRA -n 1 -d
ccm start -v
ccm status
Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SUMMARY_GOES_HERE
### Additional Details & Logs

- Kong version (`$ kong version`)
- Kong configuration (registered APIs/Plugins & configuration file)
- Kong debug-level startup logs (`$ kong start --vv`)
- Kong error logs (`<KONG_PREFIX>/logs/error.log`)
- Kong configuration (registered APIs/Plugins & configuration file)
- Operating System
19 changes: 13 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
sudo: false

language: c

compiler:
- gcc

notifications:
email: false

Expand All @@ -15,11 +20,12 @@ addons:
env:
global:
- SERF=0.7.0
- LUAROCKS=2.3.0
- OPENSSL=1.0.2h
- CASSANDRA=2.2.7
- OPENRESTY=1.9.15.1
- $CACHE_DIR=$HOME/cache
- LUAROCKS=2.4.0
- OPENSSL=1.0.2j
- CASSANDRA=2.2.8
- OPENRESTY=1.11.2.1
- DOWNLOAD_CACHE=$HOME/download-cache
- INSTALL_CACHE=$HOME/install-cache
matrix:
- TEST_SUITE=lint
- TEST_SUITE=unit
Expand All @@ -39,5 +45,6 @@ cache:
apt: true
pip: true
directories:
- $CACHE_DIR
- $DOWNLOAD_CACHE
- $INSTALL_CACHE
- $HOME/.ccm/repository
159 changes: 158 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,155 @@
## [Unreleased][unreleased]

## [0.9.7] - 2016/12/21

### Fixed

- Fixed a performance issue in Cassandra by removing an old workaround that was
forcing Cassandra to use LuaSocket instead of cosockets.
[#1916](https://github.com/Mashape/kong/pull/1916)
- Fixed an issue that was causing a recursive attempt to stop Kong's services
when an error was occurring.
[#1877](https://github.com/Mashape/kong/pull/1877)
- Custom plugins are now properly loaded again.
[#1910](https://github.com/Mashape/kong/pull/1910)
- Plugins:
- Galileo: properly encode empty arrays.
[#1909](https://github.com/Mashape/kong/pull/1909)
- OAuth 2: implements a missing Postgres migration for `redirect_uri` in
every OAuth 2 credential. [#1911](https://github.com/Mashape/kong/pull/1911)
- OAuth 2: safely parse the request body even when no data has been sent.
[#1915](https://github.com/Mashape/kong/pull/1915)

## [0.9.6] - 2016/11/29

### Fixed

- Resolve support for PostgreSQL SSL connections.
[#1720](https://github.com/Mashape/kong/issues/1720)
- Ensure `kong start` honors the `--conf` flag is a config file already exists
at one of the default locations (`/etc/kong.conf`, `/etc/kong/kong.conf`).
[#1681](https://github.com/Mashape/kong/pull/1681)
- Obfuscate sensitive properties from the `/` Admin API route which returns
the current node's configuration.
[#1650](https://github.com/Mashape/kong/pull/1650)

## [0.9.5] - 2016/11/07

### Changed

- Dropping support for OpenResty 1.9.15.1 in favor of 1.11.2.1
[#1797](https://github.com/Mashape/kong/pull/1797)

### Fixed

- Fixed an error (introduced in 0.9.4) in the auto-clustering event

## [0.9.4] - 2016/11/02

### Fixed

- Fixed the random string generator that was causing some problems, especially
in Serf for clustering. [#1754](https://github.com/Mashape/kong/pull/1754)
- Seed random number generator in CLI.
[#1641](https://github.com/Mashape/kong/pull/1641)
- Reducing log noise in the Admin API.
[#1781](https://github.com/Mashape/kong/pull/1781)
- Fixed the reports lock implementation that was generating a periodic error
message. [#1783](https://github.com/Mashape/kong/pull/1783)

## [0.9.3] - 2016/10/07

### Added

- Added support for Serf 0.8. [#1693](https://github.com/Mashape/kong/pull/1693)

### Fixed

- Properly invalidate global plugins.
[#1723](https://github.com/Mashape/kong/pull/1723)

## [0.9.2] - 2016/09/20

### Fixed

- Correctly report migrations errors. This was caused by an error being thrown
from the error handler, and superseding the actual error. [#1605]
(https://github.com/Mashape/kong/pull/1605)
- Prevent Kong from silently failing to start. This would be caused by an
erroneous error handler. [28f5d10]
(https://github.com/Mashape/kong/commit/28f5d10)
- Only report a random number generator seeding error when it is not already
seeded. [#1613](https://github.com/Mashape/kong/pull/1613)
- Reduce intra-cluster noise by not propagating keepalive requests events.
[#1660](https://github.com/Mashape/kong/pull/1660)
- Admin API:
- Obfuscates sensitive configuration settings from the `/` route.
[#1650](https://github.com/Mashape/kong/pull/1650)
- CLI:
- Prevent a failed `kong start` to stop an already running Kong node.
[#1645](https://github.com/Mashape/kong/pull/1645)
- Remove unset configuration placeholders from the nginx configuration
template. This would occur when no Internet connection would be
available and would cause Kong to compile an erroneous nginx config.
[#1606](https://github.com/Mashape/kong/pull/1606)
- Properly count the number of executed migrations.
[#1649](https://github.com/Mashape/kong/pull/1649)
- Plugins:
- OAuth2: remove the "Kong" mentions in missing `provision_key` error
messages. [#1633](https://github.com/Mashape/kong/pull/1633)
- OAuth2: allow to correctly delete applications when using Cassandra.
[#1659](https://github.com/Mashape/kong/pull/1659)
- galileo: provide a default `bodySize` value when `log_bodies=true` but the
current request/response has no body.
[#1657](https://github.com/Mashape/kong/pull/1657)

## [0.9.1] - 2016/09/02

### Added

- Plugins:
- ACL: allow to retrieve/update/delete an ACL by group name.
[#1544](https://github.com/Mashape/kong/pull/1544)
- Basic Authentication: allow to retrieve/update/delete a credential by `username`.
[#1570](https://github.com/Mashape/kong/pull/1570)
- HMAC Authentication: allow to retrieve/update/delete a credential by `username`.
[#1570](https://github.com/Mashape/kong/pull/1570)
- JWT Authentication: allow to retrieve/update/delete a credential by `key`.
[#1570](https://github.com/Mashape/kong/pull/1570)
- Key Authentication: allow to retrieve/update/delete a credential by `key`.
[#1570](https://github.com/Mashape/kong/pull/1570)
- OAuth2 Authentication: allow to retrieve/update/delete a credential by `client_id` and tokens by `access_token`.
[#1570](https://github.com/Mashape/kong/pull/1570)

### Fixed

- Correctly parse configuration file settings contaning comments.
[#1569](https://github.com/Mashape/kong/pull/1569)
- Prevent third-party Lua modules (and plugins) to override the seed for random
number generation. This prevents the creation of conflicitng UUIDs.
[#1558](https://github.com/Mashape/kong/pull/1558)
- Use [pgmoon-mashape](https://github.com/Mashape/pgmoon) `2.0.0` which
properly namespaces our fork, avoiding conflicts with other versions of
pgmoon, such as the one installed by Lapis.
[#1582](https://github.com/Mashape/kong/pull/1582)
- Avoid exposing OpenResty's information on HTTP `4xx` errors.
[#1567](https://github.com/Mashape/kong/pull/1567)
- ulimit with `unlimited` value is now properly handled.
[#1545](https://github.com/Mashape/kong/pull/1545)
- CLI:
- Stop third-party services (dnsmasq/Serf) when Kong could not start.
[#1588](https://github.com/Mashape/kong/pull/1588)
- Prefix database migration errors (such as Postgres' `connection refused`)
with the database name (`postgres`/`cassandra`) to avoid confusions.
[#1583](https://github.com/Mashape/kong/pull/1583)
- Plugins:
- galileo: Use `Content-Length` header to get request/response body size when
`log_bodies` is disabled.
[#1584](https://github.com/Mashape/kong/pull/1584)
- Admin API:
- Revert the `/plugins/enabled` endpoint's response to be a JSON array, and
not an Object. [#1529](https://github.com/Mashape/kong/pull/1529)

## [0.9.0] - 2016/08/18

The main focus of this release is Kong's new CLI. With a simpler configuration file, new settings, environment variables support, new commands as well as a new interpreter, the new CLI gives more power and flexibility to Kong users and allow for an easier integration in your deployment workflow, as well as better testing for developers and plugins authors. Additionally, some new plugins and performance improvements are included as well as the regular bug fixes.
Expand Down Expand Up @@ -662,7 +812,14 @@ First version running with Cassandra.
- CLI `bin/kong` script.
- Database migrations (using `db.lua`).

[unreleased]: https://github.com/mashape/kong/compare/0.9.0...next
[unreleased]: https://github.com/mashape/kong/compare/0.9.7...next
[0.9.7]: https://github.com/mashape/kong/compare/0.9.6...0.9.7
[0.9.6]: https://github.com/mashape/kong/compare/0.9.5...0.9.6
[0.9.5]: https://github.com/mashape/kong/compare/0.9.4...0.9.5
[0.9.4]: https://github.com/mashape/kong/compare/0.9.3...0.9.4
[0.9.3]: https://github.com/mashape/kong/compare/0.9.2...0.9.3
[0.9.2]: https://github.com/mashape/kong/compare/0.9.1...0.9.2
[0.9.1]: https://github.com/mashape/kong/compare/0.9.0...0.9.1
[0.9.0]: https://github.com/mashape/kong/compare/0.8.3...0.9.0
[0.8.3]: https://github.com/mashape/kong/compare/0.8.2...0.8.3
[0.8.2]: https://github.com/mashape/kong/compare/0.8.1...0.8.2
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ lint:
--globals 'ngx' \
--globals 'assert' \
--no-redefined \
--no-unused-args
--no-unused-args \
--ignore 6..

test:
@$(TEST_CMD) spec/01-unit
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ usage of the tests suites and the Makefile.

Finally, a very useful tool in Lua development (as with many other dynamic
languages) is performing static linting of your code. You can use [luacheck]
(installed with `make dev`) for this:
\(installed with `make dev`\) for this:

```
$ make lint
Expand Down Expand Up @@ -312,7 +312,7 @@ limitations under the License.
[gitter-url]: https://gitter.im/Mashape/kong
[gitter-badge]: https://img.shields.io/badge/Gitter-Join%20Chat-blue.svg
[google-groups-url]: https://groups.google.com/forum/#!forum/konglayer
[badge-travis-url]: https://travis-ci.org/Mashape/kong
[badge-travis-url]: https://travis-ci.org/Mashape/kong/branches
[badge-travis-image]: https://travis-ci.org/Mashape/kong.svg?branch=master

[busted]: https://github.com/Olivine-Labs/busted
Expand Down
Loading

0 comments on commit 6bbcdec

Please sign in to comment.