user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/2] wwwaltid: use curl -d '' in instructions
@ 2021-02-04  2:54 Kyle Meyer
  2021-02-04  2:54 ` [PATCH 1/2] www: call curl with -d '' in the altid instructions Kyle Meyer
  2021-02-04  2:54 ` [PATCH 2/2] wwwaltid: add missing word to instructions Kyle Meyer
  0 siblings, 2 replies; 5+ messages in thread
From: Kyle Meyer @ 2021-02-04  2:54 UTC (permalink / raw)
  To: meta

In light of 533e1234 (lei_xsearch: use curl -d '' for nginx
compatibility, 2021-01-24), I think it makes sense to also use -d ''
in the altid instructions.  The first patch does that, and the second
fixes a nearby typo.

  [1/2] www: call curl with -d '' in the altid instructions
  [2/2] wwwaltid: add missing word to instructions

 lib/PublicInbox/WwwAltId.pm | 6 +++---
 lib/PublicInbox/WwwText.pm  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)


base-commit: cff308df82cda8370e98c0c9c6a3704209362a60
-- 
2.30.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] www: call curl with -d '' in the altid instructions
  2021-02-04  2:54 [PATCH 0/2] wwwaltid: use curl -d '' in instructions Kyle Meyer
@ 2021-02-04  2:54 ` Kyle Meyer
  2021-02-04  3:46   ` Kyle Meyer
  2021-02-04  2:54 ` [PATCH 2/2] wwwaltid: add missing word to instructions Kyle Meyer
  1 sibling, 1 reply; 5+ messages in thread
From: Kyle Meyer @ 2021-02-04  2:54 UTC (permalink / raw)
  To: meta

Nginx doesn't appear to be happy with just -XPOST, so use -d '' to
avoid potential confusion about why the instructions aren't working.

cf. commit 533e1234bc03a1ca8754d249aa8c2ce157e26780
    (lei_xsearch: use curl -d '' for nginx compatibility, 2021-01-24)
---
 lib/PublicInbox/WwwAltId.pm | 4 ++--
 lib/PublicInbox/WwwText.pm  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/WwwAltId.pm b/lib/PublicInbox/WwwAltId.pm
index b90819a2..33e6da30 100644
--- a/lib/PublicInbox/WwwAltId.pm
+++ b/lib/PublicInbox/WwwAltId.pm
@@ -44,11 +44,11 @@ EOF
 		return html_oneshot($ctx, 405, \<<EOF);
 <pre>A POST request required to retrieve $altid_pfx.sql.gz
 
-	curl -XPOST -O $url
+	curl -d '' -O $url
 
 or
 
-	curl -XPOST $url | \\
+	curl -d '' $url | \\
 		gzip -dc | \\
 		sqlite3 /path/to/$altid_pfx.sqlite3
 </pre>
diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index 817d032c..9f46c6a6 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -165,7 +165,7 @@ EOS
 	; gzip(1), and sqlite3(1) as documented:
 EOF
 		for (sort keys %$altid_map) {
-			$$txt .= "\t;\tcurl -XPOST $base_url$_.sql.gz | \\\n" .
+			$$txt .= "\t;\tcurl -d '' $base_url$_.sql.gz | \\\n" .
 				"\t;\tgzip -dc | \\\n" .
 				"\t;\tsqlite3 $inboxdir/$_.sqlite3\n";
 			$$txt .= "\taltid = serial:$_:file=$_.sqlite3\n";
-- 
2.30.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] wwwaltid: add missing word to instructions
  2021-02-04  2:54 [PATCH 0/2] wwwaltid: use curl -d '' in instructions Kyle Meyer
  2021-02-04  2:54 ` [PATCH 1/2] www: call curl with -d '' in the altid instructions Kyle Meyer
@ 2021-02-04  2:54 ` Kyle Meyer
  1 sibling, 0 replies; 5+ messages in thread
From: Kyle Meyer @ 2021-02-04  2:54 UTC (permalink / raw)
  To: meta

---
 lib/PublicInbox/WwwAltId.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/WwwAltId.pm b/lib/PublicInbox/WwwAltId.pm
index 33e6da30..bf851984 100644
--- a/lib/PublicInbox/WwwAltId.pm
+++ b/lib/PublicInbox/WwwAltId.pm
@@ -42,7 +42,7 @@ EOF
 	if ($env->{REQUEST_METHOD} ne 'POST') {
 		my $url = $ibx->base_url($ctx->{env}) . "$altid_pfx.sql.gz";
 		return html_oneshot($ctx, 405, \<<EOF);
-<pre>A POST request required to retrieve $altid_pfx.sql.gz
+<pre>A POST request is required to retrieve $altid_pfx.sql.gz
 
 	curl -d '' -O $url
 
-- 
2.30.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] www: call curl with -d '' in the altid instructions
  2021-02-04  2:54 ` [PATCH 1/2] www: call curl with -d '' in the altid instructions Kyle Meyer
@ 2021-02-04  3:46   ` Kyle Meyer
  2021-02-04  4:11     ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Kyle Meyer @ 2021-02-04  3:46 UTC (permalink / raw)
  To: meta

Kyle Meyer writes:

> -	curl -XPOST $url | \\
> +	curl -d '' $url | \\
>  		gzip -dc | \\
>  		sqlite3 /path/to/$altid_pfx.sqlite3

Ah, I didn't note the '|' alignment here.  I suppose the last two lines
should be shifted left by one character to restore that style.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] www: call curl with -d '' in the altid instructions
  2021-02-04  3:46   ` Kyle Meyer
@ 2021-02-04  4:11     ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2021-02-04  4:11 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: meta

Kyle Meyer <kyle@kyleam.com> wrote:
> Kyle Meyer writes:
> 
> > -	curl -XPOST $url | \\
> > +	curl -d '' $url | \\
> >  		gzip -dc | \\
> >  		sqlite3 /path/to/$altid_pfx.sqlite3
> 
> Ah, I didn't note the '|' alignment here.  I suppose the last two lines
> should be shifted left by one character to restore that style.

Heh, I just pushed it out as-is, I don't think worrying about
pipe alignment is worth it.

Anyways thanks for this series, hopefully it makes things easier
for more people trying to mirror setups.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-04  4:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04  2:54 [PATCH 0/2] wwwaltid: use curl -d '' in instructions Kyle Meyer
2021-02-04  2:54 ` [PATCH 1/2] www: call curl with -d '' in the altid instructions Kyle Meyer
2021-02-04  3:46   ` Kyle Meyer
2021-02-04  4:11     ` Eric Wong
2021-02-04  2:54 ` [PATCH 2/2] wwwaltid: add missing word to instructions Kyle Meyer

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.mail.public-inbox.meta
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.mail.public-inbox.meta
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git