Beispiel #1
0
def run():
    """Run the server"""
    if options.insecure:
        # Run the server over an insecure HTTP connection.
        server().listen(80)
    else:
        # Default configuration: run the server over a secure HTTPS connection.
        server().listen(443, ssl_options=_get_ssl_options())
        redirector().listen(80)
    version = guiserver.get_version()
    logging.info('starting Juju GUI server v{}'.format(version))
    IOLoop.instance().start()
Beispiel #2
0
def run():
    """Run the server"""
    port = options.port
    if options.insecure:
        # Run the server over an insecure HTTP connection.
        if port is None:
            port = 80
        server().listen(port)
    else:
        # Default configuration: run the server over a secure HTTPS connection.
        if port is None:
            port = 443
            redirector().listen(80)
        server().listen(port, ssl_options=_get_ssl_options())
    version = guiserver.get_version()
    logging.info('starting Juju GUI server v{}'.format(version))
    logging.info('listening on port {}'.format(port))
    IOLoop.instance().start()
Beispiel #3
0
def run():
    """Run the server"""
    port = options.port
    if options.insecure:
        # Run the server over an insecure HTTP connection.
        if port is None:
            port = 80
        server().listen(port)
    else:
        # Default configuration: run the server over a secure HTTPS connection.
        if port is None:
            port = 443
            redirector().listen(80)
        server().listen(port, ssl_options=_get_ssl_options())
    version = guiserver.get_version()
    logging.info('starting Juju GUI server v{}'.format(version))
    logging.info('listening on port {}'.format(port))
    IOLoop.instance().start()
    def get_app(self, **kwargs):
        """Create and return the server application.

        Use the options provided in kwargs.
        """
        options_dict = {
            'apiversion': 'go',
            'guiroot': '/my/guiroot/',
            'sandbox': False,
        }
        options_dict.update(kwargs)
        options = mock.Mock(**options_dict)
        with mock.patch('guiserver.apps.options', options):
            return apps.server()
Beispiel #5
0
    def get_app(self, **kwargs):
        """Create and return the server application.

        Use the options provided in kwargs.
        """
        options_dict = {
            'apiurl': 'wss://example.com:17070',
            'apiversion': 'go',
            'guiroot': '/my/guiroot/',
            'sandbox': False,
        }
        options_dict.update(kwargs)
        options = mock.Mock(**options_dict)
        with mock.patch('guiserver.apps.options', options):
            return apps.server()
Beispiel #6
0
    def get_app(self, **kwargs):
        """Create and return the server application.

        Use the options provided in kwargs.
        """
        options_dict = {
            'apiurl': 'wss://example.com:17070',
            'apiversion': 'go',
            'sandbox': False,
            'jujuguidebug': False,
        }
        options_dict.update(kwargs)
        options = mock.Mock(**options_dict)
        with mock.patch('guiserver.apps.options', options):
            return apps.server()
Beispiel #7
0
    def get_app(self, **kwargs):
        """Create and return the server application.

        Use the options provided in kwargs.
        """
        options_dict = {
            'apiurl': 'wss://example.com:17070',
            'apiversion': 'go',
            'gzip': True,
            'jujuguidebug': False,
            'jujuversion': '2.0.0',
            'sandbox': False,
            'charmstoreurl': 'https://api.jujucharms.com/charmstore/',
            'bundleservice_url': '',
        }
        options_dict.update(kwargs)
        options = mock.Mock(**options_dict)
        with mock.patch('guiserver.apps.options', options):
            return apps.server()
Beispiel #8
0
    def get_app(self, **kwargs):
        """Create and return the server application.

        Use the options provided in kwargs.
        """
        options_dict = {
            'apiurl': 'wss://example.com:17070',
            'apiversion': 'go',
            'gzip': True,
            'jujuguidebug': False,
            'jujuversion': '2.0.0',
            'sandbox': False,
            'charmstoreurl': 'https://api.jujucharms.com/charmstore/',
            'bundleservice_url': '',
        }
        options_dict.update(kwargs)
        options = mock.Mock(**options_dict)
        with mock.patch('guiserver.apps.options', options):
            return apps.server()