summary refs log tree commit diff
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 b413a468..7f84f11b 100644
--- a/bin/man1/sup.1
+++ b/bin/man1/sup.1
@@ -1,4 +1,4 @@
-.Dd July  5, 2021
+.Dd January  9, 2022
 .Dt SUP 1
 .Os
 .
@@ -35,6 +35,7 @@ The following services are supported:
 .Cm liberapay ,
 .Cm lobsters ,
 .Cm patreon ,
+.Cm tildegit ,
 .Cm tildenews .
 .
 .Pp
diff --git a/bin/sup.sh b/bin/sup.sh
index a261cb7f..ae369e36 100644
--- a/bin/sup.sh
+++ b/bin/sup.sh
@@ -110,6 +110,39 @@ discogs() {
 	open 'https://discogs.com/login'
 }
 
+gitea() {
+	echo 'Fetching CSRF token...'
+	csrf=$(
+		curl -Ss "${giteaBase}/user/forgot_password" |
+		sed -n 's/.*name="_csrf" value="\([^"]*\)".*/\1/p'
+	)
+	echo 'Submitting form...'
+	curl -Ss -X POST \
+		-F "email=${email}" -F "_csrf=${csrf}" \
+		"${giteaBase}/user/forgot_password" \
+		>/dev/null
+	echo 'Waiting for email...'
+	code=$(
+		git fetch-email -i -M Trash \
+			-F "${giteaFrom}" -T "${email}" -S 'Recover your account' |
+		unwrap | sed -n 's/.*code=3D\(.*\)/\1/p' | head -n 1
+	)
+	echo 'Fetching CSRF token...'
+	csrf=$(
+		curl -Ss "${giteaBase}/user/recover_account" |
+		sed -n 's/.*name="_csrf" value="\([^"]*\)".*/\1/p'
+	)
+	password=$(generate)
+	echo 'Setting password...'
+	curl -Ss -X POST \
+		-F "_csrf=${csrf}" -F "code=${code}" \
+		-F "password=${password}" \
+		"${giteaBase}/user/recover_account" \
+		>/dev/null
+	copy "${password}"
+	open "${giteaBase}/user/login"
+}
+
 liberapay() {
 	echo 'Fetching CSRF token...'
 	csrf=$(
@@ -207,6 +240,12 @@ patreon() {
 	open 'https://www.patreon.com/login'
 }
 
+tildegit() {
+	giteaBase='https://tildegit.org'
+	giteaFrom='git@tildegit.org'
+	gitea
+}
+
 tildenews() {
 	lobstersBase='https://tilde.news'
 	lobstersFrom='nobody@tilde.news'
something like one sort of thing. God, it took me a whole month (more?) to read and this is only my third book of the year :( I need some more novellas to read, but the other books I have from the library currently are also thick. 2022-03-22Source ~/.profile.local if it existsJune McEnroe 2022-03-18Publish "Addendum 2021"June McEnroe 2022-03-16Remove wcwidth portJune McEnroe DYLD_FORCE_FLAT_NAMESPACE no longer exists in macOS 12 so this approach doesn't work anymore. Moved to <https://git.causal.agency/jorts/tree/wcwidth> and compiled into <https://git.causal.agency/jorts/tree/ncurses>. 2022-03-16Remove -j4 from ./PlanJune McEnroe Plan learned to set this automatically! 2022-03-15Rewrite Linux install.sh for DebianJune McEnroe 2022-03-15Remove dashJune McEnroe