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

Configure Feed

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

add support for alt social apps (with _ENDPOINT_SOCIAL_APP)

+46 -22
+1 -1
src/commands/bsky_profile.sh
··· 90 90 ๐Ÿ“ƒ $count_posts $(atfile.util.get_int_suffix "$count_followers" "\e[37mPost\e[0m" "\e[37mPosts\e[0m") โˆ™ โš™๏ธ $count_feeds $(atfile.util.get_int_suffix "$count_feeds" "\e[37mFeed\e[0m" "\e[37mFeeds\e[0m") โˆ™ ๐Ÿ“‹ $count_lists $(atfile.util.get_int_suffix "$count_lists" "\e[37mList\e[0m" "\e[37mLists\e[0m") โˆ™ ๐Ÿ‘ฅ $count_packs $(atfile.util.get_int_suffix "$count_packs" "\e[37mPack\e[0m" "\e[37mPacks\e[0m") 91 91 $type โˆ™ โœจ $date_created โˆ™ ๐Ÿ•ท๏ธ $date_indexed 92 92 \e[37m$(atfile.util.repeat_char "-" 3)\e[0m 93 - ๐Ÿฆ‹ https://bsky.app/profile/$actor\n" 93 + ๐Ÿฆ‹ $_endpoint_social_app/profile/$actor\n" 94 94 95 95 if [[ "$date_indexed" == "0001-01-01 00:00:00" ]]; then 96 96 atfile.die "No Bluesky profile for '$actor'"
+4 -2
src/commands/help.sh
··· 105 105 ${_envvar_prefix}_PASSWORD <string> (required) 106 106 Password of the PDS user 107 107 โ„น๏ธ An App Password is recommended 108 - (https://bsky.app/settings/app-passwords)\n 108 + ($_endpoint_social_app/settings/app-passwords)\n 109 109 ${_envvar_prefix}_ENABLE_FINGERPRINT <boolยน> (default: $_enable_fingerprint_default) 110 110 Apply machine fingerprint to uploaded files 111 111 ${_envvar_prefix}_OUTPUT_JSON <boolยน> (default: $_output_json_default) ··· 157 157 resolving fails) 158 158 ${_envvar_prefix}_ENDPOINT_PLC_DIRECTORY <url> (default: ${_endpoint_plc_directory_default}$([[ $_endpoint_plc_directory_default == *"zio.blue" ]] && echo "ยฒ")) 159 159 Endpoint of the PLC directory 160 + ${_envvar_prefix}_ENDPOINT_SOCIAL_APP <url> (default: ${_endpoint_social_app_default}) 161 + Endpoint of the Bluesky (or compatible) social app 160 162 ${_envvar_prefix}_DISABLE_PBC_FALLBACK <boolยน> (default: $_disable_pbc_fallback) 161 163 Disable the (hardcoded) usage of various Bluesky PBC-hosted fallbacks 162 164 if/when required. Currently, there are fallbacks for: ··· 190 192 (c) $_meta_year $_meta_author <$_meta_repo> 191 193 Licensed as MIT License โœจ\n 192 194 ๐Ÿฆ‹ Follow @$handle on the ATmosphere 193 - โ†ณ Bluesky: https://bsky.app/profile/$handle 195 + โ†ณ $_endpoint_social_app_name: $_endpoint_social_app/profile/$handle 194 196 โ†ณ Tangled: https://tangled.sh/@$handle 195 197 196 198 Usage
+4 -2
src/commands/old_cmds.sh
··· 333 333 [ -x "$(command -v xdg-open)" ] && \ 334 334 [ -x "$(command -v gtk-launch)" ]; then 335 335 336 - [[ -z $file_type ]] && file_type="text/html" # HACK: Open with browser if $file_type isn't set 336 + # HACK: Open with browser if $file_type isn't set 337 + [[ -z $file_type ]] && file_type="text/html" 337 338 338 339 if [[ -z $handler ]]; then 339 340 atfile.say.debug "Querying for handler '$file_type'..." ··· 455 456 json_output+="$c," 456 457 else 457 458 if [[ $_os == "haiku" ]]; then 458 - echo -e "$key\t$name" # BUG: Haiku Terminal has issues with emojis 459 + # BUG: Haiku Terminal has issues with emojis 460 + echo -e "$key\t$name" 459 461 else 460 462 echo -e "$key\t$type_emoji $name" 461 463 fi
+2
src/commands/something_broke.sh
··· 73 73 $(for s in "${ATFILE_DEVEL_INCLUDES[@]}"; do echo " โ†ณ $s"; done) 74 74 $(atfile.something_broke.print_envvar "DEVEL_SOURCE") 75 75 $(atfile.something_broke.print_envvar "DEVEL_PUBLISH" "$_devel_publish_default") 76 + $(atfile.something_broke.print_envvar "DISABLE_PBC_FALLBACK" "$_disable_pbc_fallback_default") 76 77 $(atfile.something_broke.print_envvar "DISABLE_UPDATE_CHECKING" "$_disable_update_checking_default") 77 78 $(atfile.something_broke.print_envvar "DISABLE_UPDATER" "$_disable_updater_default") 78 79 โ†ณ ${_envvar_prefix}_DIST_PASSWORD: $([[ -n $(atfile.util.get_envvar "${_envvar_prefix}_DIST_PASSWORD") ]] && echo "(Set)") ··· 83 84 $(atfile.something_broke.print_envvar "ENDPOINT_JETSTREAM" "$_endpoint_jetstream_default") 84 85 $(atfile.something_broke.print_envvar "ENDPOINT_PDS") 85 86 $(atfile.something_broke.print_envvar "ENDPOINT_PLC_DIRECTORY" "$_endpoint_plc_directory_default") 87 + $(atfile.something_broke.print_envvar "ENDPOINT_SOCIAL_APP" "$_endpoint_social_app_default") 86 88 $(atfile.something_broke.print_envvar "FMT_BLOB_URL" "$_fmt_blob_url_default") 87 89 $(atfile.something_broke.print_envvar "FMT_OUT_FILE" "$_fmt_out_file_default") 88 90 $(atfile.something_broke.print_envvar "FORCE_META_AUTHOR")
+2 -1
src/commands/update.sh
··· 65 65 66 66 echo "---" 67 67 if [[ $_os == "haiku" ]]; then 68 + # BUG: Haiku Terminal has issues with emojis 68 69 # shellcheck disable=SC2154 69 - atfile.say "Update available ($latest_version)\nโ†ณ Run \`$_prog update\` to update" # BUG: Haiku Terminal has issues with emojis 70 + atfile.say "Update available ($latest_version)\nโ†ณ Run \`$_prog update\` to update" 70 71 else 71 72 atfile.say "๐Ÿ˜Ž Update available ($latest_version)\n โ†ณ Run \`$_prog update\` to update" 72 73 fi
+15 -8
src/entry.sh
··· 87 87 #_endpoint_jetstream_default="wss://stream.zio.blue" 88 88 _endpoint_jetstream_default="$_endpoint_jetstream_fallback" 89 89 _endpoint_plc_directory_default="https://plc.zio.blue" 90 + _endpoint_social_app_default="https://bsky.app" 90 91 _fmt_blob_url_default="[server]/xrpc/com.atproto.sync.getBlob?did=[did]&cid=[cid]" 91 92 _fmt_out_file_default="[key]__[name]" 92 93 _enable_fingerprint_default=0 ··· 114 115 _endpoint_appview="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_APPVIEW" "$_endpoint_appview_default")" 115 116 _endpoint_jetstream="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_JETSTREAM" "$_endpoint_jetstream_default")" 116 117 _endpoint_plc_directory="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_PLC_DIRECTORY" "$_endpoint_plc_directory_default")" 118 + _endpoint_social_app="$(atfile.util.get_envvar "${_envvar_prefix}_ENDPOINT_SOCIAL_APP" "$_endpoint_social_app_default")" 117 119 _fmt_blob_url="$(atfile.util.get_envvar "${_envvar_prefix}_FMT_BLOB_URL" "$_fmt_blob_url_default")" 118 120 _fmt_out_file="$(atfile.util.get_envvar "${_envvar_prefix}_FMT_OUT_FILE" "$_fmt_out_file_default")" 119 121 _force_meta_author="$(atfile.util.get_envvar "${_envvar_prefix}_FORCE_META_AUTHOR")" ··· 136 138 _test_desktop_uas="Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" 137 139 _username="$(atfile.util.get_envvar "${_envvar_prefix}_USERNAME")" 138 140 139 - ### NSIDs 141 + ### Read-only 140 142 141 143 _nsid_prefix="blue.zio" 142 144 _nsid_lock="${_nsid_prefix}.atfile.lock" 143 145 _nsid_meta="${_nsid_prefix}.atfile.meta" 144 146 _nsid_upload="${_nsid_prefix}.atfile.upload" 147 + _endpoint_social_app_name="Bluesky" 148 + 149 + case "$_endpoint_social_app" in 150 + "https://deer.social") _endpoint_social_app_name="Deer" ;; 151 + esac 145 152 146 153 ## "Hello, world!" 147 154 ··· 167 174 168 175 [[ -n $_force_meta_author ]] && \ 169 176 _meta_author="$_force_meta_author" &&\ 170 - atfile.say.debug "Overriding Copyright Author (\$_meta_author)\nโ†ณ ${_envvar_prefix}_FORCE_META_AUTHOR set to '$_force_meta_author'" 177 + atfile.util.print_override_envvar_debug "Copyright Author" "_meta_author" 171 178 [[ -n $_force_meta_did ]] && \ 172 179 _meta_did="$_force_meta_did" &&\ 173 180 _dist_username="$(atfile.util.get_envvar "${_envvar_prefix}_DIST_USERNAME" "$_meta_did")" &&\ 174 - atfile.say.debug "Overriding DID (\$_meta_did)\nโ†ณ ${_envvar_prefix}_FORCE_META_DID set to '$_force_meta_did'" 181 + atfile.util.print_override_envvar_debug "DID" "_meta_did" 175 182 [[ -n $_force_meta_repo ]] && \ 176 183 _meta_repo="$_force_meta_repo" &&\ 177 - atfile.say.debug "Overriding Repo URL (\$_meta_repo)\nโ†ณ ${_envvar_prefix}_FORCE_META_REPO set to '$_force_meta_repo'" 184 + atfile.util.print_override_envvar_debug "Repo URL" "_meta_author" 178 185 [[ -n $_force_meta_year ]] && \ 179 186 _meta_year="$_force_meta_year" &&\ 180 - atfile.say.debug "Overriding Copyright Year (\$_meta_year)\nโ†ณ ${_envvar_prefix}_FORCE_META_YEAR set to '$_force_meta_year'" 187 + atfile.util.print_override_envvar_debug "Copyright Year" "_meta_year" 181 188 [[ -n $_force_now ]] && \ 182 189 _now="$_force_now" &&\ 183 - atfile.say.debug "Overriding Now (\$_now)\nโ†ณ ${_envvar_prefix}_FORCE_NOW set to '$_force_now'" 190 + atfile.util.print_override_envvar_debug "Current Time" "_now" 184 191 [[ -n $_force_os ]] &&\ 185 192 _os="$_force_os" &&\ 186 - atfile.say.debug "Overriding OS (\$_os)\nโ†ณ ${_envvar_prefix}_FORCE_OS set to '$_force_os'" 193 + atfile.util.print_override_envvar_debug "OSL" "_os" 187 194 [[ -n $_force_version ]] && \ 188 195 _version="$_force_version" &&\ 189 - atfile.say.debug "Overriding Version (\$_version)\nโ†ณ ${_envvar_prefix}_FORCE_VERSION set to '$_force_version'" 196 + atfile.util.print_override_envvar_debug "Version" "_version" 190 197 191 198 ### Validation 192 199
+18 -8
src/shared/util.sh
··· 114 114 115 115 if [[ -n "$actor" && -n "$collection" && -n "$rkey" ]]; then 116 116 case "$collection" in 117 - "app.bsky.actor.profile") resolved_url="https://bsky.app/profile/$actor" ;; 118 - "app.bsky.feed.generator") resolved_url="https://bsky.app/profile/$actor/feed/$rkey" ;; 119 - "app.bsky.graph.list") resolved_url="https://bsky.app/profile/$actor/lists/$rkey" ;; 120 - "app.bsky.graph.starterpack") resolved_url="https://bsky.app/starter-pack/$actor/$rkey" ;; 121 - "app.bsky.feed.post") resolved_url="https://bsky.app/profile/$actor/post/$rkey" ;; 117 + "app.bsky.actor.profile") resolved_url="$_endpoint_social_app/profile/$actor" ;; 118 + "app.bsky.feed.generator") resolved_url="$_endpoint_social_app/profile/$actor/feed/$rkey" ;; 119 + "app.bsky.graph.list") resolved_url="$_endpoint_social_app/profile/$actor/lists/$rkey" ;; 120 + "app.bsky.graph.starterpack") resolved_url="$_endpoint_social_app/starter-pack/$actor/$rkey" ;; 121 + "app.bsky.feed.post") resolved_url="$_endpoint_social_app/profile/$actor/post/$rkey" ;; 122 122 "blue.linkat.board") resolved_url="https://linkat.blue/$actor_handle" ;; 123 123 "blue.zio.atfile.upload") ignore_url_validation=1 && resolved_url="atfile://$actor/$rkey" ;; 124 - "chat.bsky.actor.declaration") resolved_url="https://bsky.app/messages/settings" ;; 124 + "chat.bsky.actor.declaration") resolved_url="$_endpoint_social_app/messages/settings" ;; 125 125 "com.shinolabs.pinksea.oekaki") resolved_url="https://pinksea.art/$actor/oekaki/$rkey" ;; 126 126 "com.whtwnd.blog.entry") resolved_url="https://whtwnd.com/$actor/$rkey" ;; 127 127 "events.smokesignal.app.profile") resolved_url="https://smokesignal.events/$actor" ;; ··· 151 151 "app.bsky.feed.threadgate") 152 152 resolved_url="$(atfile.util.get_app_url_for_at_uri "$(echo "$record" | jq -r '.value.post')")" ;; 153 153 "app.bsky.graph.follow") 154 - resolved_url="https://bsky.app/profile/$(echo "$record" | jq -r '.value.subject')" ;; 154 + resolved_url="$_endpoint_social_app/profile/$(echo "$record" | jq -r '.value.subject')" ;; 155 155 "app.bsky.graph.listblock") 156 156 resolved_url="$(atfile.util.get_app_url_for_at_uri "$(echo "$record" | jq -r '.value.subject')")" ;; 157 157 "app.bsky.graph.listitem") 158 - resolved_url="https://bsky.app/profile/$(echo "$record" | jq -r '.value.subject')" ;; 158 + resolved_url="$_endpoint_social_app/profile/$(echo "$record" | jq -r '.value.subject')" ;; 159 159 "events.smokesignal.calendar.rsvp") 160 160 resolved_url="$(atfile.util.get_app_url_for_at_uri "$(echo "$record" | jq -r '.value.subject.uri')")" ;; 161 161 "fyi.unravel.frontpage.comment") ··· 1030 1030 โ•‘ Do not upload copyrighted files! โ•‘ 1031 1031 โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" 1032 1032 fi 1033 + } 1034 + 1035 + function atfile.util.print_override_envvar_debug() { 1036 + pretty_name="$1" 1037 + override_variable="$2" 1038 + 1039 + override_value="$(eval echo "\$_force${override_variable}")" 1040 + envvar_suffix="_FORCE${override_variable^^}" 1041 + 1042 + atfile.say.debug "Overriding $pretty_name (\$$override_variable)\nโ†ณ ${_envvar_prefix}$envvar_suffix set to '$override_value'" 1033 1043 } 1034 1044 1035 1045 function atfile.util.print_seconds_since_start_debug() {