App-news
view release on metacpan or search on metacpan
script/news view on Meta::CPAN
=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
The web app allows superseding. It's up to the newsserver to allow or deny this.
There's currently no way for the user to supply their own cancel secret.
=head1 EXAMPLES
A remote news server.
NNTPSERVER=cosmic.voyage news daemon
The remote news server but only the C<campaignwiki.*> groups, with the pattern
in quotes to prevent shell expansion:
NNTPSERVER=campaignwiki.org "NEWS_GROUPS=campaignwiki.*" news daemon
The remote news server with all the groups except any C<*.test> groups, with the
pattern in quotes to prevent shell expansion. The C<sn> server can't parse this
pattern, unfortunately.
NNTPSERVER=campaignwiki.org "NEWS_GROUPS=*,!*.test" news daemon
The local news server requires no authorisation.
NNTPSERVER=localhost NEWS_MODE=NOAUTH news daemon
The news server requires authorisation and we want to point visitors to a first
post. We assume that NNTPSERVER or NEWSHOST is already set.
NEWS_INTRO_ID='<u4d0i0$n72d$1@sibirocobombus.campaignwiki>' news daemon
As a developer, run it under C<morbo> so that we can make changes to the script.
Provide the path to the script. This time with regular authorisation.
PERL5LIB=lib NNTPSERVER=localhost morbo script/news
=head1 SEE ALSO
The Tildeverse also runs news. L<https://news.tildeverse.org/>
L<RFC 3977|https://www.rfc-editor.org/rfc/rfc3977>: Network News Transfer
Protocol (NNTP).
L<RFC 3987|https://www.rfc-editor.org/rfc/rfc3987>: Internationalized Resource
Identifiers (IRIs)
L<RFC 4643|https://www.rfc-editor.org/rfc/rfc4643>: Network News Transfer
Protocol (NNTP) Extension for Authentication.
( run in 1.037 second using v1.01-cache-2.11-cpan-6aa56a78535 )