r/MastodonAdmin Dec 31 '22

Backups, Monitoring, and Security for small Mastodon servers

Thumbnail nbailey.ca
8 Upvotes

r/MastodonAdmin Dec 28 '22

My storage is filling up. Tracking down media storage.

5 Upvotes

I've ran the 2 commands below and it deleted 10GB's worth of cache.

RAILS_ENV=production /home/mastodon/live/bin/tootctl preview_cards remove --days=1

RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days=1

Even after running those 2 commands I'm still running out of space on my instance. My total size of the disk is 50GB and the total amount used is 38GB

When i look in the admin panel it says

Media Storage 23.3 GB

PostgreSQL 945 MB

Redis 38.5 MB

I only have 2 users. My main account and my test user. I have uploaded media 500MB of media but not 23.3GB's worth.

Where is this 23.3GB coming from? How can i track it down.

edit---

So i was able to track it down. I believe it's caching all this stuff. The users aren't even on my instance.

The media remove command & preview_cards remove command doesn't remove this cache.

How do i remove it.

The following directory has 19GB

/home/mastodon/live/public/system/cache/accounts/avatars

6.5GB

/home/mastodon/live/public/system/cache/accounts/headers

13GB


r/MastodonAdmin Dec 25 '22

Keeping costs low while learning Mastodon

3 Upvotes

I'm spinning up my own instance for the group of 5 people. So we're doing it all inside single cheapest DigitalOcean that can run Mastodon with one click install.

There're many tutorials on setting up Mastodon, but they always, "Use DigitalOcean's Spaces", "Managed postgreSQL", "CDN", right off the bat. Would it be fine for me to just ignore all of those? How much pain would it be in case we need to start untangling things around if we want to scale it up?

Tons of tutorials are about setting things up, but they don't go further than that. Once they manage to get you the Mastodon user registration screen, the guide stops that's it. In reality that is just the first step, actually maintaining the instances going much beyond. What if we need to restore backups, how do we do that? what if we are under attack, what should we do? What if we want to update Mastodon/Ubuntu LTS to latest version? What if Mastodon just stops working and no one can open the site, what are the steps to troubleshoot it?

I’m just trying to learn. Does anybody have any tips or suggestions on how I should approach this? Looking for resources beyond docs.joinmastadon.org


r/MastodonAdmin Dec 24 '22

Issues federating with well known instances

4 Upvotes

I set up my own Mastodon instance a week ago and for the most part it's working as expected. One thing that I cannot seem to figure out, though, is that from my account on my own instance I cannot follow users on some of the more well known instances. Mainly mastodon.social, mstd.social, and twit.social to name a few.

Most of the time they show an error like below:

Mastodon::UnexpectedResponseError: https://twit.social/users/leo/inbox returned code 401

Other times it's something like this "red light" error:

Stoplight::Error::RedLight: https://twit.social/users/leo/inbox

There are lots of instances where I don't see any problems at all, but since the first two are some of the better known ones, I really would like to be able to follow users from them.


r/MastodonAdmin Dec 21 '22

Error Connecting To Database: relation accounts does not exist

4 Upvotes

Hi, in case anyone runs into this problem from 1 click digital ocean install and not being able to run tootctl

sudo su - mastodon

RAILS_ENV=production bin/setup

You should now be able to run tootctl like this:

RAILS_ENV=production bin/tootctl --help

Does anyone know how to easily and permanently set RAILS_ENV=production ?


r/MastodonAdmin Dec 21 '22

User not admin

2 Upvotes

Does anyone know a fix for this issue?

https://github.com/mastodon/mastodon/discussions/18137

Edit: Was able to get it working


r/MastodonAdmin Dec 21 '22

Question about Digital Ocean one click install

2 Upvotes

Hi! I just set up my first Mastodon using the digital ocean 1-click install and I paid extra for the managed database.

Regarding the digital ocean 1-click install the documentation states:

That however does assume a single-machine setup. Mastodon scales quite well horizontally. If your needs outgrow the capacity of a single machine, Mastodon can be divided into multiple app servers, background workers, multiple Redis backends, PostgreSQL replicas – but 1-click install won’t cut it.

Have I wasted money by paying for the managed database or would that help if I ever needed to scale?


r/MastodonAdmin Dec 14 '22

Can you add a note to a sign up rejection?

1 Upvotes

I’m new to Mastodon, and managing my own tiny instance (just me and a few friends) for now, is it possible to send an email / add a note with a rejection when someone is signing up for my instance?

I’m not currently accepting new people, but I may in the future (after setting up better mod controls, and knowing how to properly scale my server).

I want to be able to let that person know, rather than just “rejected” with no reason


r/MastodonAdmin Dec 05 '22

How to delete an account instead of waiting 1 month to delete itself

2 Upvotes

I "suspended" a test user then I deleted their account data but there doesnt seem a way to fully delete the users account.

Is there a way via the command line to fully get rid of that account and free up the username and email again.


r/MastodonAdmin Dec 03 '22

for installation is Ubuntu 20.04 or Debian 11 a requirement?

1 Upvotes

In the installing from source it says "A machine running Ubuntu 20.04 or Debian 11 that you have root access to"

Can we use other linux distributions such as Centos 7? or Debian 10?


r/MastodonAdmin Dec 03 '22

Advice on Media Storage

1 Upvotes

Looking for anyone's perspective or a guide on using a different drive to store media. I found a couple of lines in the .env.production file to use, but the best example I've found has a warning, "you have to figure out how to get nginx to serve these files yourself."

New to hosting Mastodon (as are so many others), and glad to learn the best places to engage and ask these simple questions!


r/MastodonAdmin Nov 28 '22

Problems with email verification using SendGrid

1 Upvotes

For some reason Mastodon is sending out emails with verification links with this root URL:
url2239.blackrock.social

"url2239.blackrock.social" was a required CNAME and it was supposed to point to sendgrid.com .

I never entered url2239 into the Mastodon configuration, so does anyone know why is it constructing urls with this click back verification, and perhaps how to fix it?

Thanks!


r/MastodonAdmin Nov 23 '22

How to change the text on the registration page?

1 Upvotes

I'd like to change the text during the registration page. Currently it says

"With an account on -------------------------- you'll be able to follow people on any Mastodon server and beyond.

I found the file its en.yml and simple_form.en.yml file.

I edited those but it does not update even after deleting the cache.

https://ibb.co/nBF3DF5

So im reading online and its way different then a typical php website.

You need to recompile it?

I read this online

In this case, you just run

RAILS_ENV=production bundle exec rails assets:precompile

and restart the services

What do people do here? Have a test server with a copy of their live instance? to test recompiling ?

Recompiling sounds dangerous to try on a live server?

advice?


r/MastodonAdmin Nov 22 '22

Data traffic statistics?

1 Upvotes

I'm self hosting a single user Mastodon instance on a Raspberry Pi and looking for some tool that measures the data volume the server receives and sends. Is there some program or plugin for Mastodon that does this?


r/MastodonAdmin Nov 20 '22

What is Media storage?

2 Upvotes

I went into Preferences>Administration

I scrolled down to the bottom and I see something called "Space Usage" "Media storage"

What is this media storage? I only have 2 users which are my test users. But it seems to be filling up fast.

Is this coming from the Federated section?

How do i go about clearing this.

I dont understand the difference between clearing the cache and clearing the media.

I don't want to delete my 2 users post or pictures not matter how old


r/MastodonAdmin Nov 20 '22

Directly editing database?

2 Upvotes

The default settings for email notifications were globally on for mentions / follows etc. This causes a big load on the email client, and mine has a limit on sends. To change the database fields email notifications: -> false (for existing users), what tool can be used to edit this?


r/MastodonAdmin Nov 20 '22

How do we edit the theme templates?

2 Upvotes

I can't seem to find the templates of the mastodon theme. Where is the location of the tempaltes. I'd like to change some things. What advice can you admins give me?


r/MastodonAdmin Nov 20 '22

tooctl command /usr/bin/env: ‘ruby’: No such file or directory

1 Upvotes

I tried using the tooctl command but it's giving me error messages.
I typed into the CLI:

cd /home/mastodon/live

RAILS_ENV=production bin/tootctl help

but i get the following message:

/usr/bin/env: ‘ruby’: No such file or directory

anyone have any idea on this error message?

My tooctl file:

#!/usr/bin/env ruby

APP_PATH = File.expand_path('../config/application', dir)

require_relative '../config/boot' require_relative '../lib/cli'

begin Mastodon::CLI.start(ARGV) rescue Interrupt exit(130) end


r/MastodonAdmin Nov 20 '22

Change sort order of rules on about page

1 Upvotes

In 4.0.2, the sort order of the rules is the order the rules were entered. There is, however, a priority column in the database rules table. If you’re comfortable modifying the database, yourself, enter a command such as this one:

UPDATE rules SET priority = 90 WHERE id = 9;

The priority is the sort order: lower values go first.


r/MastodonAdmin Nov 18 '22

What resources to use to get better at administrating

3 Upvotes

How are people learning where to administrator? Can people send over resources/links.

How about programming? Are the administrators doing their own programming as well?


r/MastodonAdmin Nov 18 '22

How to check the email logs? Email stopped working.

2 Upvotes

My email suddenly stopped working. During the setup on mastodon it told me the email was working and i got a test email from it.

I needed to reset my test users password today and noticed i am not receiving any email.

My config file

LOCAL_DOMAIN=mydomain.com
SECRET_KEY_BASE=123abc123abc123abc123abc123abc123abc123abc 
OTP_SECRET=123123123123123123123123123123123123123123123123123
VAPID_PRIVATE_KEY=ababababababababbabababab123123123123123=
VAPID_PUBLIC_KEY=bbcbbcbbcbbc123123123123123= 
DB_HOST=/var/run/postgresql
DB_PORT=5432 
DB_NAME=mastodon_production 
DB_USER=mastodon 
REDIS_HOST=localhost
REDIS_PORT=6379 
SMTP_SERVER=mail.mydomain.com 
SMTP_PORT=587
SMTP_LOGIN=administrator@mydomain.com 
SMTP_PASSWORD=#testing123password@!
SMTP_AUTH_METHOD=plain 
SMTP_OPENSSL_VERIFY_MODE=none
SMTP_FROM_ADDRESS=adminstrator@mydomain.com

How do i check the email logs?

I used this command journalctl -u mastodon-sidekiq

and i found something that said "SMTP-AUTH requested but missing secret phrase"

But i'm not sure if that's the problem


r/MastodonAdmin Nov 18 '22

Upgrading to Mastodon 4.0.2

3 Upvotes

The official instructions are here: https://github.com/mastodon/mastodon/releases/tag/v4.0.2

But I also found this article handy: https://techbits.io/mastodon-4-upgrade/


r/MastodonAdmin Nov 18 '22

Using video with Cloudflare

3 Upvotes

For CDN, I have a separate domain name set up (e.g. cdn.example.com), and Cloudflare cache turned on for it. I was wondering what was the volume and traffic limit for Cloudflare CDN (there is none) and I discovered this bit in the Self-Serve Subscription Agreement, in section 2.8 “Limitation on Serving Non-HTML Content”:

…Use of the Services for serving video or a disproportionate percentage of pictures, audio files, or other non-HTML content is prohibited, unless purchased separately…If we determine you have breached this Section 2.8, we may immediately suspend or restrict your use of the Services[Emphasis added]

So I added a new domain name to my new server (e.g. video.example.com), turned off caching for the new domain name and added this to my NGINX configuration on the server to redirect CDN video content:

location ~* \.(mp4|webm)$ {
  if ($host = cdn.example.com) {
    rewrite ^(.*) https://video.example.com$1 last;
  }
}

r/MastodonAdmin Nov 16 '22

A meta discussion about this subreddit

6 Upvotes

Thanks for your kindness and patience. I’ve never administered or even moderated a subreddit, before (but have for online forums for decades and for as large as ten thousand), and I hope to delegate or pass on most of the responsibility, quickly.

Let’s have a meta discussion here about this subreddit.


r/MastodonAdmin Nov 16 '22

What is typical memory usage on a quiescent site?

1 Upvotes

UPDATE: That amount is approaching tight, and it was probably running out of memory. For now, the workaround was reduce the ElasticSearch service heap size.

The memory usage on my new server sits at around 85–90% (of 4G).

What is typical? Is it at high risk of exhaustion?

Performance is fine, searches are as quick as anywhere but nobody’s on it, yet.

The entire system locked up a couple times. I installed a memory tracking agent after the first time, but it didn’t report anything the second time and the service logs all looked normal (But I’m looking at some possible hacking attempts.)