#update pyOpenRPA - compatible with Linux (ubuntu)

dev-linux
Ivan Maslov 4 years ago
parent dff69296e8
commit fc434ceb76

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: pyOpenRPA Name: pyOpenRPA
Version: 1.2.2 Version: 1.2.3
Summary: First open source RPA platform for business Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov Author: Ivan Maslov
@ -25,9 +25,9 @@ Requires-Dist: pillow (>=6.0.0)
Requires-Dist: keyboard (>=0.13.3) Requires-Dist: keyboard (>=0.13.3)
Requires-Dist: pyautogui (>=0.9.44) Requires-Dist: pyautogui (>=0.9.44)
Requires-Dist: crypto (>=1.4.1) 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: 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: 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 # OpenRPA
First open source RPA platform for business is released! First open source RPA platform for business is released!

@ -1,9 +1,9 @@
pyOpenRPA-1.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 pyOpenRPA-1.2.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.2.2.dist-info/METADATA,sha256=Oy6DxZeOruRyWkROJ9if7MI8zheBqEqlBEFBhj1zRbU,3612 pyOpenRPA-1.2.3.dist-info/METADATA,sha256=JhjZUhqMXGka3uVYTABHekXvly9bG89Dm0VyfqhnUA4,3612
pyOpenRPA-1.2.2.dist-info/RECORD,, pyOpenRPA-1.2.3.dist-info/RECORD,,
pyOpenRPA-1.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA-1.2.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA-1.2.2.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 pyOpenRPA-1.2.3.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/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174 pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174
pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188 pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188
pyOpenRPA/.idea/modules.xml,sha256=Q__U1JIA2cjxbLRXAv-SfYY00fZA0TNlpkkbY4s3ncg,277 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/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Agent/readme.md,sha256=QF_Bnv204OK3t1JUEhjfICkxFmSdX6bvaRl_HI6lH9I,19 pyOpenRPA/Agent/readme.md,sha256=QF_Bnv204OK3t1JUEhjfICkxFmSdX6bvaRl_HI6lH9I,19
pyOpenRPA/Info.md,sha256=u4Nv-PjniSF0Zlbtr6jEJX2vblK3_1zhSLNUgOdtDaA,85 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/ControlPanel.py,sha256=OzS8HjG__8OZgqhajr8L8owyugXPuSLWHLtXuKdEP78,103
pyOpenRPA/Orchestrator/Core.py,sha256=Kjphtu0g6iaS4D_fIWmzRaLLgBQ9fcwccpQJhOETTAc,521 pyOpenRPA/Orchestrator/Core.py,sha256=Kjphtu0g6iaS4D_fIWmzRaLLgBQ9fcwccpQJhOETTAc,521
pyOpenRPA/Orchestrator/Processor.py,sha256=Z1SglmX6ykTLifD3M1mzWEJQUgweWo6HjjCjHldjGyM,8594 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__/Screen.cpython-37.pyc,,
pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,,
pyOpenRPA/Orchestrator/Server.py,sha256=301ws0BtUhz_HIghP7alHkotLCUXbJhi8fb2Wn0H8EU,29345 pyOpenRPA/Orchestrator/Server.py,sha256=Ke89zh5iZezhA_qyQ3sfWJmL9bfc1rBBYeq-WzznfsE,30432
pyOpenRPA/Orchestrator/ServerSettings.py,sha256=-WiQXhfSdS4-eKbFp4U6NBylyRtJ0a6AVdds3KT3H9Q,31004 pyOpenRPA/Orchestrator/ServerSettings.py,sha256=Ndo30YHn6XmNDLP9hPMM1867Gyx2hcYbh0UP2H1Tx_c,31205
pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=R8o3_4z2TavV3i0KSz-d_oQx-U4qsrQFHvVmZFOnmnQ,20238 pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=d6l3YrJnh8eteBUc7DX-Qu7Ioc5mZ0ZVBAkw7i0NMa0,20139
pyOpenRPA/Orchestrator/Timer.py,sha256=HvYtEeH2Q5WVVjgds9XaBpWRmvZgwgBXurJDdVVq_T0,2097 pyOpenRPA/Orchestrator/Timer.py,sha256=HvYtEeH2Q5WVVjgds9XaBpWRmvZgwgBXurJDdVVq_T0,2097
pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py,sha256=hD47TiOuKR-G8IWu9lJD2kG28qlH7YZV63i3qv1N5Dk,681 pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py,sha256=hD47TiOuKR-G8IWu9lJD2kG28qlH7YZV63i3qv1N5Dk,681
pyOpenRPA/Orchestrator/Utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 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/Index.xhtml,sha256=a4N_reLA6_Zb2KXiL73a7cWtJwO0W0Dr5lZ-RpUwuI0,16428
pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,, pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,,
pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=6S8XwSQ_3FXPpaX6zYkf8uUewVXO9bHnrrDHEoWrEgw,112922 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/__init__.py,sha256=f1RFDzOkL3IVorCtqogjGdXYPtHH-P-y-5CqT7PGy7A,183
pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273 pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273
pyOpenRPA/Orchestrator/__pycache__/BackwardCompatibility.cpython-37.pyc,, 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/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,, pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,,
pyOpenRPA/Tools/__pycache__/__init__.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/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0

@ -455,3 +455,17 @@ def Update(inGSettings):
} }
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.1 to v1.2.2): Add new key RecoveryDict in ProcessorDict > RobotRDPActive") # Log about compatibility 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

@ -526,6 +526,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
HTTPServer.finish_request(self, request, client_address) HTTPServer.finish_request(self, request, client_address)
#inGlobalDict #inGlobalDict
# "JSONConfigurationDict":<JSON> # "JSONConfigurationDict":<JSON>
import ssl
class RobotDaemonServer(Thread): class RobotDaemonServer(Thread):
def __init__(self,name,inGlobalDict): def __init__(self,name,inGlobalDict):
Thread.__init__(self) Thread.__init__(self)
@ -533,15 +534,30 @@ class RobotDaemonServer(Thread):
# Update the global dict # Update the global dict
ServerSettings.SettingsUpdate(inGlobalDict) ServerSettings.SettingsUpdate(inGlobalDict)
def run(self): def run(self):
inServerAddress=""; lL = gSettingsDict.get("Logger",None)
inPort = gSettingsDict["ServerDict"]["ListenPort"]; 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 # Server settings
# Choose port 8080, for port 80, which is normally used for a http server, you need root access # Choose port 8080, for port 80, which is normally used for a http server, you need root access
server_address = (inServerAddress, inPort) server_address = (lAddressStr, lPortInt)
#httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) #httpd = HTTPServer(server_address, testHTTPServer_RequestHandler)
# Logging
gSettingsDict["Logger"].info(f"Server init. Listen URL: {inServerAddress}, Listen port: {inPort}")
#httpd.serve_forever() #httpd.serve_forever()
httpd = ThreadedHTTPServer(server_address, testHTTPServer_RequestHandler) 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 <Ctrl-C> to stop') #print('Starting server, use <Ctrl-C> to stop')
httpd.serve_forever() httpd.serve_forever()
except Exception as e:
if lL: lL.exception(f"Web Server execution exception")

@ -279,7 +279,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings):
lActivityTypeListStr += f"{lActivityItem['Def']}; " lActivityTypeListStr += f"{lActivityItem['Def']}; "
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Append in list
inGSettings["ProcessorDict"]["ActivityList"]+=lInput inGSettings["ProcessorDict"]["ActivityList"]+=lInput
else: else:
@ -290,7 +291,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings):
lActivityTypeListStr = lInput['Def'] lActivityTypeListStr = lInput['Def']
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Append in list
inGSettings["ProcessorDict"]["ActivityList"].append(lInput) inGSettings["ProcessorDict"]["ActivityList"].append(lInput)
# Execute activity list # Execute activity list
@ -313,7 +315,8 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings):
lActivityTypeListStr += f"{lActivityItem['Def']}; " lActivityTypeListStr += f"{lActivityItem['Def']}; "
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Execution
lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = lInput) lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = lInput)
inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList), "utf8") inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList), "utf8")
@ -325,7 +328,10 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings):
lActivityTypeListStr = lInput['Def'] lActivityTypeListStr = lInput['Def']
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Execution
lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = [lInput]) lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = [lInput])
inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList[0]), "utf8") inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList[0]), "utf8")

@ -43,16 +43,16 @@ def __Create__():
"AgentConnectionLifetimeSecFloat": 300.0, # Time in seconds to handle the open connection to the Agent "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 "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 "WorkingDirectoryPathStr": None, # Will be filled automatically
"RequestTimeoutSecFloat": 300, # Time to handle request in seconds "RequestTimeoutSecFloat": 300, # Time to handle request in seconds,
"ListenPort_": "Порт, по которому можно подключиться к демону", "ListenDict": { # Prototype
"ListenPort": 80, #"Default":{
"ListenURLList": [ # "AddressStr":"",
{ # "PortInt":80,
"Description": "Local machine test", # "CertFilePEMPathStr":None,
"URL_": "Сетевое расположение сервера демона", # "KeyFilePathStr":None,
"URL": "" # "ServerInstance": None
} #}
], },
"AccessUsers": { # Default - all URL is blocked "AccessUsers": { # Default - all URL is blocked
"FlagCredentialsAsk": True, # Turn on Authentication "FlagCredentialsAsk": True, # Turn on Authentication
"RuleDomainUserDict": { "RuleDomainUserDict": {

@ -577,6 +577,27 @@ def WebURLConnectFile(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inFile
} }
inGSettings["ServerDict"]["URLList"].append(lURLItemDict) 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): def WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None):
""" """
Add control panel HTML, JSON generator or JS when page init 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: if inJSInitGeneratorDef is not None:
inGSettings["CPDict"][inCPKeyStr]["JSInitGeneratorDef"] = inJSInitGeneratorDef 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): def WebUserInfoGet(inRequest):
""" """
Return User info about request Return User info about request
@ -1975,10 +2030,13 @@ def Orchestrator(inGSettings, inDumpRestoreBool = True, inRunAsAdministratorBool
lDaemonLastDateTime=datetime.datetime.now() lDaemonLastDateTime=datetime.datetime.now()
gSettingsDict["ServerDict"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings gSettingsDict["ServerDict"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings
#Инициализация сервера #Инициализация сервера (инициализация всех интерфейсов)
lThreadServer = Server.RobotDaemonServer("ServerThread", gSettingsDict) lListenDict = gSettingsDict.get("ServerDict",{}).get("ListenDict",{})
for lItemKeyStr in lListenDict:
lItemDict = lListenDict[lItemKeyStr]
lThreadServer = Server.RobotDaemonServer(lItemKeyStr, gSettingsDict)
lThreadServer.start() lThreadServer.start()
if lL: lL.info("Web server has been started") #Logging lItemDict["ServerInstance"] = lThreadServer
# Init the RobotScreenActive in another thread # Init the RobotScreenActive in another thread
lRobotScreenActiveThread = threading.Thread(target= Monitor.CheckScreen) lRobotScreenActiveThread = threading.Thread(target= Monitor.CheckScreen)

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs) The OpenRPA package (from UnicodeLabs)
""" """
__version__ = 'v1.2.2' __version__ = 'v1.2.3'
__all__ = [] __all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>' __author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot #from .Core import Robot

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: pyOpenRPA Name: pyOpenRPA
Version: 1.2.2 Version: 1.2.3
Summary: First open source RPA platform for business Summary: First open source RPA platform for business
Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Home-page: https://gitlab.com/UnicodeLabs/OpenRPA
Author: Ivan Maslov Author: Ivan Maslov
@ -25,9 +25,9 @@ Requires-Dist: pillow (>=6.0.0)
Requires-Dist: keyboard (>=0.13.3) Requires-Dist: keyboard (>=0.13.3)
Requires-Dist: pyautogui (>=0.9.44) Requires-Dist: pyautogui (>=0.9.44)
Requires-Dist: crypto (>=1.4.1) 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: 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: 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 # OpenRPA
First open source RPA platform for business is released! First open source RPA platform for business is released!

@ -1,9 +1,9 @@
pyOpenRPA-1.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 pyOpenRPA-1.2.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pyOpenRPA-1.2.2.dist-info/METADATA,sha256=Oy6DxZeOruRyWkROJ9if7MI8zheBqEqlBEFBhj1zRbU,3612 pyOpenRPA-1.2.3.dist-info/METADATA,sha256=JhjZUhqMXGka3uVYTABHekXvly9bG89Dm0VyfqhnUA4,3612
pyOpenRPA-1.2.2.dist-info/RECORD,, pyOpenRPA-1.2.3.dist-info/RECORD,,
pyOpenRPA-1.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA-1.2.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA-1.2.2.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 pyOpenRPA-1.2.3.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/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10
pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174 pyOpenRPA/.idea/inspectionProfiles/profiles_settings.xml,sha256=YXLFmX7rPNGcnKK1uX1uKYPN0fpgskYNe7t0BV7cqkY,174
pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188 pyOpenRPA/.idea/misc.xml,sha256=V-fQnOz-bYEZULgfbFgm-8mURphZrKfXMSd0wKjeEyA,188
pyOpenRPA/.idea/modules.xml,sha256=Q__U1JIA2cjxbLRXAv-SfYY00fZA0TNlpkkbY4s3ncg,277 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/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Agent/readme.md,sha256=QF_Bnv204OK3t1JUEhjfICkxFmSdX6bvaRl_HI6lH9I,19 pyOpenRPA/Agent/readme.md,sha256=QF_Bnv204OK3t1JUEhjfICkxFmSdX6bvaRl_HI6lH9I,19
pyOpenRPA/Info.md,sha256=u4Nv-PjniSF0Zlbtr6jEJX2vblK3_1zhSLNUgOdtDaA,85 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/ControlPanel.py,sha256=OzS8HjG__8OZgqhajr8L8owyugXPuSLWHLtXuKdEP78,103
pyOpenRPA/Orchestrator/Core.py,sha256=Kjphtu0g6iaS4D_fIWmzRaLLgBQ9fcwccpQJhOETTAc,521 pyOpenRPA/Orchestrator/Core.py,sha256=Kjphtu0g6iaS4D_fIWmzRaLLgBQ9fcwccpQJhOETTAc,521
pyOpenRPA/Orchestrator/Processor.py,sha256=Z1SglmX6ykTLifD3M1mzWEJQUgweWo6HjjCjHldjGyM,8594 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__/Screen.cpython-37.pyc,,
pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,, pyOpenRPA/Orchestrator/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,,
pyOpenRPA/Orchestrator/Server.py,sha256=301ws0BtUhz_HIghP7alHkotLCUXbJhi8fb2Wn0H8EU,29345 pyOpenRPA/Orchestrator/Server.py,sha256=Ke89zh5iZezhA_qyQ3sfWJmL9bfc1rBBYeq-WzznfsE,30432
pyOpenRPA/Orchestrator/ServerSettings.py,sha256=-WiQXhfSdS4-eKbFp4U6NBylyRtJ0a6AVdds3KT3H9Q,31004 pyOpenRPA/Orchestrator/ServerSettings.py,sha256=Ndo30YHn6XmNDLP9hPMM1867Gyx2hcYbh0UP2H1Tx_c,31205
pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=R8o3_4z2TavV3i0KSz-d_oQx-U4qsrQFHvVmZFOnmnQ,20238 pyOpenRPA/Orchestrator/SettingsTemplate.py,sha256=d6l3YrJnh8eteBUc7DX-Qu7Ioc5mZ0ZVBAkw7i0NMa0,20139
pyOpenRPA/Orchestrator/Timer.py,sha256=HvYtEeH2Q5WVVjgds9XaBpWRmvZgwgBXurJDdVVq_T0,2097 pyOpenRPA/Orchestrator/Timer.py,sha256=HvYtEeH2Q5WVVjgds9XaBpWRmvZgwgBXurJDdVVq_T0,2097
pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py,sha256=hD47TiOuKR-G8IWu9lJD2kG28qlH7YZV63i3qv1N5Dk,681 pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py,sha256=hD47TiOuKR-G8IWu9lJD2kG28qlH7YZV63i3qv1N5Dk,681
pyOpenRPA/Orchestrator/Utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 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/Index.xhtml,sha256=a4N_reLA6_Zb2KXiL73a7cWtJwO0W0Dr5lZ-RpUwuI0,16428
pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,, pyOpenRPA/Orchestrator/Web/__pycache__/Basic.cpython-37.pyc,,
pyOpenRPA/Orchestrator/Web/favicon.ico,sha256=6S8XwSQ_3FXPpaX6zYkf8uUewVXO9bHnrrDHEoWrEgw,112922 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/__init__.py,sha256=f1RFDzOkL3IVorCtqogjGdXYPtHH-P-y-5CqT7PGy7A,183
pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273 pyOpenRPA/Orchestrator/__main__.py,sha256=czJrc7_57WiO3EPIYfPeF_LG3pZsQVmuAYgbl_YXcVU,273
pyOpenRPA/Orchestrator/__pycache__/BackwardCompatibility.cpython-37.pyc,, 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/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,, pyOpenRPA/Tools/__pycache__/Terminator.cpython-37.pyc,,
pyOpenRPA/Tools/__pycache__/__init__.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/__pycache__/__init__.cpython-37.pyc,,
pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA/test.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0

@ -455,3 +455,17 @@ def Update(inGSettings):
} }
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.1 to v1.2.2): Add new key RecoveryDict in ProcessorDict > RobotRDPActive") # Log about compatibility 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

@ -526,6 +526,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
HTTPServer.finish_request(self, request, client_address) HTTPServer.finish_request(self, request, client_address)
#inGlobalDict #inGlobalDict
# "JSONConfigurationDict":<JSON> # "JSONConfigurationDict":<JSON>
import ssl
class RobotDaemonServer(Thread): class RobotDaemonServer(Thread):
def __init__(self,name,inGlobalDict): def __init__(self,name,inGlobalDict):
Thread.__init__(self) Thread.__init__(self)
@ -533,15 +534,30 @@ class RobotDaemonServer(Thread):
# Update the global dict # Update the global dict
ServerSettings.SettingsUpdate(inGlobalDict) ServerSettings.SettingsUpdate(inGlobalDict)
def run(self): def run(self):
inServerAddress=""; lL = gSettingsDict.get("Logger",None)
inPort = gSettingsDict["ServerDict"]["ListenPort"]; 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 # Server settings
# Choose port 8080, for port 80, which is normally used for a http server, you need root access # Choose port 8080, for port 80, which is normally used for a http server, you need root access
server_address = (inServerAddress, inPort) server_address = (lAddressStr, lPortInt)
#httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) #httpd = HTTPServer(server_address, testHTTPServer_RequestHandler)
# Logging
gSettingsDict["Logger"].info(f"Server init. Listen URL: {inServerAddress}, Listen port: {inPort}")
#httpd.serve_forever() #httpd.serve_forever()
httpd = ThreadedHTTPServer(server_address, testHTTPServer_RequestHandler) 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 <Ctrl-C> to stop') #print('Starting server, use <Ctrl-C> to stop')
httpd.serve_forever() httpd.serve_forever()
except Exception as e:
if lL: lL.exception(f"Web Server execution exception")

@ -279,7 +279,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings):
lActivityTypeListStr += f"{lActivityItem['Def']}; " lActivityTypeListStr += f"{lActivityItem['Def']}; "
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Append in list
inGSettings["ProcessorDict"]["ActivityList"]+=lInput inGSettings["ProcessorDict"]["ActivityList"]+=lInput
else: else:
@ -290,7 +291,8 @@ def pyOpenRPA_Processor(inRequest, inGSettings):
lActivityTypeListStr = lInput['Def'] lActivityTypeListStr = lInput['Def']
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Append in list
inGSettings["ProcessorDict"]["ActivityList"].append(lInput) inGSettings["ProcessorDict"]["ActivityList"].append(lInput)
# Execute activity list # Execute activity list
@ -313,7 +315,8 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings):
lActivityTypeListStr += f"{lActivityItem['Def']}; " lActivityTypeListStr += f"{lActivityItem['Def']}; "
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Execution
lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = lInput) lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = lInput)
inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList), "utf8") inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList), "utf8")
@ -325,7 +328,10 @@ def pyOpenRPA_ActivityListExecute(inRequest, inGSettings):
lActivityTypeListStr = lInput['Def'] lActivityTypeListStr = lInput['Def']
except Exception as e: except Exception as e:
lActivityTypeListStr = "Has some error with Activity Type read" 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 # Execution
lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = [lInput]) lResultList = Processor.ActivityListExecute(inGSettings = inGSettings, inActivityList = [lInput])
inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList[0]), "utf8") inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lResultList[0]), "utf8")

@ -43,16 +43,16 @@ def __Create__():
"AgentConnectionLifetimeSecFloat": 300.0, # Time in seconds to handle the open connection to the Agent "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 "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 "WorkingDirectoryPathStr": None, # Will be filled automatically
"RequestTimeoutSecFloat": 300, # Time to handle request in seconds "RequestTimeoutSecFloat": 300, # Time to handle request in seconds,
"ListenPort_": "Порт, по которому можно подключиться к демону", "ListenDict": { # Prototype
"ListenPort": 80, #"Default":{
"ListenURLList": [ # "AddressStr":"",
{ # "PortInt":80,
"Description": "Local machine test", # "CertFilePEMPathStr":None,
"URL_": "Сетевое расположение сервера демона", # "KeyFilePathStr":None,
"URL": "" # "ServerInstance": None
} #}
], },
"AccessUsers": { # Default - all URL is blocked "AccessUsers": { # Default - all URL is blocked
"FlagCredentialsAsk": True, # Turn on Authentication "FlagCredentialsAsk": True, # Turn on Authentication
"RuleDomainUserDict": { "RuleDomainUserDict": {

@ -577,6 +577,27 @@ def WebURLConnectFile(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inFile
} }
inGSettings["ServerDict"]["URLList"].append(lURLItemDict) 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): def WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None):
""" """
Add control panel HTML, JSON generator or JS when page init 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: if inJSInitGeneratorDef is not None:
inGSettings["CPDict"][inCPKeyStr]["JSInitGeneratorDef"] = inJSInitGeneratorDef 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): def WebUserInfoGet(inRequest):
""" """
Return User info about request Return User info about request
@ -1975,10 +2030,13 @@ def Orchestrator(inGSettings, inDumpRestoreBool = True, inRunAsAdministratorBool
lDaemonLastDateTime=datetime.datetime.now() lDaemonLastDateTime=datetime.datetime.now()
gSettingsDict["ServerDict"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings gSettingsDict["ServerDict"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings
#Инициализация сервера #Инициализация сервера (инициализация всех интерфейсов)
lThreadServer = Server.RobotDaemonServer("ServerThread", gSettingsDict) lListenDict = gSettingsDict.get("ServerDict",{}).get("ListenDict",{})
for lItemKeyStr in lListenDict:
lItemDict = lListenDict[lItemKeyStr]
lThreadServer = Server.RobotDaemonServer(lItemKeyStr, gSettingsDict)
lThreadServer.start() lThreadServer.start()
if lL: lL.info("Web server has been started") #Logging lItemDict["ServerInstance"] = lThreadServer
# Init the RobotScreenActive in another thread # Init the RobotScreenActive in another thread
lRobotScreenActiveThread = threading.Thread(target= Monitor.CheckScreen) lRobotScreenActiveThread = threading.Thread(target= Monitor.CheckScreen)

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs) The OpenRPA package (from UnicodeLabs)
""" """
__version__ = 'v1.2.2' __version__ = 'v1.2.3'
__all__ = [] __all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>' __author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot #from .Core import Robot

@ -3,7 +3,7 @@ r"""
The OpenRPA package (from UnicodeLabs) The OpenRPA package (from UnicodeLabs)
""" """
__version__ = 'v1.2.2' __version__ = 'v1.2.3'
__all__ = [] __all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>' __author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
#from .Core import Robot #from .Core import Robot

@ -54,7 +54,8 @@ setup(name='pyOpenRPA',
'pywinauto>=0.6.8;platform_system=="win32" and python_version>="3.0"', 'pywinauto>=0.6.8;platform_system=="win32" and python_version>="3.0"',
'WMI>=1.4.9;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', '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, include_package_data=True,
#data_files = datafiles, #data_files = datafiles,

Loading…
Cancel
Save