NAME
yankd.conf
—
yankd configuration file
DESCRIPTION
yankd.conf
is the runtime configuration
file for yankd(8).
The file format is line-based, with one configuration directive per line. Empty lines and comments are ignored; comments begin with a ‘#’ and extend to the end of the current line.
Macros can be defined that are later expanded in context; for example:
laddr = "192.168.1.2"
...
listen on $laddr port 2770
Macro names must start with a letter, digit, or underscore, and may contain any of those characters, but may not be any of the reserved words detailed below (e.g., server). Macros are not expanded inside quotes.
Additional configuration can be interpolated inline by including
files with the include
keyword; for example:
include "/etc/yankd.conf.local"
Except when defining the chroot or including configuration files,
paths mentioned in yankd.conf
must be relative to
the configurable chroot(2)
environment, which is /var/www/yankd by default.
GLOBAL CONFIGURATION
The available global configuration directives are as follows:
chroot
path- Set the path to the chroot(2) environment of yankd(8), which must exist and be writable by the configured user. If not specified, the default location of /var/www/yankd will be used.
prefork
number- Run the specified number of server processes. yankd(8) runs N server processes by default, where N is dependent on how many processors are online as reported by sysconf(3). This is capped at 16.
user
username- Run the yankd(8) daemon as the specified user. yankd(8) must be started with root privileges to bind listening sockets for the servers. After this, yankd(8) drops privileges to the configured user. If not specified, the default user www will be used.
SERVER CONFIGURATION
Each yankd(8) pastebin server is configured with a server context. If no server context is defined in the configuration file, or no configuration file exists, a default server is instantiated. Settings for this default server are noted in the respective directives.
A server context is declared with a unique hostname followed by server-specific directives inside curly braces. The given hostname is used to form the unique URL to pastes, which is returned to clients that send paste requests. In the default configuration, the hostname(1) of the host machine is used.
server
hostname
{...}
The optional server configuration directives are as follows:
root
path- Set the path to the root directory where pastes sent to this server will be written. The path is relative to the chroot(2) environment. If not specified, the server hostname will be used as path.
listen on
addressport
port- Configure an address and port for incoming connections. Valid
address arguments are hostnames, and IPv4 and IPv6
addresses. The port argument may be a number or a
service name defined in services(5).
Can be specified multiple times to build a list of listening sockets. However, a given address and port tuple can only be used by one server. If not specified, the default is to listen on 0.0.0.0 and ::1 on port 2770.
https
on | off- Specify whether this server can be accessed via https. When on, the "https" protocol will be used in the unique URL formed to access pastes hosted by this server. Default: off.
slug
option- Set the specified options for defining the unique slug that represents
each paste. Multiple options can be specified within curly braces. Valid
options are:
min
length- Set the minimum length of the unique slug that will form the paste URL. Default: 4.
max
length- Set the maximum length of the unique slug that will form the paste URL. Default: 32.
symbols
string- Specify the ASCII characters that define the set of symbols used to
generate the unique slug. Limited to 256 bytes in size. If this limit
is exceeded, the set will be truncated. The following characters are
illegal slug symbols and will be elided if found in the set:
Default:
<>#%"{}|\^[]`;/?:@&=+$,!'()*
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
paste
option- Set the specified options that determine paste constraints. Multiple
options can be specified within curly braces. Valid options are:
min
size- Set the minimum allowed paste size, which can be denoted with a human-readable scale as described in scan_scaled(3). Default: 0.
max
size- Set the maximum allowed paste size, which can be denoted with a human-readable scale as described in scan_scaled(3). Default: 8M.
FILES
- /etc/yankd.conf
- Default location of the
yankd.conf
configuration file.
EXAMPLES
A minimal configuration using all default values except for the prefork and server hostname values, which are dependent on the host machine:
user www prefork 3 chroot "/var/www/yankd" server "yankd.example.com" { listen on * port 2770 root "yankd.example.com" slug { min 4 max 32 symbols ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 } paste max 8388608 }
An example demonstrating two servers, which corresponds to the example httpd.conf(5) configuration shown in yankd(8):
y1 = "y1.example.com" y2 = "y2.example.com" server $y1 { listen on $y1 port 2770 root "/y1" slug { min 8 include /etc/yankd.conf.symbols } paste max 8388608 } server $y2 { listen on $y2 port 2444 root "/y2" slug min 10 paste max 1048576 }