diff --git a/README.md b/README.md index 7220d2f..c52cf5f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # kong31-wallarm -Docker image with Kong 3.1.1-ubuntu and Wallarm 4.6 - https://hub.docker.com/r/dmikhin/kong31-wallarm +Docker image with Kong 3.1.1-ubuntu and Wallarm 4.6 - https://hub.docker.com/r/ebberst/kong31-wallarm Example of execution: ``` @@ -14,11 +14,12 @@ docker run -it --rm --name kong \ -e 'KONG_DECLARATIVE_CONFIG_STRING={"_format_version":"1.1", "services":[{"host":"mockbin.com","port":443,"protocol":"https", "routes":[{"paths":["/"]}]}]}' \ -e 'WALLARM_API_HOST=api.wallarm.com' \ -e 'WALLARM_API_TOKEN=' \ + -e 'WALLARM_LABELS=group=' \ -e 'TARANTOOL_MEMORY_GB=1' \ -e 'WALLARM_MODE=block' \ -p 8000:8000 \ -p 8443:8443 \ -p 8001:8001 \ -p 8444:8444 \ - dmikhin/kong31-wallarm:latest -``` \ No newline at end of file + ebberst/kong31-wallarm:latest +``` diff --git a/build_push.sh b/build_push.sh index afacba8..2dc5f54 100755 --- a/build_push.sh +++ b/build_push.sh @@ -1,5 +1,5 @@ set -ex docker build --pull \ - --tag dmikhin/kong31-wallarm:latest . -docker push dmikhin/kong31-wallarm:latest + --tag ebberst/kong31-wallarm:latest . +docker push ebberst/kong31-wallarm:latest diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index 13c34db..0869383 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -45,6 +45,9 @@ if [[ "$1" == "kong" ]]; then if [ -n "$WALLARM_MODE" ]; then sed -i -e "s|wallarm_mode monitoring|wallarm_mode $WALLARM_MODE|g" /usr/local/share/lua/5.1/kong/templates/nginx_kong.lua fi + if [ -n "$WALLARM_APPLICATION" ]; then + sed -i -e "s|wallarm_application -1 |wallarm_application $WALLARM_APPLICATION|g" /usr/local/share/lua/5.1/kong/templates/nginx_kong.lua + fi kong prepare -p "$PREFIX" "$@" ln -sf /dev/stdout $PREFIX/logs/access.log @@ -54,6 +57,9 @@ if [[ "$1" == "kong" ]]; then if [ -n "$WALLARM_API_HOST" ]; then args="$args -H $WALLARM_API_HOST" fi + if [ -n "$WALLARM_LABELS" ]; then + args="$args --labels $WALLARM_LABELS" + fi if [ -n "$TARANTOOL_MEMORY_GB" ]; then sed -i -e "s|SLAB_ALLOC_ARENA=0.2|SLAB_ALLOC_ARENA=$TARANTOOL_MEMORY_GB|g" /opt/wallarm/env.list fi