App-news

 view release on metacpan or  search on metacpan

script/news  view on Meta::CPAN


=head1 NAME

news - a web front-end to a local news server

=head1 SYNOPSIS

B<news>

=head1 DESCRIPTION

C<news> connects to the local news server via NNTP on port 119 and offers a
web interface for it.

There are a number of views available:

=over

=item * the list of newsgroups available ("server view");

=item * the list of articles available in a particular newsgroup ("group view");

=item * a list of articles with a particular tag in a newsgroup ("tag view");

=item * an article ("article view");

=item * a reply;

=item * a new post.

=back

When showing From fields, the value is stripped of things that look like email
addresses in angled brackets such as <alex@gnu.org> or in double quotes such as
"alex@gnu.org"; if an email address is followed by a real name in parenthesis
such as alex@gnu.org (Alex Schroeder), the address and the parenthesis are
stripped. If no full name is provided, "Anonymous" is used.

In the article view, email addresses in angled brackets such as <alex@gnu.org>
or in double quotes such as "alex@gnu.org" are also stripped. Other things that
might look like email addresses are not stripped.

=head2 Threading

Technically, articles only have references back in time. In order to show links
to replies, the article view relies on a cache of the group view. If the group
view isn't in the cache, replies cannot be shown.

=head2 Caching

All the NNTP requests are cached for 5min. The cache relies on L<Mojo::Cache>.
That cache only holds 100 items by default, so on a busy server, NNTP requests
might get cached for less time. The cache isn't written to disk, so if you're a
developer, you can restart the server to empty the cache instead of waiting for
5min.

=head2 Tags

When an article's subject contains a string in square brackets C<[like this]>,
then this is treated as a tag. Click on the tag to see the tag view containing
articles with the same tag, irrespective of threading.

=head2 Authentication

When posting or replying, the username and password provided by the user are
passed along to the news server. If that allows the user to post, it works.

=head2 Environment variables

The news server is determined by L<Net::NNTP>: If no host is passed then two
environment variables are checked C<NNTPSERVER> then C<NEWSHOST>, then
L<Net::Config> is checked, and if a host is not found then C<news> is used.

C<NEWS_INTRO_ID> can be set to a message id for a "start here" message. By
default, no such link is shown. This must be a message-id and cannot be a
message number (that would require a group, too).

C<NEWS_MODE> can be set to "NOAUTH" in order to hide username and password on
the post form in case your newsserver isn't public and requires no
authorisation; if set to "NOPOST" then posting links are hidden.

C<NEWS_GROUPS> can be set to a comma-separated list of patterns in the WILDMAT
format. The details are in RFC 3977. Usually it means: names separated by
commas, prefixed by C<!> if negated and C<*> used as a wildcard. Support for
this varies. The C<sn> server only accepts a single pattern, no negation. You
might have to experiment.

=head2 Systemd

To install as a service, use a C<news.service> file like the following:

    [Unit]
    Description=News (a web front-end)
    After=network-online.target
    Wants=network-online.target
    [Install]
    WantedBy=multi-user.target
    [Service]
    Type=simple
    DynamicUser=true
    Restart=always
    MemoryHigh=80M
    MemoryMax=100M
    Environment="NNTPSERVER=localhost"
    Environment="NEWS_INTRO_ID=<u4d0i0$n72d$1@sibirocobombus.campaignwiki>"
    ExecStart=/home/alex/perl5/perlbrew/perls/perl-5.32.0/bin/perl /home/alex/perl5/perlbrew/perls/perl-5.32.0/bin/news daemon

=head2 Cookies

The web app stores name, username and password in an encrypted cookie which
expires one week after posting an article.

=head2 Caching

The web app caches all the data it gets from the news server in a cache, using
L<Mojo::Cache>. By default, this cache is small (100 items). Each cached item is
cached with a timestamp and cache hits are only used if they aren't older than
5min.

=head2 Superseding



( run in 0.940 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )