- About this repl
- How it works
- Tech Stack
- Folder/File explanation
- Running this repl locally
- Customizing this Masotodon instance
- Upgrading to Production
- Contributing
- Credits ❤
The current configuration for the Repl is development. To upgrade to production, follow the instructions
This is a Bash repl, which is essentially just a shell where programs can be run. Being a one-click runable repl, all you have to do to have your very own Mastodon instance is click the run button. I also reccomend you give this repl an 8x boost and enable Always On. Both of these options are availible through Hacker plans.
All the files you view were generated through cloning the GitHub Repo of Mastodon and scripts located in start.sh
. Said scripts initiate (in order):
- Redis, that caches for PostgreSQL.
- PostgreSQL, the database system
- Nginx, used as a reverse proxy (it "sits in front of web servers and forwards client (e.g. web browser) requests to those web servers" - Cloudflare, What is a reverse proxy?)
- Mastodon! (using Webpack)
The Mastodon files in the GitHub repo are located in ./live
. The rest of the files and folders are explained here.
- Ruby on Rails powers the REST API and other web pages
- React.js and Redux are used for the dynamic parts of the interface
- Node.js powers the streaming API
File/Folder name | Location | Description |
---|---|---|
start.sh | ~/Mastodon/start.sh |
Starts up the Mastodon instance. |
README.md | ~/Mastodon/README.md |
Provides details about this Repl and instructions on how to use it |
postgresql.log | ~/Mastodon/postgresql.log |
PostgreSQL logs |
postgresql.conf.tpl | ~/Mastodon/postgresql.conf.tpl |
PostgreSQL's main configuration file and the primary source of configuration parameter settings. |
nginx.conf | ~/Mastodon/postgresql.conf.tpl |
Nginx configuration file, similar purpose as the file above |
mime.types | ~/Mastodon/mime.types |
A very large list of MIME Types |
freedesktop.org.xml | ~/Mastodon/freedesktop.org.xml |
Purpose is quite unknown. My research shows a link to Ruby on Rails, but not exactly sure what part it plays. Delete at your own risk. |
dump.rdb | ~/Mastodon/dump.rdb |
Redis backup file. |
postgres/ | ~/Mastodon/postgres/ |
Where PostgreSQL keeps all the data inserted in the database |
logs/ | ~/Mastodon/logs/ |
Folder that contains all the important logs that for your server. Refer to them for errors. |
logs/nginx.pid | ~/Mastodon/logs/nginx.pid |
Stores the main process ID of the nginx process |
logs/error.log | ~/Mastodon/logs/error.log |
Nginx error logs. |
live/ | ~/Mastodon/live/ |
Folder that contains all of Mastodon's code. This folder contains the code that is used when rendering client pages and fulfilling backend requests. |
data/ | ~/Mastodon/data/ |
PostgreSQL data folder. Contains, as the name implies, data :) |
cache/ | ~/Mastodon/cache/ |
Cache. |
Unfortunately, this Repl is designed to run on Replit's machines, and cannot be easily converted to run on a personal computer. However, this isn't necessarily a bad thing, since it literally will only take one click of Replit's "Run" button to have this instace running.
To truly have your own verion of Mastodon, it is essential that it works correctly and displays your Mastodon instance's information. To do this:
- Head to the
.env.production.sample
in thelive/
folder - Enter the correct information
- Details and instructions are already there!
- Mailgun is used for the SMPT server, but it can be changed to whatever you like
- Restart the server!
Upgrading is quite simple:
- Head over to
start.sh
and edit line 24, column 21 through 32 to sayproduction
instead ofdevelopment
- Jump to
.replit
and edit line 12, column 12 through 23 to sayproduction
instead ofdevelopment
- Restart the server!
- 🎆
I 💖 help with code, especially on a project like this. To add more, fix my typos or improve my code in any way shape or form, head over to the GitHub, do your thing edits and submit a pull request. Further discussing may insue between you, me or others.
Kudos to this amazing Replit blog article by Arec Nawo. Follow them on Twitter, Facebook and check out their GitHub!