From d1b1c1c320a8327422e646318719f1dec0adf6d1 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 16 Apr 2020 13:19:42 +0200 Subject: [PATCH 01/19] preare for next version --- CHANGELOG.md | 9 +++++++++ includes/globalVars.py | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d10eb560..ac774617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### __[v2.5.1]__ - unreleased +##### Added +##### Changed +##### Deprecated +##### Removed +##### Fixed +##### Security + + ### __[v2.5]__ - 16.04.2020 ##### Added - Divera-Plugin: Plugin zum Ansteuern der Divera-Api. [#415](https://github.com/Schrolli91/BOSWatch/pull/415) diff --git a/includes/globalVars.py b/includes/globalVars.py index 21337487..0a8045ce 100644 --- a/includes/globalVars.py +++ b/includes/globalVars.py @@ -9,9 +9,9 @@ """ # version info -versionNr = "2.5" -branch = "master" -buildDate = "16.04.2020" +versionNr = "2.5.1" +branch = "dev" +buildDate = "unreleased" # Global variables config = 0 From bf9ae8d5b3be82841beb492809a1e99884b89a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Kr=C3=B6nner?= <41260142+LarsVomMars@users.noreply.github.com> Date: Fri, 17 Apr 2020 19:24:03 +0200 Subject: [PATCH 02/19] Create requirements.txt --- plugins/Telegram/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 plugins/Telegram/requirements.txt diff --git a/plugins/Telegram/requirements.txt b/plugins/Telegram/requirements.txt new file mode 100644 index 00000000..63667ac3 --- /dev/null +++ b/plugins/Telegram/requirements.txt @@ -0,0 +1,2 @@ +python-telegram-bot +requests From cdd0d95e4d662ba801b1f200b99124eb198a0dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Kr=C3=B6nner?= <41260142+LarsVomMars@users.noreply.github.com> Date: Fri, 17 Apr 2020 19:24:29 +0200 Subject: [PATCH 03/19] Create requirements.txt --- plugins/yowsup/requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 plugins/yowsup/requirements.txt diff --git a/plugins/yowsup/requirements.txt b/plugins/yowsup/requirements.txt new file mode 100644 index 00000000..372676b9 --- /dev/null +++ b/plugins/yowsup/requirements.txt @@ -0,0 +1 @@ +yowsup2 From 4b87e21a6f4a620425f1d0e5430a344742c34a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Kr=C3=B6nner?= <41260142+LarsVomMars@users.noreply.github.com> Date: Fri, 17 Apr 2020 19:35:08 +0200 Subject: [PATCH 04/19] Update README.md --- plugins/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/README.md b/plugins/README.md index 093e5106..be512ad2 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -16,6 +16,16 @@ This `.run()` routine is called every time an alarm comes in Here are the information from BOSWatch available. See section `5. Process the data from BOSWatch` +#### 1.4 Requirements +Add all required (which need to be installed separately) python packages to a requirements.txt in the plugin directory so that the user can simply install all requirements for this plugin. + +For examples look at [the Telegram plugin](Telegram/requirements.txt) + +##### 1.4.1 Requirement installation +To install the packages from the requirements.txt run +`pip install -r /path/to/plugin/directory/requirements.txt` +Or because for the current version (2.5) Python2 is required +`pip2 install -r /path/to/plungin/directory/requirements.txt` will work for sure ## 2. Use Global Logging #### 2.1 Init and Use From e20f49b7b23555f099b9780f9e3929a08c113b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Kr=C3=B6nner?= <41260142+LarsVomMars@users.noreply.github.com> Date: Sun, 19 Apr 2020 00:37:04 +0200 Subject: [PATCH 05/19] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d10eb560..8e0d2318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### __[v2.5.1]__ - unreleased +##### Added +Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier +##### Changed +##### Deprecated +##### Removed +##### Fixed +##### Security + ### __[v2.5]__ - 16.04.2020 ##### Added - Divera-Plugin: Plugin zum Ansteuern der Divera-Api. [#415](https://github.com/Schrolli91/BOSWatch/pull/415) From 587ddad079ff494424bc68faa3948449e0f2becb Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Sun, 19 Apr 2020 18:53:53 +0200 Subject: [PATCH 06/19] Update MySQL.py Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database it established. --- plugins/MySQL/MySQL.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/MySQL/MySQL.py b/plugins/MySQL/MySQL.py index 04a8d08e..85203811 100644 --- a/plugins/MySQL/MySQL.py +++ b/plugins/MySQL/MySQL.py @@ -91,7 +91,7 @@ def run(typ,freq,data): # Connect to MySQL # logging.debug("connect to MySQL") - connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), port = globalVars.config.get("MySQL","dbport"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset='utf8mb4') + connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), port = globalVars.config.get("MySQL","dbport"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset = 'utf8mb4', collation = 'utf8mb4_general_ci') cursor = connection.cursor() except: logging.error("cannot connect to MySQL") From 21013a05f60fa42ab197b9fea33950f680753b17 Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Sun, 19 Apr 2020 20:02:32 +0200 Subject: [PATCH 07/19] Update CHANGELOG.md - MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 101c79ba..badac1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ##### Deprecated ##### Removed ##### Fixed +- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. ##### Security From d4e87ed71cf63f6141d194febc71737e047f69bb Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Mon, 20 Apr 2020 09:29:41 +0200 Subject: [PATCH 08/19] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index badac1ab..c39b4cc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ##### Deprecated ##### Removed ##### Fixed -- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. +- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447) ##### Security From cac07ed9ab3a8d6ff4d518e85fd94523a3095bdc Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Mon, 20 Apr 2020 17:43:22 +0200 Subject: [PATCH 09/19] Update eMail.py Create MIME-compliant header that can contain any kind of string --- plugins/eMail/eMail.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index ec271b20..b8b5ea0c 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -13,6 +13,7 @@ import smtplib #for the SMTP client from email.mime.text import MIMEText # Import the email modules we'll need +from email.header import Header # Import the email modules we'll need from email.utils import formatdate # need for confirm to RFC2822 standard from email.utils import make_msgid # need for confirm to RFC2822 standard @@ -61,7 +62,7 @@ def doSendmail(server, subject, mailtext): msg = MIMEText(mailtext, 'plain', 'UTF-8') msg['From'] = globalVars.config.get("eMail", "from") msg['To'] = globalVars.config.get("eMail", "to") - msg['Subject'] = subject + msg['Subject'] = Header(subject, 'UTF-8') msg['Date'] = formatdate() msg['Message-Id'] = make_msgid() msg['Priority'] = globalVars.config.get("eMail", "priority") From 641bf4b81f5bd31bbf675a695aa7fed22b5a698a Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Mon, 20 Apr 2020 17:46:28 +0200 Subject: [PATCH 10/19] Update CHANGELOG.md Create MIME-compliant header that can contain any kind of string. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c39b4cc5..040327ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ##### Removed ##### Fixed - MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447) +- E-Mail plugin: Create MIME-compliant header that can contain any kind of string. ##### Security From a8eb55981db48a9588449e3abc8d05ea4fef6f77 Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Mon, 20 Apr 2020 17:48:46 +0200 Subject: [PATCH 11/19] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 040327ed..fa2af669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ##### Removed ##### Fixed - MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447) -- E-Mail plugin: Create MIME-compliant header that can contain any kind of string. +- E-Mail plugin: Create MIME-compliant header that can contain any kind of string. [#448](https://github.com/Schrolli91/BOSWatch/pull/448) ##### Security From 6912c597853cccfb99e6746c95f8bf22372f284c Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Wed, 22 Apr 2020 20:24:54 +0200 Subject: [PATCH 12/19] Add paramter to change between main-ric and sub-ric --- config/config.template.ini | 5 +++++ includes/descriptionList.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/config/config.template.ini b/config/config.template.ini index 358fd182..4ce2d028 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -103,6 +103,11 @@ filter_range_end = 9999999 # descriptions are loaded from csv/poc.csv idDescribed = 0 +# Main-RIC with Subric (0 - off) +# Only Sub-RIC (1 - on) +# descriptions are loaded from csv/poc.csv +onlysubric = 0 + # Static Massages for Subrics. rica = Feuer ricb = TH diff --git a/includes/descriptionList.py b/includes/descriptionList.py index 11281fd5..2206d290 100644 --- a/includes/descriptionList.py +++ b/includes/descriptionList.py @@ -110,6 +110,9 @@ def getDescription(typ, data): elif typ == "ZVEI": resultStr = zveiDescribtionList[data] elif typ == "POC": + if globalVars.config.getint("POC", "onlysubric"): + resultStr = ricDescribtionList[data] # only SubRIC + else: resultStr = ricDescribtionList[data[:-1]] # MainRIC resultStr += " " + ricDescribtionList[data] # SubRIC else: From 502f4036fbbc499bedf84667d97db83b7d238ad3 Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Wed, 22 Apr 2020 21:44:03 +0200 Subject: [PATCH 13/19] Change distance --- includes/descriptionList.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/descriptionList.py b/includes/descriptionList.py index 2206d290..b8d528b0 100644 --- a/includes/descriptionList.py +++ b/includes/descriptionList.py @@ -112,9 +112,9 @@ def getDescription(typ, data): elif typ == "POC": if globalVars.config.getint("POC", "onlysubric"): resultStr = ricDescribtionList[data] # only SubRIC - else: - resultStr = ricDescribtionList[data[:-1]] # MainRIC - resultStr += " " + ricDescribtionList[data] # SubRIC + else: + resultStr = ricDescribtionList[data[:-1]] # MainRIC + resultStr += " " + ricDescribtionList[data] # SubRIC else: logging.warning("Invalid Typ: %s", typ) From c564993ce260a756b8ab4e3c2d485e22e0ea728a Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Wed, 22 Apr 2020 22:18:26 +0200 Subject: [PATCH 14/19] Change description --- config/config.template.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.template.ini b/config/config.template.ini index 4ce2d028..af5da011 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -103,8 +103,8 @@ filter_range_end = 9999999 # descriptions are loaded from csv/poc.csv idDescribed = 0 -# Main-RIC with Subric (0 - off) -# Only Sub-RIC (1 - on) +# change between Main-RIC with Sub-RIC (0 - off) +# or only the Sub-RIC (1 - on) # descriptions are loaded from csv/poc.csv onlysubric = 0 From c8f6ed52c0112fab8c168fd5c071efe4af525b60 Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Wed, 22 Apr 2020 22:23:23 +0200 Subject: [PATCH 15/19] change poc template description for subric --- csv/poc.template.csv | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/csv/poc.template.csv b/csv/poc.template.csv index 9dfe7d42..8cba8c2b 100644 --- a/csv/poc.template.csv +++ b/csv/poc.template.csv @@ -5,12 +5,18 @@ ric,description # For each RIC-Address you could set a description-text # Use the structure: ric,"Description-Text" # +# main RIC with subric: # You can even define specific subrics, therefore you # 1. need to specify a main RIC: 1234567, "Unit One" # 2. specify a certain subric: 1234567B, "Subunit Bravo" # The result for 1234567B will be "Unit One Subunit Bravo" # - Be sure having defined the main RIC (step one)! - # +# Only subric: +# Specify only the subric: 123457B, "Subunit Bravo" +# The result for 1234567B will be "Subunit Bravo" +# - main RIC is not required - +# # !!! DO NOT delete the first line !!! # 1234567,"POCSAG testdata äöüß" From 1bb71d13753772154d13a8c83f3fbc4ad548f514 Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Mon, 27 Apr 2020 19:09:25 +0200 Subject: [PATCH 16/19] Update Changelog.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa2af669..165143be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### __[v2.5.1]__ - unreleased ##### Added - Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier +- POC: neuer Parameter um Sub-RICs ohne Hauptdefinition zu beschreiben. Parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449) ##### Changed ##### Deprecated ##### Removed From 9b5aa11462d1b76ef75403338b6d9e3d2d2da7e7 Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Mon, 27 Apr 2020 19:51:48 +0200 Subject: [PATCH 17/19] Change description to english --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 165143be..d1efabf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ### __[v2.5.1]__ - unreleased ##### Added - Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier -- POC: neuer Parameter um Sub-RICs ohne Hauptdefinition zu beschreiben. Parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449) +- DescriptionList POC: add new description parameter for Sub-RICs without a main RIC definition. parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449) ##### Changed ##### Deprecated ##### Removed From 44efa8a3b4dd0aa56f25d28185fb18bd23b4bba9 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 28 Apr 2020 13:01:16 +0200 Subject: [PATCH 18/19] prepare release --- CHANGELOG.md | 6 +----- includes/globalVars.py | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1efabf1..176f30b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,12 @@ # Changelog -### __[v2.5.1]__ - unreleased +### __[v2.5.1]__ - 28.04.2020 ##### Added - Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier - DescriptionList POC: add new description parameter for Sub-RICs without a main RIC definition. parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449) -##### Changed -##### Deprecated -##### Removed ##### Fixed - MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447) - E-Mail plugin: Create MIME-compliant header that can contain any kind of string. [#448](https://github.com/Schrolli91/BOSWatch/pull/448) -##### Security ### __[v2.5]__ - 16.04.2020 diff --git a/includes/globalVars.py b/includes/globalVars.py index 0a8045ce..05a1808d 100644 --- a/includes/globalVars.py +++ b/includes/globalVars.py @@ -10,8 +10,8 @@ # version info versionNr = "2.5.1" -branch = "dev" -buildDate = "unreleased" +branch = "master" +buildDate = "28.04.2020" # Global variables config = 0 From d9176db476e4c82401a7878d0925ffc9a148cfc6 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 28 Apr 2020 13:05:12 +0200 Subject: [PATCH 19/19] fix CL --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 176f30b9..b72530e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### __[v2.5.1]__ - 28.04.2020 ##### Added -- Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier +- Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier [#446](https://github.com/Schrolli91/BOSWatch/pull/446) - DescriptionList POC: add new description parameter for Sub-RICs without a main RIC definition. parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449) ##### Fixed - MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447)