aboutsummaryrefslogtreecommitdiff
path: root/doc/wydawca.texi
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-28 18:54:48 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-28 18:54:48 +0200
commit5fc738e4d43eb708428c4b30e60e570e2dd55470 (patch)
treea96f33c70162ff8a825b800fc9276360d95d154a /doc/wydawca.texi
parent514797c56e431f37de9a00834281f990a7b15c46 (diff)
downloadwydawca-5fc738e4d43eb708428c4b30e60e570e2dd55470.tar.gz
wydawca-5fc738e4d43eb708428c4b30e60e570e2dd55470.tar.bz2
Various fixes
* doc/Makefile.am: Improve checking and final rules. * doc/fdl.texi, doc/rendition.texi: Use single-space sentence separators. * doc/wydawca.texi: Update. * src/config.c (cb_email_address): Accept a list of addresses. * src/meta.c (meta_expand_string): Take two additional arguments. Quote expansions if they are provided. * src/triplet.c (triplet_expand_method_query): New function. * src/mail.c, src/verify.c: Use triplet_expand_method_query * src/wydawca.h: Update. * src/meta.c (meta_escape): Remove.
Diffstat (limited to 'doc/wydawca.texi')
-rw-r--r--doc/wydawca.texi1031
1 files changed, 560 insertions, 471 deletions
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 589f2f7..237f196 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -37,11 +37,11 @@ Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
-and with the Back-Cover Texts as in (a) below. A copy of the license
+and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled ``GNU Free Documentation License''.
(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
+this GNU Manual, like GNU software. Copies published by the Free
Software Foundation raise funds for GNU development.''
@end copying
@@ -89,6 +89,7 @@ already listed, mentioned here so you can get to them in one step:
How to Configure @command{wydawca}.
+* Syntax:: Configuration file syntax.
* syslog::
* sql::
* access methods::
@@ -97,12 +98,32 @@ How to Configure @command{wydawca}.
* statistics::
* notification::
+Configuration file syntax
+
+* Comments::
+* Pragmatic Comments::
+* Statements::
+* Preprocessor::
+
+Access Methods
+
+* sql type::
+* builtin type::
+* external type::
+
+SQL Access Methods
+
+* gpg-key-sql::
+* project-owner-sql::
+* user-data-sql::
+* verify-user-sql::
+
Mail Notification
-* mailer::
-* templates::
-* statreports::
-* event notification::
+* mailer::
+* templates::
+* statreports::
+* event notification::
@end detailmenu
@end menu
@@ -184,8 +205,8 @@ effective and consumes little resources.
@cindex operation
@cindex overview
Usually, @command{wydawca} is installed on the machine that receives
-release uploads. It may be run either periodically as a cron-job, or
-as a standalone daemon. It supposes that both upload and distribution
+release uploads. It may be run either periodically as a cron-job, or
+as a standalone daemon. It supposes that both upload and distribution
directories are accessible in the local file system hierarchy. If that
is not the case (e.g. if upload and distribution sites are handled by
different machines), one of them should be mounted using
@@ -232,7 +253,7 @@ Standalone directives}.
Each @dfn{incomplete} triplet, i.e. such that misses one or more
necessary files, is then verified by checking if the modification
date of its oldest file is older than a predefined amount of time
-(@pxref{file-sweep-time}), and if so, all files from this triplet are
+(@FIXME-pxref{file-sweep-time}), and if so, all files from this triplet are
removed (an @dfn{expired triplet}). This gives users the possibility
to restart interrupted or otherwise broken uploads later.
@@ -354,7 +375,7 @@ detected, and withs status 1 otherwise.
@opindex -E, introduced
@xopindex{no-preprocessor, introduced}
Before parsing, configuration file is preprocessed using
-@command{m4} (@FIXME-pxref{Preprocessor}). To see the preprocessed
+@command{m4} (@pxref{Preprocessor}). To see the preprocessed
configuration without actually parsing it, use @option{-E} command
line option. To avoid preprocessing it, use
@option{--no-preprocessor} option.
@@ -383,13 +404,14 @@ directives any time by running @command{wydawca --config-help}.
There are three classes of lexical tokens: keywords, values, and
separators. Blanks, tabs, newlines and comments, collectively called
@dfn{white space} are ignored except as they serve to separate
-tokens. Some white space is required to separate otherwise adjacent
+tokens. Some white space is required to separate otherwise adjacent
keywords and values.
@menu
* Comments::
* Pragmatic Comments::
* Statements::
+* Preprocessor::
@end menu
@node Comments
@@ -469,7 +491,7 @@ compatibility with the @sc{c} preprocessor.
In fact, these statements provide a rudimentary preprocessing
features. For more sophisticated ways to modify configuration before
-parsing, see @FIXME-ref{Preprocessor}.
+parsing, see @ref{Preprocessor}.
@node Statements
@subsection Statements
@@ -478,7 +500,7 @@ parsing, see @FIXME-ref{Preprocessor}.
@cindex statement, simple
@cindex simple statements
A @dfn{simple statement} consists of a keyword and value
-separated by any amount of whitespace. Simple statement is terminated
+separated by any amount of whitespace. Simple statement is terminated
with a semicolon (@samp{;}).
Examples of simple statements:
@@ -561,6 +583,44 @@ example above:
@end group
@end smallexample
+@anchor{meta-interpretation}
+Depending on the context, the contents of a quoted string may be
+subject to @dfn{meta-variable interpretation}. During this process,
+any sequence
+
+@smallexample
+$@{@var{var}@}
+@end smallexample
+
+@noindent
+where @var{var} is the name of a defined meta-variable, is replaced with
+the value of the variable. This sequence is called @dfn{meta-
+reference}. For example, if the meta-variable @samp{user} has the
+value @samp{smith}, then the string
+
+@smallexample
+"where user = '$@{user@}'"
+@end smallexample
+
+@noindent
+becomes
+
+@smallexample
+"where user = 'smith'"
+@end smallexample
+
+If the name of the variable consists of a single character, the curly
+braces around it may be omitted. Thus, @code{$@{u@}} and @code{$u} are
+equivalent.
+
+If @var{var} is not defined, the meta-reference is left unchanged.
+
+To insert a literal @samp{$} character in a string that is subject to
+meta-variable interpretation, duplicate it: @samp{$$}.
+
+The exact set of defined meta-variables and their values depend on the
+context and are discussed in detail below.
+
@anchor{here-document}
@item Here-document
@cindex here-document
@@ -569,8 +629,8 @@ strings of text containing embedded newlines.
The @code{<<@var{word}} construct instructs the parser to read all
the following lines up to the line containing only @var{word}, with
-possible trailing blanks. Any lines thus read are concatenated
-together into a single string. For example:
+possible trailing blanks. Any lines thus read are concatenated
+together into a single string. For example:
@smallexample
@group
@@ -657,7 +717,43 @@ spool download @{
The closing curly brace may be followed by a semicolon, although
this is not required.
-
+
+@node Preprocessor
+@subsection Preprocessor
+@cindex preprocessor
+@cindex m4
+ Before parsing its configuration file, @command{wydawca} preprocesses
+it. The built-in preprocessor handles only file inclusion
+and @code{#line} statements (@pxref{Pragmatic Comments}), while the
+rest of traditional preprocessing facilities, such as macro expansion,
+is supported via @command{m4}, which is used as an external preprocessor.
+
+ The detailed description of @command{m4} facilities lies far beyond
+the scope of this document. You will find a complete user manual in
+@ifnothtml
+@ref{Top, GNU M4 manual, GNU M4, m4, GNU M4 macro processor}.
+@end ifnothtml
+@ifhtml
+@uref{http://www.gnu.org/software/m4/manual}.
+@end ifhtml
+For the rest of this subsection we assume the reader is sufficiently
+acquainted with @command{m4} macro processor.
+
+@cindex @file{pp-setup}
+ The external preprocessor is invoked with @option{-s} flag, which
+instructs it to include line synchronization information in its
+output. This information is then used by the parser to display meaningful
+diagnostic. An initial set of macro definitions is supplied by the
+@file{pp-setup} file, located in
+@file{@var{$prefix}/share/wydawca/@var{version}/include} directory (where
+@var{version} means the version of Wydawca package).
+
+The default @file{pp-setup} file renames all @command{m4} built-in
+macro names so they all start with the prefix @samp{m4_}. This
+is similar to GNU m4 @option{--prefix-builtin} options, but has an
+advantage that it works with non-GNU @command{m4} implementations as
+well.
+
@node syslog
@section Syslog Configuration Directives
@cindex syslog, configuration
@@ -746,7 +842,7 @@ database. Optional @var{port-or-socket} specifies port number (for
@acronym{TCP} connections) or socket name (for @acronym{UNIX} sockets)
to use. In the latter case, the @var{hostname} and the colon may be
omitted. If, however, it is present, it must be @samp{localhost}.
-@xref{sql-host}, for more information and examples.
+@FIXME-xref{sql-host}, for more information and examples.
@end deffn
@deffn {Configuration} database @var{name}
@@ -797,7 +893,7 @@ access-method @var{method-name} @{
Access method statements can appear either in the global scope of
the configuration file, or inside a @code{spool} statement
-(@FIXME-pxref{spool}). Global definitions affect all directory
+(@pxref{spool}). Global definitions affect all directory
pairs in the configuration file, and ones inside a @code{directory}
statement override them for that particular directory pair.
@@ -856,7 +952,7 @@ See below for a detailed description of these access methods.
@deffn {Configuration} query @var{string}
Sets the query used for retrieving the data. The @var{string} is
-subject to meta-variable expansion (@FIXME-pxref{meta-variables}). The
+subject to meta-variable interpretation (@pxref{meta-interpretation}). The
following meta-variables are defined:
@table @code
@@ -864,6 +960,7 @@ following meta-variables are defined:
@kwindex user
@item u
@itemx user
+@itemx user:name
The system name of the user that submitted the triplet.
@kwindex p
@@ -874,6 +971,24 @@ following meta-variables are defined:
submitted. It is defined as the value of directive
@code{directory}, or, in case this value contains slashes, the
shortest initial prefix of that value, not containing slashes.
+
+@item spool
+ The name of the distribution spool where this upload originates
+(@pxref{spool}).
+
+@item url
+ The @acronym{URL} of the spool, as set in the @code{url} statement
+of the @code{spool} block (@pxref{spool, url}).
+
+@item dir
+Directory (relative to the project distribution root) where the
+files are going to be uploaded.
+
+@item dest-dir
+Spool destination directory (@pxref{spool, destination}).
+
+@item source-dir
+Spool source directory (@pxref{spool, source}).
@end table
@end deffn
@@ -940,11 +1055,11 @@ access-method project-owner @{
type sql;
params (default);
query "SELECT user.email, user.realname "
- "FROM user,user_group,groups "
- "WHERE user_group.user_id=user.user_id "
- "AND user_group.group_id=groups.group_id "
- "AND user_group.admin_flags = 'A' "
- "AND groups.unix_group_name = '$@{project@}'";
+ "FROM user,user_group,groups "
+ "WHERE user_group.user_id=user.user_id "
+ "AND user_group.group_id=groups.group_id "
+ "AND user_group.admin_flags = 'A' "
+ "AND groups.unix_group_name = '$@{project@}'";
@}
@end smallexample
@@ -972,11 +1087,11 @@ access-method verify-user @{
type sql;
params (default);
query "SELECT user.user_name "
- "FROM user,user_group, groups "
- "WHERE user_group.user_id=user.user_id "
- "AND user_group.group_id=groups.group_id "
- "AND user_group.admin_flags = 'A' "
- "AND groups.unix_group_name='$@{project@}' "
+ "FROM user,user_group, groups "
+ "WHERE user_group.user_id=user.user_id "
+ "AND user_group.group_id=groups.group_id "
+ "AND user_group.admin_flags = 'A' "
+ "AND groups.unix_group_name='$@{project@}' "
"AND user.user_name='$@{user@}'";
@}
@end smallexample
@@ -1010,7 +1125,7 @@ their existing files.
@command{tar} file, and to a separate directory. The method to be used
is configured using @code{archive} statement. This statement can
appear either in the global scope, in which case it affects all
-spools, or within a @code{spool} block (@FIXME-pxref{spool}),
+spools, or within a @code{spool} block (@pxref{spool}),
where it affects only the given spool.
@kwindex archive
@@ -1186,7 +1301,7 @@ spool @var{tag} @{
The @var{tag} argument defines a unique identifier for this spool. It
will be used in log messages, timers (@FIXME-pxref{timers}) and in
-meta-substitutions (@FIXME-pxref{meta-variables, spool}).
+meta-variable interpretation (@pxref{meta-interpretation}).
@deffn {Configuration} url @var{string}
Defines download @acronym{URL}, associated with this spool. Its value
@@ -1264,10 +1379,9 @@ spool ftp @{
@node statistics
@section Statistics
@cindex statistics
-@UNREVISED
At the end of the run, @command{wydawca} prints a detailed
statistics of its execution on the diagnostic channel @samp{info}.
-The statistics is printed only if at least one of the items is not zero.
+The statistics is printed only if at least one of its items is not zero.
The following example illustrates what you might get if you configured
full statistics output:
@@ -1354,18 +1468,18 @@ A symlink is removed.
@end table
@kwindex statistics
- Amount of information included in the statistics summary is
+ The amount of information included in the statistics summary is
configured using the @code{statistics} statement. This statement takes
a list of arguments, each one being one of the keywords, described
above. For example, the following statement causes only the
information about errors and warnings to be printed:
@smallexample
-statistics errors warnings
+statistics (errors, warnings);
@end smallexample
@noindent
-It will produce the following output:
+The output produced looks like:
@smallexample
errors: 0
@@ -1373,28 +1487,27 @@ warnings: 2
@end smallexample
@kwindex none@r{, statistics}
- The special keyword @samp{none} can be used to suppress this output
+ A special keyword @samp{none} can be used to suppress this output
altogether (which is the default), as in
@smallexample
-statistics none
+statistics none;
@end smallexample
@kwindex all@r{, statistics}
- Another special keyword is @samp{all}, that enables all statistics
+ Another special keyword is @samp{all}. It enables full statistics
output. This keyword may also be followed by any number of statistics
keywords, which are in this case @emph{excluded} from the
summary. For example, to output all statistics, except errors and
warnings one would set:
@smallexample
-statistics all errors warnings
+statistics (all, errors, warnings);
@end smallexample
@node notification
@section Mail Notification
@cindex mail notification
-@UNREVISED
While running, @command{wydawca} keeps track of certain events
occurring, such as, for example, broken @acronym{PGP} signatures or
file uploads attempted by unauthorized users. The utility can notify,
@@ -1403,168 +1516,229 @@ concern their projects. Additionally, the system administrator can
choose to obtain via email the execution statistics, described in the
previous section.
-@kwindex from-address
The sender email address for these notifications is set using the
-@code{from-address} statement, e.g.:
+@code{from-address} statement.
+
+@deffn {Configuration} from-address @var{address}
+Set sender address for outgoing mails. E.g.:
@smallexample
-from-address ftp-uploads@@gnu.org.ua
+from-address ftp-uploads@@gnu.org.ua;
@end smallexample
+@end deffn
-@noindent
-It is not strictly necessary to specify it, however. In the absence of
-@code{from-address} statement, the sender email will be constructed
-from the name of the user @command{wydawca} runs as (usually
-@samp{root}) and the full domain name of the machine it runs at.
+It is not strictly necessary to specify the sender address. In the
+absence of @code{from-address} statement, the sender email will be
+constructed from the name of the user @command{wydawca} runs as
+(@FIXME-pxref{user privs}) and the full domain name of the machine it
+runs at.
+
+@deffn {Configuration} admin-address @var{email}
+Sets the admin email address or addresses. The statistics
+notifications and any notifications configured to be sent to admins
+will be forwarded to this address. The @var{email} argument is either
+a @acronym{RFC} 822 email address, or a list of such addresses. For
+example, the following statement configures a single admin address:
+
+@smallexample
+admin-address root@@gnu.org.ua;
+@end smallexample
+
+The example below illustrates how to configure multiple addresses:
+
+@smallexample
+admin-address "root@@gnu.org.ua,ftp-adm@@gnu.org.ua";
+@end smallexample
+
+Yet another way to configure them is:
+
+@smallexample
+admin-address (root@@gnu.org.ua, ftp-adm@@gnu.org.ua);
+@end smallexample
+@end deffn
@menu
-* mailer::
-* templates::
-* statreports::
-* event notification::
+* mailer::
+* templates::
+* statreports::
+* event notification::
@end menu
@node mailer
@subsection Mailer
@cindex mailer
-@kwindex mailer
-@UNREVISED
To send messages, @command{wydawca} uses a special logical entity
-called @dfn{mailer}. It is set in the configuration file using
-@code{mailer} keyword:
+called a @dfn{mailer}. It is set in the configuration file using
+@code{mailer} keyword.
-@smallexample
-mailer @var{url}
-@end smallexample
+@deffn {Configuration} mailer @var{url}
+Set mailer @acronym{URL}.
+@end deffn
@cindex @acronym{URL}, mailer
@cindex mailer @acronym{URL}
- A mailer @acronym{URL} begins with a protocol specification.
-Two protocol specifications are currently supported: @samp{sendmail}
-and @samp{smtp}. The former means to use a
-@command{sendmail}-compatible program to send mails. Such a program
-must be able to read mail from its standard input and must support the
-following options:
+ A mailer @acronym{URL} consists of a scheme specification, followed
+by @samp{://} separator and additional data. The @acronym{URL}s
+supported by Wydawca version @value{VERSION} are described in the
+table below. As usual, square brackets indicate optional parts:
+
+@table @asis
+@item smtp://@var{host}[:@var{port}]
+Use an SMTP server on @var{host} to relay messages. The @var{host} part is
+either an IP address in dotted-quad notation or as a symbolic host
+name. In the latter case, DNS system is be used to resolve
+it. Optional @var{port} specifies port number or symbolic name (as
+defined in @file{/etc/services}). It defaults to 25. For example:
+
+@smallexample
+mailer smtp://remote.server.net:24;
+@end smallexample
+
+@item sendmail://@var{progname}
+Use sendmail-compatible program
+@var{progname}. @dfn{Sendmail-compatible} means that the program must
+be able to read an RFC-822 message from its standard input and must
+support the following command line options:
@table @option
@item -oi
-Do not treat '.' as message terminator.
+Do not treat @samp{.} as message terminator.
@item -f @var{addr}
-Use @var{addr} as the address of the sender.
+Use @var{addr} as the sender address.
@item -t
Get recipient addresses from the message.
@end table
-These conditions are met by most existing @acronym{MTA} programs, such
-as @command{exim} or @command{postfix} (to say nothing of
-@command{sendmail} itself).
+Example:
+
+@smallexample
+mailer sendmail:///usr/sbin/exim;
+@end smallexample
+
+@item sendmail:
+This is a special form of the @samp{sendmail} mailer. It uses the
+@command{sendmail} binary from the @code{_PATH_SENDMAIL} macro in your
+@file{/usr/include/paths.h}. It is the default mailer.
-Following the protocol specification is the @dfn{mailer location}, which
-is separated from it with a colon. For the @samp{sendmail} protocol,
-the mailer location sets the full file name of the sendmail-compatible
-@acronym{MTA} binary, for example:
+@item prog://@var{progname}?@var{query}
+A @dfn{prog} mailer. This is a generalization of @samp{sendmail}
+mailer that allows to use arbitrary external programs as mailers.
+
+The full file name of the program is given in @var{progname} part.
+The @var{query} part is a list of arguments, separated by @samp{&}
+signs. Arguments may contain the following macro-substitutions:
+
+@table @samp
+@item $@{sender@}
+Expands to the sender email address.
+
+@item $@{rcpt@}
+Expands to the recipient email addresses.
+
+The program @var{progname} must read an RFC-822 message from its
+standard input.
+
+An example of @samp{prog} mailer definition:
+
+@smallexample
+mailer "prog:///bin/nullmail?localhost&-F$@{sender@}&$@{rcpt@}
+@end smallexample
+
+When sending a mail, @command{wydawca} will invoke:
@smallexample
-mailer sendmail:/usr/sbin/sendmail
+/bin/nullmail localhost -F@var{sender} @var{rcpt}
@end smallexample
-A special form of a sendmail @acronym{URL}, consisting of protocol
-specification only (@samp{sendmail:}) is also allowed. It means
-``use the sendmail binary from the @code{_PATH_SENDMAIL}
-macro in your @file{/usr/include/paths.h} file''. This is the default
-mailer.
+@noindent
+where @var{sender} means the sender address, and @var{rcpt} stands for
+the recipient email address.
-The @samp{smtp} protocol means to use an @acronym{SMTP} server directly.
-In this case, mailer location consists of two slashes,
-followed by the @acronym{IP} address or host name of the @acronym{SMTP}
-server, and, optionally, the port number. If the port number is
-present, it is separated from the rest of @acronym{URL} by a colon.
-For example:
+@item | @var{prog} @var{args..}
+Equivalent to the @samp{prog} mailer, described above, but written in
+a more natural fashion. In this notation, the example definition above
+becomes:
@smallexample
-@group
-mailer smtp://remote.server.net
-mailer smtp://remote.server.net:24
-@end group
+mailer "|/bin/nullmail localhost -F$@{sender@} $@{rcpt@}"
@end smallexample
+@end table
+@end table
+
@node templates
@subsection Message Templates
@cindex templates, notification messages
@cindex notification message template
@cindex message template
-@UNREVISED
Each notification message is build from a message template, by
-expanding any occurrences of @samp{%@{@var{name}@}} within it with the value
-of macro-variable @var{name}. Sets of defined macro-variables
-depend on the type of the notification and are described below.
+expanding meta-variables (@pxref{meta-interpretation}) within it.
+The message text may be specified either in place within the
+configuration directive it belongs to (@FIXME-pxref{notification}), or
+defined by @code{define-message} statement.
+
+@deffn {Configuration} define-message @var{name} @var{text};
+Define message @var{name} to be @var{text}. This message can be
+referred to from other configuration statements by @code{@@@var{name}}
+notation.
+@end deffn
-@kwindex define-message
- Message templates are defined using @code{define-message}
-statement. Its syntax is as follows:
+The message text must be formatted as a valid RFC-822 message, i.e. it
+must consist of two parts, message headers and body, separated by a
+single empty line. Therefore @var{text} is usually a
+@dfn{here-document} construct (@pxref{here-document}). For example:
@smallexample
-define-message @var{id} [-]@var{delimiter}
-@var{lines}
-@var{delimiter}
+define-message my-message <<EOT
+From: Wydawca
+Subject: test
+
+This is a test message.
+EOT;
@end smallexample
-@noindent
-where @var{id} is a symbolic identifier used to refer to this message
-in another configuration statements, @var{delimiter} is a delimiter
-used to mark the end of the message template, and @var{lines} are any
-number of lines that form the message template. If @var{delimiter} is
-prefixed by a minus sign, any leading whitespace will be removed from
-each template line, thus allowing to indent the template text in a natural
-way. Furthermore, the @var{delimiter} itself is optional. If it is
-omitted, the string @samp{end} is used to delimit the message.
-The following example illustrates the simplest way to define a message
-template:
+If you do not wish to supply any headers (which is unlikely, because a
+mail should at least have a @code{Subject} header), simply begin the
+message text with an empty line, like this:
@smallexample
-define-message my-message
-Subject: test
+define-message my-message <<EOT
This is a test message.
-end
+EOT;
@end smallexample
- Following is the same message template, but indented in a more
-natural way. @samp{EOT} is used as a message delimiter:
+@node statreports
+@subsection Statistic Reports
+@kwindex mail-statistics
+@UNREVISED
+Sending statistic reports to the system administrator is configured by
+@code{mail-statistics} statement.
@smallexample
-define-message my-message -EOT
- Subject: test
-
- This is a test message.
-EOT
+mail-statistics @{
+ message @var{text-or-id};
+ statistics @var{item-list};
+@}
@end smallexample
- It is important to notice, that the message template must supply
-both @acronym{RFC} 822 headers, and message body, so it must always
-consist of two parts, separated by a single empty line. If you do not
-wish to supply any headers (which is unlikely, because a mail should
-at least have a @code{Subject} header), simply begin the message text
-with an empty line, like this:
+@deffn {Configuration} message @var{text-or-id}
+Define the message text. The argument is either the message text
+template, or a reference to a template previously defined by a
+@code{define-message} (@pxref{templates}). The reference syntax is:
@smallexample
-define-message my-message -EOT
-
- This is a test message.
-EOT
+message @@@var{name};
@end smallexample
-@node statreports
-@subsection Statistic Reports
-@kwindex mail-admin-stat
-@UNREVISED
-Sending statistic reports to the system administrator is enabled by
-@code{mail-admin-stat} statement. It takes two or more arguments.
-The first argument supplies the identifier of a message template,
-which should be previously defined by a @code{define-message}.
-The rest of arguments is a list of statistics keywords as described in
+@noindent
+where @var{name} is the message name as used in @code{define-message}.
+@end deffn
+
+@deffn {Configuration} statistics @var{item-list}
+The argument is a list of statistics keywords as described in
@ref{statistics}. A report will be sent only if statistics
counters for at least one of the requested categories are not
zero. For example, the following statement requires sending
@@ -1572,21 +1746,15 @@ notifications only if there occurred any errors or access violation
attempts, or any bad signature was uploaded:
@smallexample
-mail-admin-stat stat-msg errors access-violations bad-signatures
+statistics (stat-msg, errors, access-violations, bad-signatures);
@end smallexample
+@end deffn
-@kwindex admin-address
- The recipient address for these notifications is set using
-@code{admin-address} statement. Its argument is either a single
-@acronym{RFC} 822 email address, or a comma-separated list of such
-addresses, e.g.:
-
-@smallexample
-admin-address root@@gnu.org.ua, ftp-adm@@gnu.org.ua
-@end smallexample
+The statistics message is sent to addresses configured by
+@code{admin-address} statement (@pxref{notification, admin-address}).
@cindex meta-variables in admin notifications
-The meta-variables available for use in admin notifications are:
+The meta-variables available for use in statistics reports are:
@multitable @columnfractions 0.50 0.50
@headitem Variable @tab Replaced with
@@ -1623,10 +1791,15 @@ triplets.
@item stat:rmsymlinks @tab Number of symbolic links removed.
@end multitable
+@FIXME{timers: @code{timer:@var{id}:user} }
+
An example definition of the admin notification template follows:
@smallexample
-define-message stat-msg
+mail-statistics @{
+ statistics (errors,warnings,bad_signatures,
+ access_violations);
+ message <<EOT
Subject: Wydawca stats
This is to notify you that my run on %@{date@}
@@ -1639,19 +1812,33 @@ access violation attempts .......... %@{stat:access_violations@}
Regards,
Wydawca
-end
+@}
@end smallexample
@node event notification
@subsection Event Notification
@cindex event notification
@UNREVISED
-The following @dfn{events} are tracked during the execution. Any of
+A number of @dfn{events} are tracked during the execution. Any of
them can be used to trigger an email notification of any party
concerned: the system administrator, project administrators, or
-the user that initiated the upload:
+the user that initiated the upload. These notifications are configured
+using the @code{notify-event} statement:
-@table @code
+@kwindex notify-event
+@smallexample
+notify-event @{
+ event @var{ev-id};
+ recipient @var{who};
+ message @var{text-or-id};
+@}
+@end smallexample
+
+@deffn {Configuration} event @var{ev-id}
+Send notification when the event @var{ev-id} occurs. The following
+table describes the available @var{ev-id}s:
+
+@table @asis
@kwindex success
@item success
Successful upload.
@@ -1670,33 +1857,30 @@ uploader.
The detached signature does not match the public key of the
uploader.
@end table
+@end deffn
-@kwindex notify-event
- These notifications are configured using the following statement:
-
-@smallexample
-notify-event @var{event} @var{who} @var{msg-id}
-@end smallexample
-
-@noindent
-where @var{event} is one of the events described above, @var{msg-id}
-is the identifier of a previously defined message template
-(@pxref{templates}), and @var{who} determines who should receive the
-notification. The following values for @var{who} are allowed:
+@deffn {Configuration} recipient @var{who}
+Determines who should receive the notification. The following values
+for @var{who} are allowed:
@table @code
@kwindex admin
@item admin
-The system administrator.
+The system administrator, as defined in @code{admin-address} statement
+(@pxref{notification, admin-address}).
@kwindex owner
@item owner
-Administrators of the project for which the files where uploaded.
+Administrators of the project for which the files where
+uploaded. Their addresses are retrieved using the @samp{project-owner}
+access method (@pxref{access methods}).
@kwindex user
@item user
-A user who uploaded files.
+The user who uploaded files. The user address is returned by
+@samp{user-data} access method (@pxref{access methods}).
@end table
+@end deffn
For example, the following two statements instruct @command{wydawca}
to email notifications about any @code{bad-directive-signature} event to
@@ -1704,8 +1888,17 @@ project administrators and to the user who did the upload, using two
different templates:
@smallexample
-notify-event bad-directive-signature user user-bad-directive-signature
-notify-event bad-directive-signature owner owner-bad-directive-signature
+notify-event @{
+ event bad-directive-signature;
+ recipient user;
+ message @@usermsg;
+@}
+
+notify-event @{
+ event bad-directive-signature;
+ recipient owner;
+ message @@ownermsg;
+@}
@end smallexample
The following macro-variables may be used in templates for these
@@ -1720,9 +1913,13 @@ Project system name.
@item url
@acronym{URL} of the distribution site.
+@kwindex spool
+@item spool
+Name of the spool (@pxref{spool}).
+
@kwindex dir
@item dir
-Directory (relative to the project distribution root) to where the
+Directory (relative to the project distribution root) where the
files where uploaded.
@kwindex dest-dir
@@ -1776,6 +1973,25 @@ Real name of the user who uploaded the triplet.
@kwindex user:email
@item user:email
Email of the user who uploaded the triplet.
+
+@item timer:wydawca:real
+@FIXME
+@item timer:wydawca:system
+@FIXME
+@item timer:wydawca:user
+@FIXME
+@item timer:triplet:real
+@FIXME
+@item timer:triplet:system
+@FIXME
+@item tumer:triplet:user
+@FIXME
+@item timer:spool:real
+@FIXME
+@item timer:spool:system
+@FIXME
+@item tumer:spool:user
+@FIXME
@end table
@dfn{Listings} referred to in the table above, are similar to those
@@ -1790,378 +2006,251 @@ example, here is a possible @code{%@{triplet:full@}} listing:
@end smallexample
-
The following example shows how to configure success notification
for the user:
@smallexample
-# @r{Define a message template.}
-define-message user-success
-Subject: Upload of %@{project@} successful
+notify-event @{
+ event success;
+ recipient user;
+ message <<EOT
+Subject: Upload of $@{project@} successful
-Upload of %@{project@} to %@{dir@} finished successfully.
+Upload of $@{project@} to $@{url@}/$@{dir@} finished successfully.
Files uploaded:
-%@{triplet:upload@}
+$@{triplet:upload@}
+
+Resource usage: $@{timer:triplet:real@}/$@{timer:wydawca:real@}r \
+$@{timer:triplet:user@}/$@{timer:wydawca:user@}u \
+$@{timer:triplet:system@}/$@{timer:wydawca:system@}s
Regards,
Wydawca
The Project Submission Robot
-end
-
-# @r{Use this template in a success notification.}
-notify-event success user user-success
+EOT;
+@}
@end smallexample
@node wydawca.rc
@chapter @command{Wydawca} configuration file.
@cindex configuration statements, reference
-@UNREVISED
-This chapter contains a concise reference list of all configuration
-file statements.
-
-@deffn {Wydawca Statement} archive @var{type} @var{archive-name} @
- [@var{backup-method}]
-Defines archivation and backup methods. @xref{archivation}, for a
-detailed discussion. @xref{archivation}, for a detailed explanation.
-
-The archivation type is specified by @var{type} argument:
-
-@table @asis
-@item tar
-@var{archive-name} is a full file name of the @command{tar}
-archive used for archivation. Files being archived are appended to
-that archive using @command{tar -r} command (@pxref{appending files,
-Appending Files to an Archive, Appending Files to an Archive, tar,
-@acronym{GNU} tar: an archiver tool}). The default file name of the
-@command{tar} binary is set by @code{tar-program} statement.
-
-@item directory
-@var{archive-name} specifies a directory name where to store
-archive copies. If it is a relative file name, this directory will be
-created under the @code{destination} directory. If it is absolute file
-name, the archive name directory will be constructed for each triplet
-using the following rule:
+@WRITEME
@smallexample
-@var{archive-name}/@var{dir}
-@end smallexample
-
-@noindent
-where @var{dir} is the value of @code{directory} directive from the
-triplet file.
-@end table
-
-@vindex VERSION_CONTROL
-@cindex backups
-For @samp{directive} archivation type, the optional @var{backup-method}
-parameter specifies how to back up an existing file whose name
-coincides with the one @command{wydawca} is about to create. If
-@var{backup-method} is not specified, the value of the @env{VERSION_CONTROL}
-environment variable will be used. And if @env{VERSION_CONTROL} is not set,
-the @samp{existing} method (see below) is used by default.
-
-@vindex version-control @r{Emacs variable}
-This option corresponds to the Emacs variable @samp{version-control};
-the same values for @var{backup-method} are accepted as in Emacs. This option
-also allows more descriptive names. Valid @var{method}s are:
-
-@table @samp
-@item t
-@itemx numbered
-Always make numbered backups.
-
-@item nil
-@itemx existing
-Make numbered backups of files that already have them, simple backups.
-of the others.
-
-@item never
-@itemx simple
-Always make simple backups.
-