Mastodon: Difference between revisions

imported>Sefidel
Since https://github.com/NixOS/nixpkgs/pull/203825, mastodon-env has been replaced with mastodon-tootctl.
imported>Onny
Restructure and cleanup
Line 1: Line 1:
== Setup your own personal Mastodon instance on a dedicated server ==
Mastodon is a decentralized social media platform that allows users to create accounts, post content, and interact with others. It is an alternative to centralized social media platforms like Twitter and Facebook.
 
== Setup ==


The <service>services.mastodon</service> service can be used to setup a Mastodon instance in [https://docs.joinmastodon.org/admin/config/#single_user_mode single user mode].
The <service>services.mastodon</service> service can be used to setup a Mastodon instance in [https://docs.joinmastodon.org/admin/config/#single_user_mode single user mode].
Line 20: Line 22:
</syntaxHighlight>
</syntaxHighlight>


You can then create your account using <code>tootctl</code>: <code>mastodon-tootctl accounts create USERNAME --email=YOUR_EMAIL --confirmed --role=Owner'</code>
You can then create your account using <code>tootctl</code>:


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


Mastodon uses postgreSQL as database. Luckily, Nixpkgs offers a useful service, [https://search.nixos.org/options?channel=unstable&show=services.postgresqlBackup.enable&from=0&size=50&sort=relevance&type=packages&query=postgresql <code>services.postgresqlBackup.enable</code>].
== Tips and tricks ==


Example settings, assuming you have the default database settings:
=== Using Caddy as a server  ===
<syntaxHighlight lang=nix>
  services.postgresqlBackup = {
    enable = true;
    databases = [ "mastodon" ];
  };
</syntaxHighlight>
 
== Using Caddy as a server  ==


Use the following template:
Use the following template:
Line 90: Line 86:
</syntaxHighlight>
</syntaxHighlight>


== Hints for running in your local network for testing ==
=== Automatic backups ===
 
Mastodon uses postgreSQL as database. Luckily, Nixpkgs offers a useful service, [https://search.nixos.org/options?channel=unstable&show=services.postgresqlBackup.enable&from=0&size=50&sort=relevance&type=packages&query=postgresql <code>services.postgresqlBackup.enable</code>].
 
Example settings, assuming you have the default database settings:
<syntaxHighlight lang=nix>
  services.postgresqlBackup = {
    enable = true;
    databases = [ "mastodon" ];
  };
</syntaxHighlight>
 
== Troubleshooting ==
 
=== Hints for running in your local network for testing ===


If you get a <code>Mastodon::HostValidationError</code> when trying to federate with another ActivityPub instance in your local network you need to allow Mastodon to access local ip addresses in outgoing http (federation) requests. To do this set the following environment variable:
If you get a <code>Mastodon::HostValidationError</code> when trying to federate with another ActivityPub instance in your local network you need to allow Mastodon to access local ip addresses in outgoing http (federation) requests. To do this set the following environment variable: