Esempio n. 1
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    helper.call('post', actions.superuser_run, 'tor', ['setup'])
    helper.call('post', actions.superuser_run, 'tor',
                ['configure', '--apt-transport-tor', 'enable'])

    global socks_service
    if socks_service is None:
        socks_service = service_module.Service(
            'tor-socks', _('Tor Anonymity Network'), ports=['tor-socks'],
            is_external=False, is_enabled=utils.is_enabled,
            is_running=utils.is_running)
    helper.call('post', socks_service.notify_enabled, None, True)

    global bridge_service
    if bridge_service is None:
        bridge_service = service_module.Service(
            'tor-bridge', _('Tor Bridge Relay'),
            ports=['tor-orport', 'tor-obfs3', 'tor-obfs4'],
            is_external=True, is_enabled=utils.is_enabled,
            is_running=utils.is_running)
    helper.call('post', bridge_service.notify_enabled, None, True)

    helper.call('post', update_hidden_service_domain)
Esempio n. 2
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)

    new_configuration = {
        'rpc-whitelist-enabled': False,
        'rpc-authentication-required': False
    }
    helper.call('post',
                actions.superuser_run,
                'transmission', ['merge-configuration'],
                input=json.dumps(new_configuration).encode())

    helper.call('post', actions.superuser_run, 'transmission', ['enable'])
    global service
    if service is None:
        service = service_module.Service(managed_services[0],
                                         name,
                                         ports=['http', 'https'],
                                         is_external=True,
                                         is_enabled=is_enabled,
                                         enable=enable,
                                         disable=disable)
    helper.call('post', service.notify_enabled, None, True)
    helper.call('post', add_shortcut)
Esempio n. 3
0
def init():
    """Initialize the module."""
    menu = main_menu.get('apps')
    menu.add_urlname(name, 'glyphicon-eye-close', 'tor:index',
                     short_description)

    setup_helper = globals()['setup_helper']
    needs_setup = setup_helper.get_state() == 'needs-setup'

    if not needs_setup:
        global socks_service
        socks_service = service_module.Service('tor-socks',
                                               _('Tor Anonymity Network'),
                                               ports=['tor-socks'],
                                               is_external=False,
                                               is_enabled=utils.is_enabled,
                                               is_running=utils.is_running)

        global bridge_service
        bridge_service = service_module.Service(
            'tor-bridge',
            _('Tor Bridge Relay'),
            ports=['tor-orport', 'tor-obfs3', 'tor-obfs4'],
            is_external=True,
            is_enabled=utils.is_enabled,
            is_running=utils.is_running)

        # Register hidden service name with Name Services module.
        status = utils.get_status()
        hostname = status['hs_hostname']
        hs_virtports = [port['virtport'] for port in status['hs_ports']]

        if status['enabled'] and status['is_running'] and \
           status['hs_enabled'] and status['hs_hostname']:
            hs_services = []
            for service_type in SERVICES:
                if str(service_type[2]) in hs_virtports:
                    hs_services.append(service_type[0])
        else:
            hostname = None
            hs_services = None

        domain_added.send_robust(sender='tor',
                                 domain_type='hiddenservice',
                                 name=hostname,
                                 description=_('Tor Hidden Service'),
                                 services=hs_services)
Esempio n. 4
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    global service
    if service is None:
        service = service_module.Service(
            managed_services[0], title, ports=['ntp'], is_external=False)
    helper.call('post', service.notify_enabled, None, True)
Esempio n. 5
0
def init():
    """Intialize the OpenVPN module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-lock', 'openvpn:index')

    global service
    service = service_module.Service(
        managed_services[0], title, ports=['openvpn'], is_external=True)
Esempio n. 6
0
def init():
    """Intialize the service discovery module."""
    menu = main_menu.get('system')
    menu.add_urlname(title, 'glyphicon-lamp', 'avahi:index')

    global service  # pylint: disable=W0603
    service = service_module.Service(
        managed_services[0], title, ports=['mdns'], is_external=False)
Esempio n. 7
0
def init():
    """Intialize the ssh module."""
    menu = main_menu.get('system')
    menu.add_urlname(name, 'glyphicon-console', 'ssh:index')

    global service
    service = service_module.Service(
        managed_services[0], name, ports=['ssh'], is_external=True)
Esempio n. 8
0
def init():
    """Intialize the date/time module."""
    menu = cfg.main_menu.get('system:index')
    menu.add_urlname(title, 'glyphicon-time', 'datetime:index')

    global service
    service = service_module.Service(
        managed_services[0], title, ports=['ntp'], is_external=False)
Esempio n. 9
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    global service
    if service is None:
        service = service_module.Service(
            managed_services[0], name, ports=['http', 'https'],
            is_external=False)
Esempio n. 10
0
def init():
    """Initialize the module."""
    menu = main_menu.get('system')
    menu.add_urlname(name, 'glyphicon-refresh', 'upgrades:index')
    global service
    service = service_module.Service(
        'auto-upgrades', name, is_external=False, is_enabled=is_enabled,
        enable=enable, disable=disable)
Esempio n. 11
0
def init():
    """Initialize the repro module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-phone-alt', 'repro:index')

    global service
    service = service_module.Service(
        managed_services[0], title, ports=['sip-plinth', 'sip-tls-plinth'],
        is_external=True)
Esempio n. 12
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    global service
    if service is None:
        service = service_module.Service(managed_services[0],
                                         title,
                                         ports=['openvpn'],
                                         is_external=True)
Esempio n. 13
0
def init():
    """Intialize the module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-envelope', 'ttrss:index')

    global service
    service = service_module.Service(
        managed_services[0], title, ports=['http', 'https'], is_external=True,
        is_enabled=is_enabled, enable=enable, disable=disable)
Esempio n. 14
0
def init():
    """Initialize the XMPP module"""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname('XMPP', 'glyphicon-comment', 'xmpp:index', 40)

    service.Service(
        'xmpp-client', _('Chat Server - client connections'),
        is_external=True, enabled=True)
    service.Service(
        'xmpp-server', _('Chat Server - server connections'),
        is_external=True, enabled=True)
    service.Service(
        'xmpp-bosh', _('Chat Server - web interface'), is_external=True,
        enabled=True)

    pre_hostname_change.connect(on_pre_hostname_change)
    post_hostname_change.connect(on_post_hostname_change)
    domainname_change.connect(on_domainname_change)
Esempio n. 15
0
def init():
    """Initialize the module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-th-large', 'minetest:index')

    global service
    service = service_module.Service(
        managed_services[0], title, ports=['minetest-plinth'],
        is_external=True)
Esempio n. 16
0
def init():
    """Initialize the radicale module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-calendar', 'radicale:index')

    global service
    service = service_module.Service(
        managed_services[0], title, ports=['http', 'https'], is_external=True,
        enable=enable, disable=disable)
Esempio n. 17
0
def init():
    """Intialize the Mumble module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-headphones', 'mumble:index')

    global service
    service = service_module.Service(managed_services[0],
                                     title,
                                     ports=['mumble-plinth'],
                                     is_external=True)
Esempio n. 18
0
def init():
    """Initialize the module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(_('Bookmarks (Shaarli)'), 'glyphicon-bookmark',
                     'shaarli:index', 350)

    global service
    service = service_module.Service(
        'shaarli', _('Shaarli'), ['http', 'https'],
        is_external=True, enabled=is_enabled())
Esempio n. 19
0
def init():
    """Intialize the service discovery module."""
    menu = cfg.main_menu.get('system:index')
    menu.add_urlname(_('Service Discovery'), 'glyphicon-lamp',
                     'avahi:index', 950)

    global service  # pylint: disable=W0603
    service = service_module.Service(
        'avahi', _('Service Discovery'), ['mdns'],
        is_external=False, enabled=is_enabled())
Esempio n. 20
0
def init():
    """Intialize the date/time module."""
    menu = main_menu.get('system')
    menu.add_urlname(title, 'glyphicon-time', 'datetime:index')

    global service
    setup_helper = globals()['setup_helper']
    if setup_helper.get_state() != 'needs-setup':
        service = service_module.Service(
            managed_services[0], title, ports=['ntp'], is_external=False)
Esempio n. 21
0
def init():
    """Intialize the module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-cloud-upload', 'privoxy:index')

    global service
    service = service_module.Service(managed_services[0],
                                     title,
                                     ports=['privoxy'],
                                     is_external=False)
Esempio n. 22
0
def init():
    """Intialize the date/time module."""
    menu = cfg.main_menu.get('system:index')
    menu.add_urlname(_('Date & Time'), 'glyphicon-time', 'datetime:index', 900)

    global service
    service = service_module.Service('ntp',
                                     _('Network Time Server'),
                                     is_external=False,
                                     enabled=is_enabled())
Esempio n. 23
0
def init():
    """Intialize the Transmission module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(_('BitTorrent (Transmission)'), 'glyphicon-save',
                     'transmission:index', 300)

    global service
    service = service_module.Service(
        'transmission', _('Transmission BitTorrent'), ['http', 'https'],
        is_external=True, enabled=is_enabled())
Esempio n. 24
0
def init():
    """Initialize the quassel module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-retweet', 'quassel:index')

    global service
    service = service_module.Service(managed_services[0],
                                     title,
                                     ports=['quassel-plinth'],
                                     is_external=True)
Esempio n. 25
0
def init():
    """Initialize the ikiwiki module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(_('Wiki & Blog (Ikiwiki)'), 'glyphicon-edit',
                     'ikiwiki:index', 1100)

    global service
    service = service_module.Service(
        'ikiwiki', _('Ikiwiki wikis and blogs'), ['http', 'https'],
        is_external=True, enabled=is_enabled())
Esempio n. 26
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    global service
    if service is None:
        service = service_module.Service(
            'shaarli', title, ports=['http', 'https'], is_external=True,
            is_enabled=is_enabled, enable=enable, disable=disable)
    helper.call('post', service.notify_enabled, None, True)
    helper.call('post', add_shortcut)
Esempio n. 27
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    global service
    if service is None:
        service = service_module.Service(managed_services[0], name, ports=[
            'quassel-plinth'
        ], is_external=True, enable=enable, disable=disable)
    helper.call('post', service.notify_enabled, None, True)
    helper.call('post', add_shortcut)
Esempio n. 28
0
def init():
    """Initialize the module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(title, 'glyphicon-eye-close', 'tor:index')

    global socks_service
    socks_service = service_module.Service('tor-socks',
                                           _('Tor Anonymity Network'),
                                           ports=['tor-socks'],
                                           is_external=False,
                                           is_enabled=utils.is_enabled,
                                           is_running=utils.is_running)

    global bridge_service
    bridge_service = service_module.Service(
        'tor-bridge',
        _('Tor Bridge Relay'),
        ports=['tor-orport', 'tor-obfs3', 'tor-obfs4'],
        is_external=True,
        is_enabled=utils.is_enabled,
        is_running=utils.is_running)

    # Register hidden service name with Name Services module.
    hs_info = utils.get_hs()
    hostname = hs_info['hostname']
    hs_virtports = [port['virtport'] for port in hs_info['ports']]

    if utils.is_enabled() and utils.is_running() and \
       hs_info['enabled'] and hs_info['hostname']:
        hs_services = []
        for service_type in SERVICES:
            if str(service_type[2]) in hs_virtports:
                hs_services.append(service_type[0])
    else:
        hostname = None
        hs_services = None

    domain_added.send_robust(sender='tor',
                             domain_type='hiddenservice',
                             name=hostname,
                             description=_('Tor Hidden Service'),
                             services=hs_services)
Esempio n. 29
0
def init():
    """Initialize the Deluge module."""
    menu = cfg.main_menu.get('apps:index')
    menu.add_urlname(_('BitTorrent (Deluge)'), 'glyphicon-magnet',
                     'deluge:index', 200)

    global service
    service = service_module.Service('deluge',
                                     _('Deluge BitTorrent'), ['http', 'https'],
                                     is_external=True,
                                     enabled=is_enabled())
Esempio n. 30
0
def setup(helper, old_version=None):
    """Install and configure the module."""
    helper.install(managed_packages)
    helper.call('post', actions.superuser_run, 'ikiwiki', ['setup'])
    global service
    if service is None:
        service = service_module.Service(
            'ikiwiki', name, ports=['http', 'https'], is_external=True,
            is_enabled=is_enabled, enable=enable, disable=disable)
    helper.call('post', service.notify_enabled, None, True)
    helper.call('post', add_shortcuts)