Skip to content

Commit

Permalink
Merge pull request #5 from lensesio-dev/feat/OPS-1979
Browse files Browse the repository at this point in the history
feat/OPS 1979
  • Loading branch information
andmarios authored Nov 19, 2021
2 parents f2a8967 + fa5f8f6 commit efb4515
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 49 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -134,7 +130,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
Expand Down
45 changes: 1 addition & 44 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_LICENSE_FILE 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"
Expand All @@ -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"
Expand All @@ -60,7 +58,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.
Expand Down Expand Up @@ -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."

Expand Down Expand Up @@ -607,42 +602,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
Expand Down Expand Up @@ -707,7 +666,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 \
Expand All @@ -724,7 +682,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 \
Expand Down

0 comments on commit efb4515

Please sign in to comment.