Synopsis
$CLICRAFT_CONFIG/clicraft.conf
Description
Clicraft’s main configuration file is clicraft.conf
, which is stored in a
directory referred to as $CLICRAFT_CONFIG
. This directory can be specified
through several different methods. In order of preference:
-
The argument to the
--config
command line option -
The
$CLICRAFT_CONFIG
environment variable -
$XDG_CONFIG_HOME/clicraft/foo
, where foo is how clicraft was invoked -
$XDG_CONFIG_HOME/clicraft/default
-
/usr/local/etc/clicraft
If $XDG_CONFIG_HOME
is not set in your environment, clicraft uses
~/.config
instead. Clicraft searches the directories above and uses the
first one it finds for $CLICRAFT_CONFIG
. If the $CLICRAFT_CONFIG
directory
is empty, clicraft populates it with default config files from /usr/local/etc/clicraft
.
The format for clicraft.conf
is bash, so configuration options take the form
OPTION="value"
(with no whitespace on either side of the equals sign (=
)).
This file is sourced from within clicraft before the default values are set,
so you must take care to initialize any options that another option depends
on. For example, if you set SERVER_JAR=$SERVER_DIR/custom_server.jar
without
setting SERVER_DIR
first, clicraft will look for /custom_server.jar
, which
is probably not what you want.
An example default file is located at $CLICRAFT_CONFIG/clicraft-defaults.conf
. It
is fairly well-commented, so it may be easiest to simply copy it to
$CLICRAFT_CONFIG/clicraft.conf
and follow the directions inside for customization.
Options
In addition to the options listed below, clicraft.conf
can include any extra
variables you wish to use in custom action scripts.
- MULTIPLEXER="multiplexer"
-
The terminal multiplexer to use. Valid values are "tmux" and "screen".
Default:
"tmux"
- SERVER_DIR="/path/to/server/directory"
-
The directory that the server is launched from. Clicraft switches to this directory before performing any action, so this is the directory that your world data, server.properties, and server log (among other things) resides in. Most relative paths are taken with respect to this directory.
Default:
"/usr/local/var/lib/clicraft"
- SERVER_NAME="name"
-
An identifier for the server. This is the value used to set the multiplexer’s window and session names when starting the server. It is also used in some informational messages.
Default:
"minecraft"
- SERVER_JAR="/path/to/server/jar"
-
The location of the server jar on disk.
Default:
"$SERVER_DIR/minecraft_server.jar"
(but seeSERVER_TYPE
, below) - SERVER_URL="url"
-
The url to download
SERVER_JAR
from.Default:
"https://s3.amazonaws.com/Minecraft.Download/versions/%v/minecraft_server.%v.jar"
(but seeSERVER_TYPE
, below) - SERVER_LOG="/path/to/server.log"
-
The location of the server log file
Default:
"$SERVER_DIR/logs/latest.log"
- SERVER_VERSION="version"
-
The server version. This will replace any instances of
%v
inDOWNLOAD_COMMAND
. If set to "release" or "snapshot", the latest Minecraft release or snapshot version will be substituted instead.Default:
"release"
- SERVER_TYPE="type"
-
The minecraft implementation this server uses. Valid values are "minecraft" and "bukkit".
For convenience, if this option is set to "bukkit",
SERVER_JAR
andSERVER_URL
will take on default values such that the server uses Bukkit Recommended Builds, instead of the vanilla minecraft jar. That is, they will have these default values:SERVER_JAR="$SERVER_DIR/craftbukkit.jar" SERVER_URL="http://cbukk.it/craftbukkit.jar"
Default:
"minecraft"
- START_COMMAND="/path/to/command [options]"
-
The command that should be used to launch the server.
The shell expands this option twice, so care must be taken to protect whitespace and special characters.
Default:
"java -jar $SERVER_JAR nogui"
- STOP_CMD="cmd"
-
The command to send to the server console to shut the server down.
Default:
"stop"
- DOWNLOAD_COMMAND="/path/to/command [options]"
-
The command used to download or update the server jar. Running this command should result in
SERVER_URL
being downloaded and saved toSERVER_JAR
.The shell expands this option twice, so care must be taken to protect whitespace and special characters.
Default:
"curl -#fL -o $SERVER_JAR $SERVER_URL"
- TIMEOUT="seconds"
-
The amount of time, in seconds, that clicraft will wait for critical operations to finish.
Default:
"20"
- START_TIMEOUT="seconds"
-
The amount of time, in seconds, that clicraft will wait for the server to start up.
Default:
$TIMEOUT
- STOP_TIMEOUT="seconds"
-
The amount of time, in seconds, that clicraft will wait for the server to shut down.
Default:
$TIMEOUT
- CMD_TIMEOUT="seconds"
-
The amount of time, in seconds, that clicraft will wait for a command to finish when using
clicraft cmd
.Default:
$TIMEOUT
- CMD_LSTRIP="string"
-
The string to strip from the beginning of commands passed to
clicraft cmd
.Default:
"/"
- REDB="/path/to/regex/database.tab"
-
The location of the regex database. Each line of this file should consist of a key followed by a space followed by an extended regular expression. Any occurences of a slash (
/
) in the regular expression should be escaped with a backslash (\
).In addition, a regular expression which begins with two start-of-line anchors (
^^
) may have special meaning. Typically, this sequence of characters will be replaced with^timestamp
, where timestamp is the value of the timestamp database entry.Default:
"$CLICRAFT_CONFIG/redb/$SERVER_TYPE.tab"
See Also
The clicraft project page is located at http://dmbuce.github.com/clicraft/.
Bugs
Report any and all bugs to the clicraft issue tracker with as much detail as possible.
Authors
-
DMBuce <dmbuce@gmail.com>
To see a full list of contributors, use git shortlog -s
in the clicraft
git repository.