flexget.webserver module#

exception flexget.webserver.WeakPassword(value, logger=<loguru.logger handlers=[(id=0, level=10, sink=<stderr>)]>, **kwargs)[source]#

Bases: Exception

class flexget.webserver.User(**kwargs)[source]#

Bases: Base, UserMixin

User class available for flask apps to handle authentication using flask_login.

get_id()[source]#
_sa_class_manager = {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'password': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'token': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
id#
name#
password#
token#
class flexget.webserver.WebSecret(**kwargs)[source]#

Bases: Base

Store flask secret in the database.

_sa_class_manager = {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}#
id#
value#
class flexget.webserver.WebServer(bind='0.0.0.0', port=5050, ssl_certificate=None, ssl_private_key=None, base_url='')[source]#

Bases: Thread

_start_server()[source]#
run()[source]#

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

start()[source]#

Start the thread’s activity.

It must be called at most once per thread object. It arranges for the object’s run() method to be invoked in a separate thread of control.

This method will raise a RuntimeError if called more than once on the same thread object.

stop()[source]#
triggers_lock = <unlocked _thread.lock object>#
flexget.webserver.generate_key()[source]#

Generate key for use to authentication.

flexget.webserver.get_random_string(length=12, allowed_chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]#

Return a securely generated random string.

The default length of 12 with the a-z, A-Z, 0-9 character set returns a 71-bit value. log_2((26+26+10)^12) =~ 71 bits.

Taken from the django.utils.crypto module.

flexget.webserver.register_app(path, application, name)[source]#
flexget.webserver.register_home(route)[source]#

Register UI home page.

flexget.webserver.setup_server(config)[source]#

Set up and start/restart the web service.

flexget.webserver.start_page()[source]#

Redirect user to registered UI home.