@@ -20,7 +20,7 @@ PORT="${PORT:-8000}"
2020 CONNECT_URL=" ${CONNECT_URL:- http:// localhost: 8083} "
2121
2222 cat /caddy/Caddyfile.template |
23- sed -e " s/8000/$PORT /" > /caddy /Caddyfile
23+ sed -e " s/8000/$PORT /" > /tmp /Caddyfile
2424
2525 if echo " $PROXY " | egrep -sq " true|TRUE|y|Y|yes|YES|1" ; then
2626 echo " Enabling proxy. You can disable this via PROXY=false."
@@ -38,7 +38,7 @@ PORT="${PORT:-8000}"
3838 let " NUM_CLUSTER+=1"
3939 if [[ " $NUM_CLUSTER " == 1 ]]; then
4040 OPEN_CURL=" {"
41- cat << EOF >/kafka-connect-ui /env.js
41+ cat << EOF >/tmp /env.js
4242var clusters = [
4343EOF
4444 fi
5555 CLUSTER_SANITIZED_NAME=" ${CLUSTER_NAME// [^a-zA-Z0-9_.-]/ } "
5656 fi
5757 if echo $PROXY | egrep -sq " true|TRUE|y|Y|yes|YES|1" ; then
58- cat << EOF >>/caddy /Caddyfile
58+ cat << EOF >>/tmp /Caddyfile
5959proxy /api/$CLUSTER_SANITIZED_NAME $CLUSTER_URL {
6060 without /api/$CLUSTER_SANITIZED_NAME
6161 $INSECURE_PROXY
6262}
6363EOF
64- cat << EOF >>/kafka-connect-ui /env.js
64+ cat << EOF >>/tmp /env.js
6565 $OPEN_CURL
6666 NAME: "$CLUSTER_NAME ",
6767 KAFKA_CONNECT: "/api/$CLUSTER_SANITIZED_NAME "
6868 }
6969EOF
7070 else
71- cat << EOF >>/kafka-connect-ui /env.js
71+ cat << EOF >>/tmp /env.js
7272 $OPEN_CURL
7373 NAME: "$CLUSTER_NAME ",
7474 KAFKA_CONNECT: "$CLUSTER_URL "
7575 }
7676EOF
7777 fi
7878 done
79- echo " ]" >> /kafka-connect-ui /env.js
79+ echo " ]" >> /tmp /env.js
8080
8181 if [[ -n " ${CADDY_OPTIONS} " ]]; then
8282 echo " Applying custom options to Caddyfile"
83- cat << EOF >>/caddy /Caddyfile
83+ cat << EOF >>/tmp /Caddyfile
8484$CADDY_OPTIONS
8585EOF
8686 fi
8787
8888
8989 # Here we emulate the output by Caddy. Why? Because we can't
9090 # redirect caddy to stderr as the logging would also get redirected.
91- echo
92- echo " Activating privacy features... done."
93- echo " http://0.0.0.0:$PORT "
91+ cat << EOF
92+ Note: if you use a PORT lower than 1024, please note that kafka-connect-ui can
93+ now run under any user. In the future a non-root user may become the default.
94+ In this case you will have to explicitly allow binding to such ports, either by
95+ setting the root user or something like '--sysctl net.ipv4.ip_unprivileged_port_start=0'.
96+
97+ Activating privacy features... done.
98+ http://0.0.0.0:$PORT
99+ EOF
94100} 1>&2
95101
96102
97- exec /caddy/caddy -conf /caddy /Caddyfile -quiet
103+ exec /caddy/caddy -conf /tmp /Caddyfile -quiet
0 commit comments