Class: Cosmos::PluginMicroservice

Inherits:
Microservice show all
Defined in:
lib/cosmos/microservices/plugin_microservice.rb

Instance Attribute Summary

Attributes inherited from Microservice

#count, #custom, #error, #microservice_status_thread, #name, #scope, #state

Instance Method Summary collapse

Methods inherited from Microservice

#as_json, run, #shutdown

Constructor Details

#initialize(name) ⇒ PluginMicroservice

Returns a new instance of PluginMicroservice.



26
27
28
# File 'lib/cosmos/microservices/plugin_microservice.rb', line 26

def initialize(name)
  super(name, is_plugin: true)
end

Instance Method Details

#runObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/cosmos/microservices/plugin_microservice.rb', line 30

def run
  Dir.chdir @work_dir
  # Fortify: Process Control
  # This is dangerous! However, plugins need to be able to run whatever they want.
  # Only admins can install plugins and they need to be vetted for content.
  # NOTE: In COSMOS EE each microservice gets its own container so the potential
  # footprint is much smaller. In OpenSource COSMOS you're in the same container
  # as all the other plugins.
  exec(*@config["cmd"])
end