user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 6/9] config: allow per-inbox nntpserver
Date: Sat,  7 Jan 2017 01:44:49 +0000	[thread overview]
Message-ID: <20170107014452.9657-7-e@80x24.org> (raw)
In-Reply-To: <20170107014452.9657-1-e@80x24.org>

This allows certain inboxes to override the global nntpserver
(perhaps under a different domain).
---
 lib/PublicInbox/Config.pm | 2 +-
 t/config.t                | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 55019e9..28b5bdb 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -136,7 +136,7 @@ sub _fill {
 
 	foreach my $k (qw(mainrepo address filter url newsgroup
 			infourl watch watchheader httpbackendmax
-			feedmax)) {
+			feedmax nntpserver)) {
 		my $v = $self->{"$pfx.$k"};
 		$rv->{$k} = $v if defined $v;
 	}
diff --git a/t/config.t b/t/config.t
index 040e9fb..3ba6111 100644
--- a/t/config.t
+++ b/t/config.t
@@ -78,6 +78,12 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 	my $cfg = PublicInbox::Config->new(\%tmp);
 	my $ibx = $cfg->lookup_name('test');
 	is($ibx->{nntpserver}, 'news.example.com', 'global NNTP server');
+
+	delete $h{'publicinbox.nntpserver'};
+	$h{"$pfx.nntpserver"} = 'news.alt.example.com';
+	$cfg = PublicInbox::Config->new(\%h);
+	$ibx = $cfg->lookup_name('test');
+	is($ibx->{nntpserver}, 'news.alt.example.com','per-inbox NNTP server');
 }
 
 done_testing();
-- 
EW


  parent reply	other threads:[~2017-01-07  1:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07  1:44 [PATCH 0/9] misc cleanups and trimming Eric Wong
2017-01-07  1:44 ` [PATCH 1/9] qspawn: prepare to support runtime reloading of Limiter Eric Wong
2017-01-07  1:44 ` [PATCH 2/9] config: always use namespaced "publicinboxlimiter" Eric Wong
2017-01-07  1:44 ` [PATCH 3/9] config: remove unused get() method Eric Wong
2017-01-07  1:44 ` [PATCH 4/9] inbox: describe the full key name Eric Wong
2017-01-07  1:44 ` [PATCH 5/9] inbox: eliminate weaken usage entirely Eric Wong
2017-01-07  2:12   ` [PATCH 10/9] inbox: properly register cleanup timer for git processes Eric Wong
2017-01-11 10:21   ` [PATCH 11/9] inbox: reinstate periodic cleanup of Xapian and SQLite objects Eric Wong
2017-01-07  1:44 ` Eric Wong [this message]
2017-01-07  1:44 ` [PATCH 7/9] remove incorrect comment about strftime + locales Eric Wong
2017-01-07  1:44 ` [PATCH 8/9] searchmsg: favor direct hash access over accessor methods Eric Wong
2017-01-07  1:44 ` [PATCH 9/9] search: remove subject_summary Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170107014452.9657-7-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).