Deploy a gebo agent
This document provides step-by-step instructions on how to deploy a gebo agent. It is comprehensive so that you may copy, paste, and execute the commands and deploy the configurations provided, from beginning to end.
Getting Started
This document is intended to stand alone so that you do not need to read previous tutorial posts. As such, some of the following steps may have already been executed. They do not need to be executed again.
Setup the database
These steps may already have been executed.
Install MongoDB on your system, if you haven’t already:
Start MongoDB by executing this at the command line:
|
|
These instructions are also outlined in your new gebo’s README.md.
Setup grunt
|
|
The first command enables you to run the grunt installed locally, automatically. The second allows you to call grunt-init on this template.
Get the gebo template
This is going in your ~/.grunt-init/
directory
|
|
Create a new project:
|
|
Upon execution gebo-init
will prompt you for some input, with some fields prefilled:
|
|
Once everything is configured to your liking, execute:
|
|
Test
If everything has been initialized correctly, the tests will pass:
|
|
Run the development server
|
|
and go to http://localhost:3000. You will be redirected to an HTTPS site, which will require making an exception in your browser, as you currently only have self-signed certificates.
Make a friendo
A gebo will only perform an action if an agent has permission to request that action. These permissions are analogous to Linux-style read/write/execute permissions on an action or database resource.
From the project directory…
Register agent
This is mostly for human agents who need traditional username/password access through some human-agent interface. A friendo does not need to be a registered agent, though a registered agent does need to be a friendo with permissions set to access any given gebo resource (unless that registered agent is an administrator).
|
|
Friendo agent
A friendo is an agent to whom you may assign an access token.
|
|
Set permissions
The someactionorresource parameter may also specify a database collection name. The boolean parameters below correspond to read/write/execute. Here, the SomeGuy agent has permission to execute on someactionorresource.
|
|
Create token
This token allows an agent access to all the resources to which he’s already been granted permission.
|
|
Development
The vanilla gebo agent doesn’t do much. He just sends a friendly greeting to his friendos. Eventually you will implement richer functionality…
Project directory
The gebo grunt-init
template produces this directory structure:
|
|
A gebo’s behaviour is defined in agent/index.js
.
Configure
Configurations are manipulated in gebo.json
. By default, the configuration looks like this:
|
|