en cs

Nocheto HTTP API v 0.3/04 / Example 0.4

This is the example for HTTP API version 0.3 (Nocheto 2.8.0) and version 0.4 (Nocheto 3.3.0).
The API v 0.3 is limited by Nocheto 2.X functionality, therefore not every funtcion in this example works with this API version.

Example v 0.42.8.0 and 2.3.0

Download: http_0.4.zip (Sign in to download the file).

Installation

Unpack the zip archive and move the http/ directory into ~/.nocheto/ directory.

Usage

Run nocheto with the --future option and then execute the http command.
Open http://localhost:8080/ in your web browser.

Configuration

This is the description of the [http] config section for Nocheto 3.3.0.
For Nocheto 2.8.0 please use configuration from example v 0.3.

Add the following section into your configuration file (i.e. ~/.nocheto/config/nocheto.ini).


[http]
port = 8080
address = "127.0.0.1"
whitegrouplist="game;sheet;edit;navigate;properties;analyze;help"
whitelist = "treenumber;quit;listboards;listthemes;listipv4;sync;echo;error"
blacklist = "pgn;pgn+;save;save!;printpgn;printpgn!;printsheet;printsheet!;autoboard;abo;setautoboard;switchsounds;setsounds;aliases"
rootdir = "/home/<your home dir>/.nocheto/http/"
authentication = ""
requestlogfile = ""

Now you can run the http command and open the corresponding URL in your internet browser (for example http://127.0.0.1:8080/).

port2.4.0

port="8080"

Port number where nocheto will accept HTTP connections.

address2.4.0

address="127.0.0.1"

IP address where nocheto will accept HTTP connections.
Use 0.0.0.0 to accept from all available addresses.

whitelist2.4.0

whitelist = "treenumber;quit;listboards;listthemes;listipv4;sync;echo;error"

List of allowed commands accepted by nocheto through the HTTP api.

whitegrouplist3.3.0

whitegrouplist = "game;sheet;edit;navigate;properties;analyze;help"

List of groups of commands which will be accepted by nocheto through the HTTP api.
See help command to list the groups and theirs commands.
Note: This is not available in 2.7.X nocheto!.

blacklist3.3.0

blacklist = "pgn;pgn+;save;save!;printpgn;printpgn!;printsheet;printsheet!;autoboard;abo;setautoboard;switchsounds;setsounds;aliases"

List of disallowed commands which will not be accepted by nocheto through the HTTP api even if they are part of whitelist or in group in whitegrouplist.
Note: This is not available in 2.7.X nocheto!.

rootdir2.4.0

rootdir = "<$HOME>/.nocheto/http/"

Root directory for files provided by nocheto through the HTTP API.
Default is the ~/.nocheto/http/ directory.

authentication3.0.0

authentication = ""

Http authentication in base64 encoding.
Default value is bm9jaGV0bzpub2NoZXRv (=base64('nocheto:nocheto'))

requestlogfile3.0.0

requestlogfile=""

Path to a file where nocheto will log HTTP requests (if set).