====== Services Configuration ======

The Services Server is configured in the ''[[config:sbbs.ini]]'' file, editable using the ''[[util:SCFG]]''->Servers->Services Server menu option.

The Services Initialization file (''services.ini'') controls which Synchronet [[service:|Services]] will be available on which TCP and UDP ports. This file is located in the ''[[dir:ctrl]]'' directory.

===== Filename =====

The default base filename of the initialization file is ''[[dir:ctrl]]/services.ini''. This filename overridden by setting the ''iniFileName'' key in the ''[services]'' section of the ''[[dir:ctrl]]/[[sbbs.ini]]'' file.

The standard host/platform variations of the initialization filenames are also supported. See [[INI_files#filenaming|INI Filenaming]] for details.

===== Defaults =====

Download or view the default ''services.ini'' file here: ''[[https://gitlab.synchro.net/main/sbbs/-/blob/master/ctrl/services.ini|services.ini]]''

===== Sections =====

The [[ini files#root section]] may contain keys which will determine the default value of keys which may be over-ridden in each service's section.

Every other section in the file is a service section with the name of the service specified as the section. Example: ''[MyService]''

===== Common Keys =====

These keys may be specified in the [[ini files#root section]] where they will determine the default value for the same key in each service section. Additionally, these keys be specified within in each service section if the default value is not acceptable for that service.

^Key          ^Default Value                      ^Possible Values                     ^Description      ^
|''LogLevel''     |''[[sbbs.ini]]->[Services]'' |See [[INI Files#Enumerated Values]] |Minimum severity for log entries |
|''StackSize''    |''0''                              |0+                                  |Number of bytes to use for service thread (0=automatic)|
|''MaxClients''   |''0''                              |0+                                  |Maximum number of simultaneous clients allowed (0=unlimited)|
|''ListenBacklog''|''5''                              |1+                                  |The maximum length of the queue of pending connections|
|''Options''      |''0''                              |                                    |See [[#Options]] |

==== Options ====

In addition to the common ''[[config:sbbs.ini]]'' ''Options'' [[ini files#bit-field values]], the following options are also supported:

^ Option       ^ Description ^
| UDP          | Service uses UDP, not TCP |
| STATIC       | Service is static (runs indefinitely), not dynamic (runs for every client connection) |
| LOOP         | Service is will re-run automatically when terminated (only applicable to static services) |
| NATIVE       | Service is native program, not a script |
| FULL_ACCEPT  | Accept connections even when max connections have been reached |
| TLS          | Implicit TLS service |
| NO_USER_PROT | Do not change the user's "protocol" field upon login (v3.20c+) |
===== Service Keys =====

In addition to the [[#common keys]], each service section may include some or all of the following keys:

^Key          ^Default Value                      ^Possible Values                     ^Description      ^
|''Enabled''  |''true''                           |''true'' or ''false''               |Set to ''false'' to temporarily disable this service|
|''Protocol'' |''[//service name//]''             |Any                                 |The name of the protocol serviced by this service|
|''Interface''|''[[sbbs.ini]]->[Services]''|IP address list or blank             |Comma separated list of <IP address>:<port> pairs of the network interface to bind to.  If the port is left out, the port in the ''Port'' key is used.  For IPv6 addresses, it needs to be enclosed in square brackets [ ] if a port is specified (ie: [::]:6667) ''0.0.0.0,::'' would listen on all IPv4 and IPv6 addresses using the port specified in the ''Port'' key.  ''0.0.0.0,::,192.168.0.1:7000,[fd0b:71d1:a7f3::1]:7000'' would bind to ports specified in the ''Port'' key for all interfaces and also port 7000 on the internal networks. |
|''Command''  |                                   |Any valid command-line              |The command-line to execute to start this service|
|''Port''     |Default for ''Protocol''           |''1''-''65535''                     |TCP or UDP port number serviced by this service|
|''Host''     |                                   |Any valid hostname                  |Hostname for which this service should be executed|
|''NotHost''  |                                   |Any valid hostname                  |Hostname for which this service should not be executed|
|''JavaScript*'' |''[[sbbs.ini]]->[Services]''|  | See [[JavaScript]] for details |
|''LoginRequirements'' | //none// | [[Access:Requirements]] | [[:Access:]] requirements (in ARS format) to allow users to login |

===== See Also =====
  * [[:config:|Configuration]]
  * [[:service:|Services]]


{{tag>configuration general_config ini}}
