Changeset - c34648b1a4d6
[Not reviewed]
default
0 5 0
Dennis Fink - 11 years ago 2014-07-16 01:23:27
dennis.fink@c3l.lu
Add support for flashproxy an meek an version bump
5 files changed with 29 insertions and 4 deletions:
0 comments (0 inline, 0 general)
Scripts/update_server.py
Show inline comments
 
@@ -8,8 +8,9 @@ import requests
 
from ast import literal_eval
 

	
 
OBFS_REGEX = re.compile(r'^ServerTransportPlugin (obfs\d+|scramblesuit)')
 

	
 
FTEPROXY_REGEX = re.compile(r'^ServerTransportPlugin fte')
 
FLASHPROXY_REGEX = re.compile(r'^ServerTransportPlugin webproxy')
 
MEEKPROXY_REGEX = re.compile(r'^ServerTransportPlugin meek')
 

	
 
IP_REGEX = re.compile(r'^(OutboundBindAddress)\ (\d{1,3}\.\d{1,3}\.\d{1,3}\.'
 
                      r'\d{1,3})')
 
@@ -71,6 +72,16 @@ def get_fte_proxy(tor_config):
 
    return any(FTEPROXY_REGEX.match(i) for i in tor_config)
 

	
 

	
 
def get_flash_proxy(tor_config):
 

	
 
    return any(FLASHPROXY_REGEX.match(i) for i in tor_config)
 

	
 

	
 
def get_meek_proxy(tor_config):
 

	
 
    return any(MEEKPROXY_REGEX.match(i) for i in tor_config)
 

	
 

	
 
def get_ip(tor_config):
 

	
 
    for i in tor_config:
 
@@ -100,10 +111,14 @@ def create_server_json(tor_configfile='/
 

	
 
    obfs = None
 
    fte = None
 
    flash = None
 
    meek = None
 

	
 
    if server_type == 'Bridge':
 
        obfs = get_obfs_proxy(tor_config)
 
        fte = get_fte_proxy(tor_config)
 
        flash = get_flash_proxy(tor_config)
 
        meek = get_meek_proxy(tor_config)
 

	
 
    dictionary = {'server_type': server_type, 'server_name': hostname,
 
                  'tor_status': tor_status, 'fingerprint': fingerprint}
 
@@ -117,6 +132,12 @@ def create_server_json(tor_configfile='/
 
    if fte is not None:
 
        dictionary['fteproxy'] = fte
 

	
 
    if flash is not None:
 
        dictionary['flashproxy'] = flash
 

	
 
    if meek is not None:
 
        dictionary['meek'] = meek
 

	
 
    return dictionary
 

	
 

	
ennstatus/api/functions.py
Show inline comments
 
@@ -55,7 +55,7 @@ def check_json_format(server):
 
        raise ValueError('fingerprint has not the right format!\n')
 

	
 
    if server['server_type'] == 'bridge':
 
        for key in ('obfs', 'fteproxy'):
 
        for key in ('obfs', 'fteproxy', 'flashproxy', 'meek'):
 
            check_bridge(key, server)
 

	
 
    if 'ip' in server:
ennstatus/templates/api/export/xml/server.xml
Show inline comments
 
@@ -9,6 +9,8 @@
 
    {% if server['server_type'] == 'bridge' %}
 
    <obfs>{{ server['obfs'] }}</obfs>
 
    <fteproxy>{{ server['fteproxy'] }}</fteproxy>
 
    <flashproxy>{{ server['flashproxy'] }}</flashproxy>
 
    <meek>{{ server['meek'] }}</meek>
 
    {% else %}
 
    <ip>{{ server['ip'] }}</ip>
 
    {% endif %}
ennstatus/templates/status/macros.html
Show inline comments
 
@@ -40,7 +40,7 @@
 
  {% if server_type in ('Exit', 'Relay') %}
 
    {% set headers = ('#', 'Name', 'IP', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'Last Updated (UTC)') %}
 
  {% else %}
 
    {% set headers = ('#', 'Name', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'OBFS', 'FTEProxy', 'Last Updated (UTC)') %}
 
    {% set headers = ('#', 'Name', 'Server Status', 'Tor Status', 'Country', 'Fingerprint', 'OBFS', 'FTEProxy', 'Flashproxy', 'meek', 'Last Updated (UTC)') %}
 
  {% endif %}
 
  <h2>{{ server_type }}</h2>
 
  <table class="table table-bordered table-striped">
 
@@ -69,6 +69,8 @@
 
          {% if server_type == 'Bridge' %}
 
            <td>{{ colorize_obfs(server['obfs']) }}</td>
 
            <td>{{ colorize_obfs(server['fteproxy']) }}</td>
 
            <td>{{ colorize_obfs(server['flashproxy']) }}</td>
 
            <td>{{ colorize_obfs(server['meek']) }}</td>
 
          {% endif %}
 
          <td>{{ server['last_updated'] }}</td>
 
        </tr>
setup.py
Show inline comments
 
@@ -11,7 +11,7 @@ def _get_requirements():
 

	
 

	
 
setup(name='Ennstatus',
 
      version='4.1.4',
 
      version='4.2.0',
 
      description=('Ennstatus provides the user with vital information about '
 
                   'the status of the organizations Tor servers.'),
 
      author='Frënn vun der Ënn',
0 comments (0 inline, 0 general)