emqxarchive / emqx-docker

This repository is no longer maintained, please go to https://github.com/emqx/emqx-rel/tree/master/deploy/docker
Apache License 2.0
235 stars 162 forks source link

can not set auth.http.auth_req.params with docker environments #21

Closed CrazyPandar closed 7 years ago

CrazyPandar commented 7 years ago

run EMQ by docker with following command:

docker run --rm -ti --name emq -p 192.168.128.30:18083:18083 -p 8883:8883 -p 8084:8084 \
-e EMQ_NODE__PROCESS_LIMIT=2097152 \
-e EMQ_NODE__MAX_PORTS=1048576 \
-e EMQ_MQTT__ALLOW_ANONYMOUS=false \
-e EMQ_MQTT__CACHE_ACL=false \
-e EMQ_MQTT__MQUEUE__MAX_LENGTH=8 \
-e EMQ_LISTENER__TCP__EXTERNAL__ACCEPTORS=64 \
-e EMQ_LISTENER__TCP__EXTERNAL__MAX_CLIENTS=1024000 \
-e EMQ_LISTENER__SSL__EXTERNAL__MAX_CLIENTS=1024000 \
-e EMQ_LISTENER__WS__EXTERNAL__MAX_CLIENTS=1024000 \
-e EMQ_LISTENER__WSS__EXTERNAL__MAX_CLIENTS=1024000 \
-e EMQ_SYSMON__LARGE_HEAP=64MB \
-e EMQ_LOADED_PLUGINS="emq_recon,emq_modules,emq_retainer,emq_dashboard,emq_auth_http" \
-e EMQ_AUTH__HTTP__AUTH_REQ="http:\/\/192.168.128.30:12101\/mqtt\/auth" \
-e EMQ_AUTH__HTTP__AUTH_REQ__PARAMS="clientid=%c,username=%u,password=%P,ipaddr=%a" \
-e EMQ_AUTH__HTTP__SUPER_REQ="http:\/\/192.168.128.30:12101\/mqtt\/superuser" \
-e EMQ_AUTH__HTTP__ACL_REQ="http:\/\/192.168.128.30:12101\/mqtt\/acl" \
emq:2.2

alll evnironments take effect within docker except auth.http.auth_req.params failed to be set.

turtleDeng commented 7 years ago

@CrazyPandar

EMQ_AUTH__HTTP__AUTH_REQ="http:\\/\\/192.168.128.30:12101\\/mqtt\\/auth"
AutomationD commented 6 years ago

Why are we closing this? IMO we should rather do sanitation instead of forcing people to escape forward slashes. Why not just do another sed -e 's/\//\\\//'?

gyuuu commented 6 years ago

At least indicate somewhere that /-s has to be escaped with \/, I spent more than 2 hours finding it out, discussions in github tickets indicate different escape sequences, no other documentation is available or I was nat able to find it.

Please include the actual escape sequence in the documentation. If someone can comfirm that this is the right sequence and it's not working because of some kind of bug, I can submit a pull request updating the documentation.