From 15b5f6cc49cc12378e991db6ea04c3a6685092e0 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 17 May 2023 20:03:39 +0000 Subject: [PATCH 1/4] updated docker for wallarm_labels and updated the build script to my docker repo --- README.md | 7 ++++--- build_push.sh | 4 ++-- scripts/docker-entrypoint.sh | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7220d2f..44acf29 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_LABEL=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..c62485a 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -54,6 +54,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 From 9bb77878febcff7f713edebcd7da7afe2f4a53f7 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 17 May 2023 20:12:33 +0000 Subject: [PATCH 2/4] fixed if statement --- scripts/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index c62485a..9c5cfbb 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -54,7 +54,7 @@ if [[ "$1" == "kong" ]]; then if [ -n "$WALLARM_API_HOST" ]; then args="$args -H $WALLARM_API_HOST" fi - if [ -n "$WALLARM_LABELS"]; then + if [ -n "$WALLARM_LABELS" ]; then args="$args --labels $WALLARM_LABELS" fi if [ -n "$TARANTOOL_MEMORY_GB" ]; then From 0f2ed2668a39d352bc0721d642970da925382f57 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 17 May 2023 20:13:14 +0000 Subject: [PATCH 3/4] update WALLARM_LABEL to Plural --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44acf29..c52cf5f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ 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_LABEL=group=' \ + -e 'WALLARM_LABELS=group=' \ -e 'TARANTOOL_MEMORY_GB=1' \ -e 'WALLARM_MODE=block' \ -p 8000:8000 \ From 2ce9b8abadc0a4352ab91ea66bf3533605fb8a23 Mon Sep 17 00:00:00 2001 From: tebbers Date: Tue, 10 Oct 2023 19:25:06 -0400 Subject: [PATCH 4/4] Update docker-entrypoint.sh --- scripts/docker-entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index 9c5cfbb..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