Core Jarvis
Configuration - Core Jarvis
The N2C5 configuration file is a Jarvis configuration file in XML format.
This file contains both core Jarvis configuration parameters, and also custom N2C5 parameters. The standard Jarvis parameters are all described in detail in the Jarvis Documentation. They are summarised here for convenience.
The “jarvis” element is the root container for Jarvis configuration.
<jarvis>
Application Element
Inside here, the “app” element defines the configuration for the N2C5 application.
<app use_placeholders="yes" format="json" debug="no" dump="no" log_format="[%P/%A/%U/%D] %M">
It has the following attributes:
- use_placeholders = “yes” : Indicates that bind variables should be used for all SQL statements. This is the preferred setting as it is more secure against SQL injection attacks.
- format = “json” : Instructs Jarvis to return data in JSON format as expected by the N2C5 client-side application.
- debug = “no” : Set to “yes” if you wish to enable server-side debug to the apache error log file (usually /var/log/apache/error.log). This is useful for resolving faults. Enabling Jarvis debug will usually have a noticable impact on application performance.
- dump = “no” : Set to “yes” to enable even more trace output in the server side apache error log.
- log_format = “[%P/%A/%U/%D] %M” : Defines the log format for output into the apache error log file. The default value is usually appropriate.
Tracker Configuration
The “tracker” element configures behaviour for the Jarvis “Tracker” application.
<tracker logins="no" requests="no" errors="no">
The Jarvis “tracker” application is an optional component which logs Jarvis requests into a dedicated standalone database (not the SMF database). This information can be useful for performance and user-pattern analysis, as well as for an independent auditing tool. However, the “Tracker” application is disabled by default and should only be enabled if requested by N-Squared software.
Router Configuration
The “router” element informs Jarvis of RESTful routes which allows the arguments to be used as named parameters in our queries. This configuration should not be modified.
<router>
<route path="/rate_table/:id" dataset="rate_table"/>
<route path="/tariff_plan_selector/:id" dataset="tariff_plan_selector"/>
</router>
Library & Dataset Paths
The “default_libs” element informs Jarvis which directories should be searched for runtime modules. The install-time values should not be modified.
<default_libs>
<lib path="/usr/share/n2c5-dev/jarvis/plugin"/>
<lib path="/usr/share/n2c5-dev/jarvis/hook"/>
<lib path="/usr/share/n2c5-dev/jarvis/login"/>
<lib path="/usr/share/n2c5-dev/lib"/>
</default_libs>
The “dataset_dir” attribute informs Jarvis which directories should be searched for SQL configuration files. The install-time value should not be modified.
<dataset_dir>/usr/share/n2c5-dev/jarvis/datasets</dataset_dir>
Session Database
The “sessiondb” attribute defines the configuration and storage location for N2C5 session cookie information.
<sessiondb store="driver:file;serializer:default;id:md5" expiry="+1M" cookie="N2C5_CGISESSID">
<parameter name="Directory" value="/tmp"/>
</sessiondb>
Note: By default, multiple parallel N2C5 installs (e.g. “model”, “test”, “dev”) will share a common cookie name “N2C5_CGISESSID” and storage directory “/tmp/”. This means that logging into any installation will automatically give you access to the other two. If this is not desirable, then change the cookie names to distinct values.
- store = “driver:file;serializer:default;id:md5” : Specifies file-based server-side cookie storage, with MD5 hash checksums. This default should not be changed.
- expiry = “+1M” : Specifies that cookies expire 1 Month after use. This default value is quite long. You may wish to reduce this to e.g. “+5d” (5 days) or “+4h” (4 hours) or “+40m” (40 minutes).
- cookie = “N2C5_CGISESSID” : Defines the cookie name. See notes below.
- <parameter name=“Directory” value=“/tmp”/> : Specifies the directory for server-side cookie storage.
NCC Database
The “database” element configures parameters for the external DBI database connections used by Jarvis. There is currently only one database connection used by N2C5, and it has the following parameters.
<database name="smf" username="smf" password="s3cur3"
connect="dbi:Oracle:host=10.42.2.151;port=1521;sid=SMF" />
- name = “smf” : This denotes the database connection which connects to the “SMF” database for this N2C5 instance.
- username = “smf” : The Oracle username for the connection. The N2C5 system uses connection-pooling for efficiency, and hence needs to connect as the “smf” user.
- password = “<password>“ : Specify the password for the “smf” user.
- connect = “dbi:Oracle:host=10.42.2.151;port=1521;sid=SMF” : This is the DBI connection string for an Oracle DB. Specify the host, port and Oracle SID as indicated.
Other configuration parameters are described in the following sections. Note that although plugins are a core Jarvis feature, the nature of their individual configuration means that they have been documented in a separate page, N2C5 - Configuration - Plugins.