From 808addf1ecf45241b4bc599ab10a6dadf00a0aa6 Mon Sep 17 00:00:00 2001 From: winnerineast Date: Fri, 1 Oct 2021 19:05:48 +0800 Subject: [PATCH] mask out all clear password into encrypted ones for myems-modbus. --- myems-modbus-tcp/config.py | 14 ++++++++++---- myems-modbus-tcp/requirements.txt | 1 + myems-modbus-tcp/run.sh | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 myems-modbus-tcp/run.sh diff --git a/myems-modbus-tcp/config.py b/myems-modbus-tcp/config.py index 212aaf51..b23123eb 100644 --- a/myems-modbus-tcp/config.py +++ b/myems-modbus-tcp/config.py @@ -1,14 +1,20 @@ +from decouple import config + + +userID = config('userID', default='root') +password = config('password', default='') + myems_system_db = { - 'user': 'root', - 'password': '!MyEMS1', + 'user': userID, + 'password': password, 'host': '127.0.0.1', 'database': 'myems_system_db', 'port': 3306, } myems_historical_db = { - 'user': 'root', - 'password': '!MyEMS1', + 'user': userID, + 'password': password, 'host': '127.0.0.1', 'database': 'myems_historical_db', 'port': 3306, diff --git a/myems-modbus-tcp/requirements.txt b/myems-modbus-tcp/requirements.txt index a867d987..f6bd7e95 100644 --- a/myems-modbus-tcp/requirements.txt +++ b/myems-modbus-tcp/requirements.txt @@ -1,3 +1,4 @@ mysql-connector modbus_tk schedule +python-decouple diff --git a/myems-modbus-tcp/run.sh b/myems-modbus-tcp/run.sh new file mode 100644 index 00000000..7a84f979 --- /dev/null +++ b/myems-modbus-tcp/run.sh @@ -0,0 +1 @@ +python main.py \ No newline at end of file