From e4aabaa5ca4e025285b975e6e29889dbe2d3dfa3 Mon Sep 17 00:00:00 2001 From: Leonard Goodell Date: Wed, 16 Aug 2023 12:02:39 -0700 Subject: [PATCH] fix: Set EXTRA_PROXY_ROUTE_LIST for all add on services except Device Virtual fixes #405 Signed-off-by: Leonard Goodell --- compose-builder/Makefile | 112 ++++++++++++++++++++++- docker-compose-arm64.yml | 2 +- docker-compose-with-app-sample-arm64.yml | 2 +- docker-compose-with-app-sample.yml | 2 +- docker-compose.yml | 2 +- 5 files changed, 112 insertions(+), 8 deletions(-) diff --git a/compose-builder/Makefile b/compose-builder/Makefile index 14e2c077..92c984e2 100644 --- a/compose-builder/Makefile +++ b/compose-builder/Makefile @@ -126,6 +126,12 @@ ifeq (ds-onvif-camera, $(filter ds-onvif-camera,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-onvif-camera],message-bus[device-onvif-camera] endif + PROXY_ROUTE:=device-onvif-camera.http://edgex-device-onvif-camera:59984 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-onvif-camera) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -148,6 +154,12 @@ ifeq (ds-usb-camera, $(filter ds-usb-camera,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-usb-camera],message-bus[device-usb-camera] endif + PROXY_ROUTE:=device-usb-camera.http://edgex-device-usb-camera:59983 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-usb-camera device-usb-camera docker-entrypoint.sh) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -170,6 +182,12 @@ ifeq (ds-bacnet-ip, $(filter ds-bacnet-ip,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-bacnet-ip],message-bus[device-bacnet-ip] endif + PROXY_ROUTE:=device-bacnet-ip.http://edgex-device-bacnet-ip:59980 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-bacnet-ip device-bacnet-ip device-bacnet-ip/device-bacnet-c " -cp=consul://edgex-core-consul:8500 --registry") COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) @@ -193,6 +211,12 @@ ifeq (ds-bacnet-mstp, $(filter ds-bacnet-mstp,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-bacnet-mstp],message-bus[device-bacnet-mstp] endif + PROXY_ROUTE:=device-bacnet-mstp.http://edgex-device-bacnet-mstp:59980 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-bacnet-mstp device-bacnet-mstp device-bacnet-mstp/device-bacnet-c " -cp=consul://edgex-core-consul:8500 --registry") COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) @@ -216,6 +240,12 @@ ifeq (ds-modbus, $(filter ds-modbus,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-modbus],message-bus[device-modbus] endif + PROXY_ROUTE:=device-modbus.http://edgex-device-modbus:59901 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-modbus) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -242,6 +272,12 @@ ifeq (ds-mqtt, $(filter ds-mqtt,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-mqtt],message-bus[device-mqtt] endif + PROXY_ROUTE:=device-mqtt.http://edgex-device-mqtt:59982 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-mqtt) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -254,11 +290,18 @@ endif ifeq (ds-rest, $(filter ds-rest,$(ARGS))) COMPOSE_FILES:=$(COMPOSE_FILES) -f add-device-rest.yml ifneq (no-secty, $(filter no-secty,$(ARGS))) + # Device-rest's token is created by default, so not setting TOKEN_LIST ifeq ($(KNOWN_SECRETS_LIST),) KNOWN_SECRETS_LIST:=redisdb[device-rest],message-bus[device-rest] else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-rest],message-bus[device-rest] endif + PROXY_ROUTE:=device-rest.http://edgex-device-rest:59986 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-rest) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -281,6 +324,12 @@ ifeq (ds-snmp, $(filter ds-snmp,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-snmp],message-bus[device-snmp] endif + PROXY_ROUTE:=device-snmp.http://edgex-device-snmp:59993 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-snmp device-snmp device-snmp) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -293,12 +342,13 @@ endif ifeq (ds-virtual, $(filter ds-virtual,$(ARGS))) COMPOSE_FILES:=$(COMPOSE_FILES) -f add-device-virtual.yml ifneq (no-secty, $(filter no-secty,$(ARGS))) - # Device-virtual's token is created by default. + # Device-virtual's token is created by default, so not setting TOKEN_LIST ifeq ($(KNOWN_SECRETS_LIST),) KNOWN_SECRETS_LIST:=redisdb[device-virtual],message-bus[device-virtual] else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-virtual],message-bus[device-virtual] endif + # Device-virtual's proxy is created by default, so not setting EXTRA_PROXY_ROUTE_LIST extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-virtual) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -321,6 +371,12 @@ ifeq (ds-llrp, $(filter ds-llrp,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-rfid-llrp],message-bus[device-rfid-llrp] endif + PROXY_ROUTE:=device-rfid-llrp.http://edgex-device-rfid-llrp:59989 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-rfid-llrp) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -343,6 +399,12 @@ ifeq (ds-coap, $(filter ds-coap,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-coap],message-bus[device-coap] endif + PROXY_ROUTE:=device-coap.http://edgex-device-coap:59988 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-coap) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -365,6 +427,12 @@ ifeq (ds-gpio, $(filter ds-gpio,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-gpio],message-bus[device-gpio] endif + PROXY_ROUTE:=device-gpio.http://edgex-device-gpio:59910 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-gpio) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) # add runtime token config for delayed-start if specified @@ -387,11 +455,11 @@ ifeq (ds-uart, $(filter ds-uart,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-uart],message-bus[device-uart] endif - UART_PROXY_ROUTE:=device-uart.http://edgex-device-uart:59995 + PROXY_ROUTE:=device-uart.http://edgex-device-uart:59995 ifeq ($(EXTRA_PROXY_ROUTE_LIST),) - EXTRA_PROXY_ROUTE_LIST:=$(UART_PROXY_ROUTE) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) else - EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(UART_PROXY_ROUTE) + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) endif extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-uart) COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file) @@ -422,6 +490,12 @@ ifeq (asc-http, $(filter asc-http,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[app-http-export],message-bus[app-http-export] endif + PROXY_ROUTE:=app-http-export.http://edgex-app-http-export:59704 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif # when no security mode (no-secty) not explicitly specified, # then we also need to add the secure version on top of base yml by default. extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-http-export \ @@ -452,6 +526,12 @@ ifeq (asc-mqtt, $(filter asc-mqtt,$(ARGS))) else IS_MQTT_BUS:=0 endif + PROXY_ROUTE:=app-mqtt-export.http://edgex-app-mqtt-export:59703 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif # when no security mode (no-secty) not explicitly specified, # then we also need to add the secure version on top of base yml by default. extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" IS_MQTT_BUS="$(IS_MQTT_BUS)" ./gen_secure_compose_ext.sh app-mqtt-export \ @@ -478,6 +558,12 @@ ifeq (asc-sample, $(filter asc-sample,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[app-sample],message-bus[app-sample] endif + PROXY_ROUTE:=app-sample.http://edgex-app-sample:59700 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif # when no security mode (no-secty) not explicitly specified, # then we also need to add the secure version on top of base yml by default. extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-sample \ @@ -504,6 +590,12 @@ ifeq (asc-metrics, $(filter asc-metrics,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[app-metrics-influxdb],message-bus[app-metrics-influxdb] endif + PROXY_ROUTE:=app-metrics-influxdb.http://edgex-app-metrics-influxdb:59707 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif # when no security mode (no-secty) not explicitly specified, # then we also need to add the secure version on top of base yml by default. extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-metrics-influxdb \ @@ -529,6 +621,12 @@ ifeq (as-llrp, $(filter as-llrp,$(ARGS))) else KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[app-rfid-llrp-inventory],message-bus[app-rfid-llrp-inventory] endif + PROXY_ROUTE:=app-rfid-llrp-inventory.http://edgex-app-rfid-llrp-inventory:59711 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif # when no security mode (no-secty) not explicitly specified, # then we also need to add the secure version on top of base yml by default. extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh app-rfid-llrp-inventory) @@ -558,6 +656,12 @@ ifeq (asc-ex-mqtt, $(filter asc-ex-mqtt,$(ARGS))) else IS_MQTT_BUS:=0 endif + PROXY_ROUTE:=app-external-mqtt-trigger.http://edgex-app-external-mqtt-trigger:59706 + ifeq ($(EXTRA_PROXY_ROUTE_LIST),) + EXTRA_PROXY_ROUTE_LIST:=$(PROXY_ROUTE) + else + EXTRA_PROXY_ROUTE_LIST:=$(EXTRA_PROXY_ROUTE_LIST),$(PROXY_ROUTE) + endif # when no security mode (no-secty) not explicitly specified, # then we also need to add the secure version on top of base yml by default. extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" IS_MQTT_BUS="$(IS_MQTT_BUS)" ./gen_secure_compose_ext.sh app-external-mqtt-trigger \ diff --git a/docker-compose-arm64.yml b/docker-compose-arm64.yml index 0c0bcfc5..123f4861 100644 --- a/docker-compose-arm64.yml +++ b/docker-compose-arm64.yml @@ -903,7 +903,7 @@ services: entrypoint: - /edgex-init/proxy_setup_wait_install.sh environment: - EDGEX_ADD_PROXY_ROUTE: "" + EDGEX_ADD_PROXY_ROUTE: device-rest.http://edgex-device-rest:59986 EDGEX_SECURITY_SECRET_STORE: "true" PROXY_SETUP_HOST: edgex-security-proxy-setup ROUTES_CORE_COMMAND_HOST: edgex-core-command diff --git a/docker-compose-with-app-sample-arm64.yml b/docker-compose-with-app-sample-arm64.yml index 169b365c..5883688b 100644 --- a/docker-compose-with-app-sample-arm64.yml +++ b/docker-compose-with-app-sample-arm64.yml @@ -973,7 +973,7 @@ services: entrypoint: - /edgex-init/proxy_setup_wait_install.sh environment: - EDGEX_ADD_PROXY_ROUTE: "" + EDGEX_ADD_PROXY_ROUTE: device-rest.http://edgex-device-rest:59986,app-sample.http://edgex-app-sample:59700 EDGEX_SECURITY_SECRET_STORE: "true" PROXY_SETUP_HOST: edgex-security-proxy-setup ROUTES_CORE_COMMAND_HOST: edgex-core-command diff --git a/docker-compose-with-app-sample.yml b/docker-compose-with-app-sample.yml index f3daa841..a256bb91 100644 --- a/docker-compose-with-app-sample.yml +++ b/docker-compose-with-app-sample.yml @@ -973,7 +973,7 @@ services: entrypoint: - /edgex-init/proxy_setup_wait_install.sh environment: - EDGEX_ADD_PROXY_ROUTE: "" + EDGEX_ADD_PROXY_ROUTE: device-rest.http://edgex-device-rest:59986,app-sample.http://edgex-app-sample:59700 EDGEX_SECURITY_SECRET_STORE: "true" PROXY_SETUP_HOST: edgex-security-proxy-setup ROUTES_CORE_COMMAND_HOST: edgex-core-command diff --git a/docker-compose.yml b/docker-compose.yml index 00e59367..5553ccef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -903,7 +903,7 @@ services: entrypoint: - /edgex-init/proxy_setup_wait_install.sh environment: - EDGEX_ADD_PROXY_ROUTE: "" + EDGEX_ADD_PROXY_ROUTE: device-rest.http://edgex-device-rest:59986 EDGEX_SECURITY_SECRET_STORE: "true" PROXY_SETUP_HOST: edgex-security-proxy-setup ROUTES_CORE_COMMAND_HOST: edgex-core-command