From e56a66ceb544df50e6469b61010723ef9e3a425a Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 18 Oct 2023 19:02:34 +0200 Subject: [PATCH] fix(riseupvpn): render as an experimental nettest Closes https://github.com/ooni/explorer/issues/875 --- .../measurement/MeasurementContainer.js | 2 - components/measurement/nettests/RiseupVPN.js | 57 ------------------- components/search/ResultsList.js | 1 - components/test-info.js | 2 +- 4 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 components/measurement/nettests/RiseupVPN.js diff --git a/components/measurement/MeasurementContainer.js b/components/measurement/MeasurementContainer.js index b31395176..8546c3bc8 100644 --- a/components/measurement/MeasurementContainer.js +++ b/components/measurement/MeasurementContainer.js @@ -13,7 +13,6 @@ import HttpInvalidRequestLine from './nettests/HTTPInvalidRequestLine' import VanillaTorDetails from './nettests/VanillaTor' import PsiphonDetails from './nettests/Psiphon' import TorDetails from './nettests/Tor' -import RiseupVPNDetails from './nettests/RiseupVPN' import DefaultTestDetails from './nettests/Default' import TorSnowflakeDetails from './nettests/TorSnowflake' @@ -31,7 +30,6 @@ const mapTestDetails = { vanilla_tor: VanillaTorDetails, psiphon: PsiphonDetails, tor: TorDetails, - riseupvpn: RiseupVPNDetails, torsf: TorSnowflakeDetails } diff --git a/components/measurement/nettests/RiseupVPN.js b/components/measurement/nettests/RiseupVPN.js deleted file mode 100644 index bf6be2f2c..000000000 --- a/components/measurement/nettests/RiseupVPN.js +++ /dev/null @@ -1,57 +0,0 @@ -import PropTypes from 'prop-types' -import { useIntl, defineMessages } from 'react-intl' - - -const messages = defineMessages({ - metaReachable: { - id: 'Measurement.Metadata.RiseupVPN.Reachable', - defaultMessage: 'Riseup VPN was reachable in {country}' - }, - metaBlocked: { - id: 'Measurement.Metadata.RiseupVPN.Blocked', - defaultMessage: 'Riseup VPN was NOT reachable in {country}' - } -}) - -const RiseupVPNDetails = ({ measurement, render }) => { - const intl = useIntl() - // TODO(bassosimone,cyberta): possibly refine the algorithm - const testKeys = measurement.test_keys - const caCertStatus = testKeys.ca_cert_status || false - const apiStatus = testKeys.api_status || 'blocked' - const failingGateways = testKeys.failing_gateways || [] - const good = ( - caCertStatus == true && apiStatus == 'ok' && - failingGateways.length <= 0 - ) - let status, statusInfo, summaryText, metaText - - if (good) { - status = 'reachable' - statusInfo = intl.formatMessage({ id: 'Measurement.Status.Hint.RiseupVPN.Reachable' }) - summaryText = 'Measurement.Details.SummaryText.RiseupVPN.OK' - metaText = messages.metaReachable - } else { - status = 'anomaly' - statusInfo = intl.formatMessage({ id: 'Measurement.Status.Hint.RiseupVPN.Blocked' }) - summaryText = 'Measurement.Details.SummaryText.RiseupVPN.Blocked' - metaText = messages.metaBlocked - } - return ( - render({ - status, - statusInfo, - summaryText, - headMetadata: { - message: metaText, - formatted: false - } - }) - ) -} - -RiseupVPNDetails.propTypes = { - render: PropTypes.func -} - -export default RiseupVPNDetails diff --git a/components/search/ResultsList.js b/components/search/ResultsList.js index ff5b5de01..1a1ca99be 100644 --- a/components/search/ResultsList.js +++ b/components/search/ResultsList.js @@ -46,7 +46,6 @@ const testsWithStates = [ 'tor', 'torsf', 'psiphon', - 'riseupvpn', 'http_header_field_manipulation', 'http_invalid_request_line', ] diff --git a/components/test-info.js b/components/test-info.js index f175df6da..5805caff5 100644 --- a/components/test-info.js +++ b/components/test-info.js @@ -156,7 +156,7 @@ export const testNames = { info: 'https://ooni.org/nettest/torsf/' }, 'riseupvpn': { - group: 'circumvention', + group: 'experimental', name: , id: 'Tests.RiseupVPN.Name', info: 'https://ooni.org/nettest/'