# The CoffeeMud CM1 Server
Security Configuration Protocol | The CoffeeMud CM1 Server is a control and monitoring service for your mud. It allows external applications and tools to access, monitor, and alter your mud in a safe, secure, and formalized manner. There frankly isn't much you can do with it now (Well, there IS, but it is neither well documented yet, nor is there a proper client). However, the intention is for this to act as a build port for external tools or even external game clients. ## Security The CM1 Server may be bound to 127.0.0.1 (localhost) - this means it will not accept external connections. The access available to unauthorized clients is limited to a small number of trivial commands. Connections that use LOGIN command to be authorized as users are limited by their user security level. Connections that use the REGISTER command to be authorized are limited to communication commands. ## Configuration The default installation of CoffeeMud will run a single CM1Server, determined by the line 'RUNCM1SERVER=true' in 'CoffeeMud.ini', and configured by the ini file defined by 'CM1CONFIG=/web/cm1.ini'. Either setting can cause the server not to start. The INI fils for the cm1 server lives in the 'web/' directory off the CoffeeMud root. The file is called cm1.ini, and contains the following entries: PORT=xx : [REQUIRED] (e.g.25) Sets the port number the server will listen for CM1 requests on; this cannot be the same port as the main MUD server or web servers. Identical to MUD server usage. There is normally no good reason to change from 25, as that is what email clients will expect. BIND=addr : (e.g.127.0.0.1) Causes the server to be bound to a specific address; this is useful on multi-homed machines or if you wish to prevent public access to the pages. Identical to MUD server usage. IDLETIMEOUTMINS=xx : [REQUIRED] (e.g. 10) The maximum amount of time the cm1 server will tolerate idleness before kicking a connection out. This is in minutes. MAXTHREADS=xx : [REQUIRED] (e.g. 10) The maximum number of threads that your server will spawn to handle connections. QUEUESIZE=xx : [REQUIRED] (e.g. 512) The maximum number of requests to queue up for processing, when all threads are active. ## Protocol By default, the CM1 server listens on port port 27733. The interface is standard ascii, so you can test the service by telnetting to it. However, no formal telnet codes are supported. After connecting to the server, the client will receive a single line greeting, the phrase: CONNECTED TO CM1SERVER0@27733 After this, all output from the server will be be according to the following rules: 1. Output will begin with a bracket [ 2. The first bracket will be followed by the string OK, FAIL, MESSAGE, or BLOCK. 3. All output, except for BLOCK, will be terminated by a closing bracket ] and a carriage-return followed by a linefeed: \r\n 4. All output, except for BLOCK, is guaranteed to not contain any carriage-return or linefeed characters. 5. All output, except for [MESSAGE, will only be generated in response to input. [OK...] An output string beginning with OK may be followed by a space, and one or more parameters, space delimited. This denotes that the command executed successfully. [FAIL...] An output string beginning with FAIL will be followed by a space, and a string describing the nature of the failure. This denotes that the command failed to execute successfully, usually because of bad input, but for other reasons also. [MESSAGE...] An output string beginning with MESSAGE will be followed by a space, and a one or more parameters, space delimited. This is the only string that need not be in direct response to a command, but according to a request for event notification. [BLOCK <end of block string>] An output string beginning with BLOCK will be followed by a space, and a random string. All ouput from the end of this output line to the next occurrence of the given end of block string is the full intended output. This output may contain other end of line characters, which are part of the output string. All input commands are terminated by some combination of carriage-return, linefeed, or both, except when the BLOCK command is used.