TLDR; Getting Started with the LegionIO Gem

This page will explain on how to get started with Legion without Bundler. If you want to use Bundler for local development, go to this

Instructions

  1. run gem install legionio

  2. Manually install any LEXs you want if auto install is disabled via gem command. Example: gem install lex-http lex-scheduler

  3. run legionio

  4. Control+C to exit

Configuring Legion

  1. Legion will look in the following paths, in this order and stop when it finds a valid directory

    1. /etc/legionio

    2. "#{ENV['home']}/legionio"

    3. ~/legionio

    4. ./settings

    5. ./

  2. Legion will then load all .json files and merge them into Legion::Settings (see examples below)

  3. If Legion is running, you will need to stop and start it to have the new settings take affect

  4. LEX Settings can be added to the json configs directly, example LEX::Pushover requires the token setting so you can do this {”extensions”:{”pushover”:{”token”:”abc”}}}

 

Config Examples

{ "transport": { "vhost": "legion", "connection": { "host": "rabbitmq-server.local.domain", "user": "legion", "password": "legion", "vhost": "legion", "heartbeat": 10 }, "messages": { "encrypt": false }, "prefetch": 20 } }
{ "data": { "creds": { "host":"host.docker.internal", "password": "foobar" }, "connection": { "max_connections": 100, "preconnect": false } } }
{ "extensions": { "conditioner": {}, "health": { "enabed": true }, "http": {}, "lex": { "enabled": true }, "log": { "enabled": true, "workers": 5 }, "scheduler": { "enabled": true, "workers": 2 }, "tasker": { "enabled": true, "workers": 10, "logger":{ "trace": true, "extended": true, "level":"debug" } }, "transformer": { "enabled": true } } }

 

When using Bundler, LEXs will not be installed automatically. If you run the legion command after installing the legion gem, it will automatically install the gems needed on start. This is a major difference between using bundler and using the gem directly