From 964aef290eb8ea7addb0cd01425fdb497bb47da5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 8 Oct 2023 23:03:09 +0200 Subject: [PATCH] =?utf8?q?CORS=20f=C3=BCr=20die=20cruise-control-ui=20konf?= =?utf8?q?iguriert=20-=20=5FHilft=20nicht=20:/=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Siehe: https://github.com/linkedin/cruise-control-ui/wiki/CORS-Method * Die Zugriffe werden weiter abgelehnt. * _Grund:_ Die Vorgaben erlauben nur einen speziellen Header. * Die Anfragen werden dann wegen Headern wie z.B. `Content-Type` abgelehnt. * *Idee:* UI in das CC-Image einbauen - _müsste laut Parametern gehen!_ --- Dockerfile | 3 ++- docker/docker-compose.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ec7b58..c3009a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ COPY cruise-control /opt/cruise-control/ WORKDIR /opt/cruise-control ENV BOOTSTRAP_SERVERS=localhost:9092 ENV ZOOKEEPER_CONNECT=localhost:2181 -RUN echo -e '#!/bin/bash\n sed -ie "s+^bootstrap\.servers=.*$+bootstrap.servers=${BOOTSTRAP_SERVERS}+;s+^zookeeper\.connect=.*$+zookeeper.connect=${ZOOKEEPER_CONNECT}+" config/cruisecontrol.properties\nexec ./kafka-cruise-control-start.sh "$@"' > run.sh; chmod a+x run.sh +ENV CORS_ORIGIN=localhost:8080 +RUN echo -e '#!/bin/bash\n sed -ie "s+^bootstrap\.servers=.*$+bootstrap.servers=${BOOTSTRAP_SERVERS}+;s+^zookeeper\.connect=.*$+zookeeper.connect=${ZOOKEEPER_CONNECT}+;s+^webserver\.http\.cors\.enabled=.*$+webserver.http.cors.enabled=true+;s+webserver\.http\.cors\.origin=.*+webserver.http.cors.origin=${CORS_ORIGIN}+" config/cruisecontrol.properties\nexec ./kafka-cruise-control-start.sh "$@"' > run.sh; chmod a+x run.sh ENTRYPOINT [ "/opt/cruise-control/run.sh" ] CMD [ "config/cruisecontrol.properties" ] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 5fb1d3d..ffd4c1f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -83,6 +83,7 @@ services: environment: BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092 ZOOKEEPER_CONNECT: zookeeper:2181/ + CORS_ORIGIN: http://localhost:9080 ports: - "9090:9090" -- 2.20.1