unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: Alyssa Ross <hi@alyssa.is>
Cc: meta@public-inbox.org
Subject: Re: public-inbox-init with minimal info
Date: Fri, 4 Oct 2019 02:45:59 +0000	[thread overview]
Message-ID: <20191004024559.GA24741@dcvr> (raw)
In-Reply-To: <87bluyhyfi.fsf@alyssa.is>

Alyssa Ross <hi@alyssa.is> wrote:
> In NixOS, the best way for us to provide a public-inbox module would be
> to generate the configuration file ahead of time, and then initialize
> inboxes that don't already exist at some reasonable time during boot.
> 
> public-inbox-init tries to write a config file in addition to
> initializing an inbox.  My initial idea was to just eschew
> public-inbox-init for doing git init --bare myself, which works great
> for V1 repositories, but I'd really like to be generating V2 ones.
> 
> Since the V2 initialization isn't encapsulated in one easy command, I'm
> wondering what the best way to accomplish initialization without writing
> a config file or asking for unnecessary information is.  I could just
> run public-inbox-init with PI_CONFIG=/dev/null, but then it's still not
> clear to me what information about the mailbox the script requires to be
> able to initialize the mailbox.  Looking at the code, I see that at
> least the primary address is passed to PublicInbox::Inbox, but I'm not
> sure what that would actually be used for inside the inbox.

That address is used for making commits using the
public-inbox-{learn,edit,purge} commands, and also matching
with public-inbox-mda for delivery.

> So, what would the best thing for me to do here be?  To summarise, I'd
> like to generate V2 inboxes while providing as little information about
> the inbox as possible, and without writing a config file.

You want to provide that inbox during the post-install?

I'm not sure if I understand what's going on (but it's been a
long day :x).  I'm not sure if providing an inbox on package
installation is necessary or even a good thing...

Using git itself as an analogy: I wouldn't expect installing git
to auto-generate an empty git repo for me.  So same with
public-inbox, and stuff like cgit/gitweb...

Perhaps examples/public-inbox-config could add some newish
features such as nntpserver and css support and packaged
up for users, though:

diff --git a/examples/public-inbox-config b/examples/public-inbox-config
index 7fcbe0ba..a6785a7c 100644
--- a/examples/public-inbox-config
+++ b/examples/public-inbox-config
@@ -1,5 +1,13 @@
 # this usually in ~/.public-inbox/config and parseable with git-config(1)
 # update t/config.t if changing this, that test relies on this
+[publicinbox]
+	nntpserver = news.example.com
+	css = /path/to/share/public-inbox/216dark.css media=screen
+	css = /path/to/share/public-inbox/216light.css media=print
+	css = /path/to/share/public-inbox/216light.css \
+		media='screen AND (prefers-color-scheme:light)'
+[publicinboxwatch]
+	spamcheck = spamc
 [publicinbox "test"]
 	address = try@public-inbox.org
 	address = sandbox@public-inbox.org

  reply	other threads:[~2019-10-04  2:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 11:16 public-inbox-init with minimal info Alyssa Ross
2019-10-04  2:45 ` Eric Wong [this message]
2019-10-04 11:18   ` Alyssa Ross
2019-10-05  5:14     ` Eric Wong
2019-10-05 13:05       ` Alyssa Ross
2019-10-05 19:58         ` Eric Wong
2019-10-06  9:52           ` Alyssa Ross
2019-10-06 12:01             ` Eric Wong
2019-10-07 20:52               ` Alyssa Ross
2019-10-08  7:11                 ` Eric Wong
2019-10-09 12:09                   ` Alyssa Ross
2019-10-10  8:19                     ` Eric Wong
2019-10-16 10:04                       ` 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=20191004024559.GA24741@dcvr \
    --to=e@80x24.org \
    --cc=hi@alyssa.is \
    --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.
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).