diff --git a/docker/addons/prometheus/grafana/example-dashboard.json b/docker/addons/prometheus/grafana/example-dashboard.json index 560410312..c70d4a5b6 100644 --- a/docker/addons/prometheus/grafana/example-dashboard.json +++ b/docker/addons/prometheus/grafana/example-dashboard.json @@ -1002,7 +1002,7 @@ "uid": "PBFA97CFB590B2093" }, "exemplar": true, - "expr": "ws_adapter_api_request_count{}", + "expr": "http_adapter_api_request_count{}", "interval": "", "legendFormat": "{{method}}", "refId": "A" @@ -1107,7 +1107,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "label_replace(label_replace(label_replace(ws_adapter_api_request_latency_microseconds, \"quantile\", \"50th percentile\", \"quantile\", \"0.5\"), \"quantile\", \"90th percentile\", \"quantile\", \"0.9\"), \"quantile\", \"99th percentile\", \"quantile\", \"0.99\")", + "expr": "label_replace(label_replace(label_replace(http_adapter_api_request_latency_microseconds, \"quantile\", \"50th percentile\", \"quantile\", \"0.5\"), \"quantile\", \"90th percentile\", \"quantile\", \"0.9\"), \"quantile\", \"99th percentile\", \"quantile\", \"0.99\")", "format": "time_series", "instant": false, "interval": "", diff --git a/docker/nginx/entrypoint.sh b/docker/nginx/entrypoint.sh index 985662860..7480215bb 100755 --- a/docker/nginx/entrypoint.sh +++ b/docker/nginx/entrypoint.sh @@ -23,7 +23,6 @@ envsubst ' ${SMQ_NGINX_MQTTS_PORT} ${MG_RE_HTTP_PORT} ${MG_ALARMS_HTTP_PORT} - ${MG_REPORTS_HTTP_PORT} - ${SMQ_WS_ADAPTER_HTTP_PORT}' /etc/nginx/nginx.conf + ${MG_REPORTS_HTTP_PORT}' /etc/nginx/nginx.conf exec nginx -g "daemon off;" diff --git a/docker/nginx/nginx-key.conf b/docker/nginx/nginx-key.conf index abb5a7f34..e74f20b57 100644 --- a/docker/nginx/nginx-key.conf +++ b/docker/nginx/nginx-key.conf @@ -145,7 +145,7 @@ http { location /ws/ { include snippets/proxy-headers.conf; include snippets/ws-upgrade.conf; - proxy_pass http://ws-adapter:${SMQ_WS_ADAPTER_HTTP_PORT}/; + proxy_pass http://http-adapter:${SMQ_HTTP_ADAPTER_HTTP_PORT}/; } } } diff --git a/docker/nginx/nginx-x509.conf b/docker/nginx/nginx-x509.conf index 4ee2df72c..a00deeb6b 100644 --- a/docker/nginx/nginx-x509.conf +++ b/docker/nginx/nginx-x509.conf @@ -158,7 +158,7 @@ http { include snippets/verify-ssl-client.conf; include snippets/proxy-headers.conf; include snippets/ws-upgrade.conf; - proxy_pass http://ws-adapter:${SMQ_WS_ADAPTER_HTTP_PORT}/; + proxy_pass http://http-adapter:${SMQ_HTTP_ADAPTER_HTTP_PORT}/; } } } diff --git a/docker/supermq-docker-compose.override.yaml b/docker/supermq-docker-compose.override.yaml index 415147fe9..aaf6bc543 100644 --- a/docker/supermq-docker-compose.override.yaml +++ b/docker/supermq-docker-compose.override.yaml @@ -94,10 +94,6 @@ services: networks: !override - magistrala-base-net - ws-adapter: - networks: !override - - magistrala-base-net - rabbitmq: networks: !override - magistrala-base-net diff --git a/docker/supermq-docker/.env b/docker/supermq-docker/.env index 9d682d7f0..70a0b750a 100644 --- a/docker/supermq-docker/.env +++ b/docker/supermq-docker/.env @@ -437,17 +437,6 @@ SMQ_COAP_ADAPTER_CACHE_MAX_COST=1048576 SMQ_COAP_ADAPTER_CACHE_BUFFER_ITEMS=64 SMQ_COAP_ADAPTER_INSTANCE_ID= -### WS -SMQ_WS_ADAPTER_LOG_LEVEL=debug -SMQ_WS_ADAPTER_HTTP_HOST=ws-adapter -SMQ_WS_ADAPTER_HTTP_PORT=8186 -SMQ_WS_ADAPTER_HTTP_SERVER_CERT= -SMQ_WS_ADAPTER_HTTP_SERVER_KEY= -SMQ_WS_ADAPTER_CACHE_NUM_COUNTERS=200000 -SMQ_WS_ADAPTER_CACHE_MAX_COST=1048576 -SMQ_WS_ADAPTER_CACHE_BUFFER_ITEMS=64 -SMQ_WS_ADAPTER_INSTANCE_ID= - ## Addons Services # Certs AM_CERTS_LOG_LEVEL=debug diff --git a/docker/supermq-docker/addons/journal/docker-compose.yaml b/docker/supermq-docker/addons/journal/docker-compose.yaml index de77ac212..6ababaf53 100644 --- a/docker/supermq-docker/addons/journal/docker-compose.yaml +++ b/docker/supermq-docker/addons/journal/docker-compose.yaml @@ -59,6 +59,7 @@ services: SMQ_AUTH_GRPC_CLIENT_CERT: ${SMQ_AUTH_GRPC_CLIENT_CERT:+/auth-grpc-client.crt} SMQ_AUTH_GRPC_CLIENT_KEY: ${SMQ_AUTH_GRPC_CLIENT_KEY:+/auth-grpc-client.key} SMQ_AUTH_GRPC_SERVER_CA_CERTS: ${SMQ_AUTH_GRPC_SERVER_CA_CERTS:+/auth-grpc-server-ca.crt} + SMQ_AUTH_KEYS_ALGORITHM: ${SMQ_AUTH_KEYS_ALGORITHM} SMQ_ES_URL: ${SMQ_ES_URL} SMQ_JAEGER_URL: ${SMQ_JAEGER_URL} SMQ_JAEGER_TRACE_RATIO: ${SMQ_JAEGER_TRACE_RATIO} diff --git a/docker/supermq-docker/addons/prometheus/grafana/example-dashboard.json b/docker/supermq-docker/addons/prometheus/grafana/example-dashboard.json index c2eabb4fb..b83e75bb7 100644 --- a/docker/supermq-docker/addons/prometheus/grafana/example-dashboard.json +++ b/docker/supermq-docker/addons/prometheus/grafana/example-dashboard.json @@ -1002,7 +1002,7 @@ "uid": "PBFA97CFB590B2093" }, "exemplar": true, - "expr": "ws_adapter_api_request_count{}", + "expr": "http_adapter_api_request_count{}", "interval": "", "legendFormat": "{{method}}", "refId": "A" @@ -1107,7 +1107,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "label_replace(label_replace(label_replace(ws_adapter_api_request_latency_microseconds, \"quantile\", \"50th percentile\", \"quantile\", \"0.5\"), \"quantile\", \"90th percentile\", \"quantile\", \"0.9\"), \"quantile\", \"99th percentile\", \"quantile\", \"0.99\")", + "expr": "label_replace(label_replace(label_replace(http_adapter_api_request_latency_microseconds, \"quantile\", \"50th percentile\", \"quantile\", \"0.5\"), \"quantile\", \"90th percentile\", \"quantile\", \"0.9\"), \"quantile\", \"99th percentile\", \"quantile\", \"0.99\")", "format": "time_series", "instant": false, "interval": "", diff --git a/docker/supermq-docker/docker-compose.yaml b/docker/supermq-docker/docker-compose.yaml index bd0a45d49..47c3c11d6 100644 --- a/docker/supermq-docker/docker-compose.yaml +++ b/docker/supermq-docker/docker-compose.yaml @@ -432,7 +432,6 @@ services: - users - mqtt-adapter - http-adapter - - ws-adapter - coap-adapter ulimits: nofile: @@ -1538,119 +1537,6 @@ services: bind: create_host_path: true - ws-adapter: - image: docker.io/supermq/ws:${SMQ_RELEASE_TAG} - container_name: supermq-ws - depends_on: - - clients - - nats - restart: on-failure - environment: - SMQ_WS_ADAPTER_LOG_LEVEL: ${SMQ_WS_ADAPTER_LOG_LEVEL} - SMQ_WS_ADAPTER_HTTP_HOST: ${SMQ_WS_ADAPTER_HTTP_HOST} - SMQ_WS_ADAPTER_HTTP_PORT: ${SMQ_WS_ADAPTER_HTTP_PORT} - SMQ_WS_ADAPTER_HTTP_SERVER_CERT: ${SMQ_WS_ADAPTER_HTTP_SERVER_CERT} - SMQ_WS_ADAPTER_HTTP_SERVER_KEY: ${SMQ_WS_ADAPTER_HTTP_SERVER_KEY} - SMQ_WS_ADAPTER_CACHE_NUM_COUNTERS: ${SMQ_WS_ADAPTER_CACHE_NUM_COUNTERS} - SMQ_WS_ADAPTER_CACHE_MAX_COST: ${SMQ_WS_ADAPTER_CACHE_MAX_COST} - SMQ_WS_ADAPTER_CACHE_BUFFER_ITEMS: ${SMQ_WS_ADAPTER_CACHE_BUFFER_ITEMS} - SMQ_CLIENTS_GRPC_URL: ${SMQ_CLIENTS_GRPC_URL} - SMQ_CLIENTS_GRPC_TIMEOUT: ${SMQ_CLIENTS_GRPC_TIMEOUT} - SMQ_CLIENTS_GRPC_CLIENT_CERT: ${SMQ_CLIENTS_GRPC_CLIENT_CERT:+/clients-grpc-client.crt} - SMQ_CLIENTS_GRPC_CLIENT_KEY: ${SMQ_CLIENTS_GRPC_CLIENT_KEY:+/clients-grpc-client.key} - SMQ_CLIENTS_GRPC_SERVER_CA_CERTS: ${SMQ_CLIENTS_GRPC_SERVER_CA_CERTS:+/clients-grpc-server-ca.crt} - SMQ_CHANNELS_GRPC_URL: ${SMQ_CHANNELS_GRPC_URL} - SMQ_CHANNELS_GRPC_TIMEOUT: ${SMQ_CHANNELS_GRPC_TIMEOUT} - SMQ_CHANNELS_GRPC_CLIENT_CERT: ${SMQ_CHANNELS_GRPC_CLIENT_CERT:+/channels-grpc-client.crt} - SMQ_CHANNELS_GRPC_CLIENT_KEY: ${SMQ_CHANNELS_GRPC_CLIENT_KEY:+/channels-grpc-client.key} - SMQ_CHANNELS_GRPC_SERVER_CA_CERTS: ${SMQ_CHANNELS_GRPC_SERVER_CA_CERTS:+/channels-grpc-server-ca.crt} - SMQ_DOMAINS_GRPC_URL: ${SMQ_DOMAINS_GRPC_URL} - SMQ_DOMAINS_GRPC_TIMEOUT: ${SMQ_DOMAINS_GRPC_TIMEOUT} - SMQ_DOMAINS_GRPC_CLIENT_CERT: ${SMQ_DOMAINS_GRPC_CLIENT_CERT:+/domains-grpc-client.crt} - SMQ_DOMAINS_GRPC_CLIENT_KEY: ${SMQ_DOMAINS_GRPC_CLIENT_KEY:+/domains-grpc-client.key} - SMQ_DOMAINS_GRPC_SERVER_CA_CERTS: ${SMQ_DOMAINS_GRPC_SERVER_CA_CERTS:+/domains-grpc-server-ca.crt} - SMQ_AUTH_GRPC_URL: ${SMQ_AUTH_GRPC_URL} - SMQ_AUTH_GRPC_TIMEOUT: ${SMQ_AUTH_GRPC_TIMEOUT} - SMQ_AUTH_GRPC_CLIENT_CERT: ${SMQ_AUTH_GRPC_CLIENT_CERT:+/auth-grpc-client.crt} - SMQ_AUTH_GRPC_CLIENT_KEY: ${SMQ_AUTH_GRPC_CLIENT_KEY:+/auth-grpc-client.key} - SMQ_AUTH_GRPC_SERVER_CA_CERTS: ${SMQ_AUTH_GRPC_SERVER_CA_CERTS:+/auth-grpc-server-ca.crt} - SMQ_AUTH_KEYS_ALGORITHM: ${SMQ_AUTH_KEYS_ALGORITHM} - SMQ_MESSAGE_BROKER_URL: ${SMQ_MESSAGE_BROKER_URL} - SMQ_JAEGER_URL: ${SMQ_JAEGER_URL} - SMQ_JAEGER_TRACE_RATIO: ${SMQ_JAEGER_TRACE_RATIO} - SMQ_SEND_TELEMETRY: ${SMQ_SEND_TELEMETRY} - SMQ_WS_ADAPTER_INSTANCE_ID: ${SMQ_WS_ADAPTER_INSTANCE_ID} - SMQ_ES_URL: ${SMQ_ES_URL} - ports: - - ${SMQ_WS_ADAPTER_HTTP_PORT}:${SMQ_WS_ADAPTER_HTTP_PORT} - networks: - - supermq-base-net - volumes: - # Clients gRPC mTLS client certificates - - type: bind - source: ${SMQ_CLIENTS_GRPC_CLIENT_CERT:-ssl/certs/dummy/client_cert} - target: /clients-grpc-client${SMQ_CLIENTS_GRPC_CLIENT_CERT:+.crt} - bind: - create_host_path: true - - type: bind - source: ${SMQ_CLIENTS_GRPC_CLIENT_KEY:-ssl/certs/dummy/client_key} - target: /clients-grpc-client${SMQ_CLIENTS_GRPC_CLIENT_KEY:+.key} - bind: - create_host_path: true - - type: bind - source: ${SMQ_CLIENTS_GRPC_SERVER_CA_CERTS:-ssl/certs/dummy/server_ca} - target: /clients-grpc-server-ca${SMQ_CLIENTS_GRPC_SERVER_CA_CERTS:+.crt} - bind: - create_host_path: true - # Channels gRPC mTLS client certificates - - type: bind - source: ${SMQ_CHANNELS_GRPC_CLIENT_CERT:-ssl/certs/dummy/client_cert} - target: /channels-grpc-client${SMQ_CHANNELS_GRPC_CLIENT_CERT:+.crt} - bind: - create_host_path: true - - type: bind - source: ${SMQ_CHANNELS_GRPC_CLIENT_KEY:-ssl/certs/dummy/client_key} - target: /channels-grpc-client${SMQ_CHANNELS_GRPC_CLIENT_KEY:+.key} - bind: - create_host_path: true - - type: bind - source: ${SMQ_CHANNELS_GRPC_SERVER_CA_CERTS:-ssl/certs/dummy/server_ca} - target: /channels-grpc-server-ca${SMQ_CHANNELS_GRPC_SERVER_CA_CERTS:+.crt} - bind: - create_host_path: true - # Auth gRPC mTLS client certificates - - type: bind - source: ${SMQ_AUTH_GRPC_CLIENT_CERT:-ssl/certs/dummy/client_cert} - target: /auth-grpc-client${SMQ_AUTH_GRPC_CLIENT_CERT:+.crt} - bind: - create_host_path: true - - type: bind - source: ${SMQ_AUTH_GRPC_CLIENT_KEY:-ssl/certs/dummy/client_key} - target: /auth-grpc-client${SMQ_AUTH_GRPC_CLIENT_KEY:+.key} - bind: - create_host_path: true - - type: bind - source: ${SMQ_AUTH_GRPC_SERVER_CA_CERTS:-ssl/certs/dummy/server_ca} - target: /auth-grpc-server-ca${SMQ_AUTH_GRPC_SERVER_CA_CERTS:+.crt} - bind: - create_host_path: true - # Domains gRPC mTLS client certificates - - type: bind - source: ${SMQ_DOMAINS_GRPC_CLIENT_CERT:-ssl/certs/dummy/client_cert} - target: /domains-grpc-client${SMQ_DOMAINS_GRPC_CLIENT_CERT:+.crt} - bind: - create_host_path: true - - type: bind - source: ${SMQ_DOMAINS_GRPC_CLIENT_KEY:-ssl/certs/dummy/client_key} - target: /domains-grpc-client${SMQ_DOMAINS_GRPC_CLIENT_KEY:+.key} - bind: - create_host_path: true - - type: bind - source: ${SMQ_DOMAINS_GRPC_SERVER_CA_CERTS:-ssl/certs/dummy/server_ca} - target: /domains-grpc-server-ca${SMQ_DOMAINS_GRPC_SERVER_CA_CERTS:+.crt} - bind: - create_host_path: true - rabbitmq: image: docker.io/rabbitmq:4.1.4-management-alpine container_name: supermq-rabbitmq diff --git a/docker/supermq-docker/nginx/entrypoint.sh b/docker/supermq-docker/nginx/entrypoint.sh index b221dc054..a220673f1 100755 --- a/docker/supermq-docker/nginx/entrypoint.sh +++ b/docker/supermq-docker/nginx/entrypoint.sh @@ -22,7 +22,6 @@ envsubst ' ${SMQ_CHANNELS_HTTP_PORT} ${SMQ_HTTP_ADAPTER_PORT} ${SMQ_NGINX_MQTT_PORT} - ${SMQ_NGINX_MQTTS_PORT} - ${SMQ_WS_ADAPTER_HTTP_PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf + ${SMQ_NGINX_MQTTS_PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf exec nginx -g "daemon off;" diff --git a/docker/supermq-docker/nginx/nginx-key.conf b/docker/supermq-docker/nginx/nginx-key.conf index bdf0ce2ec..4c35ffb05 100644 --- a/docker/supermq-docker/nginx/nginx-key.conf +++ b/docker/supermq-docker/nginx/nginx-key.conf @@ -131,7 +131,7 @@ http { location /ws/ { include snippets/proxy-headers.conf; include snippets/ws-upgrade.conf; - proxy_pass http://ws-adapter:${SMQ_WS_ADAPTER_HTTP_PORT}/; + proxy_pass http://http-adapter:${SMQ_HTTP_ADAPTER_PORT}/; } } } diff --git a/docker/supermq-docker/nginx/nginx-x509.conf b/docker/supermq-docker/nginx/nginx-x509.conf index f80437ad3..e18ee0baf 100644 --- a/docker/supermq-docker/nginx/nginx-x509.conf +++ b/docker/supermq-docker/nginx/nginx-x509.conf @@ -144,7 +144,7 @@ http { include snippets/verify-ssl-client.conf; include snippets/proxy-headers.conf; include snippets/ws-upgrade.conf; - proxy_pass http://ws-adapter:${SMQ_WS_ADAPTER_HTTP_PORT}/; + proxy_pass http://http-adapter:${SMQ_HTTP_ADAPTER_PORT}/; } } } diff --git a/go.mod b/go.mod index 41cb420bb..64a21a185 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/0x6flab/namegenerator v1.4.0 github.com/absmach/callhome v0.18.2 github.com/absmach/certs v0.18.3 - github.com/absmach/supermq v0.18.4-0.20251223143751-59f8d4e4d7b1 + github.com/absmach/supermq v0.18.4 github.com/authzed/authzed-go v1.7.0 github.com/authzed/grpcutil v0.0.0-20250221190651-1985b19b35b8 github.com/caarlos0/env/v11 v11.3.1 diff --git a/go.sum b/go.sum index 1a5b2c1e2..a62c0f3a9 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ github.com/absmach/mgate v0.5.0 h1:RV2Aalra3xIm+XTs13TM7iE7v4WTL2SKhKcPbKr22Ac= github.com/absmach/mgate v0.5.0/go.mod h1:0KVq7mxM0wayosmyXPPxp1EL0c2d9kRp5V8NZCKdetA= github.com/absmach/senml v1.0.8 h1:+opem/r4g6c6eA/JLyCIuksyEhj7eBdysY3pEmy1mqo= github.com/absmach/senml v1.0.8/go.mod h1:DRhzHLgvQoIUHroBgpFrSWso+bJZO9E96RlHAHy+VRI= -github.com/absmach/supermq v0.18.4-0.20251223143751-59f8d4e4d7b1 h1:z7WjbHbbgUO0U3ZzFPzmVKFS446+n3YyM4tfc1qENno= -github.com/absmach/supermq v0.18.4-0.20251223143751-59f8d4e4d7b1/go.mod h1:euXoe+V0bSYi9bz4ljRl60N6R80Lc2ehkq0Lj/XfePg= +github.com/absmach/supermq v0.18.4 h1:7GG0O6pgadR2xmpm9rhXDXJFdU2xnLUwqE6unN4pEEY= +github.com/absmach/supermq v0.18.4/go.mod h1:RdAohsDpSIn78d+F68RYSOKI3Dc0hwqsQixyqzIRsuI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= diff --git a/scripts/run.sh b/scripts/run.sh index b37e662d9..4664c0c83 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -50,11 +50,6 @@ SMQ_CLIENTS_LOG_LEVEL=info SMQ_CLIENTS_HTTP_PORT=9000 SMQ_CLIENTS_GRPC_PORT=7000 ### SMQ_HTTP_ADAPTER_LOG_LEVEL=info SMQ_HTTP_ADAPTER_PORT=8008 SMQ_CLIENTS_GRPC_URL=localhost:7000 $BUILD_DIR/supermq-http & -### -# WS -### -SMQ_WS_ADAPTER_LOG_LEVEL=info SMQ_WS_ADAPTER_HTTP_PORT=8190 SMQ_CLIENTS_GRPC_URL=localhost:7000 $BUILD_DIR/supermq-ws & - ### # MQTT ###