diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/INSTALLER b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/INSTALLER similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/INSTALLER rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/INSTALLER diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/METADATA b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/METADATA similarity index 97% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/METADATA rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/METADATA index ac785da2..ffb24fc0 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/METADATA +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.2.2 +Version: 1.2.3 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov @@ -25,9 +25,9 @@ Requires-Dist: pillow (>=6.0.0) Requires-Dist: keyboard (>=0.13.3) Requires-Dist: pyautogui (>=0.9.44) Requires-Dist: crypto (>=1.4.1) -Requires-Dist: pywin32 (>=224) ; platform_system == "Linux" and python_version >= "3.0" Requires-Dist: pywinauto (>=0.6.8) ; platform_system == "win32" and python_version >= "3.0" Requires-Dist: WMI (>=1.4.9) ; platform_system == "win32" and python_version >= "3.0" +Requires-Dist: pywin32 (>=224) ; platform_system == "win32" and python_version >= "3.0" # OpenRPA First open source RPA platform for business is released! diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/RECORD similarity index 97% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/RECORD rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/RECORD index 4b6c90df..36c49d75 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/RECORD +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/RECORD @@ -1,9 +1,9 @@ -pyOpenRPA-1.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pyOpenRPA-1.2.2.dist-info/METADATA,sha256=Oy6DxZeOruRyWkROJ9if7MI8zheBqEqlBEFBhj1zRbU,3612 -pyOpenRPA-1.2.2.dist-info/RECORD,, -pyOpenRPA-1.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pyOpenRPA-1.2.2.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 -pyOpenRPA-1.2.2.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 +pyOpenRPA-1.2.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyOpenRPA-1.2.3.dist-info/METADATA,sha256=JhjZUhqMXGka3uVYTABHekXvly9bG89Dm0VyfqhnUA4,3612 +pyOpenRPA-1.2.3.dist-info/RECORD,, +pyOpenRPA-1.2.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyOpenRPA-1.2.3.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 +pyOpenRPA-1.2.3.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174 pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188 pyOpenRPA/.idea/modules.xml,sha256=Q__U1JIA2cjxbLRXAv-SfYY00fZA0TNlpkkbY4s3ncg,277 @@ -22,7 +22,7 @@ pyOpenRPA/Agent/__pycache__/__Agent__.cpython-37.pyc,, pyOpenRPA/Agent/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Agent/readme.md,sha256=QF_Bnv204OK3t1JUEhjfICkxFmSdX6bvaRl_HI6lH9I,19 pyOpenRPA/Info.md,sha256=u4Nv-PjniSF0Zlbtr6jEJX2vblK3_1zhSLNUgOdtDaA,85 -pyOpenRPA/Orchestrator/BackwardCompatibility.py,sha256=3EhSlSMoDB9Po7lfllmgXn4LbwhVuPzLszR6P1pHU_M,32440 +pyOpenRPA/Orchestrator/BackwardCompatibility.py,sha256=-pV_zaPcqD5lYz-2OXUJQ7tB2BZknd3_ci0HPHKcLFg,33110 pyOpenRPA/Orchestrator/ControlPanel.py,sha256=OzS8HjG__8OZgqhajr8L8owyugXPuSLWHLtXuKdEP78,103 pyOpenRPA/Orchestrator/Core.py,sha256=Kjphtu0g6iaS4D_fIWmzRaLLgBQ9fcwccpQJhOETTAc,521 pyOpenRPA/Orchestrator/Processor.py,sha256=Z1SglmX6ykTLifD3M1mzWEJQUgweWo6HjjCjHldjGyM,8594 @@ -59,9 +59,9 @@ pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/Monitor.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/Screen.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,, -pyOpenRPA/Orchestrator/Server.py,sha256=301ws0BtUhz_HIghP7alHkotLCUXbJhi8fb2Wn0H8EU,29345 -pyOpenRPA/Orchestrator/ServerSettings.py,sha256=-WiQXhfSdS4-eKbFp4U6NBylyRtJ0a6AVdds3KT3H9Q,31004 -pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=R8o3_4z2TavV3i0KSz-d_oQx-U4qsrQFHvVmZFOnmnQ,20238 +pyOpenRPA/Orchestrator/Server.py,sha256=Ke89zh5iZezhA_qyQ3sfWJmL9bfc1rBBYeq-WzznfsE,30432 +pyOpenRPA/Orchestrator/ServerSettings.py,sha256=Ndo30YHn6XmNDLP9hPMM1867Gyx2hcYbh0UP2H1Tx_c,31205 +pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=d6l3YrJnh8eteBUc7DX-Qu7Ioc5mZ0ZVBAkw7i0NMa0,20139 pyOpenRPA/Orchestrator/Timer.py,sha256=HvYtEeH2Q5WVVjgds9XaBpWRmvZgwgBXurJDdVVq_T0,2097 pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py,sha256=hD47TiOuKR-G8IWu9lJD2kG28qlH7YZV63i3qv1N5Dk,681 pyOpenRPA/Orchestrator/Utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 @@ -72,7 +72,7 @@ pyOpenRPA/Orchestrator/Web/Index.js,sha256=Blo3LHe_a3zrW7MqYo4BSIwoOx7nlO7Ko9LWx pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=a4N_reLA6_Zb2KXiL73a7cWtJwO0W0Dr5lZ-RpUwuI0,16428 pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,, pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=6S8XwSQ_3FXPpaX6zYkf8uUewVXO9bHnrrDHEoWrEgw,112922 -pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=WTPCLcAGunuIJ-6fAfMTXtboAvhuZUCHm2vf3h6kS8U,109030 +pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=uqH9ma0C8OxnnfgZ4mMNl15rE5tc9k9v3hn6CY67PMU,111546 pyOpenRPA/Orchestrator/__init__.py,sha256=f1RFDzOkL3IVorCtqogjGdXYPtHH-P-y-5CqT7PGy7A,183 pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273 pyOpenRPA/Orchestrator/__pycache__/BackwardCompatibility.cpython-37.pyc,, @@ -341,6 +341,6 @@ pyOpenRPA/Tools/Terminator.py,sha256=VcjX3gFXiCGu3MMCidhrTNsmC9wsAqfjRJdTSU9fLnU pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,, pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,, -pyOpenRPA/__init__.py,sha256=ZiHtLttT3HWPDuXjwYNe06oadFPTLrVMTKyaMXZAmBE,174 +pyOpenRPA/__init__.py,sha256=O8SOldPlZbE_YguduoMHJNJaRtlVN3dHXEC0JVpQMYY,174 pyOpenRPA/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/REQUESTED b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/REQUESTED similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/REQUESTED rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/REQUESTED diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/WHEEL similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/WHEEL rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/WHEEL diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/top_level.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/top_level.txt similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/top_level.txt rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/top_level.txt diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py index 6c340444..2bfac13b 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py @@ -455,3 +455,17 @@ def Update(inGSettings): } if lL: lL.warning( f"Backward compatibility (v1.2.1 to v1.2.2): Add new key RecoveryDict in ProcessorDict > RobotRDPActive") # Log about compatibility + # Add new key ServerDict > ListenDict + if "ListenDict" not in inGSettings["ServerDict"]: + lPortInt = inGSettings.get("ServerDict",{}).get("ListenPort",80) + inGSettings["ServerDict"]["ListenDict"] = { + "Default": { + "AddressStr": "", + "PortInt": lPortInt, + "CertFilePEMPathStr": None, + "KeyFilePathStr": None, + "ServerInstance": None + } + } + if lL: lL.warning( + f"Backward compatibility (v1.2.2 to v1.2.3): Add new key ServerDict > ListenDict. Transfer port from ServerDict > ListenPort") # Log about compatibility \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py index 9db03c12..76cfea8a 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py @@ -526,6 +526,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): HTTPServer.finish_request(self, request, client_address) #inGlobalDict # "JSONConfigurationDict": +import ssl class RobotDaemonServer(Thread): def __init__(self,name,inGlobalDict): Thread.__init__(self) @@ -533,15 +534,30 @@ class RobotDaemonServer(Thread): # Update the global dict ServerSettings.SettingsUpdate(inGlobalDict) def run(self): - inServerAddress=""; - inPort = gSettingsDict["ServerDict"]["ListenPort"]; - # Server settings - # Choose port 8080, for port 80, which is normally used for a http server, you need root access - server_address = (inServerAddress, inPort) - #httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) - # Logging - gSettingsDict["Logger"].info(f"Server init. Listen URL: {inServerAddress}, Listen port: {inPort}") - #httpd.serve_forever() - httpd = ThreadedHTTPServer(server_address, testHTTPServer_RequestHandler) - #print('Starting server, use to stop') - httpd.serve_forever() + lL = gSettingsDict.get("Logger",None) + try: + lServerDict = gSettingsDict["ServerDict"]["ListenDict"][self.name] + lAddressStr=lServerDict["AddressStr"] + lPortInt=lServerDict["PortInt"] + lCertFilePathStr = lServerDict["CertFilePEMPathStr"] + lKeyFilePathStr = lServerDict["KeyFilePathStr"] + if lCertFilePathStr == "": lCertFilePathStr = None + if lKeyFilePathStr == "": lKeyFilePathStr = None + # Server settings + # Choose port 8080, for port 80, which is normally used for a http server, you need root access + server_address = (lAddressStr, lPortInt) + #httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) + #httpd.serve_forever() + httpd = ThreadedHTTPServer(server_address, testHTTPServer_RequestHandler) + if lCertFilePathStr is not None: + if lKeyFilePathStr is not None: + httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile=lCertFilePathStr, keyfile=lKeyFilePathStr) + else: + httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile=lCertFilePathStr) + if lL: lL.info(f"Web Server init (with SSL). Name: {self.name}, Listen URL: {lAddressStr}, Listen port: {lPortInt}, Cert path: {lCertFilePathStr}") + else: + if lL: lL.info(f"Web Server init. Name: {self.name}, Listen URL: {lAddressStr}, Listen port: {lPortInt}") + #print('Starting server, use to stop') + httpd.serve_forever() + except Exception as e: + if lL: lL.exception(f"Web Server execution exception") diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py index da236626..b3197ee8 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py @@ -279,7 +279,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings): lActivityTypeListStr += f"{lActivityItem['Def']}; " except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_Processor. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest,inOperationCodeStr=lActivityTypeListStr, inMessageStr="pyOpenRPA_Processor") + if lL: lL.info(lWebAuditMessageStr) # Append in list inGSettings["ProcessorDict"]["ActivityList"]+=lInput else: @@ -290,7 +291,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings): lActivityTypeListStr = lInput['Def'] except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_Processor. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest,inOperationCodeStr=lActivityTypeListStr, inMessageStr="pyOpenRPA_Processor") + if lL: lL.info(lWebAuditMessageStr) # Append in list inGSettings["ProcessorDict"]["ActivityList"].append(lInput) # Execute activity list @@ -313,7 +315,8 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings): lActivityTypeListStr += f"{lActivityItem['Def']}; " except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_ActivityListExecute. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest,inOperationCodeStr=lActivityTypeListStr, inMessageStr="pyOpenRPA_ActivityListExecute") + if lL: lL.info(lWebAuditMessageStr) # Execution lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = lInput) inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList), "utf8") @@ -325,7 +328,10 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings): lActivityTypeListStr = lInput['Def'] except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_ActivityListExecute. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest, + inOperationCodeStr=lActivityTypeListStr, + inMessageStr="pyOpenRPA_ActivityListExecute") + if lL: lL.info(lWebAuditMessageStr) # Execution lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = [lInput]) inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList[0]), "utf8") diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py index 10570556..923a0ce1 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py @@ -43,16 +43,16 @@ def __Create__(): "AgentConnectionLifetimeSecFloat": 300.0, # Time in seconds to handle the open connection to the Agent "AgentLoopSleepSecFloat": 2.0, # Time in seconds to sleep between loops when check to send some activity to the agent "WorkingDirectoryPathStr": None, # Will be filled automatically - "RequestTimeoutSecFloat": 300, # Time to handle request in seconds - "ListenPort_": "Порт, по которому можно подключиться к демону", - "ListenPort": 80, - "ListenURLList": [ - { - "Description": "Local machine test", - "URL_": "Сетевое расположение сервера демона", - "URL": "" - } - ], + "RequestTimeoutSecFloat": 300, # Time to handle request in seconds, + "ListenDict": { # Prototype + #"Default":{ + # "AddressStr":"", + # "PortInt":80, + # "CertFilePEMPathStr":None, + # "KeyFilePathStr":None, + # "ServerInstance": None + #} + }, "AccessUsers": { # Default - all URL is blocked "FlagCredentialsAsk": True, # Turn on Authentication "RuleDomainUserDict": { diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py index 1fcf5d9a..366db88b 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -577,6 +577,27 @@ def WebURLConnectFile(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inFile } inGSettings["ServerDict"]["URLList"].append(lURLItemDict) +def WebListenCreate(inGSettings, inServerKeyStr="Default", inAddressStr="", inPortInt=80, inCertFilePEMPathStr=None, inKeyFilePathStr=None): + """ + Create listen interface for the web server + + :param inGSettings: Global settings dict (singleton) + :param inAddressStr: IP interface to listen + :param inPortInt: Port int to listen for HTTP default is 80; for HTTPS default is 443 + :param inCertFilePEMPathStr: Path to .pem (base 64) certificate. Required for SSL connection. ATTENTION - do not use certificate with password + :param inKeyFilePathStr: Path to the private key file + :return: + """ + + inGSettings["ServerDict"]["ListenDict"][inServerKeyStr]={ + "AddressStr":inAddressStr, + "PortInt":inPortInt, + "CertFilePEMPathStr":inCertFilePEMPathStr, + "KeyFilePathStr":inKeyFilePathStr, + "ServerInstance": None + } + + def WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None): """ Add control panel HTML, JSON generator or JS when page init @@ -600,6 +621,40 @@ def WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDe if inJSInitGeneratorDef is not None: inGSettings["CPDict"][inCPKeyStr]["JSInitGeneratorDef"] = inJSInitGeneratorDef + +def WebAuditMessageCreate(inRequest, inOperationCodeStr="-", inMessageStr="-"): + """ + Create message string with request user details (IP, Login etc...). Very actual for IT security in big company. + + .. code-block:: python + + # USAGE + from pyOpenRPA import Orchestrator + + lWebAuditMessageStr = Orchestrator.WebAuditMessageCreate( + inRequest = lRequest, + inOperationCodeStr = "OP_CODE_1", + inMessageStr="Success"): + + # Log the WebAudit message + lLogger.info(lWebAuditMessageStr) + + :param inRequest: HTTP request handler + :param inOperationCodeStr: operation code in string format (actual for IT audit in control panels) + :param inMessageStr: additional message after + :return: format "WebAudit :: DOMAIN\\USER@101.121.123.12 :: operation code :: message" + """ + try: + lClientIPStr = inRequest.client_address[0] + lUserDict = WebUserInfoGet(inRequest=inRequest) + lDomainUpperStr = lUserDict["DomainUpperStr"] + lUserLoginStr = lUserDict["UserNameUpperStr"] + lResultStr = f"WebAudit :: {lDomainUpperStr}\\\\{lUserLoginStr}@{lClientIPStr} :: {inOperationCodeStr} :: {inMessageStr}" + except Exception as e: + print(str(e)) # Has no logger - must be dead alg branch + lResultStr = inMessageStr + return lResultStr + def WebUserInfoGet(inRequest): """ Return User info about request @@ -1975,10 +2030,13 @@ def Orchestrator(inGSettings, inDumpRestoreBool = True, inRunAsAdministratorBool lDaemonLastDateTime=datetime.datetime.now() gSettingsDict["ServerDict"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings - #Инициализация сервера - lThreadServer = Server.RobotDaemonServer("ServerThread", gSettingsDict) - lThreadServer.start() - if lL: lL.info("Web server has been started") #Logging + #Инициализация сервера (инициализация всех интерфейсов) + lListenDict = gSettingsDict.get("ServerDict",{}).get("ListenDict",{}) + for lItemKeyStr in lListenDict: + lItemDict = lListenDict[lItemKeyStr] + lThreadServer = Server.RobotDaemonServer(lItemKeyStr, gSettingsDict) + lThreadServer.start() + lItemDict["ServerInstance"] = lThreadServer # Init the RobotScreenActive in another thread lRobotScreenActiveThread = threading.Thread(target= Monitor.CheckScreen) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py index c4acf9bd..aeff0887 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/__init__.py @@ -3,7 +3,7 @@ r""" The OpenRPA package (from UnicodeLabs) """ -__version__ = 'v1.2.2' +__version__ = 'v1.2.3' __all__ = [] __author__ = 'Ivan Maslov ' #from .Core import Robot \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/INSTALLER b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/INSTALLER similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/INSTALLER rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/INSTALLER diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/METADATA b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/METADATA similarity index 97% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/METADATA rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/METADATA index ac785da2..ffb24fc0 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/METADATA +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.2.2 +Version: 1.2.3 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov @@ -25,9 +25,9 @@ Requires-Dist: pillow (>=6.0.0) Requires-Dist: keyboard (>=0.13.3) Requires-Dist: pyautogui (>=0.9.44) Requires-Dist: crypto (>=1.4.1) -Requires-Dist: pywin32 (>=224) ; platform_system == "Linux" and python_version >= "3.0" Requires-Dist: pywinauto (>=0.6.8) ; platform_system == "win32" and python_version >= "3.0" Requires-Dist: WMI (>=1.4.9) ; platform_system == "win32" and python_version >= "3.0" +Requires-Dist: pywin32 (>=224) ; platform_system == "win32" and python_version >= "3.0" # OpenRPA First open source RPA platform for business is released! diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/RECORD similarity index 97% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/RECORD rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/RECORD index 4b6c90df..36c49d75 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/RECORD +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/RECORD @@ -1,9 +1,9 @@ -pyOpenRPA-1.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pyOpenRPA-1.2.2.dist-info/METADATA,sha256=Oy6DxZeOruRyWkROJ9if7MI8zheBqEqlBEFBhj1zRbU,3612 -pyOpenRPA-1.2.2.dist-info/RECORD,, -pyOpenRPA-1.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pyOpenRPA-1.2.2.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 -pyOpenRPA-1.2.2.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 +pyOpenRPA-1.2.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyOpenRPA-1.2.3.dist-info/METADATA,sha256=JhjZUhqMXGka3uVYTABHekXvly9bG89Dm0VyfqhnUA4,3612 +pyOpenRPA-1.2.3.dist-info/RECORD,, +pyOpenRPA-1.2.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyOpenRPA-1.2.3.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 +pyOpenRPA-1.2.3.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174 pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188 pyOpenRPA/.idea/modules.xml,sha256=Q__U1JIA2cjxbLRXAv-SfYY00fZA0TNlpkkbY4s3ncg,277 @@ -22,7 +22,7 @@ pyOpenRPA/Agent/__pycache__/__Agent__.cpython-37.pyc,, pyOpenRPA/Agent/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Agent/readme.md,sha256=QF_Bnv204OK3t1JUEhjfICkxFmSdX6bvaRl_HI6lH9I,19 pyOpenRPA/Info.md,sha256=u4Nv-PjniSF0Zlbtr6jEJX2vblK3_1zhSLNUgOdtDaA,85 -pyOpenRPA/Orchestrator/BackwardCompatibility.py,sha256=3EhSlSMoDB9Po7lfllmgXn4LbwhVuPzLszR6P1pHU_M,32440 +pyOpenRPA/Orchestrator/BackwardCompatibility.py,sha256=-pV_zaPcqD5lYz-2OXUJQ7tB2BZknd3_ci0HPHKcLFg,33110 pyOpenRPA/Orchestrator/ControlPanel.py,sha256=OzS8HjG__8OZgqhajr8L8owyugXPuSLWHLtXuKdEP78,103 pyOpenRPA/Orchestrator/Core.py,sha256=Kjphtu0g6iaS4D_fIWmzRaLLgBQ9fcwccpQJhOETTAc,521 pyOpenRPA/Orchestrator/Processor.py,sha256=Z1SglmX6ykTLifD3M1mzWEJQUgweWo6HjjCjHldjGyM,8594 @@ -59,9 +59,9 @@ pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/Monitor.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/Screen.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,, -pyOpenRPA/Orchestrator/Server.py,sha256=301ws0BtUhz_HIghP7alHkotLCUXbJhi8fb2Wn0H8EU,29345 -pyOpenRPA/Orchestrator/ServerSettings.py,sha256=-WiQXhfSdS4-eKbFp4U6NBylyRtJ0a6AVdds3KT3H9Q,31004 -pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=R8o3_4z2TavV3i0KSz-d_oQx-U4qsrQFHvVmZFOnmnQ,20238 +pyOpenRPA/Orchestrator/Server.py,sha256=Ke89zh5iZezhA_qyQ3sfWJmL9bfc1rBBYeq-WzznfsE,30432 +pyOpenRPA/Orchestrator/ServerSettings.py,sha256=Ndo30YHn6XmNDLP9hPMM1867Gyx2hcYbh0UP2H1Tx_c,31205 +pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=d6l3YrJnh8eteBUc7DX-Qu7Ioc5mZ0ZVBAkw7i0NMa0,20139 pyOpenRPA/Orchestrator/Timer.py,sha256=HvYtEeH2Q5WVVjgds9XaBpWRmvZgwgBXurJDdVVq_T0,2097 pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py,sha256=hD47TiOuKR-G8IWu9lJD2kG28qlH7YZV63i3qv1N5Dk,681 pyOpenRPA/Orchestrator/Utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 @@ -72,7 +72,7 @@ pyOpenRPA/Orchestrator/Web/Index.js,sha256=Blo3LHe_a3zrW7MqYo4BSIwoOx7nlO7Ko9LWx pyOpenRPA/Orchestrator/Web/Index.xhtml,sha256=a4N_reLA6_Zb2KXiL73a7cWtJwO0W0Dr5lZ-RpUwuI0,16428 pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,, pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=6S8XwSQ_3FXPpaX6zYkf8uUewVXO9bHnrrDHEoWrEgw,112922 -pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=WTPCLcAGunuIJ-6fAfMTXtboAvhuZUCHm2vf3h6kS8U,109030 +pyOpenRPA/Orchestrator/__Orchestrator__.py,sha256=uqH9ma0C8OxnnfgZ4mMNl15rE5tc9k9v3hn6CY67PMU,111546 pyOpenRPA/Orchestrator/__init__.py,sha256=f1RFDzOkL3IVorCtqogjGdXYPtHH-P-y-5CqT7PGy7A,183 pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273 pyOpenRPA/Orchestrator/__pycache__/BackwardCompatibility.cpython-37.pyc,, @@ -341,6 +341,6 @@ pyOpenRPA/Tools/Terminator.py,sha256=VcjX3gFXiCGu3MMCidhrTNsmC9wsAqfjRJdTSU9fLnU pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,, pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,, -pyOpenRPA/__init__.py,sha256=ZiHtLttT3HWPDuXjwYNe06oadFPTLrVMTKyaMXZAmBE,174 +pyOpenRPA/__init__.py,sha256=O8SOldPlZbE_YguduoMHJNJaRtlVN3dHXEC0JVpQMYY,174 pyOpenRPA/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/REQUESTED b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/REQUESTED similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/REQUESTED rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/REQUESTED diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/WHEEL similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/WHEEL rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/WHEEL diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/top_level.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/top_level.txt similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.2.dist-info/top_level.txt rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.2.3.dist-info/top_level.txt diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py index 6c340444..2bfac13b 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/BackwardCompatibility.py @@ -455,3 +455,17 @@ def Update(inGSettings): } if lL: lL.warning( f"Backward compatibility (v1.2.1 to v1.2.2): Add new key RecoveryDict in ProcessorDict > RobotRDPActive") # Log about compatibility + # Add new key ServerDict > ListenDict + if "ListenDict" not in inGSettings["ServerDict"]: + lPortInt = inGSettings.get("ServerDict",{}).get("ListenPort",80) + inGSettings["ServerDict"]["ListenDict"] = { + "Default": { + "AddressStr": "", + "PortInt": lPortInt, + "CertFilePEMPathStr": None, + "KeyFilePathStr": None, + "ServerInstance": None + } + } + if lL: lL.warning( + f"Backward compatibility (v1.2.2 to v1.2.3): Add new key ServerDict > ListenDict. Transfer port from ServerDict > ListenPort") # Log about compatibility \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py index 9db03c12..76cfea8a 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/Server.py @@ -526,6 +526,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): HTTPServer.finish_request(self, request, client_address) #inGlobalDict # "JSONConfigurationDict": +import ssl class RobotDaemonServer(Thread): def __init__(self,name,inGlobalDict): Thread.__init__(self) @@ -533,15 +534,30 @@ class RobotDaemonServer(Thread): # Update the global dict ServerSettings.SettingsUpdate(inGlobalDict) def run(self): - inServerAddress=""; - inPort = gSettingsDict["ServerDict"]["ListenPort"]; - # Server settings - # Choose port 8080, for port 80, which is normally used for a http server, you need root access - server_address = (inServerAddress, inPort) - #httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) - # Logging - gSettingsDict["Logger"].info(f"Server init. Listen URL: {inServerAddress}, Listen port: {inPort}") - #httpd.serve_forever() - httpd = ThreadedHTTPServer(server_address, testHTTPServer_RequestHandler) - #print('Starting server, use to stop') - httpd.serve_forever() + lL = gSettingsDict.get("Logger",None) + try: + lServerDict = gSettingsDict["ServerDict"]["ListenDict"][self.name] + lAddressStr=lServerDict["AddressStr"] + lPortInt=lServerDict["PortInt"] + lCertFilePathStr = lServerDict["CertFilePEMPathStr"] + lKeyFilePathStr = lServerDict["KeyFilePathStr"] + if lCertFilePathStr == "": lCertFilePathStr = None + if lKeyFilePathStr == "": lKeyFilePathStr = None + # Server settings + # Choose port 8080, for port 80, which is normally used for a http server, you need root access + server_address = (lAddressStr, lPortInt) + #httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) + #httpd.serve_forever() + httpd = ThreadedHTTPServer(server_address, testHTTPServer_RequestHandler) + if lCertFilePathStr is not None: + if lKeyFilePathStr is not None: + httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile=lCertFilePathStr, keyfile=lKeyFilePathStr) + else: + httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile=lCertFilePathStr) + if lL: lL.info(f"Web Server init (with SSL). Name: {self.name}, Listen URL: {lAddressStr}, Listen port: {lPortInt}, Cert path: {lCertFilePathStr}") + else: + if lL: lL.info(f"Web Server init. Name: {self.name}, Listen URL: {lAddressStr}, Listen port: {lPortInt}") + #print('Starting server, use to stop') + httpd.serve_forever() + except Exception as e: + if lL: lL.exception(f"Web Server execution exception") diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py index da236626..b3197ee8 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/ServerSettings.py @@ -279,7 +279,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings): lActivityTypeListStr += f"{lActivityItem['Def']}; " except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_Processor. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest,inOperationCodeStr=lActivityTypeListStr, inMessageStr="pyOpenRPA_Processor") + if lL: lL.info(lWebAuditMessageStr) # Append in list inGSettings["ProcessorDict"]["ActivityList"]+=lInput else: @@ -290,7 +291,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings): lActivityTypeListStr = lInput['Def'] except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_Processor. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest,inOperationCodeStr=lActivityTypeListStr, inMessageStr="pyOpenRPA_Processor") + if lL: lL.info(lWebAuditMessageStr) # Append in list inGSettings["ProcessorDict"]["ActivityList"].append(lInput) # Execute activity list @@ -313,7 +315,8 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings): lActivityTypeListStr += f"{lActivityItem['Def']}; " except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_ActivityListExecute. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest,inOperationCodeStr=lActivityTypeListStr, inMessageStr="pyOpenRPA_ActivityListExecute") + if lL: lL.info(lWebAuditMessageStr) # Execution lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = lInput) inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList), "utf8") @@ -325,7 +328,10 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings): lActivityTypeListStr = lInput['Def'] except Exception as e: lActivityTypeListStr = "Has some error with Activity Type read" - if lL: lL.info(f"ServerSettings.pyOpenRPA_ActivityListExecute. User activity from web. Domain: {inRequest.OpenRPA['Domain']}, Username: {inRequest.OpenRPA['User']}, ActivityType: {lActivityTypeListStr}") + lWebAuditMessageStr = __Orchestrator__.WebAuditMessageCreate(inRequest=inRequest, + inOperationCodeStr=lActivityTypeListStr, + inMessageStr="pyOpenRPA_ActivityListExecute") + if lL: lL.info(lWebAuditMessageStr) # Execution lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = [lInput]) inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList[0]), "utf8") diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py index 10570556..923a0ce1 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/SettingsTemplate.py @@ -43,16 +43,16 @@ def __Create__(): "AgentConnectionLifetimeSecFloat": 300.0, # Time in seconds to handle the open connection to the Agent "AgentLoopSleepSecFloat": 2.0, # Time in seconds to sleep between loops when check to send some activity to the agent "WorkingDirectoryPathStr": None, # Will be filled automatically - "RequestTimeoutSecFloat": 300, # Time to handle request in seconds - "ListenPort_": "Порт, по которому можно подключиться к демону", - "ListenPort": 80, - "ListenURLList": [ - { - "Description": "Local machine test", - "URL_": "Сетевое расположение сервера демона", - "URL": "" - } - ], + "RequestTimeoutSecFloat": 300, # Time to handle request in seconds, + "ListenDict": { # Prototype + #"Default":{ + # "AddressStr":"", + # "PortInt":80, + # "CertFilePEMPathStr":None, + # "KeyFilePathStr":None, + # "ServerInstance": None + #} + }, "AccessUsers": { # Default - all URL is blocked "FlagCredentialsAsk": True, # Turn on Authentication "RuleDomainUserDict": { diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py index 1fcf5d9a..366db88b 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -577,6 +577,27 @@ def WebURLConnectFile(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inFile } inGSettings["ServerDict"]["URLList"].append(lURLItemDict) +def WebListenCreate(inGSettings, inServerKeyStr="Default", inAddressStr="", inPortInt=80, inCertFilePEMPathStr=None, inKeyFilePathStr=None): + """ + Create listen interface for the web server + + :param inGSettings: Global settings dict (singleton) + :param inAddressStr: IP interface to listen + :param inPortInt: Port int to listen for HTTP default is 80; for HTTPS default is 443 + :param inCertFilePEMPathStr: Path to .pem (base 64) certificate. Required for SSL connection. ATTENTION - do not use certificate with password + :param inKeyFilePathStr: Path to the private key file + :return: + """ + + inGSettings["ServerDict"]["ListenDict"][inServerKeyStr]={ + "AddressStr":inAddressStr, + "PortInt":inPortInt, + "CertFilePEMPathStr":inCertFilePEMPathStr, + "KeyFilePathStr":inKeyFilePathStr, + "ServerInstance": None + } + + def WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None): """ Add control panel HTML, JSON generator or JS when page init @@ -600,6 +621,40 @@ def WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDe if inJSInitGeneratorDef is not None: inGSettings["CPDict"][inCPKeyStr]["JSInitGeneratorDef"] = inJSInitGeneratorDef + +def WebAuditMessageCreate(inRequest, inOperationCodeStr="-", inMessageStr="-"): + """ + Create message string with request user details (IP, Login etc...). Very actual for IT security in big company. + + .. code-block:: python + + # USAGE + from pyOpenRPA import Orchestrator + + lWebAuditMessageStr = Orchestrator.WebAuditMessageCreate( + inRequest = lRequest, + inOperationCodeStr = "OP_CODE_1", + inMessageStr="Success"): + + # Log the WebAudit message + lLogger.info(lWebAuditMessageStr) + + :param inRequest: HTTP request handler + :param inOperationCodeStr: operation code in string format (actual for IT audit in control panels) + :param inMessageStr: additional message after + :return: format "WebAudit :: DOMAIN\\USER@101.121.123.12 :: operation code :: message" + """ + try: + lClientIPStr = inRequest.client_address[0] + lUserDict = WebUserInfoGet(inRequest=inRequest) + lDomainUpperStr = lUserDict["DomainUpperStr"] + lUserLoginStr = lUserDict["UserNameUpperStr"] + lResultStr = f"WebAudit :: {lDomainUpperStr}\\\\{lUserLoginStr}@{lClientIPStr} :: {inOperationCodeStr} :: {inMessageStr}" + except Exception as e: + print(str(e)) # Has no logger - must be dead alg branch + lResultStr = inMessageStr + return lResultStr + def WebUserInfoGet(inRequest): """ Return User info about request @@ -1975,10 +2030,13 @@ def Orchestrator(inGSettings, inDumpRestoreBool = True, inRunAsAdministratorBool lDaemonLastDateTime=datetime.datetime.now() gSettingsDict["ServerDict"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings - #Инициализация сервера - lThreadServer = Server.RobotDaemonServer("ServerThread", gSettingsDict) - lThreadServer.start() - if lL: lL.info("Web server has been started") #Logging + #Инициализация сервера (инициализация всех интерфейсов) + lListenDict = gSettingsDict.get("ServerDict",{}).get("ListenDict",{}) + for lItemKeyStr in lListenDict: + lItemDict = lListenDict[lItemKeyStr] + lThreadServer = Server.RobotDaemonServer(lItemKeyStr, gSettingsDict) + lThreadServer.start() + lItemDict["ServerInstance"] = lThreadServer # Init the RobotScreenActive in another thread lRobotScreenActiveThread = threading.Thread(target= Monitor.CheckScreen) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py index c4acf9bd..aeff0887 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/__init__.py @@ -3,7 +3,7 @@ r""" The OpenRPA package (from UnicodeLabs) """ -__version__ = 'v1.2.2' +__version__ = 'v1.2.3' __all__ = [] __author__ = 'Ivan Maslov ' #from .Core import Robot \ No newline at end of file diff --git a/Sources/pyOpenRPA/__init__.py b/Sources/pyOpenRPA/__init__.py index c4acf9bd..aeff0887 100644 --- a/Sources/pyOpenRPA/__init__.py +++ b/Sources/pyOpenRPA/__init__.py @@ -3,7 +3,7 @@ r""" The OpenRPA package (from UnicodeLabs) """ -__version__ = 'v1.2.2' +__version__ = 'v1.2.3' __all__ = [] __author__ = 'Ivan Maslov ' #from .Core import Robot \ No newline at end of file diff --git a/Sources/setup.py b/Sources/setup.py index 8d7aa637..ca68354c 100644 --- a/Sources/setup.py +++ b/Sources/setup.py @@ -54,7 +54,8 @@ setup(name='pyOpenRPA', 'pywinauto>=0.6.8;platform_system=="win32" and python_version>="3.0"', 'WMI>=1.4.9;platform_system=="win32" and python_version>="3.0"', 'pillow>=6.0.0','keyboard>=0.13.3','pyautogui>=0.9.44', - 'pywin32>=224;platform_system=="Linux" and python_version>="3.0"', 'crypto>=1.4.1' + 'pywin32>=224;platform_system=="win32" and python_version>="3.0"', 'crypto>=1.4.1' + #'pywin32>=224;platform_system=="Linux" and python_version>="3.0"', 'crypto>=1.4.1' ], include_package_data=True, #data_files = datafiles, diff --git a/v1.2.2 b/v1.2.3 similarity index 100% rename from v1.2.2 rename to v1.2.3