Skip to content

Commit

Permalink
Merge pull request #406 from 3scale/disable-v1-api-by-default
Browse files Browse the repository at this point in the history
[remote_v1] disable v1 API by default
  • Loading branch information
mikz authored Aug 30, 2017
2 parents 8981fbd + bf09f05 commit cfeaf5a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- `THREESCALE\_DEPLOYMENT\_ENV` defaults to `production` [PR #406](https://github.com/3scale/apicast/pull/406)
- OIDC is now used based on settings on the API Manager [PR #405](https://github.com/3scale/apicast/pull/405)

## [3.1.0-beta2] - 2017-08-21
Expand Down
8 changes: 7 additions & 1 deletion apicast/bin/apicast
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ usage () {
-s <signal> Send signal to a master process: stop, quit, reopen, reload
-p <pid> Path to the PID file.
-b Load configuration on boot.
-e Deployment environment. Can be staging or production.
USAGE
}

main=("")
args=("")

while getopts ":dc:hvbqi:rw:m:s:p:" opt; do
while getopts ":dc:hvbqi:rw:m:s:p:e:" opt; do
case "${opt}" in
d)
daemon="on"
Expand All @@ -86,6 +87,9 @@ while getopts ":dc:hvbqi:rw:m:s:p:" opt; do
;;
i)
export APICAST_CONFIGURATION_CACHE="${OPTARG}"
;;
e)
export THREESCALE_DEPLOYMENT_ENV="${OPTARG}"
;;
w)
worker_processes=${OPTARG}
Expand All @@ -112,6 +116,8 @@ while getopts ":dc:hvbqi:rw:m:s:p:" opt; do
esac
done

export THREESCALE_DEPLOYMENT_ENV=${THREESCALE_DEPLOYMENT_ENV-production}

main+=("daemon ${daemon};")
main+=("worker_processes ${worker_processes};")
main+=$(printenv | awk '$1 ~ /^(APICAST|THREESCALE)_/ {split($0,env,"="); print "env", env[1] ";"}')
Expand Down
4 changes: 2 additions & 2 deletions apicast/src/configuration_loader/remote_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function _M:index(host)
return nil, 'wrong endpoint url'
end

local env = resty_env.get('THREESCALE_DEPLOYMENT_ENV')
local env = resty_env.value('THREESCALE_DEPLOYMENT_ENV')

if not env then
return nil, 'missing environment'
Expand Down Expand Up @@ -147,7 +147,7 @@ function _M:call(environment)
return nil, 'not initialized'
end

local env = environment or resty_env.get('THREESCALE_DEPLOYMENT_ENV')
local env = environment or resty_env.value('THREESCALE_DEPLOYMENT_ENV')
if not env then
return nil, 'missing environment'
end
Expand Down
4 changes: 2 additions & 2 deletions doc/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ Allows to specify a custom DNS resolver that will be used by OpenResty. If the `

### `THREESCALE_DEPLOYMENT_ENV`

**Values:** sandbox | production
**Default:** no value
**Values:** staging | production
**Default:** production

The value of this environment variable will be used to define the environment for which the configuration will be downloaded from 3scale (Staging or Production), when using new APIcast.

Expand Down

0 comments on commit cfeaf5a

Please sign in to comment.