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 0/2] wwwaltid: use curl -d '' in instructions
@ 2021-02-04  2:54  5% Kyle Meyer
  2021-02-04  2:54  5% ` [PATCH 1/2] www: call curl with -d '' in the altid instructions Kyle Meyer
  0 siblings, 1 reply; 4+ results
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	[relevance 5%]

* [PATCH 1/2] www: call curl with -d '' in the altid instructions
  2021-02-04  2:54  5% [PATCH 0/2] wwwaltid: use curl -d '' in instructions Kyle Meyer
@ 2021-02-04  2:54  5% ` Kyle Meyer
  0 siblings, 0 replies; 4+ results
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	[relevance 5%]

* [PATCH 6/9] lei_xsearch: use curl -d '' for nginx compatibility
  2021-01-24 11:46  5% [PATCH 0/9] lei remotes fixes and updates Eric Wong
@ 2021-01-24 11:46  7% ` Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2021-01-24 11:46 UTC (permalink / raw)
  To: meta; +Cc: Kyle Meyer

It appears Content-Length and/or Content-Type headers are
required by nginx with POST requests.

varnish alone doesn't have this requirement and my (perhaps
lossy) reading of RFC 2616, 7230, 7231 didn't note this, either.

In any case, we must support nginx even if it's overly strict.

Reported-By: Kyle Meyer <kyle@kyleam.com>
Link: https://public-inbox.org/meta/87v9bmswkh.fsf@kyleam.com/
---
 lib/PublicInbox/LeiXSearch.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index 0417db24..c6ff5679 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -191,7 +191,7 @@ sub query_remote_mboxrd {
 	push(@qform, t => 1) if $opt->{thread};
 	my $dedupe = $lei->{dedupe} // die 'BUG: {dedupe} missing';
 	$dedupe->prepare_dedupe;
-	my @cmd = qw(curl -XPOST -sSf);
+	my @cmd = (qw(curl -sSf -d), '');
 	my $verbose = $opt->{verbose};
 	push @cmd, '-v' if $verbose;
 	for my $o ($lei->curl_opt) {

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/9] lei remotes fixes and updates
@ 2021-01-24 11:46  5% Eric Wong
  2021-01-24 11:46  7% ` [PATCH 6/9] lei_xsearch: use curl -d '' for nginx compatibility Eric Wong
  0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2021-01-24 11:46 UTC (permalink / raw)
  To: meta

Eric Wong (9):
  lei q: limit concurrency to 4 remote connections
  ipc: wq supports arbitrarily large payloads
  ipc: get rid of wq_set_recv_modes
  lei q: disable remote externals if locals exist
  lei q: honor --no-local to force remote searches
  lei_xsearch: use curl -d '' for nginx compatibility
  lei q: fix JSON overview with remote externals
  smsg: make parse_references an object method
  smsg: parse_references: micro-optimization to avoid ++

 lib/PublicInbox/IPC.pm         |  85 +++++++++++++++++----------
 lib/PublicInbox/LEI.pm         |   9 ++-
 lib/PublicInbox/LeiOverview.pm |   2 +-
 lib/PublicInbox/LeiQuery.pm    |  13 ++++-
 lib/PublicInbox/LeiToMail.pm   |   7 +--
 lib/PublicInbox/LeiXSearch.pm  | 101 ++++++++++++++++++---------------
 lib/PublicInbox/OverIdx.pm     |  22 +------
 lib/PublicInbox/SearchIdx.pm   |   2 +-
 lib/PublicInbox/Smsg.pm        |  22 ++++++-
 script/lei                     |  11 ++--
 t/cmd_ipc.t                    |  16 ++++++
 t/ipc.t                        |  21 ++++++-
 t/lei.t                        |   3 +
 13 files changed, 196 insertions(+), 118 deletions(-)


^ permalink raw reply	[relevance 5%]

Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-24 11:46  5% [PATCH 0/9] lei remotes fixes and updates Eric Wong
2021-01-24 11:46  7% ` [PATCH 6/9] lei_xsearch: use curl -d '' for nginx compatibility Eric Wong
2021-02-04  2:54  5% [PATCH 0/2] wwwaltid: use curl -d '' in instructions Kyle Meyer
2021-02-04  2:54  5% ` [PATCH 1/2] www: call curl with -d '' in the altid instructions Kyle Meyer

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