← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/removessl26 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/removessl26 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~trb143/openlp/removessl26/+merge/318983

Will SSL being removed in 2.8 it and not supported in Android and iOS lets prevent it from living in 2.6.
Just removed the SSL code to stop the settings and not start the SSL server full removal will be in 2.8 when we change server infrastructure,

lp:~trb143/openlp/removessl26 (revision 2727)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1920/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1831/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1772/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1503/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/1093/
[SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1161/
[SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/1029/
^[[23~[SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/171/

-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/removessl26 into lp:openlp.
=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py	2016-12-31 11:01:36 +0000
+++ openlp/plugins/remotes/lib/httpserver.py	2017-03-04 10:34:45 +0000
@@ -111,14 +111,9 @@
         self.address = address
         self.is_secure = Settings().value(self.settings_section + '/https enabled')
         self.needs_authentication = Settings().value(self.settings_section + '/authentication enabled')
-        if self.is_secure:
-            port = Settings().value(self.settings_section + '/https port')
-            self.port = port
-            self.start_server_instance(address, port, HTTPSServer)
-        else:
-            port = Settings().value(self.settings_section + '/port')
-            self.port = port
-            self.start_server_instance(address, port, ThreadingHTTPServer)
+        port = Settings().value(self.settings_section + '/port')
+        self.port = port
+        self.start_server_instance(address, port, ThreadingHTTPServer)
         if hasattr(self, 'httpd') and self.httpd:
             self.httpd.serve_forever()
         else:
@@ -158,19 +153,3 @@
             self.http_thread.stop()
         self.httpd = None
         log.debug('Stopped the server.')
-
-
-class HTTPSServer(HTTPServer):
-    def __init__(self, address, handler):
-        """
-        Initialise the secure handlers for the SSL server if required.s
-        """
-        BaseServer.__init__(self, address, handler)
-        local_data = AppLocation.get_directory(AppLocation.DataDir)
-        self.socket = ssl.SSLSocket(
-            sock=socket.socket(self.address_family, self.socket_type),
-            certfile=os.path.join(local_data, 'remotes', 'openlp.crt'),
-            keyfile=os.path.join(local_data, 'remotes', 'openlp.key'),
-            server_side=True)
-        self.server_bind()
-        self.server_activate()

=== modified file 'openlp/plugins/remotes/lib/remotetab.py'
--- openlp/plugins/remotes/lib/remotetab.py	2016-12-31 11:01:36 +0000
+++ openlp/plugins/remotes/lib/remotetab.py	2017-03-04 10:34:45 +0000
@@ -88,42 +88,6 @@
         self.live_url.setOpenExternalLinks(True)
         self.http_setting_layout.addRow(self.live_url_label, self.live_url)
         self.left_layout.addWidget(self.http_settings_group_box)
-        self.https_settings_group_box = QtWidgets.QGroupBox(self.left_column)
-        self.https_settings_group_box.setCheckable(True)
-        self.https_settings_group_box.setChecked(False)
-        self.https_settings_group_box.setObjectName('https_settings_group_box')
-        self.https_settings_layout = QtWidgets.QFormLayout(self.https_settings_group_box)
-        self.https_settings_layout.setObjectName('https_settings_layout')
-        self.https_error_label = QtWidgets.QLabel(self.https_settings_group_box)
-        self.https_error_label.setVisible(False)
-        self.https_error_label.setWordWrap(True)
-        self.https_error_label.setObjectName('https_error_label')
-        self.https_settings_layout.addRow(self.https_error_label)
-        self.https_port_label = QtWidgets.QLabel(self.https_settings_group_box)
-        self.https_port_label.setObjectName('https_port_label')
-        self.https_port_spin_box = QtWidgets.QSpinBox(self.https_settings_group_box)
-        self.https_port_spin_box.setMaximum(32767)
-        self.https_port_spin_box.setObjectName('https_port_spin_box')
-        self.https_settings_layout.addRow(self.https_port_label, self.https_port_spin_box)
-        self.remote_https_url = QtWidgets.QLabel(self.https_settings_group_box)
-        self.remote_https_url.setObjectName('remote_http_url')
-        self.remote_https_url.setOpenExternalLinks(True)
-        self.remote_https_url_label = QtWidgets.QLabel(self.https_settings_group_box)
-        self.remote_https_url_label.setObjectName('remote_http_url_label')
-        self.https_settings_layout.addRow(self.remote_https_url_label, self.remote_https_url)
-        self.stage_https_url_label = QtWidgets.QLabel(self.http_settings_group_box)
-        self.stage_https_url_label.setObjectName('stage_https_url_label')
-        self.stage_https_url = QtWidgets.QLabel(self.https_settings_group_box)
-        self.stage_https_url.setObjectName('stage_https_url')
-        self.stage_https_url.setOpenExternalLinks(True)
-        self.https_settings_layout.addRow(self.stage_https_url_label, self.stage_https_url)
-        self.live_https_url_label = QtWidgets.QLabel(self.https_settings_group_box)
-        self.live_https_url_label.setObjectName('live_url_label')
-        self.live_https_url = QtWidgets.QLabel(self.https_settings_group_box)
-        self.live_https_url.setObjectName('live_https_url')
-        self.live_https_url.setOpenExternalLinks(True)
-        self.https_settings_layout.addRow(self.live_https_url_label, self.live_https_url)
-        self.left_layout.addWidget(self.https_settings_group_box)
         self.user_login_group_box = QtWidgets.QGroupBox(self.left_column)
         self.user_login_group_box.setCheckable(True)
         self.user_login_group_box.setChecked(False)
@@ -177,8 +141,6 @@
         self.thumbnails_check_box.stateChanged.connect(self.on_thumbnails_check_box_changed)
         self.address_edit.textChanged.connect(self.set_urls)
         self.port_spin_box.valueChanged.connect(self.set_urls)
-        self.https_port_spin_box.valueChanged.connect(self.set_urls)
-        self.https_settings_group_box.clicked.connect(self.https_changed)
 
     def retranslateUi(self):
         self.server_settings_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'Server Settings'))
@@ -200,14 +162,6 @@
             translate('RemotePlugin.RemoteTab',
                       'Scan the QR code or click <a href="{qr}">download</a> to install the iOS app from the App '
                       'Store.').format(qr='https://itunes.apple.com/app/id1096218725'))
-        self.https_settings_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'HTTPS Server'))
-        self.https_error_label.setText(
-            translate('RemotePlugin.RemoteTab', 'Could not find an SSL certificate. The HTTPS server will not be '
-                      'available unless an SSL certificate is found. Please see the manual for more information.'))
-        self.https_port_label.setText(self.port_label.text())
-        self.remote_https_url_label.setText(self.remote_url_label.text())
-        self.stage_https_url_label.setText(self.stage_url_label.text())
-        self.live_https_url_label.setText(self.live_url_label.text())
         self.user_login_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'User Authentication'))
         self.user_id_label.setText(translate('RemotePlugin.RemoteTab', 'User id:'))
         self.password_label.setText(translate('RemotePlugin.RemoteTab', 'Password:'))
@@ -218,17 +172,11 @@
         """
         ip_address = self.get_ip_address(self.address_edit.text())
         http_url = 'http://{url}:{text}/'.format(url=ip_address, text=self.port_spin_box.value())
-        https_url = 'https://{url}:{text}/'.format(url=ip_address, text=self.https_port_spin_box.value())
         self.remote_url.setText('<a href="{url}">{url}</a>'.format(url=http_url))
-        self.remote_https_url.setText('<a href="{url}">{url}</a>'.format(url=https_url))
         http_url_temp = http_url + 'stage'
-        https_url_temp = https_url + 'stage'
         self.stage_url.setText('<a href="{url}">{url}</a>'.format(url=http_url_temp))
-        self.stage_https_url.setText('<a href="{url}">{url}</a>'.format(url=https_url_temp))
         http_url_temp = http_url + 'main'
-        https_url_temp = https_url + 'main'
         self.live_url.setText('<a href="{url}">{url}</a>'.format(url=http_url_temp))
-        self.live_https_url.setText('<a href="{url}">{url}</a>'.format(url=https_url_temp))
 
     def get_ip_address(self, ip_address):
         """
@@ -254,43 +202,25 @@
         """
         Load the configuration and update the server configuration if necessary
         """
-        self.is_secure = Settings().value(self.settings_section + '/https enabled')
         self.port_spin_box.setValue(Settings().value(self.settings_section + '/port'))
-        self.https_port_spin_box.setValue(Settings().value(self.settings_section + '/https port'))
         self.address_edit.setText(Settings().value(self.settings_section + '/ip address'))
         self.twelve_hour = Settings().value(self.settings_section + '/twelve hour')
         self.twelve_hour_check_box.setChecked(self.twelve_hour)
         self.thumbnails = Settings().value(self.settings_section + '/thumbnails')
         self.thumbnails_check_box.setChecked(self.thumbnails)
-        local_data = AppLocation.get_directory(AppLocation.DataDir)
-        if not os.path.exists(os.path.join(local_data, 'remotes', 'openlp.crt')) or \
-                not os.path.exists(os.path.join(local_data, 'remotes', 'openlp.key')):
-            self.https_settings_group_box.setChecked(False)
-            self.https_settings_group_box.setEnabled(False)
-            self.https_error_label.setVisible(True)
-        else:
-            self.https_settings_group_box.setChecked(Settings().value(self.settings_section + '/https enabled'))
-            self.https_settings_group_box.setEnabled(True)
-            self.https_error_label.setVisible(False)
         self.user_login_group_box.setChecked(Settings().value(self.settings_section + '/authentication enabled'))
         self.user_id.setText(Settings().value(self.settings_section + '/user id'))
         self.password.setText(Settings().value(self.settings_section + '/password'))
         self.set_urls()
-        self.https_changed()
 
     def save(self):
         """
         Save the configuration and update the server configuration if necessary
         """
         if Settings().value(self.settings_section + '/ip address') != self.address_edit.text() or \
-                Settings().value(self.settings_section + '/port') != self.port_spin_box.value() or \
-                Settings().value(self.settings_section + '/https port') != self.https_port_spin_box.value() or \
-                Settings().value(self.settings_section + '/https enabled') != \
-                self.https_settings_group_box.isChecked():
+                Settings().value(self.settings_section + '/port') != self.port_spin_box.value():
             self.settings_form.register_post_process('remotes_config_updated')
         Settings().setValue(self.settings_section + '/port', self.port_spin_box.value())
-        Settings().setValue(self.settings_section + '/https port', self.https_port_spin_box.value())
-        Settings().setValue(self.settings_section + '/https enabled', self.https_settings_group_box.isChecked())
         Settings().setValue(self.settings_section + '/ip address', self.address_edit.text())
         Settings().setValue(self.settings_section + '/twelve hour', self.twelve_hour)
         Settings().setValue(self.settings_section + '/thumbnails', self.thumbnails)
@@ -317,12 +247,6 @@
         if check_state == QtCore.Qt.Checked:
             self.thumbnails = True
 
-    def https_changed(self):
-        """
-        Invert the HTTP group box based on Https group settings
-        """
-        self.http_settings_group_box.setEnabled(not self.https_settings_group_box.isChecked())
-
     def generate_icon(self):
         """
         Generate icon for main window
@@ -330,12 +254,6 @@
         self.remote_server_icon.hide()
         icon = QtGui.QImage(':/remote/network_server.png')
         icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
-        if self.is_secure:
-            overlay = QtGui.QImage(':/remote/network_ssl.png')
-            overlay = overlay.scaled(60, 60, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
-            painter = QtGui.QPainter(icon)
-            painter.drawImage(0, 0, overlay)
-            painter.end()
         if Settings().value(self.settings_section + '/authentication enabled'):
             overlay = QtGui.QImage(':/remote/network_auth.png')
             overlay = overlay.scaled(60, 60, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)

=== modified file 'tests/functional/openlp_plugins/remotes/test_remotetab.py'
--- tests/functional/openlp_plugins/remotes/test_remotetab.py	2016-12-31 11:01:36 +0000
+++ tests/functional/openlp_plugins/remotes/test_remotetab.py	2017-03-04 10:34:45 +0000
@@ -37,8 +37,6 @@
 __default_settings__ = {
     'remotes/twelve hour': True,
     'remotes/port': 4316,
-    'remotes/https port': 4317,
-    'remotes/https enabled': False,
     'remotes/user id': 'openlp',
     'remotes/password': 'password',
     'remotes/authentication enabled': False,
@@ -114,10 +112,6 @@
             self.form.set_urls()
             # THEN: the following screen values should be set
             self.assertEqual(self.form.address_edit.text(), ZERO_URL, 'The default URL should be set on the screen')
-            self.assertEqual(self.form.https_settings_group_box.isEnabled(), False,
-                             'The Https box should not be enabled')
-            self.assertEqual(self.form.https_settings_group_box.isChecked(), False,
-                             'The Https checked box should note be Checked')
             self.assertEqual(self.form.user_login_group_box.isChecked(), False,
                              'The authentication box should not be enabled')
 
@@ -143,7 +137,3 @@
             # THEN: the following screen values should be set
             self.assertEqual(self.form.http_settings_group_box.isEnabled(), True,
                              'The Http group box should be enabled')
-            self.assertEqual(self.form.https_settings_group_box.isChecked(), False,
-                             'The Https checked box should be Checked')
-            self.assertEqual(self.form.https_settings_group_box.isEnabled(), True,
-                             'The Https box should be enabled')


Follow ups