Exemplo n.º 1
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)
        if not EDENWALL:
            message_area = MessageArea()
            message_area.critical(
                "nuFirewall",
                tr(
                    "This EAS version does not support the Activation Key frontend but it seems that your appliance does. "
                    "Please check if another EAS version is available."
                    )
                    )
            self.setWidget(message_area)
            return
        self.client = client
        self.mainwindow = parent
        self._modified = False
        self.error_message = ''
        self._not_modifying = True
        try:
            self.ID = self.client.call("license", 'getID')
        except RpcdError:
            self.__disable("Could not fetch activation key info")

        self.buildInterface()
        self.getValidLicenses()
Exemplo n.º 2
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)
        self.client = client
        self.mainwindow = parent
        self._modified = False
        self.error_message = ''
        self.config = None
        frame = QFrame(self)
        layout = QGridLayout(frame)

        title = QLabel(u'<H1>%s</H1>' % tr('Contact Configuration'))
        layout.addWidget(title, 0, 0)

        self.admin_mail = self.buildAdminMail(layout, 1, 0)
        self.sender_mail = self.buildSenderMail(layout, 2, 0)
        self.smarthost_group, self.use_smarthost, self.mail_relay = \
            self.buildOutgoing(layout, 3, 0)
        self.language = self.buildChooseLanguage(layout, 4, 0)
        self.buildTestMail(layout, 5, 0)
        layout.setRowStretch(6, 15)

        self.setWidget(frame)
        self.setWidgetResizable(True)

        self.resetConf()
        self.mainwindow.addToInfoArea(tr('Contact interface enabled'))
Exemplo n.º 3
0
    def __init__(self, client, parent=None):
        ScrollArea.__init__(self)
        self.client = client
        self.mainwindow = parent
        self._modified = False
        self.cfg = {}
        self.host_loaded = False
        self.resolv_loaded = False
        self._can_edit_hostname = True
        self.qhostnamecfg = QHostnameObject.getInstance()
        self.qresolvcfg = QResolvObject.getInstance()

        main_widget = QWidget()
        self.setWidget(main_widget)
        self.setWidgetResizable(True)

        self.form = QFormLayout(main_widget)

        self.form.addRow(QLabel("<h1>%s</h1>" % tr('Hostname')))

        host_box = self.mkHostBox()
        self.form.addRow(host_box)

        self.form.addItem(
            QSpacerItem(1, 1, QSizePolicy.Minimum, QSizePolicy.Expanding)
            )

        self.form.addRow(QLabel("<h1>%s</h1>" % tr('DNS')))
        self.dns1 = self.addField(tr("Server 1"), IpEdit)
        self.dns2_label = QLabel(tr("Server 2"))
        self.dns2 = self.addField(self.dns2_label, IpEdit)

        self.form.addRow(QLabel("<h1>%s</h1>" % tr('Active configuration test')))

        self.test_group = _mkTestGroup()
        self.form.addRow(self.test_group)
        self.connect(self.test_group.test_button, SIGNAL('clicked()'), self.full_test)

        self.mainwindow.writeAccessNeeded(
            self.dns1,
            self.dns2,
            self.edit_hostname,
            self.edit_domain
            )

        self.message = MessageArea()
        self.message.setWidth(80)
        self.error_message = ''

        self.form.addRow(self.message)

        self.resetConf()
        if not self.host_loaded and not self.resolv_loaded:
            raise NuConfModuleDisabled

        if self.resolv_loaded:
            self._connectsignals()
Exemplo n.º 4
0
    def __init__(self, client, parent):
        self.__loading = True
        ScrollArea.__init__(self)
        self.mainwindow = parent
        self.client = client
        self.modified = False

        self.qsyslogexportobject = QSyslogExportObject.getInstance()

        frame = QFrame(self)
        layout = QVBoxLayout(frame)

        layout.addWidget(QLabel('<H1>%s</H1>' % tr('Syslog export')))

        enabled_box = QGroupBox(tr("Enable syslog export"))
        enabled_layout = QFormLayout(enabled_box)
        self.enabledCheckBox = QCheckBox()
        enabled_layout.addRow(QLabel(tr("Enable the syslog export service")),
                              self.enabledCheckBox)
        self.connect(self.enabledCheckBox, SIGNAL('toggled(bool)'),
                     self.setEnabled)

        servers_box = QGroupBox(tr("Syslog server to export to"))
        servers_layout = QFormLayout(servers_box)
        self.serverLineEdit = QLineEdit()
        servers_layout.addRow(QLabel(tr("Syslog server to export to")),
                              self.serverLineEdit)
        self.connect(self.serverLineEdit,
                     SIGNAL('textEdited(const QString&)'),
                     self.setModifiedCallback)

        components_box = QGroupBox(tr("Enabled components"))
        components_layout = QFormLayout(components_box)
        self.ulogdCheckBox = QCheckBox()
        components_layout.addRow(QLabel(tr(
            "Firewall logs (ulogd, facility local4, level info)")),
                                 self.ulogdCheckBox)
        self.connect(self.ulogdCheckBox, SIGNAL('toggled(bool)'),
                     self.setUlogd)

        self.mainwindow.writeAccessNeeded(
            self.enabledCheckBox, self.ulogdCheckBox, self.serverLineEdit)

        for widget in (enabled_box, servers_box, components_box):
            layout.addWidget(widget)
        layout.addStretch()
        self.setWidget(frame)
        self.setWidgetResizable(True)

        self.resetConf()
        self.__loading = False
Exemplo n.º 5
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)
        if not EDENWALL:
            raise NuConfModuleDisabled("idsips")
        self.client = client
        self.mainwindow = parent
        self._modified = False
        self.error_message = ''
        self._not_modifying = True
        self.config = None

        self.resetConf(no_interface=True)
        self.buildInterface()
        self.updateView()
Exemplo n.º 6
0
    def __init__(self, client, parent=None):
        ScrollArea.__init__(self)
        box = QVBoxLayout(self)

        title = QLabel("<H1>System</H1>")
        box.addWidget(title)

        try:
            values = client.call('system_info', 'systemInfo')
        except Exception:
            parent.addToInfoArea(tr("Unmanaged error, warn developpers."))

        else:

            info_box = Device(values)
            box.addWidget(info_box)
        box.addStretch()
Exemplo n.º 7
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)

        self.client = client
        self.mainwindow = parent
        self.form = QFormLayout(self)

        title = QLabel("<H1>Services</H1>")
        self.form.addRow(title)

        self.monitor = None
        group = QGroupBox()
        group.setTitle(self.tr("System Services Status"))
        box = QVBoxLayout(group)
        #parent is expected to be MainWindow !
        self.monitor = MonitorWindow(client, self, parent)
        box.addWidget(self.monitor)
        self.form.addRow(group)
Exemplo n.º 8
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)
        self.mainwindow = parent
        self._modified = False
        self.q_netobject = QNetObject.getInstance()
        self.connect(self.q_netobject, SIGNAL('cancelled'), self.resetConf)
        box_layout = QVBoxLayout(self)

        title = QLabel("<H1>%s</H1>" % tr("Routed networks"))
        box_layout.addWidget(title)
        if self.q_netobject.netcfg is None:
            debug("Routes can not load: no netcfg loaded")
            msg_area = MessageArea()
            msg_area.setMessage(
                tr("Routes not loaded"),
                tr("Could not get networking information from the appliance"),
                "critical"
                )
            box_layout.addWidget(msg_area)
            box_layout.addStretch()
            return

        self.ifaces_frontend = parent.widgets['Network']
        self.connect(self.ifaces_frontend, SIGNAL('modified'), self.resetConf)

        # TODO write useful routesList.setEditBoxDescription('') (used when a route is modified)
        self.routesList = ListEdit()
        self.routesList.headers = [self.tr('Destination'), self.tr('Gateway'), 'Interfaces']
        # Interfaces column is hidden
        self.routesList.hideColumn(2)
        self.routesList.readOnly = self.mainwindow.readonly
        self.routesList.displayUpDown = False
        self.routesList.editInPopup = True
        self.routesList.setColDelegate(self.createDelegateForColumn)
        self.routesList.setEditBox(self.createWizard)
        self.mainwindow.writeAccessNeeded(self.routesList)

        self.connect(self.routesList, SIGNAL('itemDeleted'), self.routeDeleted)
        self.connect(self.routesList, SIGNAL('itemAdded'), self.routeAdded)
        self.connect(self.routesList, SIGNAL('itemModified'), self.routeModified)

        box_layout.addWidget(self.routesList)

        self.resetConf()
Exemplo n.º 9
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)
        if not EDENWALL:
            raise NuConfModuleDisabled("Roadwarrior")
        self.loaded_done = False
        self.mainwindow = parent
        self.client = client
        self.modified = False
        self.error_message = ''
        self._buildGui()

        self.qopenvpnobject = QOpenVpnObject.getInstance()
        self.qopenvpnobject.openvpn = self.client.call('openvpn',
                                                       'getOpenVpnConfig')

        # FIXME: Remove isValid() or call it more even?
        self.isValid()

        self.resetConf()
Exemplo n.º 10
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)
        if not EDENWALL:
            raise NuConfModuleDisabled("mail")
        self.mainwindow = parent
        self._modified = False
        self.mail_modified = False
        self.spam_modified = False
        self._init_done = False
        self.spam_config = None
        self.client = client

        frame = QFrame(self)
        layout = QGridLayout(frame)

        title = QLabel('<H1>%s</H1>' % self.tr('Email Configuration'))
        layout.addWidget(title, 0, 0)

        self.antivirus_enable = self.buildAntivirus(layout, 1, 0)
        self.antispam_enable, self.mark_spam_level, self.deny_spam_level = self.buildAntispam(layout, 2, 0)

        self.relayed_domains = self.buildIncoming(layout, 3, 0)
        self.relayed_net = self.buildOutgoing(layout, 4, 0)
        self.test_mail = self.buildTestMail(layout, 5, 0)

        self.mainwindow.writeAccessNeeded(
            self.antivirus_enable,
            self.relayed_domains,
            self.relayed_net,
            self.test_mail
            )

        self.setWidget(frame)
        self.setWidgetResizable(True)

        self.resetConf()

        if self.spam_config is not None:
            self.mainwindow.writeAccessNeeded(self.antispam_enable)

        self._init_done = True
        self.mainwindow.addToInfoArea(tr('Email services interface enabled'))
Exemplo n.º 11
0
    def __init__(self, client, parent=None):
        ScrollArea.__init__(self)

        if not EDENWALL:
            raise NuConfModuleDisabled("DHCP")

        self.error_message = tr("Incorrect DHCP specification")
        self.client =  client
        self.main_window = parent
        self.q_netobject = QNetObject.getInstance()

        # detect when DHCP backend is unavailable : raise NuConfModuleDisabled
        try:
            self.main_window.init_call("dhcp", "getDhcpConfig")
        except RpcdError:
            #dhcp module was not available, server side
            self.main_window.addToInfoArea(tr("DHCP interface disabled: DHCP backend not loaded"),
                category=COLOR_CRITICAL)
            raise NuConfModuleDisabled("DHCP")
        else:
            self.main_window.addToInfoArea(tr("DHCP interface enabled"))
Exemplo n.º 12
0
    def __init__(self, client, parent):
        ScrollArea.__init__(self)

        self.client = client
        self.mainwindow = parent
        self._modified = False
        self.__disabled = False
        self.net_object = QNetObject.getInitializedInstance(self.client)
        if EDENWALL:
            self.vpn_object = QOpenVpnObject.getInstance()

        self.setupWidgets()
        self.getConfigs()
        self.getNetworks()
        # vpn_config is used to check if the VPN config changed or not
        self.vpn_config = self.getVPNConfig()
        self.fillTable()
        self.net_object.registerCallbacks(self.validateNetCfg, self.updateWithNetCfg)
        if EDENWALL:
            self.vpn_object.registerCallbacks(self.validateVpnCfg, self.updateWithVpnCfg)


        self.mainwindow.addToInfoArea(tr("Access interface enabled"))
Exemplo n.º 13
0
 def __init__(self, client, parent=None):
     ScrollArea.__init__(self)
     self.ntp_widget = NTPWidget(client, parent, self)
     self.setWidget(self.ntp_widget)
     self.setWidgetResizable(True)
Exemplo n.º 14
0
    def __init__(self, client, parent=None):
        ScrollArea.__init__(self)
        self._modified = False

        self.drawGUIBasic()

        self.loaded_done = False

        parent.widgets["Network"] = self
        parent.addToInfoArea(self.tr("Network configuration interface enabled"))

        self.new_vlan = QAction(QIcon(":/icons/vlan"), tr("New VLAN"), self)
        self.new_vlan.setToolTip(tr("Create a VLAN interface"))

        self.new_bonding = QAction(QIcon(":/icons/New_bonding"), tr("New Bonding"), self)
        self.new_bonding.setToolTip(tr("Create a Bonding interface"))

        self.new_network = QAction(QIcon(":/icons/addnetwork"), tr("New Network"), self)
        self.new_network.setToolTip(tr("Add a network definition"))

        self.show_all = QAction(QIcon(":/icons/show_all_interface"), tr("Text Set Below"), self)
        self.show_all.setToolTip(tr("Show all interfaces"))
        self.is_showing_all = False
        self.toggleShowAll()

        self.connect(self.show_all, SIGNAL('triggered(bool)'), self.toggleShowAll)

        self.contextual_toolbar = ToolBar(
            (
                self.new_network,
                self.new_vlan,
                self.new_bonding,
                self.show_all
            ),
            name=tr("Interfaces"))
        self.contextual_toolbar.setObjectName("Network toolbar")

        self.parent = parent
        self.client = client
        self.routes_model = None
        self.q_netobject = QNetObject.getInitializedInstance(self.client)
        self.q_netobject.registerCallbacks(
            self.canHandleModification,
            self.handleModification
            )

        if self.q_netobject.netcfg is None:
            self.parent.addToInfoArea("Could not load network configuration", COLOR_ERROR)
            msg_area = MessageArea()
            msg_area.setMessage(
                tr("Network configuration interface disabled"),
                tr("Could not fetch network configuration from the appliance"),
                "critical"
                )
            self.widget().layout().addWidget(msg_area)
            return
        self.resetConf()

        try:
            Protector(self.client.host, self)
        except:
            self.parent.addToInfoArea(
                tr(
                    "Problem while loading a misconfiguration preventer: "
                    "you will not be warned if you deconfigure the IP address "
                    "to which EdenWall Administration Suite is connected.")
                    )
Exemplo n.º 15
0
    def __init__(self, client, parent):
        self.__loading = True
        ScrollArea.__init__(self)
        self.mainwindow = parent
        self.client = client
        self.modified = False

        self.qauthcertobject = QAuthCertObject.getInstance()

        frame = QFrame(self)

        layout = QVBoxLayout(frame)

        layout.addWidget(QLabel('<H1>%s</H1>' % tr('Authentication server') ))

        head_box = QGroupBox(tr("How the authentication server handles certificates"))
        head = QFormLayout(head_box)
        self.strictCheckBox = QCheckBox()
        head.addRow(QLabel(tr("Strict mode (check the client's certificate against the installed CA)")), self.strictCheckBox)
        self.connect(self.strictCheckBox, SIGNAL('toggled(bool)'),
                     self.setStrict)

        self.cl_auth_box = QGroupBox(tr("Client authentication with a certificate is"))
        cl_auth = QVBoxLayout(self.cl_auth_box)
        self.auth_by_cert = QButtonGroup()
        self.auth_by_cert.setExclusive(True)

        self.mainwindow.writeAccessNeeded(self.strictCheckBox)

        labels = [tr('forbidden'), tr('allowed'), tr('mandatory')]
        for index, label_button in enumerate(labels):
            button = QRadioButton(label_button)
            self.auth_by_cert.addButton(button, index)
            cl_auth.addWidget(button)
            self.mainwindow.writeAccessNeeded(button)
        self.auth_by_cert.button(0).setChecked(Qt.Checked)
        self.connect(self.auth_by_cert, SIGNAL('buttonClicked(int)'),
                     self.auth_by_cert_modified)


        # Captive portal
        # --------------
        self.portal_groupbox = QGroupBox(tr("Captive portal"))
        self.portal_groupbox.setLayout(QVBoxLayout())

        # Enabled checkbox:
        self.portal_checkbox = QCheckBox(tr("Enable captive portal"))
        self.connect(self.portal_checkbox, SIGNAL('toggled(bool)'),
                     self.setPortalEnabled)

        # List of networks redirected to the captive portal:
        self.portal_nets_groupbox = QGroupBox(
            tr("Networks handled by the captive portal"))
        self.portal_nets_groupbox.setLayout(QVBoxLayout())
        self.portal_nets_edit = NetworkListEdit()
        self.connect(self.portal_nets_edit, SIGNAL('textChanged()'), self.setPortalNets)
        self.portal_nets_groupbox.layout().addWidget(self.portal_nets_edit)

        # Pack the widgets:
        for widget in (self.portal_checkbox, self.portal_nets_groupbox):
            self.portal_groupbox.layout().addWidget(widget)
        self.mainwindow.writeAccessNeeded(self.portal_checkbox)
        self.mainwindow.writeAccessNeeded(self.portal_nets_edit)

        if not EDENWALL:
            self.portal_groupbox.setVisible(False)


        # authentication server
        self.pki_widget = PkiEmbedWidget(self.client, self, 'auth_cert', PkiEmbedWidget.SHOW_ALL|PkiEmbedWidget.CRL_OPTIONAL, self.setModified)
        self.mainwindow.writeAccessNeeded(self.pki_widget)

        layout.addWidget(head_box)
        layout.addWidget(self.cl_auth_box)
        layout.addWidget(self.portal_groupbox)
        layout.addWidget(self.pki_widget)
        layout.addStretch()
        self.setWidget(frame)
        self.setWidgetResizable(True)

        self.resetConf()
        self.__loading = False