turbot/mastodon
steampipe plugin install mastodon

Table: mastodon_rule - Query Mastodon Rules using SQL

Mastodon is a decentralized, open-source social network. A Mastodon Rule represents a moderation policy defined by the administrators of a Mastodon instance. These rules provide guidelines to the users about what is and isn't allowed on that particular instance.

Table Usage Guide

The mastodon_rule table provides insights into the moderation rules within a Mastodon instance. As a community manager or administrator, explore rule-specific details through this table, including the rule text, creation date, and associated metadata. Utilize it to uncover information about rules, such as those concerning specific user behavior, content restrictions, and the overall moderation policy of the instance.

Examples

Query rules for the home server

Assess the elements within your home server's rule set to better understand its configuration and identify areas for potential optimization or troubleshooting.

select
id as "#",
rule
from
mastodon_rule
order by
id :: int;
select
id as "#",
rule
from
mastodon_rule
order by
cast(id as integer);

Query rules for another server

Explore the rules applicable for a specific server in the Mastodon social network. This can help in understanding the server's operational guidelines and ensure compliance with its policies.

select
id as "#",
rule
from
mastodon_rule
where
server = 'https://fosstodon.org'
order by
id :: int;
select
id as "#",
rule
from
mastodon_rule
where
server = 'https://fosstodon.org'
order by
CAST(id AS INTEGER);

Schema for mastodon_rule

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
idtextID of the rule.
ruletextText of the rule.
servertext=Server to which rules apply.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- mastodon

You can pass the configuration to the command with the --config argument:

steampipe_export_mastodon --config '<your_config>' mastodon_rule