Skip to content

Commit

Permalink
added playground tools certs-create
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed Dec 9, 2024
1 parent 5c491d5 commit bd62c1b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 283 deletions.
7 changes: 3 additions & 4 deletions ccloud/fm-mqtt-source/fully-managed-mqtt-source-mtls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
source ${DIR}/../../scripts/utils.sh

cd ${DIR}/security
log "🔐 Generate keys and certificates used for SSL"
docker run -u0 --rm -v $PWD:/tmp ${CP_CONNECT_IMAGE}:${CONNECT_TAG} bash -c "/tmp/certs-create.sh > /dev/null 2>&1 && chown -R $(id -u $USER):$(id -g $USER) /tmp/ && chmod a+r /tmp/*"
cd ../../ccloud/fm-mqtt-source/security
playground tools certs-create --output-folder "$PWD" --container connect --container mosquitto --verbose
base64_truststore=$(cat $PWD/kafka.connect.truststore.jks | base64 | tr -d '\n')
base64_keystore=$(cat $PWD/kafka.connect.keystore.jks | base64 | tr -d '\n')
cd ${DIR}
cd -

NGROK_AUTH_TOKEN=${NGROK_AUTH_TOKEN:-$1}

Expand Down
80 changes: 0 additions & 80 deletions ccloud/fm-mqtt-source/security/certs-create.sh

This file was deleted.

8 changes: 3 additions & 5 deletions ccloud/fm-rabbitmq-sink/fully-managed-rabbitmq-sink-ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ source ${DIR}/../../scripts/utils.sh
NGROK_AUTH_TOKEN=${NGROK_AUTH_TOKEN:-$1}

cd ../../ccloud/fm-rabbitmq-sink/security
log "🔐 Generate keys and certificates used for SSL"
docker run -u0 --rm -v $PWD:/tmp ${CP_CONNECT_IMAGE}:${CONNECT_TAG} bash -c "/tmp/certs-create.sh > /dev/null 2>&1 && chown -R $(id -u $USER):$(id -g $USER) /tmp/ && chmod a+r /tmp/*"
playground tools certs-create --output-folder "$PWD" --container connect --container rabbitmq
base64_truststore=$(cat $PWD/kafka.connect.truststore.jks | base64 | tr -d '\n')
base64_keystore=$(cat $PWD/kafka.connect.keystore.jks | base64 | tr -d '\n')
cd -

display_ngrok_warning
Expand Down Expand Up @@ -72,9 +73,6 @@ set +e
playground connector delete --connector $connector_name > /dev/null 2>&1
set -e

base64_truststore=$(cat $PWD/security/kafka.connect.truststore.jks | base64 | tr -d '\n')
base64_keystore=$(cat $PWD/security/kafka.connect.keystore.jks | base64 | tr -d '\n')

log "Creating fully managed connector"
playground connector create-or-update --connector $connector_name << EOF
{
Expand Down
80 changes: 0 additions & 80 deletions ccloud/fm-rabbitmq-sink/security/certs-create.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
source ${DIR}/../../scripts/utils.sh


cd ../../ccloud/fm-rabbitmq-source/security
log "🔐 Generate keys and certificates used for SSL"
docker run -u0 --rm -v $PWD:/tmp ${CP_CONNECT_IMAGE}:${CONNECT_TAG} bash -c "/tmp/certs-create.sh > /dev/null 2>&1 && chown -R $(id -u $USER):$(id -g $USER) /tmp/ && chmod a+r /tmp/*"
playground tools certs-create --output-folder "$PWD" --container connect --container rabbitmq
base64_truststore=$(cat $PWD/kafka.connect.truststore.jks | base64 | tr -d '\n')
base64_keystore=$(cat $PWD/kafka.connect.keystore.jks | base64 | tr -d '\n')
cd -

NGROK_AUTH_TOKEN=${NGROK_AUTH_TOKEN:-$1}
Expand Down Expand Up @@ -61,9 +61,6 @@ sleep 6
log "Send message to RabbitMQ in myqueue"
docker exec rabbitmq_producer bash -c "python /producer.py myqueue 5"

base64_truststore=$(cat $PWD/security/kafka.connect.truststore.jks | base64 | tr -d '\n')
base64_keystore=$(cat $PWD/security/kafka.connect.keystore.jks | base64 | tr -d '\n')

log "Creating fully managed connector"
playground connector create-or-update --connector $connector_name << EOF
{
Expand Down
9 changes: 0 additions & 9 deletions ccloud/rest-proxy-security-plugin/security/certs-clean.sh

This file was deleted.

81 changes: 0 additions & 81 deletions ccloud/rest-proxy-security-plugin/security/certs-create.sh

This file was deleted.

14 changes: 0 additions & 14 deletions ccloud/rest-proxy-security-plugin/security/certs-verify.sh

This file was deleted.

7 changes: 3 additions & 4 deletions ccloud/rest-proxy-security-plugin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ sed -e "s|:CCLOUD_REST_PROXY_SECURITY_PLUGIN_API_KEY:|$CCLOUD_REST_PROXY_SECURIT
-e "s|:CCLOUD_REST_PROXY_SECURITY_PLUGIN_API_SECRET:|$CCLOUD_REST_PROXY_SECURITY_PLUGIN_API_SECRET|g" \
../../ccloud/rest-proxy-security-plugin/kafka-rest.jaas-template.conf > ../../ccloud/rest-proxy-security-plugin/kafka-rest.jaas.conf

cd ${DIR}/security
log "🔐 Generate keys and certificates used for SSL"
docker run -u0 --rm -v $PWD:/tmp ${CP_CONNECT_IMAGE}:${CONNECT_TAG} bash -c "/tmp/certs-create.sh > /dev/null 2>&1 $CCLOUD_REST_PROXY_SECURITY_PLUGIN_API_KEY && chown -R $(id -u $USER):$(id -g $USER) /tmp/"
cd ${DIR}
cd ../../ccloud/rest-proxy-security-plugin/security
playground tools certs-create --output-folder "$PWD" --container restproxy --container $CCLOUD_REST_PROXY_SECURITY_PLUGIN_API_KEY --verbose
cd -

docker compose -f "${PWD}/docker-compose.yml" up -d --quiet-pull

Expand Down

0 comments on commit bd62c1b

Please sign in to comment.