summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/man1/sup.13
-rw-r--r--bin/sup.sh39
2 files changed, 41 insertions, 1 deletions
diff --git a/bin/man1/sup.1 b/bin/man1/sup.1
index f0fe70cb..10dac5d9 100644
--- a/bin/man1/sup.1
+++ b/bin/man1/sup.1
@@ -1,4 +1,4 @@
-.Dd February 16, 2021
+.Dd February 17, 2021
 .Dt SUP 1
 .Os
 .
@@ -36,5 +36,6 @@ and
 .Pp
 The following services are supported:
 .Cm discogs ,
+.Cm freebsdbugzilla ,
 .Cm lobsters ,
 .Cm tildenews .
diff --git a/bin/sup.sh b/bin/sup.sh
index 308fd706..b8af9fc1 100644
--- a/bin/sup.sh
+++ b/bin/sup.sh
@@ -11,6 +11,45 @@ copy() {
 	printf '%s' "$1" | pbcopy
 }
 
+bugzilla() {
+	echo 'Fetching CSRF token...'
+	csrf=$(
+		curl -Ss "${bugzillaBase}/" |
+		sed -n '
+			/name="token"/N
+			s/.*name="token"[[:space:]]*value="\([^"]*\)".*/\1/p
+		' | head -n 1
+	)
+	echo 'Submitting form...'
+	curl -Ss -X POST \
+		-F "loginname=${email}" -F "token=${csrf}" -F 'a=reqpw' \
+		"${bugzillaBase}/token.cgi" \
+		>/dev/null
+	echo 'Waiting for email...'
+	token=$(
+		git fetch-email -i -M Trash \
+			-F "${bugzillaFrom}" -T "${email}" \
+			-S 'Bugzilla Change Password Request' |
+		sed -n 's/.*t=3D\([^&]*\).*/\1/p' |
+		head -n 1
+	)
+	password=$(generate)
+	echo 'Setting password...'
+	curl -Ss -X POST \
+		-F "t=${token}" -F 'a=chgpw' \
+		-F "password=${password}" -F "matchpassword=${password}" \
+		"${bugzillaBase}/token.cgi" \
+		>/dev/null
+	copy "${password}"
+	open "${bugzillaBase}/"
+}
+
+freebsdbugzilla() {
+	bugzillaBase='https://bugs.freebsd.org/bugzilla'
+	bugzillaFrom='bugzilla-noreply@freebsd.org'
+	bugzilla
+}
+
 discogs() {
 	echo 'Submitting form...'
 	curl -Ss -X POST \
/td>Add head-include configuration option.Mark Lodato 2009-03-15CGIT 0.8.2.1Lars Hjemli 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli 2009-03-15fix segfault when displaying empty blobsEric Wong 2009-02-19Add support for HEAD requestsLars Hjemli 2009-02-19Add support for ETag in 'plain' viewLars Hjemli 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli 2009-02-12Makefile: add doc-related targetsLars Hjemli