Next: , Up: (dir)

Webster NodeBrain Module

This manual is for the Webster NodeBrain Module (version 0.2, August 2014) used as minimal web server for a NodeBrain application.

Copyright © 2014 Ed Trettevik <eat@nodebrain.org>

Permission is granted to copy, distribute and/or modify this document under the terms of either the MIT License (Expat) or NodeBrain License. See the Licenses section at the end of this document for details.

Short Table of Contents

Table of Contents


Next: , Previous: Top, Up: Top

1 Concepts

A Webster module provides administrators with an HTTPS interface to NodeBrain agents, enabling the use of a web browser as a client. It is not intended as a general purpose web server and should not be used as alternative to web servers like Apache that are designed for general purpose use. However, it can be used to provide access to custom content packaged with a NodeBrain kit or application where a low rate of access is expected.


Next: , Previous: Concepts, Up: Top

2 Tutorial

The world is governed more by appearance than realities, so that it is fully as necessary to seem to know something as to know it. —Daniel Webster (1782–1852)

The Webster module enables NodeBrain to pretend to be a web server—not with the goal of providing a web server for web applications in general but to support little web tools associated with NodeBrain applications.

Although Webster supports x509 certificate authentication, let's skip over all that fun stuff and get it running quickly with no security. If you don't secure it with password or certificate authentication, Webster doesn't let you do anything other than display web pages, so other than exposing a port that could be vulnerable to buffer overflow errors if NodeBrain has bugs, there is no risk in running it without security.

For this tutorial, the files are in the tutorial/Webster subdirectory of the distribution directory. The server script webster1 looks like this.

     #!/usr/local/bin/nb -d
     # File: tutorial/Webster/webster1
     -rm webster.log
     set out=".",log="webster.log";
     define webster node webster;
     webster. define uri cell "http://0.0.0.0:62443");
     webster. define Authenticate cell "no";  # Default is "yes"

A Webster server is specified as identity@interface:port. You are using the default identity, all interfaces "0.0.0.0", and port 62443. The "443" reminds you that you'd prefer to use HTTPS in a real application. Change the port number if 62443 is used on your system.

If there are no errors in the log file, you can leave your server running and connect with your web browser using the following URL.

     http://hostname:62443

This tutorial continues on the page displayed by your browser.


Next: , Previous: Tutorial, Up: Top

3 Commands

3.1 Define

Syntax

websterDefinition ::= define s* term s* node [s* " identity " ] [;] •
identity ::= Identity for commands issued by the webster node.
cellOption ::= term. define option cell value [;] •
textOption ::= term. define websterModuleOption text: value
option ::= tlsApiOption | websterApiOption | websterModuleOption
tlsApiOption ::= See list below
websterApiOption ::= See list below
websterModuleOption ::= See list below

The following NodeBrain TLS API options are specified as cells within the context of a Webster node.

Option Description
uri Protocol, interface, and port
Default: "https://0.0.0.0:49443"
option Authentication option
Default: "CERTS"
timeout Read timeout seconds
Default: 5
keyfile File containing the server key
Default: "security/ServerKey.pem"
certfile File containing the server certificate
Default: "security/ServerCert.pem"
trustfile File containing the server key
Default: "security/TrustedCertificates.pem"

The following NodeBrain Webster API options are specified as cells within the context of a Webster node.

Option Description
Filter NodeBrain translator used as web application filter
Define: -none-
DocumentRoot Root directory for web pages
Default: "web"
IndexPage Page selected by default when resource is a directory
Default: "index.html"
IndexQuery Parameters if the IndexPage accepts them (e.g. cgi script)
Default: -none-
Authenticate Authentication option "yes" | "certificate" | "password" | "no"
Default: "yes"
AccessList Access control list file [deprecated - see Authorize]
Default: "security/AccessList.conf"
Config Configuration file name - see next block of options below
Default: ""

The following Webster module options are specified as string or text cells within the context of a Webster node.

Option Description
Title Title displayed in the center of a Webster page heading
Default: "MyCaboodle"
Link Link associated with the title in Webster page heading
Default: "http://nodebrain.org"
Menu Menu displayed in top right area of Webster page heading
Default: "<a href=':page'>Webster</a>"
Version Application version number to display in Webster page heading
Default: ""

When Webster module options are specified in a configuration file identified by the Config option and illustrated below, the values specified in the configuration file override values specified as cells.

     # Comment lines start with "#".
     # Blank lines are allowed
     Title="MyCaboodle";
     Version="";
     Link="http://nodebrain.org";
     Menu="<a href=':page">Webster</a>";

One reason you want to use a configuration file is to share these options with cgi scripts.


Next: , Previous: Commands, Up: Top

4 Triggers

The Webster module does not implement any triggers


Next: , Previous: Triggers, Up: Top

Licenses

NodeBrain is free software; you can modify and/or redistribute it, including this document, under the terms of either the MIT License (Expat) or the NodeBrain License.


MIT License

Copyright © 2014 Ed Trettevik <eat@nodebrain.org>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


NodeBrain License

Copyright © 2014 Ed Trettevik <eat@nodebrain.org>

Permission to use and redistribute with or without fee, in source and binary forms, with or without modification, is granted free of charge to any person obtaining a copy of this software and included documentation, provided that the above copyright notice, this permission notice, and the following disclaimer are retained with source files and reproduced in documention included with source and binary distributions.

Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.


Previous: Licenses, Up: Top

Index