Added open-registrations-detection.

This commit is contained in:
tastytea 2019-07-15 15:55:09 +02:00
parent a4dba85927
commit 2ba49d8fb9
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Print some basic info about fediverse instances.
# Version: 2019-07-12_1
# Version: 2019-07-15_1
if [[ -z "${1}" ]]; then
echo "usage: ${0} DOMAIN" >&2
@ -43,11 +43,8 @@ function main()
local users=$(curl -s -X POST "https://${instance}/api/stats" | jq -r ".usersCount")
[[ -n ${users} ]] && echo "Number of users: ${users}"
# NOTE: I'm not sure what the returned data means exactly and I couldn't find the API-documentation. So I commented it out for now.
# # shellcheck disable=SC2155
# local federation=$(curl -s -X POST "https://${instance}/api/federation/instances" | jq ".[].host")
# # shellcheck disable=SC2046
# [[ -n ${federation} ]] && echo "Federates with: ${federation}"
echo -n "Open registrations: "
jq -r ".features.registration" <<<"${json}"
# shellcheck disable=SC2155
local tos=$(jq -r ".ToSUrl" <<<"${json}")
@ -82,6 +79,9 @@ function main()
echo -n "Number of users: "
jq -r ".usage.users.total" <<<"${json}"
echo -n "Open registrations: "
jq -r ".openRegistrations" <<<"${json}"
# shellcheck disable=SC2155
local restrictions=$(jq -r ".metadata.federation.mrf_simple" <<<"${json}")
[[ "${restrictions}" != "null" ]] && echo "Federation restrictions: ${restrictions}"
@ -131,6 +131,9 @@ function main()
echo -n "Number of users: "
jq -r ".stats.user_count" <<<"${json}"
echo -n "Open registrations: "
jq -r ".registrations" <<<"${json}"
if [[ "${implementation}" == "Mastodon"
|| "${implementation}" == "Mastodon fork"
|| "${implementation}" == "Florence" ]]; then