From c73d26d76457d25f332e09bcf9c84bb6dcc8a51d Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 13:15:04 +0100 Subject: [PATCH 01/10] Update config.ini --- config.ini | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/config.ini b/config.ini index fcd278a..e6a096e 100644 --- a/config.ini +++ b/config.ini @@ -39,12 +39,11 @@ type = serial ######################### #### Enabled Modules #### ######################### -#All modules are enaabled by default but can be removed from the menu by uncommenting thre below lines. +# All modules are enaabled by default but can be removed from the menu by adding them below. +# Available modules: mail, bulletin, stats, fortune, wos, channel +# Example: +# [modules] +# disabled = fortune, channel # [modules] -# mail = False -# bulletin = False -# stats = False -# fortune = False -# wos = False -# channel = False +# disabled = From 418b52111aa248411dbac60aaa27c27bdb60ee4e Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 13:16:25 +0100 Subject: [PATCH 02/10] Update config_init.py work for disabling modules from config.ini --- config_init.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config_init.py b/config_init.py index 17820b7..b9a0073 100644 --- a/config_init.py +++ b/config_init.py @@ -110,7 +110,11 @@ def initialize_config(config_file:str = None) -> dict[str, Any]: if bbs_nodes == ['']: bbs_nodes = [] - return {'config':config, 'interface_type': interface_type, 'hostname': hostname, 'port': port, 'bbs_nodes': bbs_nodes, 'mqtt_topic': 'meshtastic.receive'} + disabled = config.get('modules', 'disabled', fallback='').split(',') + if disabled == ['']: + disabled = [] + + return {'config':config, 'interface_type': interface_type, 'hostname': hostname, 'port': port, 'bbs_nodes': bbs_nodes, 'disabled': disabled, 'mqtt_topic': 'meshtastic.receive'} def get_interface(system_config:dict[str, Any]) -> meshtastic.stream_interface.StreamInterface: From a1d922d29c65388480c09ec7a77b959d3eee56f5 Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 13:57:13 +0100 Subject: [PATCH 03/10] Update server.py work for disabling features from config --- server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server.py b/server.py index af5117c..b3ca67c 100644 --- a/server.py +++ b/server.py @@ -52,6 +52,7 @@ def main(): interface = get_interface(system_config) interface.bbs_nodes = system_config['bbs_nodes'] + interface.disabled = system_config['disabled'] logging.info(f"TC²-BBS is running on {system_config['interface_type']} interface...") From dcec7d94b1b190683dad5c5b81903833704f8c75 Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 14:18:35 +0100 Subject: [PATCH 04/10] Update command_handlers.py disable features from config.ini --- command_handlers.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/command_handlers.py b/command_handlers.py index 0eadf2d..f791280 100644 --- a/command_handlers.py +++ b/command_handlers.py @@ -37,16 +37,21 @@ def handle_exit_command(sender_id, interface): def handle_help_command(sender_id, interface, state=None): title = "█▓▒░ Yorkshire BBS ░▒▓█\n\n" - commands = [ - "[M]ail", - "[B]ulletin", - "[S]tats", - #"[F]ortune", - #"[W]all of Shame", - #"[C]hannel Directory", - #"EXIT: Exit current menu", - "[H]elp" - ] + commands = [] + if mail in interface.disabled == False: + commands.append("[M]ail") + if bulletin in interface.disabled == False: + commands.append("[B]ulletin") + if stats in interface.disabled == False: + commands.append("[S]tats") + if fortune in interface.disabled == False: + commands.append("[F]ortune") + if wos in interface.disabled == False: + commands.append("[W]all of Shame") + if channel in interface.disabled == False: + commands.append("[C]hannel Directory") + commands.append("[H]elp") + if state and 'command' in state: current_command = state['command'] if current_command == 'MAIL': From fa33766b9a6ab3e782bf638ec04ddfae28317a2b Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 14:36:42 +0100 Subject: [PATCH 05/10] Update server.py --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index b3ca67c..aba8c68 100644 --- a/server.py +++ b/server.py @@ -3,7 +3,8 @@ """ TC²-BBS Server for Meshtastic by TheCommsChannel (TC²) Date: 06/25/2024 -Version: 0.1.0 +Yorkshire BBS Edition +Version: 0.1.01 Description: The system allows for mail message handling, bulletin boards, and a channel @@ -31,7 +32,8 @@ def display_banner(): ██║ ██║ ██╔═══╝ ╚════╝██╔══██╗██╔══██╗╚════██║ ██║ ╚██████╗███████╗ ██████╔╝██████╔╝███████║ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ -Meshtastic Version +Yorkshire BBS Edition +Version: 0.1.01 """ print(banner) From 59a08f4d4f66394074f515029513f4d3522b772d Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 14:38:06 +0100 Subject: [PATCH 06/10] Update server.py --- server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index aba8c68..2a93023 100644 --- a/server.py +++ b/server.py @@ -2,9 +2,9 @@ """ TC²-BBS Server for Meshtastic by TheCommsChannel (TC²) -Date: 06/25/2024 +Date: 03/07/2024 Yorkshire BBS Edition -Version: 0.1.01 +Version: 0.1.02 Description: The system allows for mail message handling, bulletin boards, and a channel @@ -33,7 +33,7 @@ def display_banner(): ██║ ╚██████╗███████╗ ██████╔╝██████╔╝███████║ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ Yorkshire BBS Edition -Version: 0.1.01 +Version: 0.1.02 """ print(banner) From 447fb6175de1ba2100febd6c2aa5d0f480376126 Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 14:46:27 +0100 Subject: [PATCH 07/10] Update server.py --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 2a93023..5ef9ac4 100644 --- a/server.py +++ b/server.py @@ -4,7 +4,7 @@ TC²-BBS Server for Meshtastic by TheCommsChannel (TC²) Date: 03/07/2024 Yorkshire BBS Edition -Version: 0.1.02 +Version: 0.1.03 Description: The system allows for mail message handling, bulletin boards, and a channel @@ -33,7 +33,7 @@ def display_banner(): ██║ ╚██████╗███████╗ ██████╔╝██████╔╝███████║ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ Yorkshire BBS Edition -Version: 0.1.02 +Version: 0.1.03 """ print(banner) From bd1985acf4cb1fd7499a8bc9eba03c3404daf76b Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 14:49:36 +0100 Subject: [PATCH 08/10] Update command_handlers.py --- command_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command_handlers.py b/command_handlers.py index f791280..97bb5ee 100644 --- a/command_handlers.py +++ b/command_handlers.py @@ -112,7 +112,7 @@ def handle_stats_steps(sender_id, message, step, interface, bbs_nodes): la2 = str(psutil.getloadavg()[1]) la3 = str(psutil.getloadavg()[2]) ramu = str(psutil.virtual_memory().percent) - response = "CPU: " + cpu + "Mhz\nLoad: " + la1 + ", " + la2 + ", " + la3 + "\nRAM: " + ramu + "% Used" + response = "Version: 0.1.03\nCPU: " + cpu + "Mhz\nLoad: " + la1 + ", " + la2 + ", " + la3 + "\nRAM: " + ramu + "% Used" send_message(response, sender_id, interface) handle_stats_command(sender_id, interface) return From 6ca6a878bbe29010888586c67ba74961e4a2f3e2 Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 15:24:19 +0100 Subject: [PATCH 09/10] Update server.py --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 5ef9ac4..d3e1b43 100644 --- a/server.py +++ b/server.py @@ -4,7 +4,7 @@ TC²-BBS Server for Meshtastic by TheCommsChannel (TC²) Date: 03/07/2024 Yorkshire BBS Edition -Version: 0.1.03 +Version: 0.1.03_Dev Description: The system allows for mail message handling, bulletin boards, and a channel @@ -33,7 +33,7 @@ def display_banner(): ██║ ╚██████╗███████╗ ██████╔╝██████╔╝███████║ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ Yorkshire BBS Edition -Version: 0.1.03 +Version: 0.1.03_Dev """ print(banner) From 79e7b7071e05b3230299356bf8ce59351ccba2cb Mon Sep 17 00:00:00 2001 From: Blergo Date: Wed, 3 Jul 2024 15:24:55 +0100 Subject: [PATCH 10/10] Update command_handlers.py --- command_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command_handlers.py b/command_handlers.py index 97bb5ee..044a36d 100644 --- a/command_handlers.py +++ b/command_handlers.py @@ -112,7 +112,7 @@ def handle_stats_steps(sender_id, message, step, interface, bbs_nodes): la2 = str(psutil.getloadavg()[1]) la3 = str(psutil.getloadavg()[2]) ramu = str(psutil.virtual_memory().percent) - response = "Version: 0.1.03\nCPU: " + cpu + "Mhz\nLoad: " + la1 + ", " + la2 + ", " + la3 + "\nRAM: " + ramu + "% Used" + response = "Version: 0.1.03_Dev\nCPU: " + cpu + "Mhz\nLoad: " + la1 + ", " + la2 + ", " + la3 + "\nRAM: " + ramu + "% Used" send_message(response, sender_id, interface) handle_stats_command(sender_id, interface) return