From b33635053f8e1d1c7e31da253edc3aa3751bdafa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Mon, 27 Jul 2020 21:20:09 -0400
Subject: [PATCH 01/18] Fixed whitelisting/blacklisting users
---
JJMumbleBot/plugins/core/bot_commands/bot_commands.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/JJMumbleBot/plugins/core/bot_commands/bot_commands.py b/JJMumbleBot/plugins/core/bot_commands/bot_commands.py
index d04863cc..41674ff2 100644
--- a/JJMumbleBot/plugins/core/bot_commands/bot_commands.py
+++ b/JJMumbleBot/plugins/core/bot_commands/bot_commands.py
@@ -173,7 +173,7 @@ def cmd_showblacklist(self, data):
def cmd_blacklistuser(self, data):
try:
- all_data = data.message.strip().split()
+ all_data = data.message.strip().split(' ', 2)
reason = "No reason provided."
if len(all_data) > 2:
reason = all_data[2]
@@ -197,7 +197,7 @@ def cmd_blacklistuser(self, data):
def cmd_whitelistuser(self, data):
try:
- all_data = data.message.strip().split()
+ all_data = data.message.strip().split(' ', 1)
result = privileges.remove_from_blacklist(all_data[1])
if result:
gs.gui_service.quick_gui(f"User: {all_data[1]} removed from the blacklist.",
@@ -208,7 +208,7 @@ def cmd_whitelistuser(self, data):
)
log(INFO, f"User: {all_data[1]} removed from the blacklist.", origin=L_USER_PRIV)
except IndexError:
- gs.gui_service.quick_gui("Command format: !whitelist username",
+ gs.gui_service.quick_gui(f"Incorrect format! Format: {rutils.get_command_token()}whitelistuser 'username'",
text_type='header',
box_align='left',
user=gs.mumble_inst.users[data.actor]['name'],
From 2ad951345275844c114448b651c1d2736b92426f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 14:50:36 -0400
Subject: [PATCH 02/18] Removed unused psutil dependency
---
JJMumbleBot/lib/monitor_service.py | 8 --------
requirements.txt | 1 -
2 files changed, 9 deletions(-)
diff --git a/JJMumbleBot/lib/monitor_service.py b/JJMumbleBot/lib/monitor_service.py
index bd3968c4..3ca609cc 100644
--- a/JJMumbleBot/lib/monitor_service.py
+++ b/JJMumbleBot/lib/monitor_service.py
@@ -1,5 +1,4 @@
from datetime import timedelta
-import psutil
import platform
from JJMumbleBot.settings import global_settings
from JJMumbleBot.lib.utils.runtime_utils import get_all_channels
@@ -70,13 +69,6 @@ def get_all_online():
return online_user_info
-def get_hardware_info():
- return {
- "cpu_usage": f'{psutil.cpu_percent()}%',
- "mem_usage": f'{psutil.virtual_memory().percent}%'
- }
-
-
def get_last_command_output():
return {
"last_cmd_type": f'{global_settings.last_command_type}',
diff --git a/requirements.txt b/requirements.txt
index a8e2803f..299b1c21 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,7 +4,6 @@ websockets==8.1
Flask==1.1.2
gevent==20.6.2
beautifulsoup4==4.9.1
-psutil==5.7.2
requests==2.24.0
Pillow==7.2.0
youtube-dl==2020.6.16.1
From a964b1d02a64aee50207bfa15cd69f38f0875488 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 15:13:59 -0400
Subject: [PATCH 03/18] Added more documentation to config_template file for
new users
---
JJMumbleBot/cfg/templates/config_template.ini | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/JJMumbleBot/cfg/templates/config_template.ini b/JJMumbleBot/cfg/templates/config_template.ini
index 1a8c7ee8..f7b6e2c2 100644
--- a/JJMumbleBot/cfg/templates/config_template.ini
+++ b/JJMumbleBot/cfg/templates/config_template.ini
@@ -1,9 +1,14 @@
[Connection Settings]
; Please don't surround any values in quotations!
+; Enter your server IP here.
ServerIP = SERVER_IP
+; Enter your bot username here, If the bot is registered with a certificate, the name must match the name in the certificate.
UserID = USERNAME
+; Enter the server password here.
ServerPassword = PASSWORD
+; Enter the server port number here.
ServerPort = PORT_NUMBER
+; Enter the file path to your certificate. If your server doesn't require a certificate, leave this blank.
UserCertification = CERT_FILE_PATH
; Auto-Reconnect to the server if connection is lost.
AutoReconnect = False
From 8d3ba7f4a24ce5a4ab6b35b799c93f1f74d2f01a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 19:09:12 -0400
Subject: [PATCH 04/18] Removed old funding link
---
.github/FUNDING.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index b5fc87cc..6c7974a7 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -3,7 +3,7 @@
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
-ko_fi: jasonjerome
+ko_fi:
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
From f24bde96ffbe1d302d1d4a2c68b3aa5760242bca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 19:53:28 -0400
Subject: [PATCH 05/18] Security update: server_ip/port/pass is required as
launch parameters
- Server IP/Port/Pass is now given in as a launch parameter instead of being stored in the config file.
---
JJMumbleBot/cfg/templates/config_template.ini | 6 ----
JJMumbleBot/core/bot_service.py | 19 +++++-----
JJMumbleBot/lib/helpers/bot_service_helper.py | 8 ++---
JJMumbleBot/lib/resources/strings.py | 3 --
JJMumbleBot/lib/utils/runtime_utils.py | 28 ++++++++-------
__main__.py | 35 +++++++++++++------
6 files changed, 52 insertions(+), 47 deletions(-)
diff --git a/JJMumbleBot/cfg/templates/config_template.ini b/JJMumbleBot/cfg/templates/config_template.ini
index f7b6e2c2..eec1fd00 100644
--- a/JJMumbleBot/cfg/templates/config_template.ini
+++ b/JJMumbleBot/cfg/templates/config_template.ini
@@ -1,13 +1,7 @@
[Connection Settings]
; Please don't surround any values in quotations!
-; Enter your server IP here.
-ServerIP = SERVER_IP
; Enter your bot username here, If the bot is registered with a certificate, the name must match the name in the certificate.
UserID = USERNAME
-; Enter the server password here.
-ServerPassword = PASSWORD
-; Enter the server port number here.
-ServerPort = PORT_NUMBER
; Enter the file path to your certificate. If your server doesn't require a certificate, leave this blank.
UserCertification = CERT_FILE_PATH
; Auto-Reconnect to the server if connection is lost.
diff --git a/JJMumbleBot/core/bot_service.py b/JJMumbleBot/core/bot_service.py
index d3546338..5663c1b2 100644
--- a/JJMumbleBot/core/bot_service.py
+++ b/JJMumbleBot/core/bot_service.py
@@ -23,7 +23,7 @@
class BotService:
- def __init__(self):
+ def __init__(self, serv_ip, serv_port, serv_pass):
# Initialize bot services.
global_settings.bot_service = self
# Initialize user settings.
@@ -57,12 +57,12 @@ def __init__(self):
dir_utils.make_directory(global_settings.cfg[C_MEDIA_SETTINGS][P_TEMP_MED_DIR])
dir_utils.make_directory(f'{global_settings.cfg[C_MEDIA_SETTINGS][P_TEMP_MED_DIR]}/internal/images')
dir_utils.make_directory(f'{global_settings.cfg[C_MEDIA_SETTINGS][P_TEMP_MED_DIR]}/internal/audio')
- log(INFO, "Initialized Temporary Directories.", origin=L_STARTUP)
- rprint("Initialized Temporary Directories.", origin=L_STARTUP)
+ log(INFO, "######### Initialized Temporary Directories #########", origin=L_STARTUP)
+ rprint("######### Initialized Temporary Directories #########", origin=L_STARTUP)
# Initialize PGUI system.
global_settings.gui_service = PseudoGUI()
- log(INFO, "Initialized PGUI.", origin=L_STARTUP)
- rprint("Initialized PGUI.", origin=L_STARTUP)
+ log(INFO, "######### Initialized PGUI #########", origin=L_STARTUP)
+ rprint("######### Initialized PGUI #########", origin=L_STARTUP)
# Initialize VLC interface.
global_settings.vlc_interface = VLCInterface()
# Initialize plugins.
@@ -73,12 +73,10 @@ def __init__(self):
rprint("Initialized plugins with safe mode.", origin=L_STARTUP)
else:
BotServiceHelper.initialize_plugins()
- log(INFO, "Initialized all plugins.", origin=L_STARTUP)
- rprint("Initialized all plugins.", origin=L_STARTUP)
log(INFO, "######### Initializing Mumble Client #########", origin=L_STARTUP)
rprint("######### Initializing Mumble Client #########", origin=L_STARTUP)
# Retrieve mumble client data from configs.
- mumble_login_data = BotServiceHelper.retrieve_mumble_data()
+ mumble_login_data = BotServiceHelper.retrieve_mumble_data(serv_ip, serv_port, serv_pass)
BotService.initialize_mumble(mumble_login_data)
log(INFO, "######### Initialized Mumble Client #########", origin=L_STARTUP)
rprint("######### Initialized Mumble Client #########", origin=L_STARTUP)
@@ -96,7 +94,7 @@ def __init__(self):
@staticmethod
def initialize_mumble(md: MumbleData):
global_settings.mumble_inst = pymumble.Mumble(md.ip_address, port=md.port, user=md.user_id, reconnect=md.auto_reconnect,
- password=md.password, certfile=md.certificate, stereo=md.stereo)
+ password=md.password, certfile=md.certificate, stereo=md.stereo)
global_settings.mumble_inst.callbacks.set_callback('text_received', BotService.message_received)
global_settings.mumble_inst.callbacks.set_callback('sound_received', BotService.sound_received)
global_settings.mumble_inst.callbacks.set_callback('connected', BotService.on_connected)
@@ -104,7 +102,8 @@ def initialize_mumble(md: MumbleData):
global_settings.mumble_inst.set_receive_sound(True)
global_settings.mumble_inst.start()
global_settings.mumble_inst.is_ready()
- if global_settings.cfg.getboolean(C_CONNECTION_SETTINGS, P_SELF_REGISTER):
+
+ if global_settings.cfg.getboolean(C_CONNECTION_SETTINGS, P_SELF_REGISTER, fallback=False):
global_settings.mumble_inst.users.myself.register()
global_settings.mumble_inst.users.myself.comment(
f'{runtime_utils.get_comment()}
[{META_NAME}({META_VERSION})] - {runtime_utils.get_bot_name()}
{runtime_utils.get_about()}')
diff --git a/JJMumbleBot/lib/helpers/bot_service_helper.py b/JJMumbleBot/lib/helpers/bot_service_helper.py
index b9927b84..8c6a692f 100644
--- a/JJMumbleBot/lib/helpers/bot_service_helper.py
+++ b/JJMumbleBot/lib/helpers/bot_service_helper.py
@@ -13,10 +13,10 @@
class BotServiceHelper:
@staticmethod
- def retrieve_mumble_data():
- server_ip: str = global_settings.cfg[C_CONNECTION_SETTINGS][P_SERVER_IP]
- server_pass: str = global_settings.cfg[C_CONNECTION_SETTINGS][P_SERVER_PASS]
- server_port: int = int(global_settings.cfg[C_CONNECTION_SETTINGS][P_SERVER_PORT])
+ def retrieve_mumble_data(serv_ip, serv_port, serv_pass):
+ server_ip: str = serv_ip
+ server_pass: str = serv_pass
+ server_port: int = serv_port
user_id: str = global_settings.cfg[C_CONNECTION_SETTINGS][P_USER_ID]
user_cert: str = global_settings.cfg[C_CONNECTION_SETTINGS][P_USER_CERT]
use_stereo: bool = global_settings.cfg.getboolean(C_MEDIA_SETTINGS, P_MEDIA_VLC_STEREO, fallback=True)
diff --git a/JJMumbleBot/lib/resources/strings.py b/JJMumbleBot/lib/resources/strings.py
index 6b0c01b9..0a77e98f 100644
--- a/JJMumbleBot/lib/resources/strings.py
+++ b/JJMumbleBot/lib/resources/strings.py
@@ -9,9 +9,6 @@
C_LOGGING = 'Logging'
# PROGRAM CONFIG PARAMETER STRINGS
# Connection Settings
-P_SERVER_IP = 'ServerIP'
-P_SERVER_PASS = 'ServerPassword'
-P_SERVER_PORT = 'ServerPort'
P_USER_ID = 'UserID'
P_USER_CERT = 'UserCertification'
P_SERVER_RECONNECT = 'AutoReconnect'
diff --git a/JJMumbleBot/lib/utils/runtime_utils.py b/JJMumbleBot/lib/utils/runtime_utils.py
index d5db8fb8..f9b0a765 100644
--- a/JJMumbleBot/lib/utils/runtime_utils.py
+++ b/JJMumbleBot/lib/utils/runtime_utils.py
@@ -341,12 +341,13 @@ def refresh_plugins():
def exit_bot():
from JJMumbleBot.lib.utils import dir_utils
- global_settings.gui_service.quick_gui(
- f"{get_bot_name()} is being shutdown.",
- text_type='header',
- box_align='left',
- ignore_whisper=True,
- )
+ if global_settings.mumble_inst:
+ global_settings.gui_service.quick_gui(
+ f"{get_bot_name()} is being shutdown.",
+ text_type='header',
+ box_align='left',
+ ignore_whisper=True,
+ )
for plugin in global_settings.bot_plugins.values():
plugin.quit()
if global_settings.flask_server:
@@ -368,13 +369,14 @@ def exit_bot():
def exit_bot_error(error_code: ExitCodes):
from JJMumbleBot.lib.utils import dir_utils
- global_settings.gui_service.quick_gui(
- f"{get_bot_name()} has encountered an error and is being shutdown.
Please check the bot logs/console."
- f"
Exit Code: {error_code.value}",
- text_type='header',
- box_align='center',
- ignore_whisper=True,
- )
+ if global_settings.mumble_inst:
+ global_settings.gui_service.quick_gui(
+ f"{get_bot_name()} has encountered an error and is being shutdown.
Please check the bot logs/console."
+ f"
Exit Code: {error_code.value}",
+ text_type='header',
+ box_align='center',
+ ignore_whisper=True,
+ )
try:
for plugin in global_settings.bot_plugins.values():
plugin.quit()
diff --git a/__main__.py b/__main__.py
index 2de9e5f3..7b99c8d7 100644
--- a/__main__.py
+++ b/__main__.py
@@ -2,23 +2,36 @@
import JJMumbleBot.settings.global_settings as global_settings
import argparse
-
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="A plugin-based All-In-One mumble bot solution in python 3.7+ with extensive features and support "
"for custom plugins."
)
- parser.add_argument('-safe', dest='safe_mode', action='store_true', default=False,
- help='Enables safe mode for the bot service which initializes the bot with safe-mode only '
- 'plugins.')
- parser.add_argument('-verbose', dest='verbose_mode', action='store_true', default=False,
- help='Enables verbose mode which displays extensive output statements from the bot service. '
- 'This is useful for debugging purposes.')
- parser.add_argument('-quiet', dest='quiet_mode', action='store_true', default=False,
- help='Enables quiet mode which suppresses output statements from the bot service. This is '
- 'useful for running the bot in a headless environment.')
+ parser._action_groups.pop()
+ required_args = parser.add_argument_group("Required Arguments")
+ optional_args = parser.add_argument_group("Optional Arguments")
+
+ required_args.add_argument('-ip', dest='server_ip', default='127.0.0.1',
+ required=True,
+ help='Enter the server IP using this parameter.')
+ required_args.add_argument('-port', dest='server_port', default='64738',
+ required=True,
+ help='Enter the server port using this parameter.')
+
+ optional_args.add_argument('-password', dest='server_password', default='',
+ help='Enter the server password using this parameter.')
+ optional_args.add_argument('-safe', dest='safe_mode', action='store_true', default=False,
+ help='Enables safe mode for the bot service which initializes the bot with safe-mode only '
+ 'plugins.')
+ optional_args.add_argument('-verbose', dest='verbose_mode', action='store_true', default=False,
+ help='Enables verbose mode which displays extensive output statements from the bot service. '
+ 'This is useful for debugging purposes.')
+ optional_args.add_argument('-quiet', dest='quiet_mode', action='store_true', default=False,
+ help='Enables quiet mode which suppresses output statements from the bot service. This is '
+ 'useful for running the bot in a headless environment.')
args = parser.parse_args()
+
if args.quiet_mode:
global_settings.quiet_mode = True
if args.safe_mode:
@@ -31,4 +44,4 @@
raise SysArgError("It looks like both verbose mode and quiet mode are enabled. "
"Only one or the other can be used!\n")
# Initialize bot service.
- service.BotService()
+ service.BotService(args.server_ip, int(args.server_port), args.server_password)
From 4c784f9b1e3935b8eaac08f7ea9e75bb210373b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 19:53:49 -0400
Subject: [PATCH 06/18] Updated vlc track information to use uppercase letters
---
JJMumbleBot/lib/vlc/vlc_api.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/JJMumbleBot/lib/vlc/vlc_api.py b/JJMumbleBot/lib/vlc/vlc_api.py
index 23d99b2a..b56ed597 100644
--- a/JJMumbleBot/lib/vlc/vlc_api.py
+++ b/JJMumbleBot/lib/vlc/vlc_api.py
@@ -13,14 +13,14 @@
class TrackStatus(Enum):
- PLAYING = 'playing'
- PAUSED = 'paused'
- STOPPED = 'stopped'
+ PLAYING = 'Playing'
+ PAUSED = 'Paused'
+ STOPPED = 'Stopped'
class TrackType(Enum):
- FILE = 'file'
- STREAM = 'stream'
+ FILE = 'File'
+ STREAM = 'Stream'
class TrackInfo:
From be7384ad9b021f1c869a7f38a7372c66935d1bee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 19:54:19 -0400
Subject: [PATCH 07/18] Updated config unit tests for v4.0.0
---
JJMumbleBot/tests/dummy_config.ini | 4 ++++
JJMumbleBot/tests/test_cfg.py | 20 ++++++++------------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/JJMumbleBot/tests/dummy_config.ini b/JJMumbleBot/tests/dummy_config.ini
index d3a3b0ea..104d69db 100644
--- a/JJMumbleBot/tests/dummy_config.ini
+++ b/JJMumbleBot/tests/dummy_config.ini
@@ -45,6 +45,10 @@ VLCDuckingThreshold: 2500.0
VLCDuckingDelay: 1.0
; The default maximum queue length for the audio interface (default=50)
VLCMaxQueueLength = 50
+; Optional Proxy URL - If you want to use a proxy server to use the youtube-dl library, fill this out.
+YoutubeDLProxyURL = YOUTUBE_DL_PROXY_URL
+; Optionally use a cookies.txt file for the youtube-dl library (useful to deal with rate limits).
+YoutubeDLCookieFile = YOUTUBE_DL_COOKIE_PATH
; Temporary images directory to store youtube thumbnails and other images content. This directory is cleared when the bot exits
TemporaryMediaDirectory = TEMP_MEDIA_DIR_PATH
; Permanent media directory to store sound board clips, and other media that won't be deleted when the bot exits
diff --git a/JJMumbleBot/tests/test_cfg.py b/JJMumbleBot/tests/test_cfg.py
index 01b4a09b..d4120ebb 100644
--- a/JJMumbleBot/tests/test_cfg.py
+++ b/JJMumbleBot/tests/test_cfg.py
@@ -16,22 +16,10 @@ def test_version(self):
assert bot_version == META_VERSION
# Connection Config Tests
- def test_server_ip(self):
- server_ip = self.cfg[C_CONNECTION_SETTINGS][P_SERVER_IP]
- assert server_ip == "SERVER_IP"
-
def test_user_id(self):
user_id = self.cfg[C_CONNECTION_SETTINGS][P_USER_ID]
assert user_id == "USERNAME"
- def test_server_pass(self):
- server_pass = self.cfg[C_CONNECTION_SETTINGS][P_SERVER_PASS]
- assert server_pass == "PASSWORD"
-
- def test_server_port(self):
- server_port = self.cfg[C_CONNECTION_SETTINGS][P_SERVER_PORT]
- assert server_port == "PORT_NUMBER"
-
def test_user_cert(self):
user_cert = self.cfg[C_CONNECTION_SETTINGS][P_USER_CERT]
assert user_cert == "CERT_FILE_PATH"
@@ -112,6 +100,14 @@ def test_vlc_max_queue_length(self):
vlc_max_queue_length = int(self.cfg[C_MEDIA_SETTINGS][P_MEDIA_VLC_QUEUE_LEN])
assert vlc_max_queue_length == 50
+ def test_youtube_dl_proxy(self):
+ youtube_dl_proxy = self.cfg[C_MEDIA_SETTINGS][P_TEMP_MED_DIR]
+ assert youtube_dl_proxy == "YOUTUBE_DL_PROXY_URL"
+
+ def test_youtube_dl_cookie(self):
+ youtube_dl_cookie = self.cfg[C_MEDIA_SETTINGS][P_TEMP_MED_DIR]
+ assert youtube_dl_cookie == "YOUTUBE_DL_COOKIE_PATH"
+
def test_temp_media_directory(self):
temp_media_directory = self.cfg[C_MEDIA_SETTINGS][P_TEMP_MED_DIR]
assert temp_media_directory == "TEMP_MEDIA_DIR_PATH"
From 3f7ead704bc864838d95b10d88eed24f2dbe0549 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?=
=?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com>
Date: Tue, 28 Jul 2020 19:54:50 -0400
Subject: [PATCH 08/18] Updated QSU for v4.0.0
---
docs/js/qsu_master.js | 34 ++--
docs/pages/qsu_master.html | 315 ++++++++++++++++++++++++-------------
2 files changed, 228 insertions(+), 121 deletions(-)
diff --git a/docs/js/qsu_master.js b/docs/js/qsu_master.js
index ed11123a..08588bd9 100644
--- a/docs/js/qsu_master.js
+++ b/docs/js/qsu_master.js
@@ -1,12 +1,6 @@
function get_connection_settings() {
return `
[Connection Settings]
-; Enter your server ip here, don't use quotations.
-ServerIP = ${document.getElementById('server-ip').value}
-; Enter the server password here to authenticate the bot. If your server has no password, leave it blank.
-ServerPassword = ${document.getElementById('server-pass').value}
-; Enter the server port number here so the bot can connect to the server.
-ServerPort = ${document.getElementById('server-port').value}
; Enter your bot username here, If the bot is registered with a certificate, the name must match the name in the certificate.
UserID = ${document.getElementById('server-user').value}
; Enter the file path to your certificate. If your server doesn't require a certificate, leave this blank.
@@ -25,6 +19,28 @@ DefaultComment = ${document.getElementById('server-comment').value}
function get_media_directories() {
return `
[Media Directories]
+; VLC location
+VLCPath = ${document.getElementById('media-vlc-path').value}
+; Use Stereo Audio
+VLCStereoAudio = ${document.getElementById('media-stereo-enable').value}
+; Enable/Disable VLC Console Messages
+VLCRunQuiet = ${document.getElementById('media-quiet-enable').value}
+; The default volume when the bot starts (default=0.3)
+VLCDefaultVolume = ${document.getElementById('media-default-volume').value}
+; Enable Audio Ducking (off by default, use !duckaudio to toggle on and off)
+VLCAudioDuck = ${document.getElementById('media-duck-audio-enable').value}
+; The default audio ducking volume (How low the volume will drop down when ducking) (default=0.05)
+VLCDuckingVolume: ${document.getElementById('media-ducking-volume').value}
+; The default threshold before audio is ducked (default=2500.0)
+VLCDuckingThreshold: ${document.getElementById('media-ducking-threshold').value}
+; The default delay before the audio ducking reacts to user voices (default=1.0)
+VLCDuckingDelay: ${document.getElementById('media-ducking-delay').value}
+; The default maximum queue length for the audio interface (default=50)
+VLCMaxQueueLength = ${document.getElementById('media-max-queue-length').value}
+; Optional Proxy URL - If you want to use a proxy server to use the youtube-dl library, fill this out.
+YoutubeDLProxyURL = ${document.getElementById('media-proxy-url').value}
+; Optionally use a cookies.txt file for the youtube-dl library (useful to deal with rate limits).
+YoutubeDLCookieFile = ${document.getElementById('media-cookies-path').value}
; Temporary media directory to store youtube thumbnails and other images content. This directory is cleared when the bot exits
TemporaryMediaDirectory = ${document.getElementById('media-temp-path').value}
; Permanent media directory to store sound board clips, and other media that won't be deleted when the bot exits
@@ -39,6 +55,8 @@ function get_logging() {
EnableLogging = ${document.getElementById('logging-enable').value}
; This sets the maximum number of logs the bot can have at a time before it overwrites the oldest one.
MaxLogs = ${document.getElementById('logging-max-logs').value}
+; Enable/Disable channel message logging (Enabling it will hide message logs to: Message Received: [User -> #####])
+HideMessageLogging = ${document.getElementById('logging-hide-message-enable').value}
; This is the path to directory where logs are stored. All bot logs will be stored in this directory.
LogDirectory = ${document.getElementById('logging-path').value}
`;
@@ -68,7 +86,7 @@ WebPagePort = ${document.getElementById('web-interface-server-port').value}
; This sets the port of the web socket on the web interface providing live data.
WebSocketPort = ${document.getElementById('web-interface-socket-port').value}
; This sets the tick rate of the loop that sends data to the web interface.
-WebTickRate = ${document.getElementById('web-interface-tick-rate-port').value}
+WebTickRate = ${document.getElementById('web-interface-tick-rate').value}
`;
}
@@ -77,8 +95,6 @@ function get_main_settings() {
[Main Settings]
; Enable or disable automatic internal database backups
EnableDatabaseBackup = ${document.getElementById('main-settings-db-backups').value}
-; To enable stereo output for the bot, check the box. Uncheck it to disable.
-UseStereoOutput = ${document.getElementById('main-settings-stereo').value}
; The execution tick rate of commands in the command queue [Must be an integer/float].
CommandTickRate = ${document.getElementById('main-settings-cmd-tick-rate').value}
; Maximum commands in a multi-command input (this includes multi-commands in aliases) [Must be an integer] This determines the number of commands that can be inputted in a single line
diff --git a/docs/pages/qsu_master.html b/docs/pages/qsu_master.html
index 8e0e418a..c4076307 100644
--- a/docs/pages/qsu_master.html
+++ b/docs/pages/qsu_master.html
@@ -4,220 +4,309 @@
JJMumbleBot Quick Setup Utility - Web Interface (MASTER BRANCH)
-
+
+
Enter your server ip here, don't use quotations.
- [Example: 127.0.0.1]Enter the server port number here so the bot can connect to the server.
- [Example: 68734]Enter your bot username here, If the bot is registered with a certificate, the name must match the name in the certificate.
[Example: JJMumbleBot]Enter the server password here to authenticate the bot. If your server has no password, leave it blank.
- [Example: mypassword123]Enter the file path to your certificate. If your server doesn't require a certificate, leave this blank.
[Example: /path/to/my/cert.pem]Specify the default channel the bot should join when it connects to the server.
[Example: Root]Enter the bot owner's display name here. The bot must have at least 1 super user to be able to control all bot commands.
[Example: SuperUserJason]Enable self registering if you want the bot to attempt to self-register to the server.
- + +The default comment associated with the bot that is shown to users when they view the bot's comment. This can be left blank.
[Example: Hello! This is JJMumbleBot!]To enable the web interface for the bot, check the box. Uncheck it to disable.
Enter the web server IP here.
[Example: 192.168.1.100]Enter the port of the web server for the main web interface page.
[Example: 7000]Enter the port of the web socket on the web interface providing live data.
[Example: 7001]Enter the tick rate of the web interface loop. [Recommended: 0.1 - 2]
[Example: 1]The file path to VLC.
+ [Example: path/to/vlc]To enable stereo audio for the bot, check the box. Uncheck the box for mono audio.
+ + +To enable vlc quiet mode, check the box.
+ + +The default volume when the bot starts.
+ [Default: 0.3]Enable Audio Ducking (off by default, use !duckaudio to toggle on and off)
+ +The default audio ducking volume (How low the volume will drop down when ducking)
+ [Default: 0.05]The default threshold before audio is ducked.
+ [Default: 2500.0]The default delay before the audio ducking reacts to user voices.
+ [Default: 1.0]The default maximum queue length for the audio interface.
+ [Default: 50]Optional Proxy URL - If you want to use a proxy server to use the youtube-dl library, fill this out.
+ [Example: socks5://myproxy:8080, https://myproxy:8080]Optionally use a cookies.txt file for the youtube-dl library (useful to deal with rate limits).
+ [Example: path/to/cookies.txt]Temporary media directory to store youtube thumbnails and other images content. This directory is cleared when the bot exits.
[Example: path/to/temp_media_dir]Permanent media directory to store sound board clips, and other media that won't be deleted when the bot exits.
[Example: path/to/perm_media_dir]To enable logging for the bot, check the box. Uncheck the box to disable.
- +This sets the maximum number of logs the bot can have at a time before it overwrites the oldest one.
[Recommended: 5-20]Enable/Disable channel message logging (Enabling it will hide message logs to: Message Received: [User -> #####])
+ +This is the path to directory where logs are stored. All bot logs will be stored in this directory.
[Example: my/path/to/logs]Disables plugins that are included in this list for regular operation. You can leave the list empty.
Type the name of the plugins in quotes separated by commas.
The list of plugins that are available during safe-mode operation of the bot.
Type the name of the plugins separated by commas.
The root channels in which the creation of temporary channels are allowed.
Change this list to include the channels in your server that you allow the bot to create temporary channels in.
Type the name of the plugins separated by commas.
Enable automatic internal database backups by checking the box, or disable by unchecking it.
Enable stereo output by checking the box, or disable by unchecking it.
- - -The execution tick rate of commands in the command queue [Must be an integer/float]
Maximum commands in a multi-command input (this includes multi-commands in aliases) [Must be an integer]
This determines the number of commands that can be inputted in a single line
Maximum commands per queue (this includes commands in aliases) [Must be an integer]
This determines the maximum number of commands that the bot can process in it's queue.
The command token to identify commands in the chat [Must be a single character]
[Example: !, ~, $]The number of commands to store in the command history tracker [Must be an integer]
Determines the default background color of the UI canvas.
@@ -231,65 +320,67 @@
Determines the default background color of images in the UI canvas.
Determines the default canvas alignment using html alignment tags
[Example: center, left, right]Determines the default canvas border size [Recommended: 0]
Determines the default canvas text color
[Example: white, red, blue, (qt5 html subset colors)]Determines the default canvas text font [Recommended: Calibri]
Determines the default header text color
[Example: white, red, blue, (qt5 html subset colors)]Determines the default index text color
[Example: white, red, blue, (qt5 html subset colors)]Determines the default sub-header text color
[Example: white, red, blue, (qt5 html subset colors)]