Skip to content

v5.0.0 - Updated Logging, Web Server, Many New Features!

Compare
Choose a tag to compare
@DuckBoss DuckBoss released this 29 Jan 01:44
· 160 commits to master since this release

This is a major update that requires users to reconfigure their config files.

Core Updates

Web Interface Changes

The web interface is now a part of the new web_server core plugin.
As a result, references to the web interface in the config.ini file has been moved to the web_server plugin's metadata.ini file. The new plugin will provide a REST API and serve the web interface.
This update has a change in dependencies as a result.

Dependency Updates - Changed Dependencies, Remember to Update!

There are now multiple requirements files located in the requirements/ directory.
This directory will contain a requirements.txt file which has the core requirements for the bot,
and additional requirement files for plugins such as the web_server.

To install all dependencies for v5.0.0, you can use the following commands:
pip install -r requirements/requirements.txt
pip install -r requirements/web_server.txt

This change will allow users who want a minimal setup without a web interface
to install the minimum number of dependencies to run the bot.

Updated Launch Parameters

  • Renamed -webinterface to -useweb
  • Renamed -ydlproxy to -mediaproxy
  • Renamed -ydlcookie to -mediacookie
  • Added -noweb parameter to disable the web interface on startup if it is enabled by default in the plugin metadata.
  • Added -logtrace parameter to enable logging stack traces of events.

Plugin Template Generator Updates

The plugin template generator has been updated to v5.0.0.
If you are a developer looking to make a JJMumbleBot plugin, but don't know where to start, then generate a template plugin like so: python3 JJMumbleBot/utility/plugin_template_generator.py my_example_plugin.
This plugin will be generated in the JJMumbleBot/user_generated/directory, and must be placed in the JJMumbleBot/plugins/extensions/directory to work.

Persistent Plugin Data in Docker Containers

So far, docker images of JJMumbleBot haven't been able to store persistent data for plugins easily.
In this update each plugin will receive it's own directory in the /cfg/plugins/ directory to use for persistent data.
Since the content of this directory is dependent on the plugin, some plugins may opt not to use it.

  • A persistent data utility is now available in the bot library for third-party plugins to utilize for containerized bots.

Updated Logging and Console Printing System

  • More bot/plugin events are now logged.
  • Added 'LogStackTrace' option to the config.ini file to allow the logging API to log the event stack trace.
    Launch parameter: -logtrace
  • Logging API Updates
    • The logging API now supports multi-line messages as a list of strings.
      log ( INFO, [string1, string2, string3], ... )
    • Added new logging origin for plugins: L_PLUGIN
    • The logging API supports displaying custom error types.
    • The logging API now supports 'error' log level.
    • The logging API has been updated to make it easier than ever for third-party developed plugins to adopt logging features.
      For more information on the logging API, refer to the wiki page: [Logging API](https://duckboss.github.io/JJMumbleBot/wiki/general/logging.html)

Updated PGUI System

  • PGUI System API Updates
    • The PGUI system now supports multi-line messages.

Plugin Updates

Bot Commands Plugin - New Commands

The bot commands plugin has new commands.

  • !aliassearch 'search_term': Searches and returns a list of aliases that most closely matched the search term.

Core Commands Plugin - New Commands

The core commands plugin now has commands that can be used to individually stop/start/restart plugins.
A plugin's ability to be stopped/started/restarted in this way is controlled in the plugin's respective metadata.ini file.

  • !stopplugin 'plugin_name': Stops the plugin by the name provided if it is running.
  • !startplugin 'plugin_name': Starts the plugin by the name provided if it is currently inactive.
  • !restartplugin 'plugin_name': Restarts the plugin by the name provided if it is currently running.

Server Tools Plugin

The server tools plugin is now considered a core plugin and has been moved from the extension plugin folder to the core plugin folder.
Some plugin commands have also been shortened so that they are easier to use.

  • The server tools plugin now only uses audio clips from the sound_board permanent media directory if the option is enabled in the plugin's metadata.ini file.
  • The plugin now comes with a default built-in "ping" sound clip to play when a user connects to the server.
    This can be configured in the metadata.ini file.
  • The plugin can now send a welcome message to a user that connects to the server.
    The content of this message can be configured in the metadata.ini file.
  • Shortened the !setuserrconnectionsound command to !setloginsound
  • Shortened the !getuserconnectionsound command to !getloginsound
  • Shortened the !clearuserconnectionsound command to !clearloginsound
  • Shortened the !toggleuserconnectionsound command to !toggleloginsounds
  • Shortened the !setdefaultconnectionsound command to !setdefaultloginsound

Web Server Plugin [NEW] - New Web Interface

The web interface is now a part of the web_server plugin, which gives it the benefit of being a drag-and-drop optional feature to the bot. This plugin is included by default, but it can be removed by simple deleting it from the plugins list.

  • One port access for both the interface + socket: For example localhost:7000/ provides the web interface, and localhost:7000/ws will provide the socket connection for the interface.
  • Modern front-end visuals: The interface has been completely reworked using ReactJS
  • Transition to a plugin-based web server: The web interface is now a part of the web_server plugin, which gives it the benefit of being a drag-and-drop optional feature to the bot.
  • Better API implementation: New, fast API system utilizing the FastAPI library that is open for customization and third-party web interfaces. The API can also be used for other third-party integrations.
  • Dark/Light Mode themes: A new theme selector has been added so that users who prefer a dark/ or light interface scheme can select their preference.
  • CLICK HERE TO SEE PREVIEW IMAGES

    Navigation Bar

    Navigation Bar Image

    Commands Tab

    Commands Tab Image

    Audio Tab

    Audio Tab Image

    Debug Tab

    Debug Tab Image
  • Web Server API
    • [POST] /api/command: Sends a given command to the bot.
      Example request body: { "text": "!echo test" }
    • [GET] /api/lastcommand: Retrieves the most recent command sent to the bot.
    • [POST] /api/pause: Pauses the audio interface.
      Example request body: No request body required
    • [POST] /api/pause: Pauses the current track in the audio interface.
      Example request body: No request body required
    • [POST] /api/resume: Resumes the current track in the audio interface.
      Example request body: No request body required
    • [POST] /api/replay: Replays the current track in the audio interface.
      Example request body: No request body required
    • [POST] /api/nexttrack: Skips to the next track in the audio interface queue.
      Example request body: No request body required
    • [POST] /api/decreasevolume: Decreases the volume of the audio interface by 0.1
      Example request body: No request body required
    • [POST] /api/increasevolume: Increases the volume of the audio interface by 0.1
      Example request body: No request body required
    • [POST] /api/clearcmdhistory: Clears the command history of the bot.
      Example request body: No request body required
    • [GET] /api/cmdhistory: Retrieves the command history of the bot.
    • [POST] /api/loop: Sets the audio interface to loop tracks.
      Example request body: No request body required
    • [POST] /api/skipto: Skips to the given track in the audio interface queue.
      Example request body: { "text": "track_index_in_queue" }
    • [POST] /api/removetrack: Removes the given track in the audio interface queue.
      Example request body: { "text": "track_index_in_queue" }
    • [POST] /api/stop: Stops the current track and clears the queue in the audio interface.
      Example request body: No request body required
    • [GET] /api/plugins: Retrieves a list of all the active plugins in the bot.
    • [GET] /api/channels: Retrieves a list of all the server channels in the mumble server.
    • [GET] /api/soundboardclips: Retrieves a list of all the sound_board clips in local storage.
    • [POST] /api/soundboard-random: Plays a random soundboard clip from local storage.
      Example request body: No request body required
    • [POST] /api/soundboard-play: Plays a soundboard clip by the given name from local storage.
      Example request body: { "text": "my_clip_name" }
    • [GET] /api/system: Retrieves the system information that the bot is running on.
    • [GET] /api/general/: Retrieves general bot information such as the name and command token.
    • [GET] /api/general/name: Retrieves the bot name.
    • [GET] /api/general/token: Retrieves the bot command token.
    For more information on the Web Server REST API, please check the Web Server API Wiki Page

Randomizer Plugin - New Commands

  • Added d100roll command to the randomizer plugin.

Media Plugin

  • The internal track duration tracking now uses integers, and only converts to a string timedelta representation for outputting to the user.

Sound Board Plugin - New Commands

The sound board plugin has new commands.

  • !sbrandomquiet: Plays a random sound clip from local storage without displaying it to the channel chat.
  • !sbrandomquietnow: Plays a random sound clip from local storage without displaying it to the channel chat and overrides the queue to play immediately.

Docker Updates

  • The bot now supports the IP/PORT/PASS of the server to be provided automatically through system environment variables (MUMBLE_IP/MUMBLE_PORT/MUMBLE_PASSWORD). If these environment variables are unavailable, it uses default parameters or parameters provided through the -ip/-port/-password parameters.
  • Updated the docker file to install all the necessary dependencies as per the new requirements/ directory.
  • Updated the docker container to pass through required system environment variables for connecting to a mumble server.
  • The docker container now exposes port 7000 by default.

Wiki Updates

  • Updated the wiki as per the updates in v5.0.0

Unit Tests

  • Added unit testing to plugins
  • Added unit testing for template files such as configs, aliases, etc.

Bug Fixes

  • Logging: Fixed message printing error where the message origin was not displayed.
  • Audio API: Fixed thumbnail downloading issue that occurred due to recent youtube_dl updated.
  • Audio API: "now"-postfixed commands such as !sbnow override the audio interface queue as expected.
  • Audio API: Fixed an issue where the progress tracking of audio clips wasn't being reset properly.
  • Server Tools Plugin: Added missing documentation for commands in the help.html file.
  • Media Plugin: Fixed the !ytsearch command.

Misc

  • Updated all plugins to v5.0.0
  • Optimized imports and dependency usage.
  • Added generic warning/error resource strings.
  • Plugin help data no longer displays the bot name as 'JJMumbleBot'.
  • Added a on_disconnect callback to the core bot service.
  • Added new utility methods to the runtime utility.
  • Added logging/printing suppression to the image helper script.
  • Added support for base64 image encoded string retrieval without html formatting.
  • Removed localization folder, as it is currently unimplemented.
  • The monitor service that was previously used for the web interface has been moved to the web_server plugin.
  • Updated the core bot service and runtime utility to allow the web server plugin to handle it's own start/shutdown procedures.
  • Removed unused dependencies and licensing associated with it.