Skip to content

Commit

Permalink
[apicast] automatically forward env variables
Browse files Browse the repository at this point in the history
all variables starting with APICAST_ or THREESCALE_
will be forwarded to the nginx processes
  • Loading branch information
mikz committed Mar 14, 2017
1 parent 319f06b commit 203b5b9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed

- Use per request configuration when cache is disabled [PR #289](https://github.com/3scale/apicast/pull/289)
- Automatically expose all environment variables starting with `APICAST_` or `THREESCALE_` to nginx [PR #292](https://github.com/3scale/apicast/pull/292)

### Added

Expand Down
1 change: 1 addition & 0 deletions apicast/bin/apicast
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ done

main+=("daemon ${daemon};")
main+=("worker_processes ${worker_processes};")
main+=$(printenv | awk '$1 ~ /^(APICAST|THREESCALE)_/ {split($0,env,"="); print "env", env[1] ";"}')

function join_by { local IFS="$1"; shift; echo "$*"; }
args=$(join_by '' "${args[@]}")
Expand Down
12 changes: 0 additions & 12 deletions apicast/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
env THREESCALE_DEPLOYMENT_ENV;
env THREESCALE_PORTAL_ENDPOINT;
env THREESCALE_CONFIG_FILE;
env APICAST_CUSTOM_CONFIG;
env APICAST_PATH_ROUTING_ENABLED;
env APICAST_SERVICES;
env REDIS_HOST;
env REDIS_PORT;
env RESOLVER;
env APICAST_MODULE;
env APICAST_RESPONSE_CODES;
env APICAST_MANAGEMENT_API;
env BACKEND_ENDPOINT_OVERRIDE;

env APICAST_CONFIGURATION_LOADER;
env APICAST_CONFIGURATION_CACHE;

include ../main.d/*.conf;

error_log /dev/null emerg;
Expand Down

0 comments on commit 203b5b9

Please sign in to comment.