Mastodon: Difference between revisions

imported from old wiki
Onny (talk | contribs)
Usage: Add approve user command
 
(5 intermediate revisions by 5 users not shown)
Line 17: Line 17:
     streamingProcesses = 3; # Number of processes used. It is recommended to set to the number of CPU cores minus one
     streamingProcesses = 3; # Number of processes used. It is recommended to set to the number of CPU cores minus one
     extraConfig.SINGLE_USER_MODE = "true";
     extraConfig.SINGLE_USER_MODE = "true";
    streamingProcesses = 3; # Number of processes used by the mastodon-streaming service. recommended is the amount of your CPU cores minus one.
   };
   };
   networking.firewall.allowedTCPPorts = [ 80 443 ];
   networking.firewall.allowedTCPPorts = [ 80 443 ];
Line 26: Line 25:


<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>


Line 37: Line 36:


== 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 99: 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>