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 2/2] config: support "inboxdir" in addition to "mainrepo"
  2019-10-16  8:59  7% [PATCH 0/2] rename "mainrepo" to "inboxdir" Eric Wong
@ 2019-10-16  8:59  1% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-10-16  8:59 UTC (permalink / raw)
  To: meta

"mainrepo" ws a bad name and artifact from the early days when I
intended for there to be a "spamrepo" (now just the
ENV{PI_EMERGENCY} Maildir).  With v2, "mainrepo" can be
especially confusing, since v2 needs at least two git
repositories (epoch + all.git) to function and we shouldn't
confuse users by having them point to a git repository for v2.

Much of our documentation already references "INBOX_DIR" for
command-line arguments, so use "inboxdir" as the
git-config(1)-friendly variant for that.

"mainrepo" remains supported indefinitely for compatibility.
Users may need to revert to old versions, or may be referring
to old documentation and must not be forced to change config
files to account for this change.

So if you're using "mainrepo" today, I do NOT recommend changing
it right away because other bugs can lurk.

Link: https://public-inbox.org/meta/874l0ice8v.fsf@alyssa.is/
---
 Documentation/public-inbox-config.pod  | 19 +++++++++-----
 Documentation/public-inbox-convert.pod |  2 +-
 Documentation/public-inbox-init.pod    |  2 +-
 Documentation/public-inbox-watch.pod   |  4 +--
 examples/public-inbox-config           |  6 +++--
 lib/PublicInbox/Admin.pm               |  8 +++---
 lib/PublicInbox/AdminEdit.pm           |  4 +--
 lib/PublicInbox/AltId.pm               |  4 +--
 lib/PublicInbox/Config.pm              | 10 +++++---
 lib/PublicInbox/Inbox.pm               | 14 +++++------
 lib/PublicInbox/InboxWritable.pm       |  2 +-
 lib/PublicInbox/Search.pm              |  6 ++---
 lib/PublicInbox/SearchIdx.pm           |  8 +++---
 lib/PublicInbox/V2Writable.pm          | 16 ++++++------
 lib/PublicInbox/WwwAtomStream.pm       |  2 +-
 lib/PublicInbox/WwwListing.pm          |  2 +-
 lib/PublicInbox/WwwStream.pm           |  2 +-
 lib/PublicInbox/WwwText.pm             |  3 +++
 lib/PublicInbox/Xapcmd.pm              |  4 +--
 script/public-inbox-convert            | 16 ++++++------
 script/public-inbox-edit               |  2 +-
 script/public-inbox-init               | 16 ++++++------
 script/public-inbox-mda                |  2 +-
 scripts/dupe-finder                    |  2 +-
 scripts/import_vger_from_mbox          |  6 ++---
 t/admin.t                              |  2 +-
 t/altid.t                              |  2 +-
 t/altid_v2.t                           |  6 ++---
 t/cgi.t                                |  2 +-
 t/config.t                             | 34 +++++++++++++++++++-------
 t/config_limiter.t                     |  4 +--
 t/convert-compact.t                    | 20 +++++++--------
 t/edit.t                               | 32 ++++++++++++------------
 t/feed.t                               |  2 +-
 t/filter_rubylang.t                    |  2 +-
 t/html_index.t                         |  2 +-
 t/indexlevels-mirror.t                 | 16 ++++++------
 t/mda.t                                |  2 +-
 t/mda_filter_rubylang.t                |  6 ++---
 t/nntp.t                               |  2 +-
 t/nntpd-tls.t                          |  6 ++---
 t/nntpd-validate.t                     |  4 +--
 t/nntpd.t                              |  6 ++---
 t/perf-msgview.t                       |  2 +-
 t/perf-nntpd.t                         |  4 +--
 t/perf-threading.t                     |  2 +-
 t/plack.t                              |  2 +-
 t/psgi_attach.t                        |  2 +-
 t/psgi_bad_mids.t                      |  6 ++---
 t/psgi_mount.t                         |  2 +-
 t/psgi_multipart_not.t                 |  4 +--
 t/psgi_scan_all.t                      |  6 ++---
 t/psgi_search.t                        |  4 +--
 t/psgi_text.t                          |  2 +-
 t/psgi_v2.t                            |  6 ++---
 t/purge.t                              | 12 ++++-----
 t/replace.t                            |  4 +--
 t/search-thr-index.t                   |  2 +-
 t/search.t                             |  2 +-
 t/solver_git.t                         |  6 ++---
 t/v1-add-remove-add.t                  |  6 ++---
 t/v1reindex.t                          | 20 +++++++--------
 t/v2-add-remove-add.t                  |  4 +--
 t/v2mda.t                              |  4 +--
 t/v2mirror.t                           |  4 +--
 t/v2reindex.t                          | 18 +++++++-------
 t/v2writable.t                         | 22 ++++++++---------
 t/watch_filter_rubylang.t              |  8 +++---
 t/watch_maildir.t                      |  2 +-
 t/watch_maildir_v2.t                   | 10 ++++----
 t/www_listing.t                        |  6 ++---
 t/xcpdb-reshard.t                      |  8 +++---
 72 files changed, 262 insertions(+), 230 deletions(-)

diff --git a/Documentation/public-inbox-config.pod b/Documentation/public-inbox-config.pod
index 6a9739f7..1c5ba015 100644
--- a/Documentation/public-inbox-config.pod
+++ b/Documentation/public-inbox-config.pod
@@ -17,13 +17,17 @@ all public-inboxes used by a particular user.
 =head2 EXAMPLE
 
 	[publicinbox "test"]
-		mainrepo = /home/user/path/to/test.git
+		inboxdir = /home/user/path/to/test.git
 		; multiple addresses are supported
 		address = test@example.com
 		; address = alternate@example.com
 		url = http://example.com/test
 		newsgroup = inbox.test
 
+		; backwards compatibility with public-inbox pre-1.2.0,
+		; "inboxdir" takes precedence over "mainrepo"
+		mainrepo = /home/user/path/to/test.git
+
 =head2 VARIABLES
 
 =over 8
@@ -38,11 +42,14 @@ informational purposes.
 
 Default: none, required
 
-=item publicinbox.<name>.mainrepo
+=item publicinbox.<name>.inboxdir
 
 The absolute path to the directory which hosts the
 public-inbox.  This must be specified once.
 
+This was previously known as "mainrepo", which remains supported,
+but "inboxdir" takes precedence.
+
 Default: none, required
 
 =item publicinbox.<name>.url
@@ -373,20 +380,20 @@ RLIMIT_CPU, and RLIMIT_DATA for you operating system.
 
 	; big inboxes which require lots of memory to clone:
 	[publicinbox "big1"]
-		mainrepo = /path/to/big1
+		inboxdir = /path/to/big1
 		address = big1@example.com
 		httpbackendmax = big
 	[publicinbox "big2"]
-		mainrepo = /path/to/big2
+		inboxdir = /path/to/big2
 		address = big2@example.com
 		httpbackendmax = big
 
 	; tiny inboxes which are easily cloned:
 	[publicinbox "tiny1"]
-		mainrepo = /path/to/tiny1
+		inboxdir = /path/to/tiny1
 		address = tiny1@example.com
 	[publicinbox "tiny2"]
-		mainrepo = /path/to/tiny2
+		inboxdir = /path/to/tiny2
 		address = tiny2@example.com
 
 	[publicinboxlimiter "big"]
diff --git a/Documentation/public-inbox-convert.pod b/Documentation/public-inbox-convert.pod
index 4e358c9d..4c790dee 100644
--- a/Documentation/public-inbox-convert.pod
+++ b/Documentation/public-inbox-convert.pod
@@ -10,7 +10,7 @@ public-inbox-convert - convert v1 inboxes to v2
 
 public-inbox-convert copies the contents of an old "v1" inbox
 into a new "v2" inbox.  It makes no changes to the old inbox
-and users are expected to update the "mainrepo" path in
+and users are expected to update the "inboxdir" path in
 L<public-inbox-config(5)> to point to the path of NEW_DIR
 once they are satisfied with the conversion.
 
diff --git a/Documentation/public-inbox-init.pod b/Documentation/public-inbox-init.pod
index 377fb2a2..f5de6bf9 100644
--- a/Documentation/public-inbox-init.pod
+++ b/Documentation/public-inbox-init.pod
@@ -11,7 +11,7 @@ B<public-inbox-init> [OPTIONS] NAME INBOX_DIR HTTP_URL ADDRESS [ADDRESS..]
 Creates an empty public-inbox or reinitializes an existing one.
 It updates C<~/.public-inbox/config> by creating a
 C<[publicinbox "NAME"]> section where
-C<publicinbox.NAME.mainrepo> is C<INBOX_DIR>,
+C<publicinbox.NAME.inboxdir> is C<INBOX_DIR>,
 C<publicinbox.NAME.url> is C<HTTP_URL>, and
 C<publicinbox.NAME.address> is C<ADDRESS>.  Multiple addresses
 may be specified for inboxes with multiple addresses.
diff --git a/Documentation/public-inbox-watch.pod b/Documentation/public-inbox-watch.pod
index 198c170a..0934eade 100644
--- a/Documentation/public-inbox-watch.pod
+++ b/Documentation/public-inbox-watch.pod
@@ -12,7 +12,7 @@ In ~/.public-inbox/config:
 		; generic public-inbox-config keys:
 		address = test@example.com
 		url = http://example.com/test
-		mainrepo = /path/to/test.example.com.git
+		inboxdir = /path/to/test.example.com.git
 
 		; config keys specific to public-inbox-watch:
 
@@ -28,7 +28,7 @@ In ~/.public-inbox/config:
 
 		; optional, emails marked as read which appear
 		; here will be trained as spam and deleted from
-		; the mainrepos of any public-inboxes which are
+		; the inboxdirs of any public-inboxes which are
 		; configured for watch.
 		; This is global for all publicinbox.* sections
 		watchspam = maildir:/path/to/maildirs/.INBOX.spam
diff --git a/examples/public-inbox-config b/examples/public-inbox-config
index 7fcbe0ba..ba06eec3 100644
--- a/examples/public-inbox-config
+++ b/examples/public-inbox-config
@@ -4,9 +4,11 @@
 	address = try@public-inbox.org
 	address = sandbox@public-inbox.org
 	address = test@public-inbox.org
-	mainrepo = /home/pi/test-main.git
+	; note: "mainrepo" is the old name for "inboxdir", both
+	; remain supported for backwards compatibility.
+	inboxdir = /home/pi/test-main.git
 	url = http://example.com/test
 [publicinbox "meta"]
 	address = meta@public-inbox.org
-	mainrepo = /home/pi/meta-main.git
+	inboxdir = /home/pi/meta-main.git
 	url = http://example.com/meta
diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm
index 2b25cf01..e9fb5d6f 100644
--- a/lib/PublicInbox/Admin.pm
+++ b/lib/PublicInbox/Admin.pm
@@ -61,7 +61,7 @@ sub detect_indexlevel ($) {
 			$l = $m;
 		} elsif ($m ne '') {
 			warn <<"";
-$ibx->{mainrepo} has unexpected indexlevel in Xapian: $m
+$ibx->{inboxdir} has unexpected indexlevel in Xapian: $m
 
 		}
 	}
@@ -74,7 +74,7 @@ sub unconfigured_ibx ($$) {
 	PublicInbox::Inbox->new({
 		name => $name,
 		address => [ "$name\@example.com" ],
-		mainrepo => $dir,
+		inboxdir => $dir,
 		# TODO: consumers may want to warn on this:
 		#-unconfigured => 1,
 	});
@@ -101,12 +101,12 @@ sub resolve_inboxes ($;$) {
 		$cfg->each_inbox(sub {
 			my ($ibx) = @_;
 			$ibx->{version} ||= 1;
-			my $path = abs_path($ibx->{mainrepo});
+			my $path = abs_path($ibx->{inboxdir});
 			if (defined($path)) {
 				$dir2ibx{$path} = $ibx;
 			} else {
 				warn <<EOF;
-W: $ibx->{name} $ibx->{mainrepo}: $!
+W: $ibx->{name} $ibx->{inboxdir}: $!
 EOF
 			}
 		});
diff --git a/lib/PublicInbox/AdminEdit.pm b/lib/PublicInbox/AdminEdit.pm
index 2e2a8629..d4a92266 100644
--- a/lib/PublicInbox/AdminEdit.pm
+++ b/lib/PublicInbox/AdminEdit.pm
@@ -25,7 +25,7 @@ sub check_editable ($) {
 		# it's possible for a Xapian directory to exist,
 		# but Search::Xapian to go missing/broken.
 		# Make sure it's purged in that case:
-		$ibx->over or die "no over.sqlite3 in $ibx->{mainrepo}\n";
+		$ibx->over or die "no over.sqlite3 in $ibx->{inboxdir}\n";
 
 		# $ibx->{search} is populated by $ibx->over call
 		my $xdir_ro = $ibx->{search}->xdir(1);
@@ -51,7 +51,7 @@ sub check_editable ($) {
 # $rewrites = [ array commits keyed by epoch ]
 sub show_rewrites ($$$) {
 	my ($fh, $ibx, $rewrites) = @_;
-	print $fh "$ibx->{mainrepo}:";
+	print $fh "$ibx->{inboxdir}:";
 	if (scalar @$rewrites) {
 		my $epoch = -1;
 		my @out = map {;
diff --git a/lib/PublicInbox/AltId.pm b/lib/PublicInbox/AltId.pm
index 6103d52e..b4daaed2 100644
--- a/lib/PublicInbox/AltId.pm
+++ b/lib/PublicInbox/AltId.pm
@@ -32,9 +32,9 @@ sub new {
 	my $f = $params{file} or die "file: required for $type spec $spec\n";
 	unless (index($f, '/') == 0) {
 		if (($ibx->{version} || 1) == 1) {
-			$f = "$ibx->{mainrepo}/public-inbox/$f";
+			$f = "$ibx->{inboxdir}/public-inbox/$f";
 		} else {
-			$f = "$ibx->{mainrepo}/$f";
+			$f = "$ibx->{inboxdir}/$f";
 		}
 	}
 	bless {
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 509de0a0..2da202f9 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -93,7 +93,7 @@ sub each_inbox {
 	# may auto-vivify if config file is non-existent:
 	foreach my $section (@{$self->{-section_order}}) {
 		next if $section !~ m!\Apublicinbox\.([^/]+)\z!;
-		defined($self->{"publicinbox.$1.mainrepo"}) or next;
+		defined($self->{"publicinbox.$1.inboxdir"}) or next;
 		my $ibx = lookup_name($self, $1) or next;
 		$cb->($ibx);
 	}
@@ -362,12 +362,16 @@ sub _fill {
 	my ($self, $pfx) = @_;
 	my $ibx = {};
 
-	foreach my $k (qw(mainrepo filter url newsgroup
+	foreach my $k (qw(inboxdir filter url newsgroup
 			infourl watch watchheader httpbackendmax
 			replyto feedmax nntpserver indexlevel)) {
 		my $v = $self->{"$pfx.$k"};
 		$ibx->{$k} = $v if defined $v;
 	}
+
+	# backwards compatibility:
+	$ibx->{inboxdir} //= $self->{"$pfx.mainrepo"};
+
 	foreach my $k (qw(obfuscate)) {
 		my $v = $self->{"$pfx.$k"};
 		defined $v or next;
@@ -385,7 +389,7 @@ sub _fill {
 		}
 	}
 
-	return unless $ibx->{mainrepo};
+	return unless $ibx->{inboxdir};
 	my $name = $pfx;
 	$name =~ s/\Apublicinbox\.//;
 
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 85f56acb..5feb2154 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -109,7 +109,7 @@ sub new {
 	_set_limiter($opts, $pi_config, 'httpbackend');
 	_set_uint($opts, 'feedmax', 25);
 	$opts->{nntpserver} ||= $pi_config->{'publicinbox.nntpserver'};
-	my $dir = $opts->{mainrepo};
+	my $dir = $opts->{inboxdir};
 	if (defined $dir && -f "$dir/inbox.lock") {
 		$opts->{version} = 2;
 	}
@@ -129,7 +129,7 @@ sub git_epoch {
 	my ($self, $epoch) = @_;
 	($self->{version} || 1) == 2 or return;
 	$self->{"$epoch.git"} ||= eval {
-		my $git_dir = "$self->{mainrepo}/git/$epoch.git";
+		my $git_dir = "$self->{inboxdir}/git/$epoch.git";
 		my $g = PublicInbox::Git->new($git_dir);
 		$g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
 		# no cleanup needed, we never cat-file off this, only clone
@@ -140,7 +140,7 @@ sub git_epoch {
 sub git {
 	my ($self) = @_;
 	$self->{git} ||= eval {
-		my $git_dir = $self->{mainrepo};
+		my $git_dir = $self->{inboxdir};
 		$git_dir .= '/all.git' if (($self->{version} || 1) == 2);
 		my $g = PublicInbox::Git->new($git_dir);
 		$g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
@@ -157,7 +157,7 @@ sub max_git_epoch {
 	my $changed = git($self)->alternates_changed;
 	if (!defined($cur) || $changed) {
 		$self->git->cleanup if $changed;
-		my $gits = "$self->{mainrepo}/git";
+		my $gits = "$self->{inboxdir}/git";
 		if (opendir my $dh, $gits) {
 			my $max = -1;
 			while (defined(my $git_dir = readdir($dh))) {
@@ -177,7 +177,7 @@ sub mm {
 	$self->{mm} ||= eval {
 		require PublicInbox::Msgmap;
 		_cleanup_later($self);
-		my $dir = $self->{mainrepo};
+		my $dir = $self->{inboxdir};
 		if (($self->{version} || 1) >= 2) {
 			PublicInbox::Msgmap->new_file("$dir/msgmap.sqlite3");
 		} else {
@@ -220,7 +220,7 @@ sub description {
 	my ($self) = @_;
 	my $desc = $self->{description};
 	return $desc if defined $desc;
-	$desc = try_cat("$self->{mainrepo}/description");
+	$desc = try_cat("$self->{inboxdir}/description");
 	local $/ = "\n";
 	chomp $desc;
 	$desc =~ s/\s+/ /smg;
@@ -232,7 +232,7 @@ sub cloneurl {
 	my ($self) = @_;
 	my $url = $self->{cloneurl};
 	return $url if $url;
-	$url = try_cat("$self->{mainrepo}/cloneurl");
+	$url = try_cat("$self->{inboxdir}/cloneurl");
 	my @url = split(/\s+/s, $url);
 	local $/ = "\n";
 	chomp @url;
diff --git a/lib/PublicInbox/InboxWritable.pm b/lib/PublicInbox/InboxWritable.pm
index 4b22149f..174e4245 100644
--- a/lib/PublicInbox/InboxWritable.pm
+++ b/lib/PublicInbox/InboxWritable.pm
@@ -35,7 +35,7 @@ sub init_inbox {
 	# TODO: honor skip_artnum
 	my $v = $self->{version} || 1;
 	if ($v == 1) {
-		my $dir = $self->{mainrepo} or die "no mainrepo in inbox\n";
+		my $dir = $self->{inboxdir} or die "no inboxdir in inbox\n";
 		PublicInbox::Import::init_bare($dir);
 	} else {
 		my $v2w = importer($self);
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index a0e6a93b..06a84c34 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -126,9 +126,9 @@ chomp @HELP;
 sub xdir ($;$) {
 	my ($self, $rdonly) = @_;
 	if ($self->{version} == 1) {
-		"$self->{mainrepo}/public-inbox/xapian" . SCHEMA_VERSION;
+		"$self->{inboxdir}/public-inbox/xapian" . SCHEMA_VERSION;
 	} else {
-		my $dir = "$self->{mainrepo}/xap" . SCHEMA_VERSION;
+		my $dir = "$self->{inboxdir}/xap" . SCHEMA_VERSION;
 		return $dir if $rdonly;
 
 		my $shard = $self->{shard};
@@ -173,7 +173,7 @@ sub new {
 	my ($class, $ibx) = @_;
 	ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx";
 	my $self = bless {
-		mainrepo => $ibx->{mainrepo},
+		inboxdir => $ibx->{inboxdir},
 		altid => $ibx->{altid},
 		version => $ibx->{version} // 1,
 	}, $class;
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 1b1a21b7..aed3875a 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -32,7 +32,7 @@ sub new {
 	my ($class, $ibx, $creat, $shard) = @_;
 	ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx";
 	my $levels = qr/\A(?:full|medium|basic)\z/;
-	my $mainrepo = $ibx->{mainrepo};
+	my $inboxdir = $ibx->{inboxdir};
 	my $version = $ibx->{version} || 1;
 	my $indexlevel = 'full';
 	my $altid = $ibx->{altid};
@@ -49,7 +49,7 @@ sub new {
 	}
 	$ibx = PublicInbox::InboxWritable->new($ibx);
 	my $self = bless {
-		mainrepo => $mainrepo,
+		inboxdir => $inboxdir,
 		-inbox => $ibx,
 		git => $ibx->git,
 		-altid => $altid,
@@ -58,7 +58,7 @@ sub new {
 	}, $class;
 	$ibx->umask_prepare;
 	if ($version == 1) {
-		$self->{lock_path} = "$mainrepo/ssoma.lock";
+		$self->{lock_path} = "$inboxdir/ssoma.lock";
 		my $dir = $self->xdir;
 		$self->{over} = PublicInbox::OverIdx->new("$dir/over.sqlite3");
 	} elsif ($version == 2) {
@@ -603,7 +603,7 @@ sub _msgmap_init {
 	die "BUG: _msgmap_init is only for v1\n" if $self->{version} != 1;
 	$self->{mm} ||= eval {
 		require PublicInbox::Msgmap;
-		PublicInbox::Msgmap->new($self->{mainrepo}, 1);
+		PublicInbox::Msgmap->new($self->{inboxdir}, 1);
 	};
 }
 
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 627bcba9..6a88f62a 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -76,7 +76,7 @@ sub new {
 	# $creat may be any true value, or 0/undef.  A hashref is true,
 	# and $creat->{nproc} may be set to an integer
 	my ($class, $v2ibx, $creat) = @_;
-	my $dir = $v2ibx->{mainrepo} or die "no mainrepo in inbox\n";
+	my $dir = $v2ibx->{inboxdir} or die "no inboxdir in inbox\n";
 	unless (-d $dir) {
 		if ($creat) {
 			require File::Path;
@@ -304,7 +304,7 @@ sub idx_init {
 		# Now that all subprocesses are up, we can open the FDs
 		# for SQLite:
 		my $mm = $self->{mm} = PublicInbox::Msgmap->new_file(
-			"$self->{-inbox}->{mainrepo}/msgmap.sqlite3", 1);
+			"$self->{-inbox}->{inboxdir}/msgmap.sqlite3", 1);
 		$mm->{dbh}->begin_work;
 	});
 }
@@ -315,7 +315,7 @@ sub idx_init {
 sub _replace_oids ($$$) {
 	my ($self, $mime, $replace_map) = @_;
 	$self->done;
-	my $pfx = "$self->{-inbox}->{mainrepo}/git";
+	my $pfx = "$self->{-inbox}->{inboxdir}/git";
 	my $rewrites = []; # epoch => commit
 	my $max = $self->{epoch_max};
 
@@ -663,8 +663,8 @@ sub done {
 sub fill_alternates ($$) {
 	my ($self, $epoch) = @_;
 
-	my $pfx = "$self->{-inbox}->{mainrepo}/git";
-	my $all = "$self->{-inbox}->{mainrepo}/all.git";
+	my $pfx = "$self->{-inbox}->{inboxdir}/git";
+	my $all = "$self->{-inbox}->{inboxdir}/all.git";
 
 	unless (-d $all) {
 		PublicInbox::Import::init_bare($all);
@@ -690,7 +690,7 @@ sub fill_alternates ($$) {
 
 sub git_init {
 	my ($self, $epoch) = @_;
-	my $git_dir = "$self->{-inbox}->{mainrepo}/git/$epoch.git";
+	my $git_dir = "$self->{-inbox}->{inboxdir}/git/$epoch.git";
 	my @cmd = (qw(git init --bare -q), $git_dir);
 	PublicInbox::Import::run_die(\@cmd);
 	@cmd = (qw/git config/, "--file=$git_dir/config",
@@ -703,7 +703,7 @@ sub git_init {
 sub git_dir_latest {
 	my ($self, $max) = @_;
 	$$max = -1;
-	my $pfx = "$self->{-inbox}->{mainrepo}/git";
+	my $pfx = "$self->{-inbox}->{inboxdir}/git";
 	return unless -d $pfx;
 	my $latest;
 	opendir my $dh, $pfx or die "opendir $pfx: $!\n";
@@ -935,7 +935,7 @@ sub update_last_commit ($$$$) {
 	last_epoch_commit($self, $i, $cmt);
 }
 
-sub git_dir_n ($$) { "$_[0]->{-inbox}->{mainrepo}/git/$_[1].git" }
+sub git_dir_n ($$) { "$_[0]->{-inbox}->{inboxdir}/git/$_[1].git" }
 
 sub last_commits ($$) {
 	my ($self, $epoch_max) = @_;
diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm
index 05659f1f..83984d37 100644
--- a/lib/PublicInbox/WwwAtomStream.pm
+++ b/lib/PublicInbox/WwwAtomStream.pm
@@ -84,7 +84,7 @@ sub atom_header {
 		$self_url .= 'new.atom';
 		$page_id = "mailto:$ibx->{-primary_address}";
 	}
-	my $mtime = (stat($ibx->{mainrepo}))[9] || time;
+	my $mtime = (stat($ibx->{inboxdir}))[9] || time;
 
 	qq(<?xml version="1.0" encoding="us-ascii"?>\n) .
 	qq(<feed\nxmlns="http://www.w3.org/2005/Atom"\n) .
diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm
index 1d4029f0..c5e16eb2 100644
--- a/lib/PublicInbox/WwwListing.pm
+++ b/lib/PublicInbox/WwwListing.pm
@@ -141,7 +141,7 @@ sub fingerprint ($) {
 sub manifest_add ($$;$$) {
 	my ($manifest, $ibx, $epoch, $default_desc) = @_;
 	my $url_path = "/$ibx->{name}";
-	my $git_dir = $ibx->{mainrepo};
+	my $git_dir = $ibx->{inboxdir};
 	if (defined $epoch) {
 		$git_dir .= "/git/$epoch.git";
 		$url_path .= "/git/$epoch.git";
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index f5338c39..6696cc35 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -98,7 +98,7 @@ sub _html_end {
 		$seen{$http} = 1;
 		for my $i (0..$max) {
 			# old parts my be deleted:
-			-d "$ibx->{mainrepo}/git/$i.git" or next;
+			-d "$ibx->{inboxdir}/git/$i.git" or next;
 			my $url = "$http/$i";
 			$seen{$url} = 1;
 			push @urls, "$url $dir/git/$i.git";
diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index bcda665c..1c7b92bd 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -145,6 +145,9 @@ sub inbox_config ($$$) {
 ; see public-inbox-config(5) manpage for more details:
 ; https://public-inbox.org/public-inbox-config.html
 [publicinbox "$name"]
+	inboxdir = /path/to/top-level-inbox
+	; note: public-inbox before v1.2.0 used "mainrepo"
+	; instead of "inboxdir", both remain supported after 1.2
 	mainrepo = /path/to/top-level-inbox
 EOS
 	for my $k (qw(address listid)) {
diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm
index 819d7829..22e56f42 100644
--- a/lib/PublicInbox/Xapcmd.pm
+++ b/lib/PublicInbox/Xapcmd.pm
@@ -153,7 +153,7 @@ sub run {
 	my ($ibx, $task, $opt) = @_; # task = 'cpdb' or 'compact'
 	my $cb = \&${\"PublicInbox::Xapcmd::$task"};
 	PublicInbox::Admin::progress_prepare($opt ||= {});
-	my $dir = $ibx->{mainrepo} or die "no mainrepo in inbox\n";
+	my $dir = $ibx->{inboxdir} or die "no inboxdir in inbox\n";
 	runnable_or_die($XAPIAN_COMPACT) if $opt->{compact};
 	my $reindex; # v1:{ from => $x40 }, v2:{ from => [ $x40, $x40, .. ] } }
 	my $from; # per-epoch ranges
@@ -181,7 +181,7 @@ sub run {
 	if ($v == 1) {
 		if (defined $reshard) {
 			warn
-"--reshard=$reshard ignored for v1 $ibx->{mainrepo}\n";
+"--reshard=$reshard ignored for v1 $ibx->{inboxdir}\n";
 		}
 		my $old_parent = dirname($old);
 		same_fs_or_die($old_parent, $old);
diff --git a/script/public-inbox-convert b/script/public-inbox-convert
index 9d2d2512..3182410e 100755
--- a/script/public-inbox-convert
+++ b/script/public-inbox-convert
@@ -30,14 +30,14 @@ $old_dir = abs_path($old_dir);
 my $old;
 if ($config) {
 	$config->each_inbox(sub {
-		$old = $_[0] if abs_path($_[0]->{mainrepo}) eq $old_dir;
+		$old = $_[0] if abs_path($_[0]->{inboxdir}) eq $old_dir;
 	});
 }
 unless ($old) {
 	warn "W: $old_dir not configured in " .
 		PublicInbox::Config::default_file() . "\n";
 	$old = {
-		mainrepo => $old_dir,
+		inboxdir => $old_dir,
 		name => 'ignored',
 		address => [ 'old@example.com' ],
 	};
@@ -48,7 +48,7 @@ if (($old->{version} || 1) >= 2) {
 	die "Only conversion from v1 inboxes is supported\n";
 }
 my $new = { %$old };
-$new->{mainrepo} = abs_path($new_dir);
+$new->{inboxdir} = abs_path($new_dir);
 $new->{version} = 2;
 $new = PublicInbox::InboxWritable->new($new);
 my $v2w;
@@ -62,9 +62,9 @@ sub link_or_copy ($$) {
 }
 
 $old->with_umask(sub {
-	my $old_cfg = "$old->{mainrepo}/config";
+	my $old_cfg = "$old->{inboxdir}/config";
 	local $ENV{GIT_CONFIG} = $old_cfg;
-	my $new_cfg = "$new->{mainrepo}/all.git/config";
+	my $new_cfg = "$new->{inboxdir}/all.git/config";
 	$v2w = PublicInbox::V2Writable->new($new, 1);
 	$v2w->init_inbox($jobs);
 	unlink $new_cfg;
@@ -79,9 +79,9 @@ $old->with_umask(sub {
 			$src->mm_alt->{dbh}->sqlite_backup_to_file($dst);
 		}
 	}
-	my $desc = "$old->{mainrepo}/description";
-	link_or_copy($desc, "$new->{mainrepo}/description") if -e $desc;
-	my $clone = "$old->{mainrepo}/cloneurl";
+	my $desc = "$old->{inboxdir}/description";
+	link_or_copy($desc, "$new->{inboxdir}/description") if -e $desc;
+	my $clone = "$old->{inboxdir}/cloneurl";
 	if (-e $clone) {
 		warn <<"";
 $clone may not be valid after migrating to v2, not copying
diff --git a/script/public-inbox-edit b/script/public-inbox-edit
index 6884fd0c..f2090abf 100755
--- a/script/public-inbox-edit
+++ b/script/public-inbox-edit
@@ -65,7 +65,7 @@ sub find_mid ($) {
 
 sub show_cmd ($$) {
 	my ($ibx, $smsg) = @_;
-	" GIT_DIR=$ibx->{mainrepo}/all.git \\\n    git show $smsg->{blob}\n";
+	" GIT_DIR=$ibx->{inboxdir}/all.git \\\n    git show $smsg->{blob}\n";
 }
 
 sub show_found () {
diff --git a/script/public-inbox-init b/script/public-inbox-init
index 8fd2f9dc..50711266 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -31,7 +31,7 @@ my %opts = (
 GetOptions(%opts) or usage();
 PublicInbox::Admin::indexlevel_ok_or_die($indexlevel) if defined $indexlevel;
 my $name = shift @ARGV or usage();
-my $mainrepo = shift @ARGV or usage();
+my $inboxdir = shift @ARGV or usage();
 my $http_url = shift @ARGV or usage();
 my (@address) = @ARGV;
 @address or usage();
@@ -112,18 +112,18 @@ close $fh or die "failed to close $pi_config_tmp: $!\n";
 my $pfx = "publicinbox.$name";
 my @x = (qw/git config/, "--file=$pi_config_tmp");
 
-$mainrepo = abs_path($mainrepo);
-if (-f "$mainrepo/inbox.lock") {
+$inboxdir = abs_path($inboxdir);
+if (-f "$inboxdir/inbox.lock") {
 	if (!defined $version) {
 		$version = 2;
 	} elsif ($version != 2) {
-		die "$mainrepo is a -V2 repo, -V$version specified\n"
+		die "$inboxdir is a -V2 repo, -V$version specified\n"
 	}
-} elsif (-d "$mainrepo/objects") {
+} elsif (-d "$inboxdir/objects") {
 	if (!defined $version) {
 		$version = 1;
 	} elsif ($version != 1) {
-		die "$mainrepo is a -V1 repo, -V$version specified\n"
+		die "$inboxdir is a -V1 repo, -V$version specified\n"
 	}
 }
 
@@ -134,7 +134,7 @@ if ($version == 1 && defined $skip_epoch) {
 }
 
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => $name,
 	version => $version,
 	-primary_address => $address[0],
@@ -152,7 +152,7 @@ foreach my $addr (@address) {
 	x(@x, "--add", "$pfx.address", $addr);
 }
 x(@x, "$pfx.url", $http_url);
-x(@x, "$pfx.mainrepo", $mainrepo);
+x(@x, "$pfx.inboxdir", $inboxdir);
 
 if (defined($indexlevel)) {
 	x(@x, "$pfx.indexlevel", $indexlevel);
diff --git a/script/public-inbox-mda b/script/public-inbox-mda
index 2655a6c5..dea49dc5 100755
--- a/script/public-inbox-mda
+++ b/script/public-inbox-mda
@@ -51,7 +51,7 @@ if (!defined $dst) {
 	}
 	defined $dst or do_exit(67); # EX_NOUSER 5.1.1 user unknown
 }
-$dst->{mainrepo} or do_exit(67);
+$dst->{inboxdir} or do_exit(67);
 $dst = PublicInbox::InboxWritable->new($dst);
 
 # pre-check, MDA has stricter rules than an importer might;
diff --git a/scripts/dupe-finder b/scripts/dupe-finder
index 1e980936..8060a9d7 100644
--- a/scripts/dupe-finder
+++ b/scripts/dupe-finder
@@ -14,7 +14,7 @@ my $ibx;
 if (index($repo, '@') > 0) {
 	$ibx = PublicInbox::Config->new->lookup($repo);
 } elsif (-d $repo) {
-	$ibx = { mainrepo => $repo, address => 'unnamed@example.com' };
+	$ibx = { inboxdir => $repo, address => 'unnamed@example.com' };
 	$ibx = PublicInbox::Inbox->new($ibx);
 } else {
 	$ibx = PublicInbox::Config->new->lookup_name($repo);
diff --git a/scripts/import_vger_from_mbox b/scripts/import_vger_from_mbox
index b2dd5b3a..6329dd16 100644
--- a/scripts/import_vger_from_mbox
+++ b/scripts/import_vger_from_mbox
@@ -23,9 +23,9 @@ if ($variant ne 'mboxrd' && $variant ne 'mboxo') {
 }
 my $name = shift or die $usage; # git
 my $email = shift or die $usage; # git@vger.kernel.org
-my $mainrepo = shift or die $usage; # /path/to/v2/repo
+my $inboxdir = shift or die $usage; # /path/to/v2/repo
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => $name,
 	version => $version,
 	address => [ $email ],
@@ -37,7 +37,7 @@ unless ($dry_run) {
 		require PublicInbox::V2Writable;
 		PublicInbox::V2Writable->new($ibx, 1)->init_inbox(0);
 	} else {
-		system(qw(git init --bare -q), $mainrepo) == 0 or die;
+		system(qw(git init --bare -q), $inboxdir) == 0 or die;
 	}
 }
 $ibx = PublicInbox::InboxWritable->new($ibx);
diff --git a/t/admin.t b/t/admin.t
index 3790c9e2..0024df15 100644
--- a/t/admin.t
+++ b/t/admin.t
@@ -56,7 +56,7 @@ SKIP: {
 	use_ok 'PublicInbox::V2Writable';
 	use_ok 'PublicInbox::Inbox';
 	my $ibx = PublicInbox::Inbox->new({
-			mainrepo => $v2_dir,
+			inboxdir => $v2_dir,
 			name => 'test-v2writable',
 			version => 2,
 			-primary_address => 'test@example.com',
diff --git a/t/altid.t b/t/altid.t
index b8d32f78..4ab004c4 100644
--- a/t/altid.t
+++ b/t/altid.t
@@ -43,7 +43,7 @@ my $ibx;
 	$im->done;
 }
 {
-	$ibx = PublicInbox::Inbox->new({mainrepo => $git_dir});
+	$ibx = PublicInbox::Inbox->new({inboxdir => $git_dir});
 	$ibx->{altid} = $altid;
 	my $rw = PublicInbox::SearchIdx->new($ibx, 1);
 	$rw->index_sync;
diff --git a/t/altid_v2.t b/t/altid_v2.t
index 35ab7a1b..2c1d8616 100644
--- a/t/altid_v2.t
+++ b/t/altid_v2.t
@@ -14,12 +14,12 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 use_ok 'PublicInbox::V2Writable';
 use_ok 'PublicInbox::Inbox';
 my $tmpdir = tempdir('pi-altidv2-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $mainrepo = "$tmpdir/inbox";
+my $inboxdir = "$tmpdir/inbox";
 my $full = "$tmpdir/inbox/another-nntp.sqlite3";
 my $altid = [ 'serial:gmane:file=another-nntp.sqlite3' ];
 
 {
-	ok(mkdir($mainrepo), 'created repo for msgmap');
+	ok(mkdir($inboxdir), 'created repo for msgmap');
 	my $mm = PublicInbox::Msgmap->new_file($full, 1);
 	is($mm->mid_set(1234, 'a@example.com'), 1, 'mid_set once OK');
 	ok(0 == $mm->mid_set(1234, 'a@example.com'), 'mid_set not idempotent');
@@ -27,7 +27,7 @@ my $altid = [ 'serial:gmane:file=another-nntp.sqlite3' ];
 }
 
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2writable',
 	version => 2,
 	-primary_address => 'test@example.com',
diff --git a/t/cgi.t b/t/cgi.t
index 51d64914..1b4b06cb 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -29,7 +29,7 @@ my $cfgpfx = "publicinbox.test";
 	close $fh or die "close: $!\n";
 	my %cfg = (
 		"$cfgpfx.address" => $addr,
-		"$cfgpfx.mainrepo" => $maindir,
+		"$cfgpfx.inboxdir" => $maindir,
 		"$cfgpfx.indexlevel" => 'basic',
 	);
 	while (my ($k,$v) = each %cfg) {
diff --git a/t/config.t b/t/config.t
index 3b4b12b3..0866f264 100644
--- a/t/config.t
+++ b/t/config.t
@@ -24,7 +24,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 
 	my $cfg = PublicInbox::Config->new($f);
 	is_deeply($cfg->lookup('meta@public-inbox.org'), {
-		'mainrepo' => '/home/pi/meta-main.git',
+		'inboxdir' => '/home/pi/meta-main.git',
 		'address' => [ 'meta@public-inbox.org' ],
 		'domain' => 'public-inbox.org',
 		'url' => 'http://example.com/meta',
@@ -44,7 +44,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 		              'sandbox@public-inbox.org',
 			      'test@public-inbox.org'],
 		-primary_address => 'try@public-inbox.org',
-		'mainrepo' => '/home/pi/test-main.git',
+		'inboxdir' => '/home/pi/test-main.git',
 		'domain' => 'public-inbox.org',
 		'name' => 'test',
 		feedmax => 25,
@@ -66,13 +66,29 @@ $cfgpfx.altid=serial:enamg:file=b
 EOF
 	my $ibx = $config->lookup_name('test');
 	is_deeply($ibx->{altid}, [ @altid ]);
+
+	$config = PublicInbox::Config->new(\<<EOF);
+$cfgpfx.address=test\@example.com
+$cfgpfx.mainrepo=/path/to/non/existent
+EOF
+	$ibx = $config->lookup_name('test');
+	is($ibx->{inboxdir}, '/path/to/non/existent', 'mainrepo still works');
+
+	$config = PublicInbox::Config->new(\<<EOF);
+$cfgpfx.address=test\@example.com
+$cfgpfx.inboxdir=/path/to/non/existent
+$cfgpfx.mainrepo=/path/to/deprecated
+EOF
+	$ibx = $config->lookup_name('test');
+	is($ibx->{inboxdir}, '/path/to/non/existent',
+		'inboxdir takes precedence');
 }
 
 {
 	my $pfx = "publicinbox.test";
 	my $str = <<EOF;
 $pfx.address=test\@example.com
-$pfx.mainrepo=/path/to/non/existent
+$pfx.inboxdir=/path/to/non/existent
 publicinbox.nntpserver=news.example.com
 EOF
 	my $cfg = PublicInbox::Config->new(\$str);
@@ -81,7 +97,7 @@ EOF
 
 	$str = <<EOF;
 $pfx.address=test\@example.com
-$pfx.mainrepo=/path/to/non/existent
+$pfx.inboxdir=/path/to/non/existent
 $pfx.nntpserver=news.alt.example.com
 EOF
 	$cfg = PublicInbox::Config->new(\$str);
@@ -95,9 +111,9 @@ EOF
 	my $pfx2 = "publicinbox.foo";
 	my $str = <<EOF;
 $pfx.address=test\@example.com
-$pfx.mainrepo=/path/to/non/existent
+$pfx.inboxdir=/path/to/non/existent
 $pfx2.address=foo\@example.com
-$pfx2.mainrepo=/path/to/foo
+$pfx2.inboxdir=/path/to/foo
 publicinbox.noobfuscate=public-inbox.org \@example.com z\@EXAMPLE.com
 $pfx.obfuscate=true
 EOF
@@ -161,7 +177,7 @@ for my $s (@valid) {
 		push @expect, "$i";
 		print $fh <<"" or die "print: $!";
 [publicinbox "$i"]
-	mainrepo = /path/to/$i.git
+	inboxdir = /path/to/$i.git
 	address = $i\@example.com
 
 	}
@@ -177,9 +193,9 @@ for my $s (@valid) {
 	my $pfx2 = "publicinbox.test2";
 	my $str = <<EOF;
 $pfx1.address=test\@example.com
-$pfx1.mainrepo=/path/to/non/existent
+$pfx1.inboxdir=/path/to/non/existent
 $pfx2.address=foo\@example.com
-$pfx2.mainrepo=/path/to/foo
+$pfx2.inboxdir=/path/to/foo
 $pfx1.coderepo=project
 $pfx2.coderepo=project
 coderepo.project.dir=/path/to/project.git
diff --git a/t/config_limiter.t b/t/config_limiter.t
index c1fffecf..57e298ba 100644
--- a/t/config_limiter.t
+++ b/t/config_limiter.t
@@ -8,7 +8,7 @@ my $cfgpfx = "publicinbox.test";
 {
 	my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=test\@example.com
-$cfgpfx.mainrepo=/path/to/non/existent
+$cfgpfx.inboxdir=/path/to/non/existent
 $cfgpfx.httpbackendmax=12
 EOF
 	my $ibx = $config->lookup_name('test');
@@ -27,7 +27,7 @@ EOF
 	my $config = PublicInbox::Config->new(\<<EOF);
 publicinboxlimiter.named.max=3
 $cfgpfx.address=test\@example.com
-$cfgpfx.mainrepo=/path/to/non/existent
+$cfgpfx.inboxdir=/path/to/non/existent
 $cfgpfx.httpbackendmax=named
 EOF
 	my $ibx = $config->lookup_name('test');
diff --git a/t/convert-compact.t b/t/convert-compact.t
index 6d091031..dbccfbad 100644
--- a/t/convert-compact.t
+++ b/t/convert-compact.t
@@ -20,15 +20,15 @@ use_ok 'PublicInbox::V2Writable';
 use PublicInbox::Import;
 my $tmpdir = tempdir('convert-compact-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-	mainrepo => "$tmpdir/v1",
+	inboxdir => "$tmpdir/v1",
 	name => 'test-v1',
 	-primary_address => 'test@example.com',
 };
 
-ok(PublicInbox::Import::run_die([qw(git init --bare -q), $ibx->{mainrepo}]),
+ok(PublicInbox::Import::run_die([qw(git init --bare -q), $ibx->{inboxdir}]),
 	'initialized v1 repo');
 ok(umask(077), 'set restrictive umask');
-ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{mainrepo}",
+ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{inboxdir}",
 	qw(config core.sharedRepository 0644)]), 'set sharedRepository');
 $ibx = PublicInbox::Inbox->new($ibx);
 my $im = PublicInbox::Import->new($ibx->git, undef, undef, $ibx);
@@ -51,11 +51,11 @@ for (1..2) {
 	is($@, '', 'no errors syncing');
 }
 
-is(((stat("$ibx->{mainrepo}/public-inbox"))[2]) & 07777, 0755,
+is(((stat("$ibx->{inboxdir}/public-inbox"))[2]) & 07777, 0755,
 	'sharedRepository respected for v1');
-is(((stat("$ibx->{mainrepo}/public-inbox/msgmap.sqlite3"))[2]) & 07777, 0644,
+is(((stat("$ibx->{inboxdir}/public-inbox/msgmap.sqlite3"))[2]) & 07777, 0644,
 	'sharedRepository respected for v1 msgmap');
-my @xdir = glob("$ibx->{mainrepo}/public-inbox/xap*/*");
+my @xdir = glob("$ibx->{inboxdir}/public-inbox/xap*/*");
 foreach (@xdir) {
 	my @st = stat($_);
 	is($st[2] & 07777, -f _ ? 0644 : 0755,
@@ -68,15 +68,15 @@ open my $err, '>>', "$tmpdir/err.log" or die "open: err.log $!\n";
 open my $out, '>>', "$tmpdir/out.log" or die "open: out.log $!\n";
 my $rdr = { 1 => fileno($out), 2 => fileno($err) };
 
-my $cmd = [ 'public-inbox-compact', $ibx->{mainrepo} ];
+my $cmd = [ 'public-inbox-compact', $ibx->{inboxdir} ];
 ok(PublicInbox::Import::run_die($cmd, undef, $rdr), 'v1 compact works');
 
-@xdir = glob("$ibx->{mainrepo}/public-inbox/xap*");
+@xdir = glob("$ibx->{inboxdir}/public-inbox/xap*");
 is(scalar(@xdir), 1, 'got one xapian directory after compact');
 is(((stat($xdir[0]))[2]) & 07777, 0755,
 	'sharedRepository respected on v1 compact');
 
-$cmd = [ 'public-inbox-convert', $ibx->{mainrepo}, "$tmpdir/v2" ];
+$cmd = [ 'public-inbox-convert', $ibx->{inboxdir}, "$tmpdir/v2" ];
 ok(PublicInbox::Import::run_die($cmd, undef, $rdr), 'convert works');
 @xdir = glob("$tmpdir/v2/xap*/*");
 foreach (@xdir) {
@@ -88,7 +88,7 @@ foreach (@xdir) {
 $cmd = [ 'public-inbox-compact', "$tmpdir/v2" ];
 my $env = { NPROC => 2 };
 ok(PublicInbox::Import::run_die($cmd, $env, $rdr), 'v2 compact works');
-$ibx->{mainrepo} = "$tmpdir/v2";
+$ibx->{inboxdir} = "$tmpdir/v2";
 $ibx->{version} = 2;
 
 @xdir = glob("$tmpdir/v2/xap*/*");
diff --git a/t/edit.t b/t/edit.t
index 6b4e35c3..1e9597f1 100644
--- a/t/edit.t
+++ b/t/edit.t
@@ -21,9 +21,9 @@ IPC::Run->import(qw(run));
 
 my $cmd_pfx = 'blib/script/public-inbox';
 my $tmpdir = tempdir('pi-edit-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $mainrepo = "$tmpdir/v2";
+my $inboxdir = "$tmpdir/v2";
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2edit',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -41,12 +41,12 @@ my $mid = mid_clean($mime->header('Message-Id'));
 ok($im->add($mime), 'add message to be edited');
 $im->done;
 my ($in, $out, $err, $cmd, $cur, $t);
-my $__git_dir = "--git-dir=$ibx->{mainrepo}/git/0.git";
+my $__git_dir = "--git-dir=$ibx->{inboxdir}/git/0.git";
 
 $t = '-F FILE'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/boolean prefix/bool pfx/'";
-	$cmd = [ "$cmd_pfx-edit", "-F$file", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-F$file", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t edit OK");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
@@ -56,7 +56,7 @@ $t = '-F FILE'; {
 $t = '-m MESSAGE_ID'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t edit OK");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/boolean prefix/, "$t message edited");
@@ -67,7 +67,7 @@ $t = 'no-op -m MESSAGE_ID'; {
 	$in = $out = $err = '';
 	my $before = `git $__git_dir rev-parse HEAD`;
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
 	my $prev = $cur;
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
@@ -84,7 +84,7 @@ $t = 'no-op -m MESSAGE_ID w/Status: header'; { # because mutt does it
 	my $before = `git $__git_dir rev-parse HEAD`;
 	local $ENV{MAIL_EDITOR} =
 			"$^X -i -p -e 's/^Subject:.*/Status: RO\\n\$&/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
 	my $prev = $cur;
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
@@ -102,7 +102,7 @@ $t = '-m MESSAGE_ID can change Received: headers'; {
 	my $before = `git $__git_dir rev-parse HEAD`;
 	local $ENV{MAIL_EDITOR} =
 			"$^X -i -p -e 's/^Subject:.*/Received: x\\n\$&/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/boolean prefix/,
@@ -113,7 +113,7 @@ $t = '-m MESSAGE_ID can change Received: headers'; {
 $t = '-m miss'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/boolean/FAIL/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid-miss", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid-miss", $inboxdir ];
 	ok(!run($cmd, \$in, \$out, \$err), "$t fails on invalid MID");
 	like($err, qr/No message found/, "$t shows error");
 }
@@ -121,7 +121,7 @@ $t = '-m miss'; {
 $t = 'non-interactive editor failure'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 'END { exit 1 }'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(!run($cmd, \$in, \$out, \$err), "$t detected");
 	like($err, qr/END \{ exit 1 \}' failed:/, "$t shows error");
 }
@@ -134,7 +134,7 @@ $t = 'mailEditor set in config'; {
 	is($rc, 0, 'set publicinbox.mailEditor');
 	local $ENV{MAIL_EDITOR};
 	local $ENV{GIT_EDITOR} = 'echo should not run';
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t edited message");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
@@ -144,20 +144,20 @@ $t = 'mailEditor set in config'; {
 $t = '--raw and mbox escaping'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^\$/\\nFrom not mbox\\n/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	like($cur->body, qr/^From not mbox/sm, 'put "From " line into body');
 
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^>From not/\$& an/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds with mbox escaping");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	like($cur->body, qr/^From not an mbox/sm,
 		'changed "From " line unescaped');
 
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^From not an mbox\\n//s'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds again");
 	$cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
 	unlike($cur->body, qr/^From not an mbox/sm, "$t restored body");
@@ -174,7 +174,7 @@ $t = 'reuse Message-ID'; {
 $t = 'edit ambiguous Message-ID with -m'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
 	ok(!run($cmd, \$in, \$out, \$err), "$t fails w/o --force");
 	like($err, qr/Multiple messages with different content found matching/,
 		"$t shows matches");
@@ -184,7 +184,7 @@ $t = 'edit ambiguous Message-ID with -m'; {
 $t .= ' and --force'; {
 	$in = $out = $err = '';
 	local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^Subject:.*/Subject:x/i'";
-	$cmd = [ "$cmd_pfx-edit", "-m$mid", '--force', $mainrepo ];
+	$cmd = [ "$cmd_pfx-edit", "-m$mid", '--force', $inboxdir ];
 	ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
 	like($err, qr/Will edit all of them/, "$t notes all will be edited");
 	my @dump = `git $__git_dir cat-file --batch --batch-all-objects`;
diff --git a/t/feed.t b/t/feed.t
index 4a887b49..eb1f35fb 100644
--- a/t/feed.t
+++ b/t/feed.t
@@ -22,7 +22,7 @@ my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
 	address => 'test@example',
 	name => 'testbox',
-	mainrepo => $git_dir,
+	inboxdir => $git_dir,
 	url => 'http://example.com/test',
 	feedmax => 3,
 });
diff --git a/t/filter_rubylang.t b/t/filter_rubylang.t
index 9ed6684b..7b1da11c 100644
--- a/t/filter_rubylang.t
+++ b/t/filter_rubylang.t
@@ -30,7 +30,7 @@ SKIP: {
 				TMPDIR => 1, CLEANUP => 1);
 	is(mkdir("$git_dir/public-inbox"), 1, "created public-inbox dir");
 	my $altid = [ "serial:ruby-core:file=msgmap.sqlite3" ];
-	my $ibx = PublicInbox::Inbox->new({ mainrepo => $git_dir,
+	my $ibx = PublicInbox::Inbox->new({ inboxdir => $git_dir,
 						altid => $altid });
 	$f = PublicInbox::Filter::RubyLang->new(-inbox => $ibx);
 	$msg = <<'EOF';
diff --git a/t/html_index.t b/t/html_index.t
index b9f866b3..2f4b4d1b 100644
--- a/t/html_index.t
+++ b/t/html_index.t
@@ -14,7 +14,7 @@ my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
 	address => 'test@example',
 	name => 'tester',
-	mainrepo => $git_dir,
+	inboxdir => $git_dir,
 	url => 'http://example.com/test',
 });
 my $git = $ibx->git;
diff --git a/t/indexlevels-mirror.t b/t/indexlevels-mirror.t
index b685da14..40afe4e9 100644
--- a/t/indexlevels-mirror.t
+++ b/t/indexlevels-mirror.t
@@ -36,7 +36,7 @@ sub import_index_incremental {
 	my $this = "pi-$v-$level-indexlevels";
 	my $tmpdir = tempdir("$this-tmp-XXXXXX", TMPDIR => 1, CLEANUP => 1);
 	my $ibx = PublicInbox::Inbox->new({
-		mainrepo => "$tmpdir/testbox",
+		inboxdir => "$tmpdir/testbox",
 		name => $this,
 		version => $v,
 		-primary_address => 'test@example.com',
@@ -48,9 +48,9 @@ sub import_index_incremental {
 	$im->done;
 
 	# index master (required for v1)
-	is(system($index, $ibx->{mainrepo}, "-L$level"), 0, 'index master OK');
+	is(system($index, $ibx->{inboxdir}, "-L$level"), 0, 'index master OK');
 	my $ro_master = PublicInbox::Inbox->new({
-		mainrepo => $ibx->{mainrepo},
+		inboxdir => $ibx->{inboxdir},
 		indexlevel => $level
 	});
 	my ($nr, $msgs) = $ro_master->recent;
@@ -61,9 +61,9 @@ sub import_index_incremental {
 	my @cmd = (qw(git clone --mirror -q));
 	my $mirror = "$tmpdir/mirror-$v";
 	if ($v == 1) {
-		push @cmd, $ibx->{mainrepo}, $mirror;
+		push @cmd, $ibx->{inboxdir}, $mirror;
 	} else {
-		push @cmd, "$ibx->{mainrepo}/git/0.git", "$mirror/git/0.git";
+		push @cmd, "$ibx->{inboxdir}/git/0.git", "$mirror/git/0.git";
 	}
 	my $fetch_dir = $cmd[-1];
 	is(system(@cmd), 0, "v$v clone OK");
@@ -80,7 +80,7 @@ sub import_index_incremental {
 
 	# read-only access
 	my $ro_mirror = PublicInbox::Inbox->new({
-		mainrepo => $mirror,
+		inboxdir => $mirror,
 		indexlevel => $level,
 	});
 	($nr, $msgs) = $ro_mirror->recent;
@@ -101,7 +101,7 @@ sub import_index_incremental {
 		['m@1','m@2'], 'got both messages in mirror');
 
 	# incremental index master (required for v1)
-	is(system($index, $ibx->{mainrepo}, "-L$level"), 0, 'index master OK');
+	is(system($index, $ibx->{inboxdir}, "-L$level"), 0, 'index master OK');
 	($nr, $msgs) = $ro_master->recent;
 	is($nr, 2, '2nd message seen in master');
 	is_deeply([sort { $a cmp $b } map { $_->{mid} } @$msgs],
@@ -137,7 +137,7 @@ sub import_index_incremental {
 		'message unavailable in mirror');
 
 	if ($v == 2 && $level eq 'basic') {
-		is_deeply([glob("$ibx->{mainrepo}/xap*/?/")], [],
+		is_deeply([glob("$ibx->{inboxdir}/xap*/?/")], [],
 			 'no Xapian shard directories for v2 basic');
 	}
 	if ($level ne 'basic') {
diff --git a/t/mda.t b/t/mda.t
index 3cab590b..1be41bcb 100644
--- a/t/mda.t
+++ b/t/mda.t
@@ -38,7 +38,7 @@ my $mime;
 
 	my %cfg = (
 		"$cfgpfx.address" => $addr,
-		"$cfgpfx.mainrepo" => $maindir,
+		"$cfgpfx.inboxdir" => $maindir,
 	);
 	while (my ($k,$v) = each %cfg) {
 		is(0, system(qw(git config --file), $pi_config, $k, $v),
diff --git a/t/mda_filter_rubylang.t b/t/mda_filter_rubylang.t
index 279afaac..f7d872c9 100644
--- a/t/mda_filter_rubylang.t
+++ b/t/mda_filter_rubylang.t
@@ -27,12 +27,12 @@ for my $v (qw(V1 V2)) {
 	my @warn;
 	$SIG{__WARN__} = sub { push @warn, @_ };
 	my $cfgpfx = "publicinbox.$v";
-	my $mainrepo = "$tmpdir/$v";
+	my $inboxdir = "$tmpdir/$v";
 	my $addr = "test-$v\@example.com";
-	my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $mainrepo,
+	my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $inboxdir,
 		"http://example.com/$v", $addr);
 	is(system(@cmd), 0, 'public-inbox init OK');
-	is(system('blib/script/public-inbox-index', $mainrepo), 0);
+	is(system('blib/script/public-inbox-index', $inboxdir), 0);
 	is(system(@cfg, "$cfgpfx.filter", 'PublicInbox::Filter::RubyLang'), 0);
 	is(system(@cfg, "$cfgpfx.altid",
 		'serial:alerts:file=msgmap.sqlite3'), 0);
diff --git a/t/nntp.t b/t/nntp.t
index f3a9c7d8..aabfd4ff 100644
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -99,7 +99,7 @@ use_ok 'PublicInbox::Inbox';
 	require Email::MIME;
 	my $u = 'https://example.com/a/';
 	my $ng = PublicInbox::Inbox->new({ name => 'test',
-					mainrepo => 'test.git',
+					inboxdir => 'test.git',
 					address => 'a@example.com',
 					-primary_address => 'a@example.com',
 					newsgroup => 'test',
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index 1a74924c..0b6afcef 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -37,7 +37,7 @@ require_git('2.6') if $version >= 2;
 my $tmpdir = tempdir('pi-nntpd-tls-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
-my $mainrepo = "$tmpdir";
+my $inboxdir = "$tmpdir";
 my $pi_config = "$tmpdir/pi_config";
 my $group = 'test-nntpd-tls';
 my $addr = $group . '@example.com';
@@ -52,7 +52,7 @@ END {
 };
 
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'nntpd-tls',
 	version => $version,
 	-primary_address => $addr,
@@ -64,7 +64,7 @@ $ibx->init_inbox(0);
 	open my $fh, '>', $pi_config or die "open: $!\n";
 	print $fh <<EOF
 [publicinbox "nntpd-tls"]
-	mainrepo = $mainrepo
+	inboxdir = $inboxdir
 	address = $addr
 	indexlevel = basic
 	newsgroup = $group
diff --git a/t/nntpd-validate.t b/t/nntpd-validate.t
index 87829b03..de024394 100644
--- a/t/nntpd-validate.t
+++ b/t/nntpd-validate.t
@@ -147,7 +147,7 @@ done_testing();
 sub make_local_server {
 	require PublicInbox::Inbox;
 	$group = 'inbox.test.perf.nntpd';
-	my $ibx = { mainrepo => $inbox_dir, newsgroup => $group };
+	my $ibx = { inboxdir => $inbox_dir, newsgroup => $group };
 	$ibx = PublicInbox::Inbox->new($ibx);
 	my $nntpd = 'blib/script/public-inbox-nntpd';
 	my $pi_config = "$tmpdir/config";
@@ -156,7 +156,7 @@ sub make_local_server {
 		print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "test"]
 	newsgroup = $group
-	mainrepo = $inbox_dir
+	inboxdir = $inbox_dir
 	address = test\@example.com
 
 		close $fh or die "close($pi_config): $!";
diff --git a/t/nntpd.t b/t/nntpd.t
index 153204df..462e2da9 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -26,7 +26,7 @@ my $tmpdir = tempdir('pi-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
-my $mainrepo = "$tmpdir/main.git";
+my $inboxdir = "$tmpdir/main.git";
 my $group = 'test-nntpd';
 my $addr = $group . '@example.com';
 my $nntpd = 'blib/script/public-inbox-nntpd';
@@ -43,7 +43,7 @@ my $len;
 END { kill 'TERM', $pid if defined $pid };
 
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => $group,
 	version => $version,
 	-primary_address => $addr,
@@ -52,7 +52,7 @@ my $ibx = {
 $ibx = PublicInbox::Inbox->new($ibx);
 {
 	local $ENV{HOME} = $home;
-	my @cmd = ($init, $group, $mainrepo, 'http://example.com/', $addr);
+	my @cmd = ($init, $group, $inboxdir, 'http://example.com/', $addr);
 	push @cmd, "-V$version", '-Lbasic';
 	is(system(@cmd), 0, 'init OK');
 	is(system(qw(git config), "--file=$home/.public-inbox/config",
diff --git a/t/perf-msgview.t b/t/perf-msgview.t
index 0defafc4..492ed487 100644
--- a/t/perf-msgview.t
+++ b/t/perf-msgview.t
@@ -20,7 +20,7 @@ if (require_git(2.19, 1)) {
 }
 
 use_ok 'Plack::Util';
-my $ibx = PublicInbox::Inbox->new({ mainrepo => $pi_dir, name => 'name' });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $pi_dir, name => 'name' });
 my $git = $ibx->git;
 my $fh = $git->popen(@cat);
 my $vec = '';
diff --git a/t/perf-nntpd.t b/t/perf-nntpd.t
index f272e18a..7abf2249 100644
--- a/t/perf-nntpd.t
+++ b/t/perf-nntpd.t
@@ -27,7 +27,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) {
 	$host_port .= ":119" unless index($host_port, ':') > 0;
 } else {
 	$group = 'inbox.test.perf.nntpd';
-	my $ibx = { mainrepo => $pi_dir, newsgroup => $group };
+	my $ibx = { inboxdir => $pi_dir, newsgroup => $group };
 	$ibx = PublicInbox::Inbox->new($ibx);
 	my $nntpd = 'blib/script/public-inbox-nntpd';
 	my $tmpdir = tempdir('perf-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
@@ -38,7 +38,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) {
 		print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "test"]
 	newsgroup = $group
-	mainrepo = $pi_dir
+	inboxdir = $pi_dir
 	address = test\@example.com
 
 		close $fh or die "close($pi_config): $!";
diff --git a/t/perf-threading.t b/t/perf-threading.t
index 3bed05c4..8d28b3a0 100644
--- a/t/perf-threading.t
+++ b/t/perf-threading.t
@@ -9,7 +9,7 @@ use Benchmark qw(:all);
 use PublicInbox::Inbox;
 my $pi_dir = $ENV{GIANT_PI_DIR};
 plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir;
-my $ibx = PublicInbox::Inbox->new({ mainrepo => $pi_dir });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $pi_dir });
 eval { require PublicInbox::Search };
 my $srch = $ibx->search;
 plan skip_all => "$pi_dir not configured for search $0 $@" unless $srch;
diff --git a/t/plack.t b/t/plack.t
index f9a55e43..7e65ad74 100644
--- a/t/plack.t
+++ b/t/plack.t
@@ -29,7 +29,7 @@ foreach my $mod (@mods) { use_ok $mod; }
 	close $fh or die "close: $!\n";
 	my %cfg = (
 		"$cfgpfx.address" => $addr,
-		"$cfgpfx.mainrepo" => $maindir,
+		"$cfgpfx.inboxdir" => $maindir,
 		"$cfgpfx.url" => 'http://example.com/test/',
 		"$cfgpfx.newsgroup" => 'inbox.test',
 	);
diff --git a/t/psgi_attach.t b/t/psgi_attach.t
index f5140f44..96f0cb47 100644
--- a/t/psgi_attach.t
+++ b/t/psgi_attach.t
@@ -23,7 +23,7 @@ use_ok 'PublicInbox::WwwAttach';
 use Plack::Builder;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$maindir
+$cfgpfx.inboxdir=$maindir
 EOF
 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
 my $git = PublicInbox::Git->new($maindir);
diff --git a/t/psgi_bad_mids.t b/t/psgi_bad_mids.t
index 95196a3f..c7c94718 100644
--- a/t/psgi_bad_mids.t
+++ b/t/psgi_bad_mids.t
@@ -15,10 +15,10 @@ foreach my $mod (@mods) {
 }
 use_ok($_) for @mods;
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-bad-mids-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-bad-mids-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $cfgpfx = "publicinbox.bad-mids";
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'bad-mids',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -55,7 +55,7 @@ $im->done;
 
 my $cfg = <<EOF;
 $cfgpfx.address=$ibx->{-primary_address}
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 EOF
 my $config = PublicInbox::Config->new(\$cfg);
 my $www = PublicInbox::WWW->new($config);
diff --git a/t/psgi_mount.t b/t/psgi_mount.t
index 7160896b..aa7c863f 100644
--- a/t/psgi_mount.t
+++ b/t/psgi_mount.t
@@ -23,7 +23,7 @@ use Plack::Builder;
 use Plack::App::URLMap;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$maindir
+$cfgpfx.inboxdir=$maindir
 EOF
 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
 my $git = PublicInbox::Git->new($maindir);
diff --git a/t/psgi_multipart_not.t b/t/psgi_multipart_not.t
index 2670c47a..40bc3c18 100644
--- a/t/psgi_multipart_not.t
+++ b/t/psgi_multipart_not.t
@@ -17,7 +17,7 @@ use_ok($_) for @mods;
 use_ok 'PublicInbox::V2Writable';
 my $repo = tempdir('pi-psgi-multipart-not.XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => $repo,
+	inboxdir => $repo,
 	name => 'multipart-not',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -44,7 +44,7 @@ $im->done;
 my $cfgpfx = "publicinbox.v2test";
 my $cfg = <<EOF;
 $cfgpfx.address=$ibx->{-primary_address}
-$cfgpfx.mainrepo=$repo
+$cfgpfx.inboxdir=$repo
 EOF
 my $config = PublicInbox::Config->new(\$cfg);
 my $www = PublicInbox::WWW->new($config);
diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t
index 2e00b6d8..707807a7 100644
--- a/t/psgi_scan_all.t
+++ b/t/psgi_scan_all.t
@@ -19,12 +19,12 @@ my $cfg = '';
 foreach my $i (1..2) {
 	my $cfgpfx = "publicinbox.test-$i";
 	my $addr = "test-$i\@example.com";
-	my $mainrepo = "$tmp/$i";
+	my $inboxdir = "$tmp/$i";
 	$cfg .= "$cfgpfx.address=$addr\n";
-	$cfg .= "$cfgpfx.mainrepo=$mainrepo\n";
+	$cfg .= "$cfgpfx.inboxdir=$inboxdir\n";
 	$cfg .= "$cfgpfx.url=http://example.com/$i\n";
 	my $opt = {
-		mainrepo => $mainrepo,
+		inboxdir => $inboxdir,
 		name => "test-$i",
 		version => 2,
 		indexlevel => 'basic',
diff --git a/t/psgi_search.t b/t/psgi_search.t
index ab6892bc..4cd0e499 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -21,7 +21,7 @@ use_ok $_ foreach (@mods, qw(PublicInbox::SearchIdx));
 my $tmpdir = tempdir('pi-psgi-search.XXXXXX', TMPDIR => 1, CLEANUP => 1);
 
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => $tmpdir,
+	inboxdir => $tmpdir,
 	address => 'git@vger.kernel.org',
 	name => 'test',
 });
@@ -47,7 +47,7 @@ PublicInbox::SearchIdx->new($ibx, 1)->index_sync;
 my $cfgpfx = "publicinbox.test";
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=git\@vger.kernel.org
-$cfgpfx.mainrepo=$tmpdir
+$cfgpfx.inboxdir=$tmpdir
 EOF
 my $www = PublicInbox::WWW->new($config);
 test_psgi(sub { $www->call(@_) }, sub {
diff --git a/t/psgi_text.t b/t/psgi_text.t
index 944a6476..da7c6f57 100644
--- a/t/psgi_text.t
+++ b/t/psgi_text.t
@@ -23,7 +23,7 @@ use_ok 'PublicInbox::WwwText';
 use Plack::Builder;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$maindir
+$cfgpfx.inboxdir=$maindir
 EOF
 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
 my $www = PublicInbox::WWW->new($config);
diff --git a/t/psgi_v2.t b/t/psgi_v2.t
index e4f7306e..cb5ece63 100644
--- a/t/psgi_v2.t
+++ b/t/psgi_v2.t
@@ -18,9 +18,9 @@ foreach my $mod (@mods) {
 }
 use_ok($_) for @mods;
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-v2_dupes-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-v2_dupes-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2writable',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -56,7 +56,7 @@ $im->done;
 my $cfgpfx = "publicinbox.v2test";
 my $cfg = <<EOF;
 $cfgpfx.address=$ibx->{-primary_address}
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 EOF
 my $config = PublicInbox::Config->new(\$cfg);
 my $www = PublicInbox::WWW->new($config);
diff --git a/t/purge.t b/t/purge.t
index 384f32a6..67c4e58d 100644
--- a/t/purge.t
+++ b/t/purge.t
@@ -15,9 +15,9 @@ use Cwd qw(abs_path);
 my $purge = abs_path('blib/script/public-inbox-purge');
 my $tmpdir = tempdir('pi-purge-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = "$tmpdir/v2";
+my $inboxdir = "$tmpdir/v2";
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2purge',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -47,22 +47,22 @@ $v2w->done;
 # failing cases, first:
 my $in = "$raw\nMOAR\n";
 my ($out, $err) = ('', '');
-ok(IPC::Run::run([$purge, '-f', $mainrepo], \$in, \$out, \$err),
+ok(IPC::Run::run([$purge, '-f', $inboxdir], \$in, \$out, \$err),
 	'purge -f OK');
 
 $out = $err = '';
-ok(!IPC::Run::run([$purge, $mainrepo], \$in, \$out, \$err),
+ok(!IPC::Run::run([$purge, $inboxdir], \$in, \$out, \$err),
 	'mismatch fails without -f');
 is($? >> 8, 1, 'missed purge exits with 1');
 
 # a successful case:
-ok(IPC::Run::run([$purge, $mainrepo], \$raw, \$out, \$err), 'match OK');
+ok(IPC::Run::run([$purge, $inboxdir], \$raw, \$out, \$err), 'match OK');
 like($out, qr/\b[a-f0-9]{40,}/m, 'removed commit noted');
 
 # add (old) vger filter to config file
 print $cfg_fh <<EOF or die "print $!";
 [publicinbox "test-v2purge"]
-	mainrepo = $mainrepo
+	inboxdir = $inboxdir
 	address = test\@example.com
 	indexlevel = basic
 	filter = PublicInbox::Filter::Vger
diff --git a/t/replace.t b/t/replace.t
index b1ee15bf..24f7537c 100644
--- a/t/replace.t
+++ b/t/replace.t
@@ -19,7 +19,7 @@ sub test_replace ($$$) {
 	my $this = "pi-$v-$level-replace";
 	my $tmpdir = tempdir("$this-tmp-XXXXXX", TMPDIR => 1, CLEANUP => 1);
 	my $ibx = PublicInbox::Inbox->new({
-		mainrepo => "$tmpdir/testbox",
+		inboxdir => "$tmpdir/testbox",
 		name => $this,
 		version => $v,
 		-primary_address => 'test@example.com',
@@ -95,7 +95,7 @@ EOF
 	my $t19931002 = qr/ 749520000 /;
 	is_deeply([grep(/$t19931002/, @all)], [], "nothing matches $t19931002");
 
-	for my $dir (glob("$ibx->{mainrepo}/git/*.git")) {
+	for my $dir (glob("$ibx->{inboxdir}/git/*.git")) {
 		my ($bn) = ($dir =~ m!([^/]+)\z!);
 		is(system(qw(git --git-dir), $dir, qw(fsck --strict)), 0,
 			"git fsck is clean in epoch $bn");
diff --git a/t/search-thr-index.t b/t/search-thr-index.t
index 4b26f2ee..26339989 100644
--- a/t/search-thr-index.t
+++ b/t/search-thr-index.t
@@ -18,7 +18,7 @@ my $tmpdir = tempdir('pi-search-thr-index.XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/a.git";
 
 is(0, system(qw(git init -q --bare), $git_dir), "git init (main)");
-my $ibx = PublicInbox::Inbox->new({mainrepo => $git_dir});
+my $ibx = PublicInbox::Inbox->new({inboxdir => $git_dir});
 my $rw = PublicInbox::SearchIdx->new($ibx, 1);
 ok($rw, "search indexer created");
 my $data = <<'EOF';
diff --git a/t/search.t b/t/search.t
index a728d79f..b6531ab3 100644
--- a/t/search.t
+++ b/t/search.t
@@ -14,7 +14,7 @@ use File::Temp qw/tempdir/;
 use Email::MIME;
 my $tmpdir = tempdir('pi-search-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/a.git";
-my $ibx = PublicInbox::Inbox->new({ mainrepo => $git_dir });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $git_dir });
 my ($root_id, $last_id);
 
 is(0, system(qw(git init --shared -q --bare), $git_dir), "git init (main)")
diff --git a/t/solver_git.t b/t/solver_git.t
index 0b7d7c49..baab40a4 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -22,9 +22,9 @@ $git_dir = abs_path($git_dir);
 
 use_ok "PublicInbox::$_" for (qw(Inbox V2Writable MIME Git SolverGit));
 
-my $mainrepo = tempdir('pi-solver-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-solver-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $opts = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2writable',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -52,7 +52,7 @@ is(undef, $git->commit_title('impossible'), 'undef on impossible object');
 $ibx->{-repo_objs} = [ $git ];
 my $res;
 my $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
-open my $log, '+>>', "$mainrepo/solve.log" or die "open: $!";
+open my $log, '+>>', "$inboxdir/solve.log" or die "open: $!";
 my $psgi_env = { 'psgi.errors' => *STDERR };
 $solver->solve($psgi_env, $log, '69df7d5', {});
 ok($res, 'solved a blob!');
diff --git a/t/v1-add-remove-add.t b/t/v1-add-remove-add.t
index 4777a307..3facd87e 100644
--- a/t/v1-add-remove-add.t
+++ b/t/v1-add-remove-add.t
@@ -12,10 +12,10 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	plan skip_all => "$mod missing for v1-add-remove-add.t" if $@;
 }
 require PublicInbox::SearchIdx;
-my $mainrepo = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-is(system(qw(git init --bare), $mainrepo), 0);
+my $inboxdir = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+is(system(qw(git init --bare), $inboxdir), 0);
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-add-remove-add',
 	-primary_address => 'test@example.com',
 };
diff --git a/t/v1reindex.t b/t/v1reindex.t
index d14a117d..e3547753 100644
--- a/t/v1reindex.t
+++ b/t/v1reindex.t
@@ -16,10 +16,10 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 }
 use_ok 'PublicInbox::SearchIdx';
 use_ok 'PublicInbox::Import';
-my $mainrepo = tempdir('pi-v1reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-is(system(qw(git init -q --bare), $mainrepo), 0);
+my $inboxdir = tempdir('pi-v1reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+is(system(qw(git init -q --bare), $inboxdir), 0);
 my $ibx_config = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v1reindex',
 	-primary_address => 'test@example.com',
 	indexlevel => 'full',
@@ -96,7 +96,7 @@ my ($mark1, $mark2, $mark3, $mark4);
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-my $xap = "$mainrepo/public-inbox/xapian".PublicInbox::Search::SCHEMA_VERSION();
+my $xap = "$inboxdir/public-inbox/xapian".PublicInbox::Search::SCHEMA_VERSION();
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed');
 {
@@ -118,7 +118,7 @@ ok(!-d $xap, 'Xapian directories removed');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -141,7 +141,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -164,7 +164,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -190,7 +190,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -239,7 +239,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 }
 
 # An incremental indexing test
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -349,7 +349,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 
 
 # Another incremental indexing test
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
diff --git a/t/v2-add-remove-add.t b/t/v2-add-remove-add.t
index c758dbb6..438fe3db 100644
--- a/t/v2-add-remove-add.t
+++ b/t/v2-add-remove-add.t
@@ -13,9 +13,9 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	plan skip_all => "$mod missing for v2-add-remove-add.t" if $@;
 }
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-	mainrepo => "$mainrepo/v2",
+	inboxdir => "$inboxdir/v2",
 	name => 'test-v2writable',
 	version => 2,
 	-primary_address => 'test@example.com',
diff --git a/t/v2mda.t b/t/v2mda.t
index 92b3333e..ebcbd1f4 100644
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -18,7 +18,7 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 use_ok 'PublicInbox::V2Writable';
 my $tmpdir = tempdir('pi-v2mda-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-	mainrepo => "$tmpdir/inbox",
+	inboxdir => "$tmpdir/inbox",
 	name => 'test-v2writable',
 	address => [ 'test@example.com' ],
 };
@@ -45,7 +45,7 @@ my $faildir = "$tmpdir/fail";
 local $ENV{PI_EMERGENCY} = $faildir;
 ok(mkdir $faildir);
 my @cmd = (qw(public-inbox-init), "-V$V", $ibx->{name},
-		$ibx->{mainrepo}, 'http://localhost/test',
+		$ibx->{inboxdir}, 'http://localhost/test',
 		$ibx->{address}->[0]);
 ok(PublicInbox::Import::run_die(\@cmd), 'initialized v2 inbox');
 
diff --git a/t/v2mirror.t b/t/v2mirror.t
index 86ca895d..a097a7f3 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -28,7 +28,7 @@ my $pi_config = "$tmpdir/config";
 	open my $fh, '>', $pi_config or die "open($pi_config): $!";
 	print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "v2"]
-	mainrepo = $tmpdir/in
+	inboxdir = $tmpdir/in
 	address = test\@example.com
 
 	close $fh or die "close($pi_config): $!";
@@ -88,7 +88,7 @@ foreach my $i (0..$epoch_max) {
 is(system(@cmd), 0, 'initialized public-inbox -V2');
 is(system("$script-index", "$tmpdir/m"), 0, 'indexed');
 
-my $mibx = { mainrepo => "$tmpdir/m", address => 'alt@example.com' };
+my $mibx = { inboxdir => "$tmpdir/m", address => 'alt@example.com' };
 $mibx = PublicInbox::Inbox->new($mibx);
 is_deeply([$mibx->mm->minmax], [$ibx->mm->minmax], 'index synched minmax');
 
diff --git a/t/v2reindex.t b/t/v2reindex.t
index 1dcefbe3..7c5a6b07 100644
--- a/t/v2reindex.t
+++ b/t/v2reindex.t
@@ -15,9 +15,9 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	plan skip_all => "$mod missing for v2reindex.t" if $@;
 }
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-v2reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-v2reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx_config = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2writable',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -100,7 +100,7 @@ my ($mark1, $mark2, $mark3, $mark4);
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-my $xap = "$mainrepo/xap".PublicInbox::Search::SCHEMA_VERSION();
+my $xap = "$inboxdir/xap".PublicInbox::Search::SCHEMA_VERSION();
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed');
 {
@@ -120,7 +120,7 @@ ok(!-d $xap, 'Xapian directories removed');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -143,7 +143,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 }
 
 my %sizes;
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -168,7 +168,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -207,7 +207,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 	is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -237,7 +237,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 
 
 # An incremental indexing test
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -347,7 +347,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 
 
 # Another incremental indexing test
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
diff --git a/t/v2writable.t b/t/v2writable.t
index c1c9196f..c2daac2f 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -14,9 +14,9 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 }
 use_ok 'PublicInbox::V2Writable';
 umask 007;
-my $mainrepo = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-	mainrepo => $mainrepo,
+	inboxdir => $inboxdir,
 	name => 'test-v2writable',
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -36,9 +36,9 @@ my $mime = PublicInbox::MIME->create(
 my $im = PublicInbox::V2Writable->new($ibx, {nproc => 1});
 is($im->{shards}, 1, 'one shard when forced');
 ok($im->add($mime), 'ordinary message added');
-foreach my $f ("$mainrepo/msgmap.sqlite3",
-		glob("$mainrepo/xap*/*"),
-		glob("$mainrepo/xap*/*/*")) {
+foreach my $f ("$inboxdir/msgmap.sqlite3",
+		glob("$inboxdir/xap*/*"),
+		glob("$inboxdir/xap*/*/*")) {
 	my @st = stat($f);
 	my ($bn) = (split(m!/!, $f))[-1];
 	is($st[2] & 07777, -f _ ? 0660 : 0770,
@@ -48,10 +48,10 @@ foreach my $f ("$mainrepo/msgmap.sqlite3",
 my $git0;
 
 if ('ensure git configs are correct') {
-	my @cmd = (qw(git config), "--file=$mainrepo/all.git/config",
+	my @cmd = (qw(git config), "--file=$inboxdir/all.git/config",
 		qw(core.sharedRepository 0644));
 	is(system(@cmd), 0, "set sharedRepository in all.git");
-	$git0 = PublicInbox::Git->new("$mainrepo/git/0.git");
+	$git0 = PublicInbox::Git->new("$inboxdir/git/0.git");
 	chomp(my $v = $git0->qx(qw(config core.sharedRepository)));
 	is($v, '0644', 'child repo inherited core.sharedRepository');
 	chomp($v = $git0->qx(qw(config --bool repack.writeBitmaps)));
@@ -131,14 +131,14 @@ if ('ensure git configs are correct') {
 
 {
 	use Net::NNTP;
-	my $err = "$mainrepo/stderr.log";
-	my $out = "$mainrepo/stdout.log";
+	my $err = "$inboxdir/stderr.log";
+	my $out = "$inboxdir/stdout.log";
 	my $group = 'inbox.comp.test.v2writable';
-	my $pi_config = "$mainrepo/pi_config";
+	my $pi_config = "$inboxdir/pi_config";
 	open my $fh, '>', $pi_config or die "open: $!\n";
 	print $fh <<EOF
 [publicinbox "test-v2writable"]
-	mainrepo = $mainrepo
+	inboxdir = $inboxdir
 	version = 2
 	address = test\@example.com
 	newsgroup = $group
diff --git a/t/watch_filter_rubylang.t b/t/watch_filter_rubylang.t
index b28d699a..4b88d670 100644
--- a/t/watch_filter_rubylang.t
+++ b/t/watch_filter_rubylang.t
@@ -32,15 +32,15 @@ for my $v (@v) {
 	my @warn;
 	$SIG{__WARN__} = sub { push @warn, @_ };
 	my $cfgpfx = "publicinbox.$v";
-	my $mainrepo = "$tmpdir/$v";
+	my $inboxdir = "$tmpdir/$v";
 	my $maildir = "$tmpdir/md-$v";
 	my $spamdir = "$tmpdir/spam-$v";
 	my $addr = "test-$v\@example.com";
-	my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $mainrepo,
+	my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $inboxdir,
 		"http://example.com/$v", $addr);
 	is(system(@cmd), 0, 'public-inbox init OK');
 	if ($v eq 'V1') {
-		is(system('blib/script/public-inbox-index', $mainrepo), 0);
+		is(system('blib/script/public-inbox-index', $inboxdir), 0);
 	}
 	PublicInbox::Emergency->new($spamdir);
 
@@ -72,7 +72,7 @@ EOF
 
 	my $orig = <<EOF;
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 $cfgpfx.watch=maildir:$maildir
 $cfgpfx.filter=PublicInbox::Filter::RubyLang
 $cfgpfx.altid=serial:alerts:file=msgmap.sqlite3
diff --git a/t/watch_maildir.t b/t/watch_maildir.t
index e65ab9a9..e6cd599c 100644
--- a/t/watch_maildir.t
+++ b/t/watch_maildir.t
@@ -37,7 +37,7 @@ my $sem = PublicInbox::Emergency->new($spamdir); # create dirs
 
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$git_dir
+$cfgpfx.inboxdir=$git_dir
 $cfgpfx.watch=maildir:$maildir
 $cfgpfx.filter=PublicInbox::Filter::Vger
 publicinboxlearn.watchspam=maildir:$spamdir
diff --git a/t/watch_maildir_v2.t b/t/watch_maildir_v2.t
index 99551ceb..ccc85c17 100644
--- a/t/watch_maildir_v2.t
+++ b/t/watch_maildir_v2.t
@@ -14,14 +14,14 @@ foreach my $mod (@mods) {
 }
 require PublicInbox::V2Writable;
 my $tmpdir = tempdir('watch_maildir-v2-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $mainrepo = "$tmpdir/v2";
+my $inboxdir = "$tmpdir/v2";
 my $maildir = "$tmpdir/md";
 my $spamdir = "$tmpdir/spam";
 use_ok 'PublicInbox::WatchMaildir';
 use_ok 'PublicInbox::Emergency';
 my $cfgpfx = "publicinbox.test";
 my $addr = 'test-public@example.com';
-my @cmd = ('blib/script/public-inbox-init', '-V2', 'test', $mainrepo,
+my @cmd = ('blib/script/public-inbox-init', '-V2', 'test', $inboxdir,
 	'http://example.com/v2list', $addr);
 local $ENV{PI_CONFIG} = "$tmpdir/pi_config";
 is(system(@cmd), 0, 'public-inbox init OK');
@@ -42,7 +42,7 @@ my $sem = PublicInbox::Emergency->new($spamdir); # create dirs
 
 my $orig = <<EOF;
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 $cfgpfx.watch=maildir:$maildir
 $cfgpfx.filter=PublicInbox::Filter::Vger
 publicinboxlearn.watchspam=maildir:$spamdir
@@ -56,7 +56,7 @@ PublicInbox::WatchMaildir->new($config)->scan('full');
 my ($total, undef) = $srch->reopen->query('');
 is($total, 1, 'got one revision');
 
-# my $git = PublicInbox::Git->new("$mainrepo/git/0.git");
+# my $git = PublicInbox::Git->new("$inboxdir/git/0.git");
 # my @list = $git->qx(qw(rev-list refs/heads/master));
 # is(scalar @list, 1, 'one revision in rev-list');
 
@@ -148,7 +148,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
 	is(system(qw(git init -q --bare), $v1repo), 0, 'v1 init OK');
 	my $cfg2 = <<EOF;
 $orig$v1pfx.address=$v1addr
-$v1pfx.mainrepo=$v1repo
+$v1pfx.inboxdir=$v1repo
 $v1pfx.watch=maildir:$maildir
 EOF
 	my $config = PublicInbox::Config->new(\$cfg2);
diff --git a/t/www_listing.t b/t/www_listing.t
index 990233c8..9f71257d 100644
--- a/t/www_listing.t
+++ b/t/www_listing.t
@@ -91,15 +91,15 @@ SKIP: {
 	open $fh, '>', $cfgfile or die;
 	print $fh <<"" or die;
 [publicinbox "bare"]
-	mainrepo = $bare->{git_dir}
+	inboxdir = $bare->{git_dir}
 	url = http://$host/bare
 	address = bare\@example.com
 [publicinbox "alt"]
-	mainrepo = $alt
+	inboxdir = $alt
 	url = http://$host/alt
 	address = alt\@example.com
 [publicinbox "v2"]
-	mainrepo = $v2
+	inboxdir = $v2
 	url = http://$host/v2
 	address = v2\@example.com
 
diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t
index d921e12f..43e08639 100644
--- a/t/xcpdb-reshard.t
+++ b/t/xcpdb-reshard.t
@@ -27,7 +27,7 @@ my $mime = PublicInbox::MIME->create(
 my ($this) = (split('/', $0))[-1];
 my $tmpdir = tempdir($this.'-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = PublicInbox::Inbox->new({
-	mainrepo => "$tmpdir/testbox",
+	inboxdir => "$tmpdir/testbox",
 	name => $this,
 	version => 2,
 	-primary_address => 'test@example.com',
@@ -43,7 +43,7 @@ for my $i (1..$ndoc) {
 	ok($im->add($mime), "message $i added");
 }
 $im->done;
-my @shards = grep(m!/\d+\z!, glob("$ibx->{mainrepo}/xap*/*"));
+my @shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
 is(scalar(@shards), $nproc, 'got expected shards');
 my $orig = $ibx->over->query_xover(1, $ndoc);
 my %nums = map {; "$_->{num}" => 1 } @$orig;
@@ -51,8 +51,8 @@ my %nums = map {; "$_->{num}" => 1 } @$orig;
 # ensure we can go up or down in shards, or stay the same:
 for my $R (qw(2 4 1 3 3)) {
 	delete $ibx->{search}; # release old handles
-	is(system(@xcpdb, "-R$R", $ibx->{mainrepo}), 0, "xcpdb -R$R");
-	my @new_shards = grep(m!/\d+\z!, glob("$ibx->{mainrepo}/xap*/*"));
+	is(system(@xcpdb, "-R$R", $ibx->{inboxdir}), 0, "xcpdb -R$R");
+	my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
 	is(scalar(@new_shards), $R, 'resharded to two shards');
 	my $msgs = $ibx->search->query('s:this');
 	is(scalar(@$msgs), $ndoc, 'got expected docs after resharding');

^ permalink raw reply related	[relevance 1%]

* [PATCH 0/2] rename "mainrepo" to "inboxdir"
@ 2019-10-16  8:59  7% Eric Wong
  2019-10-16  8:59  1% ` [PATCH 2/2] config: support "inboxdir" in addition to "mainrepo" Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-10-16  8:59 UTC (permalink / raw)
  To: meta

"mainrepo" is a bad name made even more confusing given the
v2 layout.  See PATCH 2/2 for more reasoning.

Eric Wong (2):
  examples/grok-pull.post_update_hook: use "inbox_dir"
  config: support "inboxdir" in addition to "mainrepo"

 Documentation/public-inbox-config.pod  | 19 +++++++++-----
 Documentation/public-inbox-convert.pod |  2 +-
 Documentation/public-inbox-init.pod    |  2 +-
 Documentation/public-inbox-watch.pod   |  4 +--
 examples/grok-pull.post_update_hook.sh | 28 ++++++++++-----------
 examples/public-inbox-config           |  6 +++--
 lib/PublicInbox/Admin.pm               |  8 +++---
 lib/PublicInbox/AdminEdit.pm           |  4 +--
 lib/PublicInbox/AltId.pm               |  4 +--
 lib/PublicInbox/Config.pm              | 10 +++++---
 lib/PublicInbox/Inbox.pm               | 14 +++++------
 lib/PublicInbox/InboxWritable.pm       |  2 +-
 lib/PublicInbox/Search.pm              |  6 ++---
 lib/PublicInbox/SearchIdx.pm           |  8 +++---
 lib/PublicInbox/V2Writable.pm          | 16 ++++++------
 lib/PublicInbox/WwwAtomStream.pm       |  2 +-
 lib/PublicInbox/WwwListing.pm          |  2 +-
 lib/PublicInbox/WwwStream.pm           |  2 +-
 lib/PublicInbox/WwwText.pm             |  3 +++
 lib/PublicInbox/Xapcmd.pm              |  4 +--
 script/public-inbox-convert            | 16 ++++++------
 script/public-inbox-edit               |  2 +-
 script/public-inbox-init               | 16 ++++++------
 script/public-inbox-mda                |  2 +-
 scripts/dupe-finder                    |  2 +-
 scripts/import_vger_from_mbox          |  6 ++---
 t/admin.t                              |  2 +-
 t/altid.t                              |  2 +-
 t/altid_v2.t                           |  6 ++---
 t/cgi.t                                |  2 +-
 t/config.t                             | 34 +++++++++++++++++++-------
 t/config_limiter.t                     |  4 +--
 t/convert-compact.t                    | 20 +++++++--------
 t/edit.t                               | 32 ++++++++++++------------
 t/feed.t                               |  2 +-
 t/filter_rubylang.t                    |  2 +-
 t/html_index.t                         |  2 +-
 t/indexlevels-mirror.t                 | 16 ++++++------
 t/mda.t                                |  2 +-
 t/mda_filter_rubylang.t                |  6 ++---
 t/nntp.t                               |  2 +-
 t/nntpd-tls.t                          |  6 ++---
 t/nntpd-validate.t                     |  4 +--
 t/nntpd.t                              |  6 ++---
 t/perf-msgview.t                       |  2 +-
 t/perf-nntpd.t                         |  4 +--
 t/perf-threading.t                     |  2 +-
 t/plack.t                              |  2 +-
 t/psgi_attach.t                        |  2 +-
 t/psgi_bad_mids.t                      |  6 ++---
 t/psgi_mount.t                         |  2 +-
 t/psgi_multipart_not.t                 |  4 +--
 t/psgi_scan_all.t                      |  6 ++---
 t/psgi_search.t                        |  4 +--
 t/psgi_text.t                          |  2 +-
 t/psgi_v2.t                            |  6 ++---
 t/purge.t                              | 12 ++++-----
 t/replace.t                            |  4 +--
 t/search-thr-index.t                   |  2 +-
 t/search.t                             |  2 +-
 t/solver_git.t                         |  6 ++---
 t/v1-add-remove-add.t                  |  6 ++---
 t/v1reindex.t                          | 20 +++++++--------
 t/v2-add-remove-add.t                  |  4 +--
 t/v2mda.t                              |  4 +--
 t/v2mirror.t                           |  4 +--
 t/v2reindex.t                          | 18 +++++++-------
 t/v2writable.t                         | 22 ++++++++---------
 t/watch_filter_rubylang.t              |  8 +++---
 t/watch_maildir.t                      |  2 +-
 t/watch_maildir_v2.t                   | 10 ++++----
 t/www_listing.t                        |  6 ++---
 t/xcpdb-reshard.t                      |  8 +++---
 73 files changed, 276 insertions(+), 244 deletions(-)

^ permalink raw reply	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-10-16  8:59  7% [PATCH 0/2] rename "mainrepo" to "inboxdir" Eric Wong
2019-10-16  8:59  1% ` [PATCH 2/2] config: support "inboxdir" in addition to "mainrepo" 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).