This is an old revision of the document!
Table of Contents
INI Files
Configuration
Synchronet supports a variety of configuration files of different formats. A growing majority of these configuration files are of the INI file type. Synchronet's INI configuration files are typically stored in the ctrl
directory, with a .ini
filename suffix/extension.
For the configuration files in the ctrl
directory which are not in INI format, there are two basic groups.
CNF Files
These are binary files which are maintained by scfg. These feature an auto-backup system configured via Advanced Options.
Text configuration files
Most of the rest of the files in the ctrl directory are text files with an ad-hoc format. Many of these have a .cfg extension but are formatted in completely different ways. Viewing the file may show documentation on the format in commas at the top.
Database
INI files are also sometimes used for data storage (not related to configuration). This is popular with some JavaScript modules. Such files are typically stored in the data
or xtrn
directory hierarchies. When INI files are used for data storage purposes, they may or may not have a .ini
file suffix/extension.
Filenaming
Synchronet supports a variety of configuration files of different formats. A growing majority of these configuration files are of the INI file type. Synchronet's INI files are typically stored in the ctrl
directory, with a .ini
filename suffix/extension.
All of Synchronet's INI filenames support a flexible naming convention so multi-host BBSes can share the same ctrl
directory, but have a subset of unique INI files particular to each host.
This flexible naming takes the normal base filename, for example, ctrl/services.ini
, and allows for the local host's name (host name or host.domain name) or platform description (e.g. “linux” or “win32”) to be inserted before the .ini
filename suffix/extension.
The order of preference (using ctrl/service.ini
as an example base filename) is:
ctrl/services.host.domain.ini
ctrl/services.host.ini
ctrl/services.platform.ini
ctrl/services.ini
NOTE: Only one file is actually used per host.
Case Sensitivity
The INI filenames are not case sensitive.
Syntax
Synchronet uses the XPDEV library for it's INI file parsing and creation. The XPDEV INI file syntax closely matches that of the common use in Windows applications with a few minor exceptions.
Root Section
Some Synchronet INI files support the concept of a root section, that is, a virtual section that consists of a set of key=value
pairs in the file before any [section]
tags. The root section is typically used for global or default values for other sections in the INI file. In some INI files, the root section is the only supported section and discovery of any [section]
tags will terminate the file.
Directives
INI file directives must be on a line by themselves and must begin with the !
character.
EOF
A premature end-of-file may be defined by using the !eof
directive. No lines after this directive will be parsed by the INI file parser.
Example:
!eof
Include
Some INI files support the embedding of other files using the !include filename
directive.
Example:
!include another.ini
Editing
When an INI file must be edited by hand, any good text file editor should work fine.
Line Termination
Lines may be terminated with a single LF character (Unix style) or CR/LF pair (DOS/Windows style).
Line Lengths
Each line in an INI file cannot be more than 2045 characters in length.
Values Lengths
The maximum length of a value that may be assigned to key (e.g. key=value
) is 1023 characters.