diff options
| -rw-r--r-- | config.py | 1 | ||||
| -rw-r--r-- | rmq.py | 2 | ||||
| -rw-r--r-- | snekbox.py | 3 | ||||
| -rw-r--r-- | snekweb.py | 2 | 
4 files changed, 0 insertions, 8 deletions
| @@ -6,7 +6,6 @@ from docker.errors import NotFound  def autodiscover():      """Search for the snekbox container and return its IPv4 address.""" -      container_names = ["rmq", "pdrmq", "snekbox_pdrmq_1"]      client = docker.from_env() @@ -25,7 +25,6 @@ class Rmq:      def consume(self, queue=QUEUE, callback=None, thread_ws=None, run_once=False):          """Subscribe to read from a RMQ channel.""" -          while True:              try:                  connection = pika.BlockingConnection(self.con_params) @@ -72,7 +71,6 @@ class Rmq:      def publish(self, message, queue=QUEUE, routingkey=ROUTING_KEY, exchange=EXCHANGE):          """Open a connection to publish (write) to a RMQ channel.""" -          try:              connection = pika.BlockingConnection(self.con_params) @@ -45,7 +45,6 @@ class Snekbox:          Returns the output of executing the command (stdout) if          successful, or a error message if the execution failed.          """ -          args = [self.nsjail_binary, '-Mo',                  '--rlimit_as', '700',                  '--chroot', '/', @@ -108,7 +107,6 @@ class Snekbox:          to RMQ. Once published, the system exits, since the snekboxes          are created and disposed of per-execution.          """ -          msg = body.decode('utf-8')          result = ''          snek_msg = json.loads(msg) @@ -125,7 +123,6 @@ class Snekbox:      def message_handler(self, ch, method, properties, body, thread_ws=None):          """Spawns a daemon process that handles RMQ messages.""" -          p = multiprocessing.Process(target=self.execute, args=(body,))          p.daemon = True          p.start() @@ -22,14 +22,12 @@ log = app.logger  @app.route('/')  def index():      """Root path returns standard index.html.""" -      return render_template('index.html')  @sockets.route('/ws/<snekboxid>')  def websocket_route(ws, snekboxid):      """Opens a websocket that spawns and connects to a snekbox daemon.""" -      localdata = threading.local()      localdata.thread_ws = ws | 
