Mastodon: Difference between revisions

Voklen (talk | contribs)
The services.mastodon.streamingProcesses option is now required for the mastodon service
Onny (talk | contribs)
Usage: Add approve user command
 
(6 intermediate revisions by 5 users not shown)
Line 21: Line 21:
</syntaxhighlight>
</syntaxhighlight>


You can then create your account using <code>tootctl</code>:
You can then create your account using the package <code>mastodon</code>:
Ignore any warnings about the ruby version, it should work anyways


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# mastodon-tootctl accounts create USERNAME --email=YOUR_EMAIL --confirmed --role=Owner
# sudo -u mastodon mastodon-tootctl accounts create USERNAME --email=YOUR_EMAIL --confirmed --role=Owner
</syntaxhighlight>
</syntaxhighlight>


and approve your new account
and approve your new account
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# mastodon-tootctl accounts approve USERNAME
# sudo -u mastodon mastodon-tootctl accounts approve USERNAME
</syntaxhighlight>
</syntaxhighlight>


Then you're ready to head to the domain you set up in <code>configuration.nix</code> and start tooting away!
Then you're ready to head to the domain you set up and start tooting away!


== Usage ==
== Usage ==
Create user
<syntaxhighlight lang="console">
# sudo -u mastodon mastodon-tootctl accounts create my_user --email myuser@example.org
</syntaxhighlight>
Confirm user mail manually
<syntaxhighlight lang="console">
# sudo -u mastodon mastodon-tootctl accounts modify my_user --email myuser@example.org --confirm
</syntaxhighlight>
Approve user manually
<syntaxhighlight lang="console">
# sudo -u mastodon mastodon-tootctl accounts modify my_user --email myuser@example.org --approve
</syntaxhighlight>


Change password for user <code>my_user</code>
Change password for user <code>my_user</code>


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# mastodon-tootctl accounts modify --reset-password my_user
# sudo -u mastodon mastodon-tootctl accounts modify --reset-password my_user
</syntaxhighlight>
</syntaxhighlight>


== Tips and tricks ==
== Tips and tricks ==
=== Enabling full text search ===
Using OpenSearch as alternative to ElasticSearch after the license change. First set the following options and rebuild the config:<syntaxhighlight lang="nix">
services.opensearch.enable = true;
services.mastodon.elasticsearch.host = "127.0.0.1";
</syntaxhighlight>Then on the server run the following command to fill the search index:<syntaxhighlight lang="console">
$ sudo -u mastodon mastodon-tootctl search deploy
</syntaxhighlight>


=== Using Caddy as a server  ===
=== Using Caddy as a server  ===
Line 97: Line 124:
# Caddy requires file and socket access
# Caddy requires file and socket access
users.users.caddy.extraGroups = [ "mastodon" ];
users.users.caddy.extraGroups = [ "mastodon" ];
# Caddy systemd unit needs readwrite permissions to /run/mastodon-web
systemd.services.caddy.serviceConfig.ReadWriteDirectories = lib.mkForce [ "/var/lib/caddy" "/run/mastodon-web" ];


</syntaxHighlight>
</syntaxHighlight>