Beispiel #1
0
def diagnose():
    """Run diagnostics and return the results."""
    return [action_utils.diagnose_url(
        'http://localhost:5678', kind='4', check_certificate=False),
            action_utils.diagnose_url(
                'http://localhost:5678', kind='6', check_certificate=False),
            action_utils.diagnose_url(
                'http://{}:5678'.format(get_configured_domain_name()),
                kind='4',
                check_certificate=False)]
Beispiel #2
0
def diagnose():
    """Run diagnostics and return the results."""
    return [action_utils.diagnose_url(
        'http://localhost:5678', kind='4', check_certificate=False),
            action_utils.diagnose_url(
                'http://localhost:5678', kind='6', check_certificate=False),
            action_utils.diagnose_url(
                'http://{}:5678'.format(get_configured_domain_name()),
                kind='4',
                check_certificate=False)]
Beispiel #3
0
def diagnose():
    """Run diagnostics and return the results."""
    results = []

    results.append(
        action_utils.diagnose_url('http://diaspora.localhost', kind='4',
                                  check_certificate=False))
    results.append(
        action_utils.diagnose_url('http://diaspora.localhost', kind='6',
                                  check_certificate=False))
    results.append(
        action_utils.diagnose_url('http://diaspora.{}'.format(
            get_configured_domain_name()), kind='4', check_certificate=False))

    return results
Beispiel #4
0
def _diagnose_url_via_tor(url, kind=None):
    """Diagnose whether a URL is reachable via Tor."""
    result = action_utils.diagnose_url(url, kind=kind, wrapper='torsocks')
    result[0] = _('Access URL {url} on tcp{kind} via Tor') \
        .format(url=url, kind=kind)

    return result
Beispiel #5
0
def _diagnose_tor_use(url, kind=None):
    """Diagnose whether webpage at URL reports that we are using Tor."""
    expected_output = "Congratulations. This browser is configured to use Tor."
    result = action_utils.diagnose_url(url, kind=kind, wrapper="torsocks", expected_output=expected_output)
    result[0] = _("Confirm Tor usage at {url} on tcp{kind}").format(url=url, kind=kind)

    return result
Beispiel #6
0
def diagnose():
    """Run diagnostics and return the results."""
    results = []

    results.append(
        action_utils.diagnose_url(
            'http://diaspora.localhost', kind='4', check_certificate=False))
    results.append(
        action_utils.diagnose_url(
            'http://diaspora.localhost', kind='6', check_certificate=False))
    results.append(
        action_utils.diagnose_url(
            'http://diaspora.{}'.format(get_configured_domain_name()),
            kind='4',
            check_certificate=False))

    return results
Beispiel #7
0
def _diagnose_tor_use(url, kind=None):
    """Diagnose whether webpage at URL reports that we are using Tor."""
    expected_output = 'Congratulations. This browser is configured to use Tor.'
    result = action_utils.diagnose_url(url, kind=kind, wrapper='torsocks',
                                       expected_output=expected_output)
    result[0] = _('Confirm Tor usage at {url} on tcp{kind}') \
        .format(url=url, kind=kind)

    return result
Beispiel #8
0
def diagnose():
    """Run diagnostics and return the results."""
    results = []

    results.append(action_utils.diagnose_port_listening(8118, 'tcp4'))
    results.append(action_utils.diagnose_port_listening(8118, 'tcp6'))
    results.append(action_utils.diagnose_url('https://www.debian.org'))
    results.extend(diagnose_url_with_proxy())

    return results
Beispiel #9
0
def diagnose():
    """Run diagnostics and return the results."""
    results = []

    results.append(action_utils.diagnose_port_listening(8118, 'tcp4'))
    results.append(action_utils.diagnose_port_listening(8118, 'tcp6'))
    results.append(action_utils.diagnose_url('https://www.debian.org'))
    results.extend(diagnose_url_with_proxy())

    return results
Beispiel #10
0
def diagnose():
    """Run diagnostics and return the results."""
    results = []

    for domain_type, domains in names.domains.items():
        if domain_type == 'hiddenservice':
            continue

        for domain in domains:
            results.append(action_utils.diagnose_url('https://' + domain))

    return results
Beispiel #11
0
def diagnose():
    """Run diagnostics and return the results."""
    results = []

    for domain_type, domains in names.domains.items():
        if domain_type == 'hiddenservice':
            continue

        for domain in domains:
            results.append(action_utils.diagnose_url('https://' + domain))

    return results
Beispiel #12
0
def diagnose_url_with_proxy():
    """Run a diagnostic on a URL with a proxy."""
    url = 'https://debian.org/'  # Gives a simple redirect to www.

    results = []
    for address in action_utils.get_addresses():
        proxy = 'http://{host}:8118/'.format(host=address['url_address'])
        env = {'https_proxy': proxy}

        result = action_utils.diagnose_url(url, kind=address['kind'], env=env)
        result[0] = _('Access {url} with proxy {proxy} on tcp{kind}') \
            .format(url=url, proxy=proxy, kind=address['kind'])
        results.append(result)

    return results
Beispiel #13
0
def diagnose_url_with_proxy():
    """Run a diagnostic on a URL with a proxy."""
    url = 'https://debian.org/'  # Gives a simple redirect to www.

    results = []
    for address in action_utils.get_addresses():
        proxy = 'http://{host}:8118/'.format(host=address['url_address'])
        env = {'https_proxy': proxy}

        result = action_utils.diagnose_url(url, kind=address['kind'], env=env)
        result[0] = _('Access {url} with proxy {proxy} on tcp{kind}') \
            .format(url=url, proxy=proxy, kind=address['kind'])
        results.append(result)

    return results
Beispiel #14
0
def diagnose_url_with_proxy():
    """Run a diagnostic on a URL with a proxy."""
    url = 'https://debian.org/'

    results = []
    for address in action_utils.get_addresses():
        if address['kind'] == '6':
            address['address'] = '[{0}]'.format(address['address'])

        proxy = 'http://{host}:8118/'.format(host=address['address'])
        if address['kind'] == '4':
            env = {'http_proxy': proxy}
        else:
            env = {'https_proxy': proxy}

        result = action_utils.diagnose_url(url, kind=address['kind'], env=env)
        result[0] = _('Access {url} with proxy {proxy} on tcp{kind}') \
                    .format(url=url, proxy=proxy, kind=address['kind'])
        results.append(result)

    return results
Beispiel #15
0
def diagnose_url_with_proxy():
    """Run a diagnostic on a URL with a proxy."""
    url = 'https://debian.org/'

    results = []
    for address in action_utils.get_addresses():
        if address['kind'] == '6':
            address['address'] = '[{0}]'.format(address['address'])

        proxy = 'http://{host}:8118/'.format(host=address['address'])
        if address['kind'] == '4':
            env = {'http_proxy': proxy}
        else:
            env = {'https_proxy': proxy}

        result = action_utils.diagnose_url(url, kind=address['kind'], env=env)
        result[0] = _('Access {url} with proxy {proxy} on tcp{kind}') \
                    .format(url=url, proxy=proxy, kind=address['kind'])
        results.append(result)

    return results