user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/3] examples/grok-pull.post_update_hook updates
@ 2020-04-06  9:56 Eric Wong
  2020-04-06  9:56 ` [PATCH 1/3] examples/grok-pull.post_update_hook: fetch mirror description Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2020-04-06  9:56 UTC (permalink / raw)
  To: meta

Some minor changes to make mirroring easier.

Eric Wong (3):
  examples/grok-pull.post_update_hook: fetch mirror description
  examples/grok-pull.post_update_hook: capture infourl
  examples/grok-pull.post_update_hook: move url_base to the top

 examples/grok-pull.post_update_hook.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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

* [PATCH 1/3] examples/grok-pull.post_update_hook: fetch mirror description
  2020-04-06  9:56 [PATCH 0/3] examples/grok-pull.post_update_hook updates Eric Wong
@ 2020-04-06  9:56 ` Eric Wong
  2020-04-06  9:56 ` [PATCH 2/3] examples/grok-pull.post_update_hook: capture infourl Eric Wong
  2020-04-06  9:56 ` [PATCH 3/3] examples/grok-pull.post_update_hook: move url_base to the top Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2020-04-06  9:56 UTC (permalink / raw)
  To: meta

The $INBOX_URL/description endpoint is available since v1.3.0,
so use it in mirrors.
---
 examples/grok-pull.post_update_hook.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/grok-pull.post_update_hook.sh b/examples/grok-pull.post_update_hook.sh
index d003448e..e04eb2c5 100755
--- a/examples/grok-pull.post_update_hook.sh
+++ b/examples/grok-pull.post_update_hook.sh
@@ -93,6 +93,7 @@ case $cfg_dir in
 		# only one newsgroup per inbox
 		break
 	done
+	curl -sSfv "remote_inbox_url"/description >"$inbox_dir"/description
 	echo "I: $inbox_name at $inbox_dir ($addresses) $local_url"
 	;;
 esac

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

* [PATCH 2/3] examples/grok-pull.post_update_hook: capture infourl
  2020-04-06  9:56 [PATCH 0/3] examples/grok-pull.post_update_hook updates Eric Wong
  2020-04-06  9:56 ` [PATCH 1/3] examples/grok-pull.post_update_hook: fetch mirror description Eric Wong
@ 2020-04-06  9:56 ` Eric Wong
  2020-04-06  9:56 ` [PATCH 3/3] examples/grok-pull.post_update_hook: move url_base to the top Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2020-04-06  9:56 UTC (permalink / raw)
  To: meta

The value of infourl parameters are shared in the config, so
include them in the mirror.
---
 examples/grok-pull.post_update_hook.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/examples/grok-pull.post_update_hook.sh b/examples/grok-pull.post_update_hook.sh
index e04eb2c5..18200ba2 100755
--- a/examples/grok-pull.post_update_hook.sh
+++ b/examples/grok-pull.post_update_hook.sh
@@ -54,6 +54,7 @@ case $cfg_dir in
 
 	config_url="$remote_inbox_url"/_/text/config/raw
 	remote_config="$inbox_dir"/remote.config.$$
+	infourls=
 	trap 'rm -f "$remote_config"' EXIT
 	if curl --compressed -sSf -v "$config_url" >"$remote_config"
 	then
@@ -70,6 +71,8 @@ case $cfg_dir in
 		esac
 		newsgroups=$(git config -f "$remote_config" -l | \
 			sed -ne 's/^publicinbox\..\+\.newsgroup=//p')
+		infourls=$(git config -f "$remote_config" -l | \
+			sed -ne 's/^publicinbox\..\+.infourl=//p')
 	else
 		newsgroups=
 		addresses="$inbox_name@$$.$(hostname).example.com"
@@ -93,6 +96,11 @@ case $cfg_dir in
 		# only one newsgroup per inbox
 		break
 	done
+	for url in $infourls
+	do
+		git config -f "$PI_CONFIG" \
+			"publicinbox.$inbox_name.infourl" "$url"
+	done
 	curl -sSfv "remote_inbox_url"/description >"$inbox_dir"/description
 	echo "I: $inbox_name at $inbox_dir ($addresses) $local_url"
 	;;

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

* [PATCH 3/3] examples/grok-pull.post_update_hook: move url_base to the top
  2020-04-06  9:56 [PATCH 0/3] examples/grok-pull.post_update_hook updates Eric Wong
  2020-04-06  9:56 ` [PATCH 1/3] examples/grok-pull.post_update_hook: fetch mirror description Eric Wong
  2020-04-06  9:56 ` [PATCH 2/3] examples/grok-pull.post_update_hook: capture infourl Eric Wong
@ 2020-04-06  9:56 ` Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2020-04-06  9:56 UTC (permalink / raw)
  To: meta

Users are encouraged to edit this script, anyways, so make it
easy for them to swap out and use whatever URL they need.
---
 examples/grok-pull.post_update_hook.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/grok-pull.post_update_hook.sh b/examples/grok-pull.post_update_hook.sh
index 18200ba2..3ead3944 100755
--- a/examples/grok-pull.post_update_hook.sh
+++ b/examples/grok-pull.post_update_hook.sh
@@ -3,6 +3,8 @@
 # git repo path as it's first and only arg.
 full_git_dir="$1"
 
+url_base=http://127.0.0.1:8080/
+
 # same default as other public-inbox-* tools
 PI_CONFIG=${PI_CONFIG-~/.public-inbox/config}
 
@@ -79,7 +81,7 @@ case $cfg_dir in
 		echo >&2 "E: curl $config_url failed"
 		echo >&2 "E: using bogus <$addresses> for $inbox_dir"
 	fi
-	local_url="http://127.0.0.1:8080/$inbox_name"
+	local_url="$url_base$inbox_name"
 	public-inbox-init -V$inbox_fmt "$inbox_name" \
 		"$inbox_dir" "$local_url" $addresses
 

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

end of thread, other threads:[~2020-04-06  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06  9:56 [PATCH 0/3] examples/grok-pull.post_update_hook updates Eric Wong
2020-04-06  9:56 ` [PATCH 1/3] examples/grok-pull.post_update_hook: fetch mirror description Eric Wong
2020-04-06  9:56 ` [PATCH 2/3] examples/grok-pull.post_update_hook: capture infourl Eric Wong
2020-04-06  9:56 ` [PATCH 3/3] examples/grok-pull.post_update_hook: move url_base to the top 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).