Package webinterface
webinterface.common
common.py
Helper functions for the graphical user interface of mercure.
- async webinterface.common.async_run(cmd, **params) Tuple[Optional[int], bytes, bytes] [source]
Executes the given command in a way compatible with ayncio.
webinterface.modules
modules.py
Modules page for the graphical user interface of mercure.
- async webinterface.modules.add_module(request)[source]
Creates a new module and forwards the user to the module edit page.
- async webinterface.modules.delete_module(request)[source]
Deletes the module with the given module name.
- async webinterface.modules.edit_module(request)[source]
Show the module edit page for the given module name.
- async webinterface.modules.edit_module_POST(request)[source]
Save the settings for the given module name.
webinterface.queue
queue.py
Queue page for the graphical user interface of mercure.
webinterface.rules
rules.py
Rules page for the graphical user interface of mercure.
- async webinterface.rules.add_rule(request) Response [source]
Creates a new routing rule and forwards the user to the rule edit page.
- async webinterface.rules.rules_delete_post(request) Response [source]
Deletes the given routing rule
- async webinterface.rules.rules_edit(request) Response [source]
Shows the edit page for the given routing rule.
- async webinterface.rules.rules_edit_post(request) Response [source]
Updates the settings for the given routing rule.
- async webinterface.rules.rules_test(request) Response [source]
Evalutes if a given routing rule is valid. The rule and testing dictionary have to be passed as form parameters.
webinterface.services
services.py
Helper functions for controlling the services from the graphical user interface of mercure.
webinterface.targets
targets.py
Targets page for the graphical user interface of mercure.
- async webinterface.targets.targets_delete_post(request) Response [source]
Deletes the given target.
- async webinterface.targets.targets_edit(request) Response [source]
Shows the edit page for the given target.
webinterface.users
users.py
Users page and user support functions for the graphical user interface of mercure.
- class webinterface.users.User(*args, **kwargs)[source]
Bases:
dict
- change_password: typing_extensions.Literal[True, False]
- email: str
- is_admin: typing_extensions.Literal[True, False]
- password: str
- permissions: Any
- async webinterface.users.add_new_user(request) Response [source]
Creates a new user and redirects to the user-edit page.
- webinterface.users.create_users() Dict[str, User] [source]
Create new users file and create seed admin account with name “admin” and password “router”.
- webinterface.users.evaluate_password(username, password) bool [source]
Check if the given password for the given user is correct. Hashed passwords are stored with salt.
- webinterface.users.hash_password(password) str [source]
Hash the password using the passlib library.
- webinterface.users.is_admin(username) bool [source]
Check in the user list if the given user has admin rights.
- webinterface.users.needs_change_password(username) bool [source]
Check if the given user has to change his password after login.
- webinterface.users.read_users() Dict[str, User] [source]
Reads the user list from the configuration file. The file will only be read if it has been updated since the last function call. If the file does not exist, create a new user file.