Getting started with blue-phrase

Configuration Syntax

Preliminaries

This note describes the syntax used within server configuration files.

Configuration files are encoded using blue-phrase notation. They must adhere to the following syntactic rules:

Pragmas

The first line of the file contains the blue-phrase version pragma. Currently version 2.0 is the only version used.

!blue 2.0        

A complete configuration file can be assembled from partial configuration files using include pragmas, which begin with the include keyword and are followed by a filename path, which is delimited with GRAVE-ACCENTS. The path may be an absolute file system path, or a path relative to the current file.

!include `./login.example.com`
!include `./www.example.com`

Comments

Comments may be used anywhere, and come in two varieties:

  • Terminal comments begin with two consecutive SOLIDI.
  • Multi-line comments begin with a SOLIDUS-ASTERISK and end with an ASTERISK-SOLIDUS.

Blank lines are ignored.

// A terminal comment

/*
A multi-line comment
*/

Sections

The remainder of the file is composed of sections beginning with a keyword, followed by an opening LEFT-CURLY-BRACKET, followed by single-line entries and subsections, and terminated with a RIGHT-CURLY-BRACKET.

server {
// single line entries
subsection {
}
}

There are two top-level section keywords: server and host. All configuration settings must be included within one of these.

Single-line entries

Entries are single-line items — beginning with optional whitespace — consisting of keywords, plain-text values, sourcerefs, attributes, and comments.

Sourcerefs are filename paths that are enclosed in GRAVE-ACCENTS.

Attributes consists of four parts: an ASTERISK, a keyword, the EQUALS-SIGN and a value, where the value must be enclosed in matching APOSTROPHES or QUOTATION-MARKS if it contains any whitespace.

keyword                                 // a keyword by itself
keyword value // a keyword followed by a plain-text value
keyword `path/to/filename` // a GRAVE-ACCENT-delimited sourceref
keyword *attribute=value // an attribute
keyword *attribute="having white space" // an attribute enclosed in QUOTATION-MARKS

Review

Key points to remember:

  • Configuration files are written using blue-phrase syntax comprising sections, subsections, single-line entries, comments and pragmas.

Getting started with blue-phrase