From 903aa172b26acbadd1cfa4cb37f00212d88b9fef Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 21 Apr 2023 22:40:07 +0530 Subject: [PATCH] added config to set exhook url --- configs/emqx_exhook.conf | 74 ++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 6 ++-- entrypoint.sh | 2 ++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 configs/emqx_exhook.conf diff --git a/configs/emqx_exhook.conf b/configs/emqx_exhook.conf new file mode 100644 index 0000000..6bb3a63 --- /dev/null +++ b/configs/emqx_exhook.conf @@ -0,0 +1,74 @@ +##==================================================================== +## EMQX Hooks +##==================================================================== + +## The default value or action will be returned, while the request to +## the gRPC server failed or no available grpc server running. +## +## Default: deny +## Value: ignore | deny +#exhook.request_failed_action = deny + +## The timeout to request grpc server +## +## Default: 5s +## Value: Duration +#exhook.request_timeout = 5s + +## Whether to automatically reconnect (initialize) the gRPC server +## +## When gRPC is not available, exhook tries to request the gRPC service at +## that interval and reinitialize the list of mounted hooks. +## +## Default: false +## Value: false | Duration +#exhook.auto_reconnect = 60s + +## The process pool size for gRPC client +## +## Default: Equals cpu cores +## Value: Integer +#exhook.pool_size = 16 + +## The exhook execution priority on the Chain of the emqx hooks. +## +## Modify the field to fix the exhook execute order before/after other plugins/modules. +## By default, most hooks registered by plugins or modules have a priority of 0. +## +## With the same priority of 0, the execute order depends on hookpoints mount order. +## Scilicet is the loaded order of plugins/ modules. +## +## Default: 0 +## Value: Integer +#exhook.hook_priority = 0 + +##-------------------------------------------------------------------- +## The Hook callback servers + +## The gRPC server url +## +## exhook.server.$name.url = url() +exhook.server.default.url = http://host.docker.internal:9000 + +#exhook.server.default.ssl.cacertfile = etc/certs/cacert.pem +#exhook.server.default.ssl.certfile = etc/certs/cert.pem +#exhook.server.default.ssl.keyfile = etc/certs/key.pem + +## Enables/disables periodic transmission on a connected socket when no other data is exchanged. +## If the other end does not respond, the connection is considered broken and an error message is sent to the controlling process. +## +## Default: true +#exhook.server.default.socket_options.keepalive = true + +## If true, option TCP_NODELAY is turned on for the socket, which means that also small amounts of data are sent immediately. +## +## Default: true +#exhook.server.default.socket_options.nodelay = true + +## The minimum size of the receive buffer to use for the socket. +#exhook.server.default.socket_options.recbuf = 64KB + +## The minimum size of the send buffer to use for the socket. +#exhook.server.default.socket_options.sndbuf = 16KB + + diff --git a/docker-compose.yml b/docker-compose.yml index 1b63835..0b11352 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: image: registry.entgra.io/entgra-emqx:4.4.11 container_name: entgra-emqx restart: always + extra_hosts: + - "host.docker.internal:host-gateway" ports: - "1883:1883" - "8081:8081" @@ -13,8 +15,8 @@ services: - "8883:8883" - "18083:18083" volumes: - # Logs - ./static:/opt/emqx/static + - ./configs:/opt/emqx/configs # environment: # Hostname configurations @@ -52,4 +54,4 @@ services: # - http_proxy=ip or hostname # - https_proxy=ip or hostname # - no_proxy= comma seperated dns -# - NO_PROXY= comma seperated dns \ No newline at end of file +# - NO_PROXY= comma seperated dns diff --git a/entrypoint.sh b/entrypoint.sh index 9efb8a2..de15cd3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,5 +5,7 @@ STATIC_CONFIG_PATH=/opt/emqx/lib/emqx_dashboard-4.4.10/priv/www/static/ cp /opt/emqx/static/css/* $STATIC_CONFIG_PATH/css/ cp /opt/emqx/static/img/* $STATIC_CONFIG_PATH/img/ +cp /opt/emqx/configs/emqx_exhook.conf /opt/emqx/etc/plugins/ + echo "Starting server.." sh /opt/emqx/bin/emqx foreground