user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 6/9] config: allow per-inbox nntpserver
  2017-01-07  1:44  5% [PATCH 0/9] misc cleanups and trimming Eric Wong
@ 2017-01-07  1:44  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2017-01-07  1:44 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/9] misc cleanups and trimming
@ 2017-01-07  1:44  5% Eric Wong
  2017-01-07  1:44  7% ` [PATCH 6/9] config: allow per-inbox nntpserver Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2017-01-07  1:44 UTC (permalink / raw)
  To: meta

Weak reference dependencies are entirely gone.  This should
simplify the internal object structures of Perl a bit and
hopefully make the data structures easier to reason about.

While we're at it, there's several search-related cleanups
to eliminate some dead code.

9 changes:

      qspawn: prepare to support runtime reloading of Limiter
      config: always use namespaced "publicinboxlimiter"
      config: remove unused get() method
      inbox: describe the full key name
      inbox: eliminate weaken usage entirely
      config: allow per-inbox nntpserver
      remove incorrect comment about strftime + locales
      searchmsg: favor direct hash access over accessor methods
      search: remove subject_summary


 lib/PublicInbox/Config.pm        | 14 ++------
 lib/PublicInbox/Inbox.pm         | 73 ++++++++++++++++++----------------------
 lib/PublicInbox/Qspawn.pm        | 11 ++++--
 lib/PublicInbox/Search.pm        | 29 ++--------------
 lib/PublicInbox/SearchIdx.pm     |  4 +--
 lib/PublicInbox/SearchMsg.pm     | 36 +++-----------------
 lib/PublicInbox/WwwAtomStream.pm |  1 -
 t/config.t                       | 25 ++++++++++++--
 t/config_limiter.t               | 11 +++---
 t/search.t                       | 17 ----------
 10 files changed, 78 insertions(+), 143 deletions(-)


^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-01-07  1:44  5% [PATCH 0/9] misc cleanups and trimming Eric Wong
2017-01-07  1:44  7% ` [PATCH 6/9] config: allow per-inbox nntpserver Eric Wong

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).