-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: actpub action: commit revision: path_from: revision_from: 4220d922bd0d901c970ce230eb77ade4815030d6: path_to: revision_to:
commit 4220d922bd0d901c970ce230eb77ade4815030d6 Author: epoch <epoch@thebackupbox.net> Date: Wed Mar 22 10:24:53 2023 +0000 removed direct uses or mention of curl diff --git a/ap-actor2acct b/ap-actor2acct
--- a/ap-actor2acct +++ b/ap-actor2acct @@ -10,7 +10,7 @@ fi cache_file=~/.cache/ap/actor/"$(sha256sum <<< "$uri" | cut '-d ' -f1)" if [ ! -e "$cache_file" ];then - curl -o "$cache_file" -sH "Accept: application/activity+json" -g "$uri" + ap-signed-get "$uri" > "${cache_file}" fi domain="$(uricut -d <<< "$uri")" diff --git a/ap-cacheactor b/ap-cacheactor
--- a/ap-cacheactor +++ b/ap-cacheactor @@ -11,7 +11,7 @@ uri="$1" cache_file=~/.cache/ap/actor/"$(sha256sum <<< "$uri" | cut '-d ' -f1)" if [ ! -s "$cache_file" ];then - curl -so "${cache_file}" -H "Accept: application/activity+json, application/ld+json" -g "$uri" + ap-signed-get "$uri" > "${cache_file}" fi printf "%s\n" "${cache_file}" diff --git a/ap-cacheobject b/ap-cacheobject
--- a/ap-cacheobject +++ b/ap-cacheobject @@ -10,9 +10,13 @@ uri="$1" cache_file=~/.cache/ap/object/"$(sha256sum <<< "$uri" | cut '-d ' -f1)" if [ ! -s "$cache_file" ];then - curl -s -H "Accept: application/activity+json, application/ld+json" -g "$uri" \ - | jq -r '. | to_entries | .[].value | select(if type == "object" then . else null end) | select(if .id == "'"$uri"'" then . else null end)' \ - > "${cache_file}" + RESPONSE="$(ap-signed-get "$uri")" + OBJECT_DATA="$(printf "%s" "$RESPONSE" | jq -r '. | to_entries | .[].value | select(if type == "object" then . else null end) | select(if .id == "'"$uri"'" then . else null end)')" + if [ "$OBJECT_DATA" ];then #we didn't find it... guess just output the original response. + printf '%s' "$OBJECT_DATA" #should be all good. + else + printf '%s' "$RESPONSE" # so we can see errors. + fi > "${cache_file}" fi printf "%s\n" "${cache_file}" diff --git a/ap-getactor b/ap-getactor
--- a/ap-getactor +++ b/ap-getactor @@ -21,8 +21,6 @@ if [ ! -s ${cache_file} -o "${no_cache}" = 1 ];then ### then get the max-age's value, ### then set the mtime of the file that far into the future. ### so I can find -mtime 0 . -rm on all of the object files. anything in the past gets deleted. - - ###curl -s -o "${cache_file}" -H "Accept: application/activity+json, application/ld+json" -g "$(ap-getactoruri "$target")" ### NOTICE: some servers require you to use signed GETs to get an actor file. ap-signed-get "$(ap-getactoruri "$target")" > "${cache_file}" cache_file2=~/.cache/ap/actor/$(sha256sum < "${cache_file}" | cut '-d ' -f1) diff --git a/ap-getfollowers b/ap-getfollowers
--- a/ap-getfollowers +++ b/ap-getfollowers @@ -14,7 +14,7 @@ url="$(ap-getactor "$acct" | jq -r '.followers')" next="$url" while [ "$next" ];do echo "ap-getfollowers: getting $next" >&2 - resp="$(curl -sg "$next")" + resp="$(ap-signed-get "$next")" jq -r '.orderedItems//[]' <<< "$resp" | jq -r '.[]' next="$(jq -r '.next//.first//""' <<< "$resp")" done diff --git a/ap-getpubkey b/ap-getpubkey
--- a/ap-getpubkey +++ b/ap-getpubkey @@ -7,7 +7,6 @@ fi ### this needs to be a signed request for some hosts so... I guess we ### will probably give the server itself a key it can use. -#curl -sH 'Accept: application/activity+json, application/ld+json' -g "$keyuri" \ ap-signed-get "$keyuri" \ | jq -r '. | to_entries | .[].value | select(if type == "object" then . else null end) | select(if .id == "'"${keyuri}"'" then . else null end) | .publicKeyPem'
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 15:19:59 2024