๐Ÿ“ฆโž”๐Ÿฆ‹ Store and retrieve files on the Atmosphere
35
fork

Configure Feed

Select the types of activity you want to include in your feed.

add configurable PBC fallbacking

Ducky 9f36df90 8c8a9bf5

+36 -9
+2 -2
README.md
··· 42 42 * Both GNU and BusyBox versions supported 43 43 * [`websocat`](https://github.com/vi/websocat) _(optional: needed for `stream`)_ 44 44 * **ATProto account** 45 - * Both [Bluesky PLC-operated](https://bsky.social) and self-hosted accounts supported 46 - * If you're using a `bsky.network` (`@*.bsky.social`) account, limit the amount of files you upload to Bluesky PLC's servers. Heed the copyright warning: **do not upload copyrighted files.** 45 + * Both [Bluesky PBC-operated](https://bsky.social) and self-hosted accounts supported 46 + * If you're using a `bsky.network` (`@*.bsky.social`) account, limit the amount of files you upload to Bluesky PBC's servers. Heed the copyright warning: **do not upload copyrighted files.** 47 47 * `did:web` accounts supported! 48 48 * Confirmed to work on [Bluesky PDS](https://github.com/bluesky-social/pds) and [millipds](https://github.com/DavidBuchanan314/millipds) 49 49 * Other PDSs remain untested, but if they implement standard `com.atproto.*` endpoints, there should be no reason these won't work
+6 -1
src/commands/help.sh
··· 157 157 โ„น๏ธ Your PDS is resolved from your username. Set to override it (or if 158 158 resolving fails) 159 159 ${_envvar_prefix}_ENDPOINT_PLC_DIRECTORY <url> (default: ${_endpoint_plc_directory_default}$([[ $_endpoint_plc_directory_default == *"zio.blue" ]] && echo "ยฒ")) 160 - Endpoint of the PLC directory\n 160 + Endpoint of the PLC directory 161 + ${_envvar_prefix}_DISABLE_PBC_FALLBACK <boolยน> (default: $_disable_pbc_fallback) 162 + Disable the (hardcoded) usage of various Bluesky PBC-hosted fallbacks 163 + if/when required. Currently, there are fallbacks for: 164 + * ${_envvar_prefix}_ENDPOINT_APPVIEW ($_endpoint_appview_fallback) 165 + * ${_envvar_prefix}_ENDPOINT_PLC_DIRECTORY ($_endpoint_plc_directory_fallback)\n 161 166 ${_envvar_prefix}_DEBUG <boolยน> (default: $_debug_default) 162 167 Print debug outputs 163 168 โš ๏ธ When output is JSON (${_envvar_prefix}_OUTPUT_JSON=1), sets to 0
+3
src/entry.sh
··· 69 69 70 70 _debug_default=$([[ $ATFILE_DEVEL == 1 ]] && echo 1 || echo 0) 71 71 _devel_publish_default=0 72 + _disable_pbc_fallback_default=0 72 73 _disable_update_checking_default=0 73 74 _disable_updater_default=0 74 75 _dist_username_default="$_meta_did" ··· 92 93 93 94 #### Fallbacks 94 95 96 + _endpoint_appview_fallback="https://api.bsky.app" 95 97 _endpoint_plc_directory_fallback="https://plc.directory" 96 98 _max_list_fallback=100 97 99 ··· 99 101 100 102 _debug="$(atfile.util.get_envvar "${_envvar_prefix}_DEBUG" "$_debug_default")" 101 103 _devel_publish="$(atfile.util.get_envvar "${_envvar_prefix}_DEVEL_PUBLISH" $_devel_publish_default)" 104 + _disable_pbc_fallback="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_PBC_FALLBACK" $_disable_pbc_fallback_default)" 102 105 _disable_update_checking="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_UPDATE_CHECKING" $_disable_update_checking_default)" 103 106 _disable_updater="$(atfile.util.get_envvar "${_envvar_prefix}_DISABLE_UPDATER" $_disable_updater_default)" 104 107 _dist_password="$(atfile.util.get_envvar "${_envvar_prefix}_DIST_PASSWORD")"
+13 -1
src/lexi/app_bsky.sh
··· 7 7 function app.bsky.actor.getProfile() { 8 8 actor="$1" 9 9 10 - atfile.xrpc.bsky.get "app.bsky.actor.getProfile" "actor=$actor" 10 + # NOTE: AppViewLite does not fully support app.bsky.actor.getProfile 11 + # shellcheck disable=SC2154 12 + appview="$_endpoint_appview_fallback" 13 + # shellcheck disable=SC2154 14 + [[ $_disable_pbc_fallback == 1 ]] && unset appview 15 + 16 + atfile.xrpc.bsky.get "app.bsky.actor.getProfile" "actor=$actor" "" "$appview" 11 17 } 12 18 13 19 function app.bsky.labeler.getServices() { 14 20 did="$1" 21 + 22 + # NOTE: AppViewLite does not fully support app.bsky.labeler.getServices 23 + # shellcheck disable=SC2154 24 + appview="$_endpoint_appview_fallback" 25 + # shellcheck disable=SC2154 26 + [[ $_disable_pbc_fallback == 1 ]] && unset appview 15 27 16 28 atfile.xrpc.bsky.get "app.bsky.labeler.getServices" "dids=$did" 17 29 }
+7 -4
src/shared/util.sh
··· 264 264 didplc_endpoint="$_endpoint_plc_directory" 265 265 didplc_doc="$(atfile.util.get_didplc_doc.request_doc "$didplc_endpoint" "$actor")" 266 266 267 - if [[ "$didplc_doc" != "{"* ]]; then 268 - # shellcheck disable=SC2154 269 - didplc_endpoint="$_endpoint_plc_directory_fallback" 270 - didplc_doc="$(atfile.util.get_didplc_doc.request_doc "$didplc_endpoint" "$actor")" 267 + # shellcheck disable=SC2154 268 + if [[ $_disable_pbc_fallback == 0 ]]; then 269 + if [[ "$didplc_doc" != "{"* ]]; then 270 + # shellcheck disable=SC2154 271 + didplc_endpoint="$_endpoint_plc_directory_fallback" 272 + didplc_doc="$(atfile.util.get_didplc_doc.request_doc "$didplc_endpoint" "$actor")" 273 + fi 271 274 fi 272 275 273 276 echo "$didplc_doc" | jq ". += {\"directory\": \"$didplc_endpoint\"}"
+5 -1
src/shared/xrpc.sh
··· 59 59 lexi="$1" 60 60 query="$2" 61 61 type="$3" 62 + appview="$4" 63 + 64 + # shellcheck disable=SC2154 65 + [[ -z "$appview" ]] && appview="$_endpoint_appview" 62 66 63 67 atfile.http.get \ 64 - "$_endpoint_appview/xrpc/$lexi?$query" \ 68 + "$appview/xrpc/$lexi?$query" \ 65 69 "" \ 66 70 "$type" | jq 67 71 }