diff --git a/NGINX-SOAP-REST/README.md b/NGINX-SOAP-REST/README.md index ac73cb8..1a2ab62 100644 --- a/NGINX-SOAP-REST/README.md +++ b/NGINX-SOAP-REST/README.md @@ -11,8 +11,8 @@ NGINX Plus manages client requests based on service definitions provided by an e This repo has been tested with: - Linux VM -- Docker-compose v2.20.2+ -- NGINX Plus R29+ license (`nginx-repo.crt` and `nginx-repo.key`) +- Docker compose v2.20.2+ +- NGINX Plus R33+ license (`nginx-repo.crt`, `nginx-repo.key` and `license.jwt`) ## Current status / work in progress @@ -64,7 +64,7 @@ To start the environment: 1. Run the startup script: during its first run it will build all Docker images ``` -$ ./nginx-soap-rest.sh -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key +$ ./nginx-soap-rest.sh -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key -j ./license.jwt [+] Running 6/6 [...] ✔ Network nginx-soap-rest_lab-network Created diff --git a/NGINX-SOAP-REST/docker-compose.yaml b/NGINX-SOAP-REST/docker-compose.yaml index 0800508..700c415 100644 --- a/NGINX-SOAP-REST/docker-compose.yaml +++ b/NGINX-SOAP-REST/docker-compose.yaml @@ -1,5 +1,3 @@ -version: "3.9" - services: openldap: container_name: openldap @@ -71,6 +69,7 @@ services: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/soaprest.js:/etc/nginx/conf.d/soaprest.js:ro - ./nginx/soaprest.conf:/etc/nginx/conf.d/soaprest.conf:ro + - ${NGINX_JWT}:/etc/nginx/license.jwt:ro - /dev/null:/etc/nginx/conf.d/default.conf:ro secrets: diff --git a/NGINX-SOAP-REST/nginx-soap-rest.sh b/NGINX-SOAP-REST/nginx-soap-rest.sh index c891b83..81d7c63 100755 --- a/NGINX-SOAP-REST/nginx-soap-rest.sh +++ b/NGINX-SOAP-REST/nginx-soap-rest.sh @@ -10,16 +10,17 @@ $0 [options]\n\n -h\t\t\t- This help\n -o [start|stop]\t- Start/stop the lab\n -C [file.crt]\t\t- Certificate file to pull packages from the official NGINX repository\n --K [file.key]\t\t- Key file to pull packages from the official NGINX repository\n\n +-K [file.key]\t\t- Key file to pull packages from the official NGINX repository\n +-j [license.jwt]\t- JWT license for NGINX Plus R33+\n\n === Examples:\n\n Lab start:\n -\t$0 -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key\n\n +\t$0 -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key -j ./license.jwt\n\n Lab stop:\n \t$0 -o stop\n\n " -while getopts 'ho:C:K:' OPTION +while getopts 'ho:C:K:j:' OPTION do case "$OPTION" in h) @@ -35,6 +36,9 @@ do K) export NGINX_KEY=$OPTARG ;; + j) + export NGINX_JWT=$OPTARG + ;; esac done @@ -46,18 +50,19 @@ fi case $MODE in 'start') - if [ -z "${NGINX_CERT}" ] || [ -z "${NGINX_KEY}" ] + if [ -z "${NGINX_CERT}" ] || [ -z "${NGINX_KEY}" ] || [ -z "${NGINX_JWT}" ] then - echo "Missing NGINX Plus certificate/key" + echo "Missing NGINX Plus certificate/key/jwt license" exit fi - DOCKER_BUILDKIT=1 docker-compose -p $PROJECT_NAME -f $DOCKERCOMPOSE up -d --remove-orphans + DOCKER_BUILDKIT=1 docker compose -p $PROJECT_NAME -f $DOCKERCOMPOSE up -d --remove-orphans ;; 'stop') export NGINX_CERT="x" export NGINX_KEY="x" - docker-compose -p $PROJECT_NAME -f $DOCKERCOMPOSE down + export NGINX_JWT="x" + docker compose -p $PROJECT_NAME -f $DOCKERCOMPOSE down ;; *) echo "$0 [start|stop]"