Sputnik's behavior is controlled by two sets of values. One is the parameters passed to Sputnik's run function. This is where all boot-strapping configurations should go. For instance, if you are using Sputnik with CGI, your sputnik.cgi might look as follows:
#! /bin/bash /tmp/sputnik3/bin/wsapi.cgi
require('sputnik')
return sputnik.new_wsapi_run_fn{
VERSIUM_PARAMS = { '/tmp/sputnik3/wiki-data/' },
BASE_URL = '/sputnik.cgi',
}
Here we are setting the two parameters that are absolutely required. VERSIUM_PARAMS tells
Sputnik where to look for data and BASE_URL tells it how to refer to its own pages.
There are several other parameters that you might want to define here:
SECRET_CODE- a code that will be used for salting hashes and setting cookies. (Sputnik's default is not very secret, since you can find it in sputnik's subversion repository.)CONFIG_PAGE_NAME- the name of the node where Sputnik will look for further configurations (_config by default)LOGGER- which lualogging logger to use if any (defaults to no logging)LOGGER_PARAMS- parameters to setup pass to the logger when initializing itROOT_PROTOTYPE- the root prototype (defaults to@Root)PASS_PAGE_NAME- the name of the node where passwords are stored (defaults to_passwords)
When a sputnik instance is created, it loads the node specified in CONFIGPAGENAME and reads further configurations from it. See _config.