-
- Would you be ok with sharing anonymous usage data with the Redash team?{" "}
-
- >
- }
- bordered={false}>
- Help Redash improve by automatically sending anonymous usage data:
-
-
-
Number of users, queries, dashboards, alerts, widgets and visualizations.
-
Types of data sources, alert destinations and visualizations.
-
-
- All data is aggregated and will never include any sensitive or private data.
-
-
-
-
-
-
- You can change this setting anytime from the{" "}
- Organization Settings page.
-
-
-
-
-
- );
-}
-
-export default BeaconConsent;
diff --git a/client/app/components/HelpTrigger.jsx b/client/app/components/HelpTrigger.jsx
index 8d0a779df..6a7f36906 100644
--- a/client/app/components/HelpTrigger.jsx
+++ b/client/app/components/HelpTrigger.jsx
@@ -23,7 +23,6 @@ export const TYPES = mapValues(
VALUE_SOURCE_OPTIONS: ["/user-guide/querying/query-parameters#Value-Source-Options", "Guide: Value Source Options"],
SHARE_DASHBOARD: ["/user-guide/dashboards/sharing-dashboards", "Guide: Sharing and Embedding Dashboards"],
AUTHENTICATION_OPTIONS: ["/user-guide/users/authentication-options", "Guide: Authentication Options"],
- USAGE_DATA_SHARING: ["/open-source/admin-guide/usage-data", "Help: Anonymous Usage Data Sharing"],
DS_ATHENA: ["/data-sources/amazon-athena-setup", "Guide: Help Setting up Amazon Athena"],
DS_BIGQUERY: ["/data-sources/bigquery-setup", "Guide: Help Setting up BigQuery"],
DS_URL: ["/data-sources/querying-urls", "Guide: Help Setting up URL"],
diff --git a/client/app/pages/home/Home.jsx b/client/app/pages/home/Home.jsx
index c6f55d646..98c35d306 100644
--- a/client/app/pages/home/Home.jsx
+++ b/client/app/pages/home/Home.jsx
@@ -6,7 +6,6 @@ import Link from "@/components/Link";
import routeWithUserSession from "@/components/ApplicationArea/routeWithUserSession";
import EmptyState, { EmptyStateHelpMessage } from "@/components/empty-state/EmptyState";
import DynamicComponent from "@/components/DynamicComponent";
-import BeaconConsent from "@/components/BeaconConsent";
import PlainButton from "@/components/PlainButton";
import { axios } from "@/services/axios";
@@ -89,7 +88,6 @@ export default function Home() {
-
);
diff --git a/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx b/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx
deleted file mode 100644
index 9dd998f4f..000000000
--- a/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import React from "react";
-import Form from "antd/lib/form";
-import Checkbox from "antd/lib/checkbox";
-import Skeleton from "antd/lib/skeleton";
-import HelpTrigger from "@/components/HelpTrigger";
-import DynamicComponent from "@/components/DynamicComponent";
-import { SettingsEditorPropTypes, SettingsEditorDefaultProps } from "../prop-types";
-
-export default function BeaconConsentSettings(props) {
- const { values, onChange, loading } = props;
-
- return (
-
-
- Anonymous Usage Data Sharing
-
-
- }>
- {loading ? (
-
- ) : (
- onChange({ beacon_consent: e.target.checked })}>
- Help Redash improve by automatically sending anonymous usage data
-
- )}
-
-
- );
-}
-
-BeaconConsentSettings.propTypes = SettingsEditorPropTypes;
-
-BeaconConsentSettings.defaultProps = SettingsEditorDefaultProps;
diff --git a/client/app/pages/settings/components/GeneralSettings/index.jsx b/client/app/pages/settings/components/GeneralSettings/index.jsx
index 3186c83a2..6b02cd2a1 100644
--- a/client/app/pages/settings/components/GeneralSettings/index.jsx
+++ b/client/app/pages/settings/components/GeneralSettings/index.jsx
@@ -4,7 +4,6 @@ import DynamicComponent from "@/components/DynamicComponent";
import FormatSettings from "./FormatSettings";
import PlotlySettings from "./PlotlySettings";
import FeatureFlagsSettings from "./FeatureFlagsSettings";
-import BeaconConsentSettings from "./BeaconConsentSettings";
export default function GeneralSettings(props) {
return (
@@ -14,7 +13,6 @@ export default function GeneralSettings(props) {
-
);
}
diff --git a/redash/app.py b/redash/app.py
index e66cc3223..437f766c8 100644
--- a/redash/app.py
+++ b/redash/app.py
@@ -36,14 +36,10 @@ def create_app():
from .metrics import request as request_metrics
from .models import db, users
from .utils import sentry
- from .version_check import reset_new_version_status
sentry.init()
app = Redash()
- # Check and update the cached version for use by the client
- reset_new_version_status()
-
security.init_app(app)
request_metrics.init_app(app)
db.init_app(app)
diff --git a/redash/handlers/authentication.py b/redash/handlers/authentication.py
index 8afbf469b..ad905036b 100644
--- a/redash/handlers/authentication.py
+++ b/redash/handlers/authentication.py
@@ -15,7 +15,6 @@ from redash.authentication.account import (
)
from redash.handlers import routes
from redash.handlers.base import json_response, org_scoped_rule
-from redash.version_check import get_latest_version
logger = logging.getLogger(__name__)
@@ -256,15 +255,11 @@ def number_format_config():
def client_config():
if not current_user.is_api_user() and current_user.is_authenticated:
- client_config = {
- "newVersionAvailable": bool(get_latest_version()),
+ client_config_inner = {
"version": __version__,
}
else:
- client_config = {}
-
- if current_user.has_permission("admin") and current_org.get_setting("beacon_consent") is None:
- client_config["showBeaconConsentMessage"] = True
+ client_config_inner = {}
defaults = {
"allowScriptsInUserInput": settings.ALLOW_SCRIPTS_IN_USER_INPUT,
@@ -284,12 +279,12 @@ def client_config():
"tableCellMaxJSONSize": settings.TABLE_CELL_MAX_JSON_SIZE,
}
- client_config.update(defaults)
- client_config.update({"basePath": base_href()})
- client_config.update(date_time_format_config())
- client_config.update(number_format_config())
+ client_config_inner.update(defaults)
+ client_config_inner.update({"basePath": base_href()})
+ client_config_inner.update(date_time_format_config())
+ client_config_inner.update(number_format_config())
- return client_config
+ return client_config_inner
def messages():
diff --git a/redash/handlers/setup.py b/redash/handlers/setup.py
index f7e8fab55..ac4bef5f4 100644
--- a/redash/handlers/setup.py
+++ b/redash/handlers/setup.py
@@ -1,13 +1,12 @@
from flask import g, redirect, render_template, request, url_for
from flask_login import login_user
-from wtforms import BooleanField, Form, PasswordField, StringField, validators
+from wtforms import Form, PasswordField, StringField, validators
from wtforms.fields.html5 import EmailField
from redash import settings
from redash.authentication.org_resolving import current_org
from redash.handlers.base import routes
from redash.models import Group, Organization, User, db
-from redash.tasks.general import subscribe
class SetupForm(Form):
@@ -15,8 +14,6 @@ class SetupForm(Form):
email = EmailField("Email Address", validators=[validators.Email()])
password = PasswordField("Password", validators=[validators.Length(6)])
org_name = StringField("Organization Name", validators=[validators.InputRequired()])
- security_notifications = BooleanField()
- newsletter = BooleanField()
def create_org(org_name, user_name, email, password):
@@ -57,8 +54,6 @@ def setup():
return redirect("/")
form = SetupForm(request.form)
- form.newsletter.data = True
- form.security_notifications.data = True
if request.method == "POST" and form.validate():
default_org, user = create_org(form.org_name.data, form.name.data, form.email.data, form.password.data)
@@ -66,10 +61,6 @@ def setup():
g.org = default_org
login_user(user)
- # signup to newsletter if needed
- if form.newsletter.data or form.security_notifications:
- subscribe.delay(form.data)
-
return redirect(url_for("redash.index", org_slug=None))
return render_template("setup.html", form=form)
diff --git a/redash/settings/__init__.py b/redash/settings/__init__.py
index e43a952c5..75c438cff 100644
--- a/redash/settings/__init__.py
+++ b/redash/settings/__init__.py
@@ -412,7 +412,6 @@ PAGE_SIZE_OPTIONS = list(
TABLE_CELL_MAX_JSON_SIZE = int(os.environ.get("REDASH_TABLE_CELL_MAX_JSON_SIZE", 50000))
# Features:
-VERSION_CHECK = parse_boolean(os.environ.get("REDASH_VERSION_CHECK", "true"))
FEATURE_DISABLE_REFRESH_QUERIES = parse_boolean(os.environ.get("REDASH_FEATURE_DISABLE_REFRESH_QUERIES", "false"))
FEATURE_SHOW_QUERY_RESULTS_COUNT = parse_boolean(os.environ.get("REDASH_FEATURE_SHOW_QUERY_RESULTS_COUNT", "true"))
FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS = parse_boolean(
diff --git a/redash/settings/organization.py b/redash/settings/organization.py
index 87a2269a8..947bc31ea 100644
--- a/redash/settings/organization.py
+++ b/redash/settings/organization.py
@@ -45,7 +45,6 @@ HIDE_PLOTLY_MODE_BAR = parse_boolean(os.environ.get("HIDE_PLOTLY_MODE_BAR", "fal
DISABLE_PUBLIC_URLS = parse_boolean(os.environ.get("REDASH_DISABLE_PUBLIC_URLS", "false"))
settings = {
- "beacon_consent": None,
"auth_password_login_enabled": PASSWORD_LOGIN_ENABLED,
"auth_saml_enabled": SAML_LOGIN_ENABLED,
"auth_saml_type": SAML_LOGIN_TYPE,
diff --git a/redash/tasks/__init__.py b/redash/tasks/__init__.py
index 4186d0e27..d7cb5623d 100644
--- a/redash/tasks/__init__.py
+++ b/redash/tasks/__init__.py
@@ -7,7 +7,6 @@ from redash.tasks.general import (
record_event,
send_mail,
sync_user_details,
- version_check,
)
from redash.tasks.queries import (
cleanup_query_results,
diff --git a/redash/tasks/general.py b/redash/tasks/general.py
index f7e6fcb8c..35a741d82 100644
--- a/redash/tasks/general.py
+++ b/redash/tasks/general.py
@@ -5,7 +5,6 @@ from redash import mail, models, settings
from redash.models import users
from redash.query_runner import NotSupported
from redash.tasks.worker import Queue
-from redash.version_check import run_version_check
from redash.worker import get_job_logger, job
logger = get_job_logger(__name__)
@@ -30,27 +29,6 @@ def record_event(raw_event):
logger.exception("Failed posting to %s", hook)
-def version_check():
- run_version_check()
-
-
-@job("default")
-def subscribe(form):
- logger.info(
- "Subscribing to: [security notifications=%s], [newsletter=%s]",
- form["security_notifications"],
- form["newsletter"],
- )
- data = {
- "admin_name": form["name"],
- "admin_email": form["email"],
- "org_name": form["org_name"],
- "security_notifications": form["security_notifications"],
- "newsletter": form["newsletter"],
- }
- requests.post("https://beacon.redash.io/subscribe", json=data)
-
-
@job("emails")
def send_mail(to, subject, html, text):
try:
diff --git a/redash/tasks/schedule.py b/redash/tasks/schedule.py
index 8de526182..fd23a7500 100644
--- a/redash/tasks/schedule.py
+++ b/redash/tasks/schedule.py
@@ -8,7 +8,7 @@ from rq_scheduler import Scheduler
from redash import rq_redis_connection, settings
from redash.tasks.failure_report import send_aggregated_errors
-from redash.tasks.general import sync_user_details, version_check
+from redash.tasks.general import sync_user_details
from redash.tasks.queries import (
cleanup_query_results,
empty_schedules,
@@ -79,9 +79,6 @@ def periodic_job_definitions():
},
]
- if settings.VERSION_CHECK:
- jobs.append({"func": version_check, "interval": timedelta(days=1)})
-
if settings.QUERY_RESULTS_CLEANUP_ENABLED:
jobs.append({"func": cleanup_query_results, "interval": timedelta(minutes=5)})
diff --git a/redash/templates/setup.html b/redash/templates/setup.html
index 4f94a6b51..5d4e01da8 100644
--- a/redash/templates/setup.html
+++ b/redash/templates/setup.html
@@ -42,20 +42,6 @@
{{ render_field(form.email) }}
{{ render_field(form.password) }}
-
-
-
-
-
-
-
-
General
{{ render_field(form.org_name, help_block="Used in email notifications and the UI.") }}
diff --git a/redash/version_check.py b/redash/version_check.py
deleted file mode 100644
index 52cffe0ff..000000000
--- a/redash/version_check.py
+++ /dev/null
@@ -1,103 +0,0 @@
-import logging
-
-import requests
-import semver
-
-from redash import __version__ as current_version
-from redash import redis_connection
-from redash.models import Organization, db
-
-REDIS_KEY = "new_version_available"
-
-
-def usage_data():
- counts_query = """
- SELECT 'users_count' as name, count(0) as value
- FROM users
- WHERE disabled_at is null
-
- UNION ALL
-
- SELECT 'queries_count' as name, count(0) as value
- FROM queries
- WHERE is_archived is false
-
- UNION ALL
-
- SELECT 'alerts_count' as name, count(0) as value
- FROM alerts
-
- UNION ALL
-
- SELECT 'dashboards_count' as name, count(0) as value
- FROM dashboards
- WHERE is_archived is false
-
- UNION ALL
-
- SELECT 'widgets_count' as name, count(0) as value
- FROM widgets
- WHERE visualization_id is not null
-
- UNION ALL
-
- SELECT 'textbox_count' as name, count(0) as value
- FROM widgets
- WHERE visualization_id is null
- """
-
- data_sources_query = "SELECT type, count(0) FROM data_sources GROUP by 1"
- visualizations_query = "SELECT type, count(0) FROM visualizations GROUP by 1"
- destinations_query = "SELECT type, count(0) FROM notification_destinations GROUP by 1"
-
- data = {name: value for (name, value) in db.session.execute(counts_query)}
- data["data_sources"] = {name: value for (name, value) in db.session.execute(data_sources_query)}
- data["visualization_types"] = {name: value for (name, value) in db.session.execute(visualizations_query)}
- data["destination_types"] = {name: value for (name, value) in db.session.execute(destinations_query)}
-
- return data
-
-
-def run_version_check():
- logging.info("Performing version check.")
- logging.info("Current version: %s", current_version)
-
- data = {"current_version": current_version}
-
- if Organization.query.first().get_setting("beacon_consent"):
- data["usage"] = usage_data()
-
- try:
- response = requests.post(
- "https://version.redash.io/api/report?channel=stable",
- json=data,
- timeout=3.0,
- )
- latest_version = response.json()["release"]["version"]
-
- _compare_and_update(latest_version)
- except requests.RequestException:
- logging.exception("Failed checking for new version.")
- except (ValueError, KeyError):
- logging.exception("Failed checking for new version (probably bad/non-JSON response).")
-
-
-def reset_new_version_status():
- latest_version = get_latest_version()
- if latest_version:
- _compare_and_update(latest_version)
-
-
-def get_latest_version():
- return redis_connection.get(REDIS_KEY)
-
-
-def _compare_and_update(latest_version):
- # TODO: support alpha channel (allow setting which channel to check & parse build number)
- is_newer = semver.compare(current_version, latest_version) == -1
- logging.info("Latest version: %s (newer: %s)", latest_version, is_newer)
-
- if is_newer:
- redis_connection.set(REDIS_KEY, latest_version)
- else:
- redis_connection.delete(REDIS_KEY)