| CROSSBOW.CONF(5) | File Formats Manual (urm) | CROSSBOW.CONF(5) |
crossbow.conf —
configuration file for
crossbow(1)
crossbow(1) attempts to
load the configuration from ~/.crossbow.conf,
$XDG_CONFIG_HOME/crossbow.conf,
or ~/.config/crossbow.conf in that order. The
configuration file is case sensitive. Lines can be indented by any number of
white-spaces (according to the
isspace(3) definition). Empty lines,
and lines starting with ‘#’ are
ignored.
Settings are defined by statements in the form
key value
A single white-space character separates key
from value. Everything that follows the separator, up to
the next line-feed character, is considered part of value.
This includes any surrounding white-space and
‘#’ character.
The configuration defines global settings, settings for feeds, and settings that apply to multiple feeds.
The list of global settings is defined at the beginning of the configuration file. Each "feed" or "group" key declares a new feed or group, respectively, and is followed by a list of settings that apply to it.
If a value represents a path on the filesystem,
and is prefixed with ‘~/’, the heading
‘~’ character is expanded to the
content of the $HOME environment variable. Relative
paths are interpreted relative to the directory where
crossbow(1) is invoked.
See EXAMPLES below.
jobs
NDefaults to 10.
persist_dir
pathDefaults to ~/.crossbow.
compat
vThe software execution will fail if the configuration file is found to be marked with a compat value different from the expected, or if the setting is missing. If this happens, the expected compat value is printed on stderr(3). The purpose of this setting is to avoid surprising behaviours after the upgrade to a new release of crossbow(1). See Compatibility Migration for information on how to migrate the configuration to be compatible with the current release.
chdir
pathexec or
pipe, execute the subprocess in the given
directory.
Defaults to ./
command
format-stringexec or
pipe, use format-string as a
command template, expanding it into the argument vector of the subprocess.
The template is split on white-space, with the first item being the command to execute and the subsequent items being the arguments. The accepted syntax allows to use printf(3)-like placeholders that are substituted with the fields of the processed entry, so that they can be made available to the subprocess.
Security
remark: Doing proper shell escaping against untrusted input is
really hard which is why the template is not parsed by means of a shell
interpreter. Constructing an interpreted code snippet within a command
template (e.g. by invoking ‘sh
-c’) is strongly discouraged, as it might result in
accidental or malicious code injection.
See crossbow-format(5).
feed
nameThis setting is special in that it marks the beginning of a feed section in the configuration file. Every settings that follows, up to the next feed section or to the end of file (whichever comes first) will be applied to the declared feed.
The provided name identifies the feed. All feeds must have
distinct names. Feed names are forbidden to contain the
‘/’ character.
format
format-stringprint, use
format-string as a template for the textual
representation of each handled feed entry. The template uses the same
printf(3)-like syntax as the
command setting. See
crossbow-format(5).
This setting is optional: if not provided, the print handler will use the default representation.
handler
handlerprintformat setting.
This is the default handler for feeds that do not define one.
execcommand setting to be defined.pipeexec, but the content (corresponding to
the ‘%c’ placeholder, see
crossbow-format(5)) is
also made available to the subprocess by means of a
pipe(2), This handler requires
the command setting to be defined.inherit
groupinherit
multiple times it is possible to inherit from multiple groups. In case of
clash, the settings from the last inherited group take precedence.
Settings specified within the feed section take precedence over those
inherited by any group.url
URLThe allowed remote protocols are HTTP, HTTPS, and Gopher
(using the ‘http://’,
‘https://’ and
‘gopher://’ URL schemas
respectively). Local file-system access (using
‘file://’)is possible too. HTTPS
is the default protocol when no schema is specified.
This setting must be defined for each feed.
Here follows a list of settings that can be specified for a group. The meaning is the same as defined above for feeds.
This section explains how to migrate the configuration from compat value 0 to 1. By compat value 0 here we mean a configuration compatible with crossbow(1) 3.0.0, although versions before 4.0.0 do not recognize any versioning information in the configuration file.
Concerning the format strings (See crossbow-format(5)):
%cm’ (‘contributor
email’), ‘%cr’
(‘rights’), ‘%ct’
(‘rights type’), ‘%cu’
(‘contributor uri’),
‘%d’ (‘summary’ /
‘content’), ‘%dt’
(‘summary type’ / ‘content type’),
‘%el’ (‘enclosure
length’), ‘%en’
(‘enclosure’), ‘%et’
(‘enclosure type’),
‘%eu’ (‘enclosure
url’), ‘%sr’
(‘source’), ‘%su’
(‘source url’), ‘%tt’
(‘title type’).%c’ (‘contributor
name’) has been redefined as ‘content’.%ca’ (‘category’),
‘%s’ (‘summary’).Furthermore, care should be taken concerning the use of the
pipe handler, since the new implementation takes
advantage of the
‘<content:encoded>’ element
(extension of RSS).
‘<content:encoded>’ is
preferable to ‘<content>’
because it is more likely to contain full article, but as a drawback it
might turn out to be HTML-encoded.
In the following example, the compat and
jobs settings are global. The
group key is used to define two groups named
"alt_dir" and "download" respectively.
The feed key introduces a feed named
"debian", fetching the
"https://micronews.debian.org/feeds/feed.rss" URL. The
"curl" command will be executed for each new entry, in accordance
to the handler and command
settings, that are inherited from the "download" group. The
subprocess will be executed from the
"$HOME/webpages.2" directory rather than
"$HOME/webpages", since the inheritance
from the "alt_dir" group is declared after the inheritance from
"download" group.
compat 1 jobs 5 group alt_dir chdir ~/webpages.2 group download handler exec command curl -o %n.html %l chdir ~/webpages feed debian url https://micronews.debian.org/feeds/feed.rss inherit download inherit alt_dir
Giovanni Simoni <dacav@fastmail.com>
| July 17, 2025 |