unofficial mirror of meta@public-inbox.org
 help / color / mirror / 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 related	[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 related	[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

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