From cdffecd77d9f7d362fefe5f5a4202f33e5e0dd07 Mon Sep 17 00:00:00 2001 From: George Yord Date: Fri, 19 Nov 2021 14:13:29 +0200 Subject: [PATCH 1/2] Remove setup of license since it will be moved to provisioning flow [OPS-1979] --- README.md | 2 +- setup.sh | 42 ++---------------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 7db9b7c..442480d 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ the mount them under `/mnt/settings` and `/mnt/secrets` respectively —i.e `/mnt/settings/lenses.conf` and `/mnt/secrets/security.conf`. You can set either one or both together. Please for `lenses.conf` omit the settings -`lenses.secret.file` and `lenses.license.file`. If by any chance you set them, +`lenses.secret.file`. If by any chance you set them, you have to make sure lenses can find the files described in these settings. ### The license file diff --git a/setup.sh b/setup.sh index 43eb0f1..ff74586 100755 --- a/setup.sh +++ b/setup.sh @@ -26,7 +26,7 @@ export LT_PACKAGE_VERSION=${LT_PACKAGE_VERSION:-$BUILD_COMMIT} WAIT_SCRIPT=${WAIT_SCRIPT:-} OPTS_JVM="LENSES_OPTS LENSES_HEAP_OPTS LENSES_JMX_OPTS LENSES_LOG4J_OPTS LENSES_PERFORMANCE_OPTS LENSES_SERDE_CLASSPATH_OPTS LENSES_PLUGINS_CLASSPATH_OPTS LENSES_APPEND_CONF" -OPTS_NEEDQUOTE="LENSES_LICENSE_FILE LENSES_KAFKA_BROKERS" +OPTS_NEEDQUOTE="LENSES_KAFKA_BROKERS" OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_GRAFANA LENSES_JMX_SCHEMA_REGISTRY LENSES_JMX_ZOOKEEPERS" OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_ACCESS_CONTROL_ALLOW_METHODS LENSES_ACCESS_CONTROL_ALLOW_ORIGIN" OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_VERSION LENSES_SECURITY_LDAP_URL LENSES_SECURITY_LDAP_BASE" @@ -60,7 +60,7 @@ OPTS_LITERAL="LENSES_KAFKA_SETTINGS_CLIENT_SASL_JAAS_CONFIG" OPTS_LITERAL="$OPTS_LITERAL LENSES_KAFKA_SETTINGS_PRODUCER_SASL_JAAS_CONFIG LENSES_KAFKA_SETTINGS_CONSUMER_SASL_JAAS_CONFIG" OPTS_LITERAL="$OPTS_LITERAL LENSES_KUBERNETES_PROCESSOR_KAFKA_SETTINGS_SASL_JAAS_CONFIG LENSES_KUBERNETES_PROCESSOR_JAAS" -OPTS_SENSITIVE="LENSES_SECURITY_USER LENSES_SECURITY_PASSWORD LENSES_SECURITY_LDAP_USER LENSES_SECURITY_LDAP_PASSWORD LICENSE LICENSE_URL" +OPTS_SENSITIVE="LENSES_SECURITY_USER LENSES_SECURITY_PASSWORD LENSES_SECURITY_LDAP_USER LENSES_SECURITY_LDAP_PASSWORD" OPTS_SENSITIVE="$OPTS_SENSITIVE LENSES_SECURITY_USERS LENSES_SECURITY_GROUPS LENSES_SECURITY_SERVICE_ACCOUNTS" # These are deprecated but keep them so we protect users from suboptimal upgrades. OPTS_SENSITIVE="$OPTS_SENSITIVE LENSES_KAFKA_SETTINGS_CONSUMER_SSL_KEYSTORE_PASSWORD LENSES_KAFKA_SETTINGS_CONSUMER_SSL_KEY_PASSWORD LENSES_KAFKA_SETTINGS_CONSUMER_SSL_TRUSTSTORE_PASSWORD" # These are deprecated but keep them so we protect users from suboptimal upgrades. OPTS_SENSITIVE="$OPTS_SENSITIVE LENSES_KAFKA_SETTINGS_PRODUCER_SSL_KEYSTORE_PASSWORD LENSES_KAFKA_SETTINGS_PRODUCER_SSL_KEY_PASSWORD LENSES_KAFKA_SETTINGS_PRODUCER_SSL_TRUSTSTORE_PASSWORD" # These are deprecated but keep them so we protect users from suboptimal upgrades. @@ -607,42 +607,6 @@ else DETECTED_SECCUSTOMFILE=true fi -# If not explicit license path -if ! grep -sqE '^lenses.license.file=' /data/lenses.conf; then - echo -e "\\nlenses.license.file=/data/license.json" >> /data/lenses.conf -# Take care of license path - if [[ -f /license.json ]]; then - cp /license.json /data/license.json - elif [[ -f /mnt/secrets/license.json ]]; then - cp /mnt/secrets/license.json /data/license.json - elif [[ -n "$LICENSE" ]] && [[ ! -f /data/license.json ]]; then - echo "$LICENSE" >> /data/license.json - elif [[ -n "$LICENSE_URL" ]] && [[ ! -f /data/license.json ]]; then - set +o errexit - __p_lver() { - source /build.info - echo "$LENSES_VERSION" - } - __p_bcom() { - source /build.info - echo "${BUILD_COMMIT::8}" - } - wget --user-agent="Lenses Docker (Lenses $(__p_lver); Commit: $(__p_bcom))" \ - "$LICENSE_URL" -O /data/license.json - # shellcheck disable=SC2181 - if [[ $? -ne 0 ]]; then - echo "ERROR! Could not download license. Maybe the link was wrong or the license expired?" - echo " Please check and try again. If the problem persists contact Landoop." - exit 1 - fi - if [[ $STRICT_SCRIPT =~ $TRUE_REG ]]; then set -o errexit; fi - elif [[ -f /data/license.json ]]; then - echo - else - echo -e "ERROR! No license was provided. Lenses will not work." - fi -fi - # Append Advanced Configuration Snippet DETECTED_LENAPPENDFILE=false if [[ -f /mnt/settings/lenses.append.conf ]]; then @@ -707,7 +671,6 @@ if [[ "$C_UID" == 0 ]] && [[ $FORCE_ROOT_USER =~ $FALSE_REG ]]; then /data/kafka-streams-state \ /data/plugins \ /data/storage \ - /data/license.json \ /data/lenses.conf \ /data/security.conf \ /data/logback.xml \ @@ -724,7 +687,6 @@ if [[ "$C_UID" == 0 ]] && [[ $FORCE_ROOT_USER =~ $FALSE_REG ]]; then /data/plugins \ /data/storage chmod 640 -f \ - /data/license.json \ /data/lenses.conf \ /data/security.conf \ /data/logback.xml \ From fa5f8f660249449a8e7cfc9387bd204e7f3ba668 Mon Sep 17 00:00:00 2001 From: George Yord Date: Fri, 19 Nov 2021 14:28:39 +0200 Subject: [PATCH 2/2] Remove setup of brokers since it will be moved to provisioning flow [OPS-1979] --- README.md | 4 ---- setup.sh | 5 ----- 2 files changed, 9 deletions(-) diff --git a/README.md b/README.md index 442480d..482ff2c 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,6 @@ services: image: lensesio/lenses environment: LENSES_PORT: 9991 - LENSES_KAFKA_BROKERS: "PLAINTEXT://broker.1.url:9092,PLAINTEXT://broker.2.url:9092" - - # # If you have enabled JMX for your brokers, set the port here - # LENSES_KAFKA_METRICS_DEFAULT_PORT: 9581 # # If you use AVRO, configure the Schema Registry # LENSES_SCHEMA_REGISTRY_URLS: | diff --git a/setup.sh b/setup.sh index ff74586..60d2173 100755 --- a/setup.sh +++ b/setup.sh @@ -26,7 +26,6 @@ export LT_PACKAGE_VERSION=${LT_PACKAGE_VERSION:-$BUILD_COMMIT} WAIT_SCRIPT=${WAIT_SCRIPT:-} OPTS_JVM="LENSES_OPTS LENSES_HEAP_OPTS LENSES_JMX_OPTS LENSES_LOG4J_OPTS LENSES_PERFORMANCE_OPTS LENSES_SERDE_CLASSPATH_OPTS LENSES_PLUGINS_CLASSPATH_OPTS LENSES_APPEND_CONF" -OPTS_NEEDQUOTE="LENSES_KAFKA_BROKERS" OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_GRAFANA LENSES_JMX_SCHEMA_REGISTRY LENSES_JMX_ZOOKEEPERS" OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_ACCESS_CONTROL_ALLOW_METHODS LENSES_ACCESS_CONTROL_ALLOW_ORIGIN" OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_VERSION LENSES_SECURITY_LDAP_URL LENSES_SECURITY_LDAP_BASE" @@ -47,7 +46,6 @@ OPTS_NEEDQUOTE="$OPTS_NEEDQUOTE LENSES_ALERT_MANAGER_SOURCE LENSES_ALERT_MANAGER OPTS_NEEDNOQUOTE="LENSES_CONNECT LENSES_CONNECT_CLUSTERS LENSES_JMX_CONNECT" OPTS_NEEDNOQUOTE="$OPTS_NEEDNOQUOTE LENSES_UI_CONFIG_DISPLAY LENSES_KAFKA_TOPICS LENSES_SQL_CONNECT_CLUSTERS" OPTS_NEEDNOQUOTE="$OPTS_NEEDNOQUOTE LENSES_ZOOKEEPER_HOSTS LENSES_SCHEMA_REGISTRY_URLS" -OPTS_NEEDNOQUOTE="$OPTS_NEEDNOQUOTE LENSES_JMX_BROKERS" OPTS_NEEDNOQUOTE="$OPTS_NEEDNOQUOTE LENSES_KAFKA_CONTROL_TOPICS LENSES_KAFKA LENSES_KAFKA_METRICS LENSES_KAFKA LENSES_KAFKA_METRICS" OPTS_NEEDNOQUOTE="$OPTS_NEEDNOQUOTE LENSES_KAFKA_METRICS_PORT LENSES_KAFKA_CONNECT_CLUSTERS LENSES_CONNECTORS_INFO" OPTS_NEEDNOQUOTE="$OPTS_NEEDNOQUOTE LENSES_ALERT_PLUGINS LENSES_SQL_UDF_PACKAGES" @@ -111,9 +109,6 @@ fi [[ -z $LENSES_PORT ]] \ && echo "LENSES_PORT is not set via env var or individual file. Using default 9991." -[[ -z $LENSES_KAFKA_BROKERS ]] \ - && echo "LENSES_KAFKA_BROKERS is not set via env var or individual file." - [[ -z $LENSES_SECURITY_PASSWORD ]] \ && echo "LENSES_SECURITY_PASSWORD is not set. You may be using the default password which is dangerous."