Find a file
2024-03-06 04:48:01 -05:00
.envrc mastodon vm 2024-02-22 04:56:31 -05:00
.gitignore mastodon vm 2024-02-22 04:56:31 -05:00
configuration.nix refactor & cleanup 2024-03-06 04:48:01 -05:00
flake.lock mastodon vm 2024-02-22 04:56:31 -05:00
flake.nix mastodon vm 2024-02-22 04:56:31 -05:00
README.md account creation 2024-03-06 04:40:22 -05:00

How to start up a mastodon VM

nixos-rebuild build-vm --flake .#mastodon 
./result/bin/run-nixos-vm

Now you can access mastodon at https://social.local.gd:44443

  • You will have to "accept the security risk".
  • It may take a minute for the webpage to come online. Until then you will see 502 Bad Gateway

Remember that if you want to clear the state from one launch to the next, you should delete the nixos.qcow2 file that is created.

Account creation / access

Mastodon throws a hissyfit when trying to create accounts / login if it's not being accessed on port 443. This is a problem with the way we've set up port forwarding.

My current (terrible) solution is to run

nixos-rebuild build-vm --flake .#mastodon

# start a proxy server to the server on port 1234 (you can pick your favourite port)
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=Error -D 1234 root@localhost -p 2222

# optional. create a new firefox profile so we don't have to undo the settings when we're done
mkdir /tmp/profile && firefox --profile /tmp/profile

Then configure Firefox by going to about:config and setting network.proxy.allow_hijacking_localhost to true, and in about:preferences set the proxy to manual localhost port 1234, and enable Proxy DNS at the bottom.

Navigate to https://social.local.gd, and click "create account"

TODOs

  • set up a domain name and a DNS service so we can do deploy this to an actual machine
  • set up an email service
  • add logging
    • errors / logs
    • performance
  • switch to garage / s3 storage
  • decouple the postgres database from this machine
  • test with high use / throughput
  • configure scaling behaviour
  • remove the need for "accept security risk" dialogue if possible
  • development environment does not work seamlessly.
  • don't require proxy server
    • either forward 443 directly, or get mastodon to accept connections on a different port (maybe 3000? see development environment documentation)
  • get letter_opener working

resources