Commit Graph

377 Commits

Author SHA1 Message Date
Kristóf Tóth
9f3a3b501f Initialise supervisor xmlrpc client lazily to avoid globals 2018-06-01 14:01:32 +02:00
Kristóf Tóth
8817f991a5 Use power of LazyInitialise to murder TFW/TAOENV global state 2018-06-01 14:01:15 +02:00
Kristóf Tóth
06c2fc97ad Implement decorator to lazy initialise a property 2018-06-01 13:58:50 +02:00
Kristóf Tóth
e98c41d3cf Comply new API style in TerminalEH 2018-05-31 14:08:29 +02:00
Kristóf Tóth
ea251ef474 Document LogMonitoringEventHandler 2018-05-31 14:03:11 +02:00
Kristóf Tóth
b68ceeb394 Rework LogMonitoringEH API to adhere new conventions 2018-05-31 13:53:11 +02:00
Kristóf Tóth
2e953ea098 Implement LogMonitorEH API 2018-05-30 15:21:36 +02:00
Kristóf Tóth
211ae1e2d9 Allow changing MonitorManagerMixin.monitor_args dynamically 2018-05-30 15:19:59 +02:00
Kristóf Tóth
73f6c6635b Rename my bootiful threadlocalise.. SupervisorBaseMixin method 2018-05-30 14:07:40 +02:00
Kristóf Tóth
babb14288c Use contextlib.suppress() to suppress stuff in SupervisorLogMixin 2018-05-30 14:05:13 +02:00
Kristóf Tóth
3bb97a6dcc Implement LogMonitoringEventHandler to manage a LogMonitor via API 2018-05-30 13:14:25 +02:00
Kristóf Tóth
9e6cd57532 Refactor MonitorManagerMixin to allow arbitrary Monitor arguments 2018-05-30 13:06:09 +02:00
Kristóf Tóth
28c16e1127 Rework log deletion – use log_tail arguments instead 2018-05-29 17:59:16 +02:00
Kristóf Tóth
4815b97200 Fix shared xmlrpc client raising HTTP errors in LogMonitor 2018-05-29 16:40:58 +02:00
Kristóf Tóth
9f6418bf60 Support creating thread-local xmlrpc clients in SupervisorBaseMixin 2018-05-29 16:40:58 +02:00
Kristóf Tóth
780d6a9b3c Avoid pylint stupidity ¯\_(ツ)_/¯ 2018-05-29 16:40:58 +02:00
Kristóf Tóth
32e3c2860d Fix inotify event logs triggering themselves (infinite log recursion) 2018-05-29 16:40:58 +02:00
Kristóf Tóth
029f4a9eb2 Implement watchdog observer to watch the logs of a supervisor process 2018-05-29 16:40:58 +02:00
Kristóf Tóth
9723f98950 Rework ProcessManagingEH log API 2018-05-28 16:36:59 +02:00
Kristóf Tóth
1a93dad562 Separate log clearing from reading 2018-05-28 15:02:53 +02:00
Kristóf Tóth
44df95a434 Refactor supervisor logging logic to separate mixin 2018-05-28 14:32:11 +02:00
Kristóf Tóth
fd56f8ca63 Make it impossible for TerminalCommands commands to kill TFW 2018-05-26 22:48:28 +02:00
Kristóf Tóth
77fabf28f6 Fix TerminalCommands parsing unix-style arguments incorrectly 2018-05-26 22:39:27 +02:00
Kristóf Tóth
0038663bc6 Allow listening to inotify events in additional directories using IdeEH 2018-05-24 16:19:04 +02:00
Kristóf Tóth
6489e4452e Remove ambigous API for log reading (actions always reply with logs included) 2018-05-24 11:22:39 +02:00
Kristóf Tóth
bfd1efa9f9 Append deployment logs to every response of ProcessManagingEventHandler 2018-05-24 11:20:00 +02:00
Kristóf Tóth
293d7972f1 Document serialization module 2018-05-11 14:36:56 +02:00
Kristóf Tóth
d30226d55b Extend docstrings in server_connector 2018-05-11 14:07:59 +02:00
Kristóf Tóth
1fb13fefff Add setup.py to allow local pip installs of tfw 2018-05-10 16:20:58 +02:00
Kristóf Tóth
d1305bc879 Add step_next trigger to LinearFSM allowing stateless stepping 2018-05-04 17:45:16 +02:00
Kristóf Tóth
06e17a6591 Raise comprehendable exception from webide when no files are present 2018-04-26 11:09:31 +02:00
Kristóf Tóth
8396c10a7b Rename TerminadoEventHandler 2018-04-26 10:13:02 +02:00
Kristóf Tóth
3b30b333e5 Rename webide -> ide 2018-04-20 17:33:06 +02:00
Kristóf Tóth
0b651abb7d Nicen some EventHandler API docstrings 2018-04-19 10:47:20 +02:00
Kristóf Tóth
b1592e8ebb Use new f-strings where possible 2018-04-19 09:21:41 +02:00
Kristóf Tóth
db1b008fc9 Fix EventHandlerBase.event_handler_callback broken logic 2018-04-18 20:16:56 +02:00
Kristóf Tóth
9d93d055b8 Refactor EventHandlerBase to be more general 2018-04-18 20:07:41 +02:00
Kristóf Tóth
addd517ba7 Add a huge bunch of docstrings 2018-04-18 19:44:26 +02:00
Kristóf Tóth
690f9bb190 Move TriggerlessEventHandler logic to base class EventHandlerBase 2018-04-18 18:47:51 +02:00
Kristóf Tóth
c909317ca0 Make TerminalCommands alias nonexistent commands only 2018-04-18 16:22:01 +02:00
Kristóf Tóth
d8988ea097 Rename make_eventhandler_response in TFWServer to increase readibility 2018-04-16 12:57:08 +02:00
Kristóf Tóth
986a67f5db Simplify bool returning function 2018-04-16 12:51:44 +02:00
Kristóf Tóth
39243811dc Remove unnecessary variable 2018-04-16 12:51:01 +02:00
Kristóf Tóth
22cdbaac2c Fix typo 2018-04-16 12:50:08 +02:00
Kristóf Tóth
743fab366b Extract variable to silence retarded linter 2018-04-14 23:15:44 +02:00
Kristóf Tóth
efb8af4cd1 Remove double trailing newline 2018-04-14 23:09:02 +02:00
Kristóf Tóth
a65d3127ba Refactor DirectoryMonitor managing code to a mixin 2018-04-14 23:00:43 +02:00
Kristóf Tóth
1c29b700c2 Move mixins and decorators to tfw module from tfw.components 2018-04-14 21:15:30 +02:00
Kristóf Tóth
e2bb126e6f Make simple not if condition more pythonic 2018-04-14 21:07:33 +02:00
Kristóf Tóth
586c435cc2 Refactor watchdog Observer handling to a mixin 2018-04-14 20:36:43 +02:00
Kristóf Tóth
b082279916 Implement message validation in TFW proxying 2018-04-14 10:45:23 +02:00
Kristóf Tóth
ecec1cde59 Root out remaining ambiguous key arguments in EventHandlers 2018-04-14 10:45:23 +02:00
Kristóf Tóth
0cd11f9d64 Remove ambiguous key parameter from proxy module 2018-04-14 10:45:23 +02:00
Kristóf Tóth
fe7bd4a678 Remove ambiguous key parameter from EventHanderConnector 2018-04-14 10:45:23 +02:00
Kristóf Tóth
3c12b5503e Mark old serialization methods as module internal 2018-04-14 10:45:23 +02:00
Kristóf Tóth
499b575adf Add module docstring to serialization.py 2018-04-14 10:45:23 +02:00
Kristóf Tóth
9eb6717972 Refactor 'mirror' message enveloping to use new serialization 2018-04-14 10:45:23 +02:00
Kristóf Tóth
aabaadc4c4 Refactor proxying to use new deserialization 2018-04-14 10:45:23 +02:00
Kristóf Tóth
cd36b6c22c Refactor ServerUplinkConnector to use new serializers 2018-04-14 10:45:23 +02:00
Kristóf Tóth
67a23166c6 Introduce [de]serialize_tfw_msg() methods to abstract away enveloping 2018-04-14 10:45:23 +02:00
Kristóf Tóth
18e9ee5f52 Rename make_response in networking to avoid confusion 2018-04-14 10:45:23 +02:00
Kristóf Tóth
d04479157d Refactor ServerUplinkConnector.send() signature 2018-04-14 10:45:23 +02:00
Kristóf Tóth
b8cdb30318 Add missing legal boilerplate to terminal_commands.py 2018-04-14 10:44:54 +02:00
Kristóf Tóth
512a965328 Update old logging code to use TFW global logging 2018-04-13 16:46:11 +02:00
Kristóf Tóth
7877e977ab Extract magic dict building to method in TerminalCommands 2018-04-13 10:01:45 +02:00
Kristóf Tóth
5d8d541394 Remove dead code from EventHandlerBase 2018-04-12 14:30:27 +02:00
Kristóf Tóth
16c1fe7b50 Implement appending command aliases to bashrc to avoid command not found 2018-04-12 11:07:56 +02:00
Kristóf Tóth
8caf879ffd Integrate terminal command magic class from test repo to TFW 2018-04-12 10:56:15 +02:00
Kristóf Tóth
73fa65c6e8 Implement triggering of FSM from ServerUplinkConnector 2018-04-11 15:22:54 +02:00
Kristóf Tóth
4842574cf3 Refactor LinearFSM triggers to have different names 2018-04-11 15:20:14 +02:00
Kristóf Tóth
6113149c58 Rework serialization module to work regardless of message format 2018-04-10 17:37:58 +02:00
Kristóf Tóth
87fa86d314 Refactor FSM triggering in TFWServer 2018-04-10 17:37:58 +02:00
Kristóf Tóth
dbe6fe0f92 Add license boilerplate to linear_fsm.py 2018-04-10 12:48:53 +02:00
Kristóf Tóth
29da0a7ca6 Implement first version of LinearFSM 2018-04-07 15:21:13 +02:00
Kristóf Tóth
1922050e87 Make semantics of whitelist and blacklist more explicit in webide 2018-04-07 15:00:31 +02:00
Kristóf Tóth
8bd6005b5d Refactor blacklisting into a method in webide 2018-04-07 14:35:42 +02:00
Kristóf Tóth
4a216d8875 Rename SourceCodeEventHandler to WebideEventHandler 2018-04-07 14:18:15 +02:00
Kristóf Tóth
de8c2ae6e2 Implement FSMUpdates to EventHandlers 2018-04-06 17:14:37 +02:00
Kristóf Tóth
b785b88af6 Pass processed message to FSM trigger predicates 2018-04-06 17:14:06 +02:00
Kristóf Tóth
96c322c17c Silence unjust critique by pylint 2018-04-06 16:52:23 +02:00
Kristóf Tóth
11743e830a Expose ServerUplinkConnector with a name understandable without TFW knowledge 2018-04-06 16:22:21 +02:00
Kristóf Tóth
0464acbdc4 Make error logs more explicit 2018-04-06 16:09:05 +02:00
Kristóf Tóth
64bd2f1ba0 Refactor handling of shared EventHandlerConnector ownership to nicen imports 2018-04-06 16:04:25 +02:00
Kristóf Tóth
1f2e1f0489 Refactor whole importing hell into a nice and clean API 2018-04-06 15:31:16 +02:00
Kristóf Tóth
bd84e4fe06 Improve code formatting in webide 2018-04-05 17:19:56 +02:00
Kristóf Tóth
bc340e2e19 Enforce webide whitelisting 2018-04-05 17:16:41 +02:00
Kristóf Tóth
b73b7307bd Improve webide whitelisting by enforcing stricter rules (fix symlink attack) 2018-04-05 17:01:50 +02:00
Kristóf Tóth
b74ff39438 Implement directory whitelisting in webide 2018-04-05 14:43:39 +02:00
Kristóf Tóth
35421649c9 Extract spawning bash as user to a variable 2018-04-05 14:43:07 +02:00
Kristóf Tóth
19f819c142 Implement TFW & challenge solver user separation 2018-04-04 17:43:18 +02:00
Kristóf Tóth
eaa0eee4ca Add LICENSE file and include copyright notice in source files 2018-04-03 14:49:14 +02:00
Kristóf Tóth
d850f55b86 Add pylint local excludes to silence false positives 2018-03-30 18:11:38 +02:00
Kristóf Tóth
3ae0995b95 Make project comply new coding standards and pylint 2018-03-30 17:50:20 +02:00
Kristóf Tóth
2087294510 Implement simple HistoryMonitor for GDB monitoring 2018-03-29 15:19:00 +02:00
Kristóf Tóth
ba41c0b505 Make initialization of historymonitor the responsibility of client 2018-03-29 11:34:08 +02:00
Kristóf Tóth
c973b17141 Refactor HistoryMonitor to be customisable 2018-03-29 11:23:38 +02:00
Kristóf Tóth
43c46a7af2 Integrate ABC module where we have abstract classes 2018-03-27 17:49:32 +02:00
Kristóf Tóth
1982a3c869 Rename TFWENV and TAOENV constants to use capital letters 2018-03-25 16:38:39 +02:00
Kristóf Tóth
ec469c6b75 Remove unnecessary super().__init__() call 2018-03-25 16:38:39 +02:00
Kristóf Tóth
8eded8cbac Make use of format string optimization in logging calls 2018-03-25 16:38:32 +02:00
Kristóf Tóth
73ed680298 Fix bad indentation 2018-03-25 16:20:49 +02:00
Kristóf Tóth
5c1431685e Remove unnecessary __init__() call 2018-03-25 16:10:55 +02:00
Kristóf Tóth
aacdbcb0d1 Standardize log constant naming and declaration placement 2018-03-25 16:06:59 +02:00
Kristóf Tóth
1e2ea0ed17 Standardize imports: standard newline package newline tfw 2018-03-25 15:43:59 +02:00
Kristóf Tóth
abcf490019 Strip controller from TFW 2018-03-23 11:37:01 +01:00
Kristóf Tóth
fda242d263 Fix EventHandlerConnector dying painfully on keyless messages 2018-03-21 17:23:18 +01:00
Kristóf Tóth
095c818a36 Move @with_monitor_paused decoartor to directory_monitor.py 2018-03-21 17:18:16 +01:00
Kristóf Tóth
6e391b6b2c Rename watchdog's EventHandlers to avoid confusion 2018-03-20 14:35:21 +01:00
Kristóf Tóth
c8dca5f33b Change order of classes in directory_monitor.py 2018-03-20 14:32:27 +01:00
Kristóf Tóth
359e478069 Move DirectoryManagingEventHandler to seperate module 2018-03-20 14:29:14 +01:00
Kristóf Tóth
598cf6218a Remove duplicate name from logging 2018-03-20 12:20:13 +01:00
Kristóf Tóth
6c5361846b Adjust DirectoryMonitor rate limiting to filter multi-inotify events 2018-03-20 11:40:20 +01:00
Kristóf Tóth
b1f4842dc7 Use now fixed DirectoryMonitor.ignore property in webide 2018-03-20 11:39:37 +01:00
Kristóf Tóth
08693d3ba2 Fix infinite recursive property in DirectoryMonitor 2018-03-20 11:31:29 +01:00
Kristóf Tóth
222143665c Implement DirManagingEH selectdir API 2018-03-20 09:02:05 +01:00
Kristóf Tóth
7b834f8f25 Expose DirManagingEH.directory as a property 2018-03-20 09:02:05 +01:00
Kristóf Tóth
aaaad9c459 Add untested DirectoryMonitoringEventHandler implementation 2018-03-20 09:02:05 +01:00
Kristóf Tóth
ccb076c885 Remove depecrated ioloop.install() calls 2018-03-15 16:11:53 +01:00
Kristóf Tóth
cc87540171 Implement SourceCodeEventHandler blacklist manipulating API 2018-03-15 15:54:07 +01:00
Kristóf Tóth
aa54e40f14 Refactor SourceCodeEventHandler blacklisting to use unix pattern matching 2018-03-15 15:50:52 +01:00
Kristóf Tóth
1b87863997 Refactor FileManager.select_file() to @filename.setter property 2018-03-15 12:18:39 +01:00
Kristóf Tóth
0ef502a680 Make property setup stuff in FileManager.__init__() more readable 2018-03-15 12:04:39 +01:00
Kristóf Tóth
4b8b71d967 Expose FileManager exclude as a property 2018-03-15 12:02:56 +01:00
Kristóf Tóth
f354fd73dc Rename response -> message in ServerConnector classes 2018-03-14 16:11:27 +01:00
Kristóf Tóth
929ea905c5 Improve error handling in webide backend 2018-03-14 14:15:40 +01:00
Kristóf Tóth
a5d0359ab8 Add helper method to ServerUplinkConnector for EH -> EH communication 2018-03-14 14:09:30 +01:00
Kristóf Tóth
69f03f7615 Implement EventHandler command mirroring (EH -> EH communication) 2018-03-14 14:08:48 +01:00
Kristóf Tóth
3e0592c176 Remove Cenator :'( sorry to see you go 2018-03-14 09:25:42 +01:00
Kristóf Tóth
b955a570fd Fix DirectoryMonitor.stop() raising unhandled KeyError on rm -rf workdir 2018-03-09 09:50:13 +01:00
Kristóf Tóth
0e4be3c22f Refactor DirectoryMonitor handling in SourceCodeEventHandler 2018-03-09 09:37:48 +01:00
Kristóf Tóth
3b241a3930 Implement error handling in SourceCodeEventHandler.select_dir() 2018-03-09 09:11:52 +01:00
Kristóf Tóth
20895cb989 Add workind directory to SourceCodeEventHandler's default fileinfos 2018-03-09 08:52:13 +01:00
Kristóf Tóth
9e4fe87d84 Implement support to change working directories in SourceCodeEventHandler 2018-03-09 08:45:30 +01:00
Kristóf Tóth
7858caf51a Make excluded stuff in FileManager configurable from __init__() 2018-03-09 08:41:12 +01:00
Kristóf Tóth
b224ed519d Add support to FileManager to change working directory 2018-03-09 08:37:08 +01:00
Kristóf Tóth
491bbe5df6 Remove ambiguous log (already logged in networking) 2018-03-08 16:41:43 +01:00
Kristóf Tóth
af1a6261cc Refactor naming conventions: data_json -> message in TFW EventHandlers 2018-03-08 16:11:43 +01:00
Kristóf Tóth
36724c5c51 Implement 'tail' on stderr feedback 2018-03-08 16:05:44 +01:00
Kristóf Tóth
f874deff6e Implement stderr feedback on deployment failure (ProcessManagingEventHandler) 2018-03-08 16:04:35 +01:00
Kristóf Tóth
8588328a8f Improve handling of supervisor errors in ProcessManagingEventHandler 2018-03-07 16:35:55 +01:00
Kristóf Tóth
9b550f724d Extend ProcessManagingEventHander with deployment failure detection 2018-03-07 15:14:33 +01:00
Kristóf Tóth
d11d9a70cb Remove TFW antipattern I wrote without thinking 2018-03-07 14:47:24 +01:00
Kristóf Tóth
2c816d5a38 Implement error handling on EventHandler exposing APIs 2018-03-07 14:45:43 +01:00
Kristóf Tóth
6a6236e704 Refactor callback subscription stuff to a mixin 2018-03-07 11:45:57 +01:00
Bokros Bálint
6db4c80671
Merge pull request #17 from avatao-content/terminado_commands
Implement terminal manipulation via a new EventHandler
2018-03-07 11:43:02 +01:00
Kristóf Tóth
6d59762e2b Clean up confusing usage of data_json['data'] in TerminadoEventHandler 2018-03-07 11:37:52 +01:00
Kristóf Tóth
cb7e8c5663 Make DirectoryMonitor.ignore setter more pythonic 2018-03-07 11:36:21 +01:00
Kristóf Tóth
4e0f95acbd Rename JOHN CENA to avataobot as per business demands 2018-03-07 10:19:11 +01:00
Kristóf Tóth
3cf404ee9a Implement inotify event ignoration logic 2018-03-07 09:17:29 +01:00
Kristóf Tóth
1165fa4ec9 Refactor pty resetting logic to TerminadoMiniServer 2018-03-06 16:15:04 +01:00