-
Notifications
You must be signed in to change notification settings - Fork 7
Installation guide
Patchwork is a framework to add a suite of plug-ins to a Mastodon server, creating layers between the underlying plumbing of Mastodon and the frontend app used by a user to access it (usually also Mastodon).
Before running Patchwork, please ensure you have set up a Mastodon server and it is running properly.
You can find the instructions to set up a Mastodon server here.
Patchwork begins with the Dashboard.
Once your Mastodon server is up and running, please begin with this repository to set up the Patchwork Dashboard.
This is the core of Patchwork’s frame, introducing new features itself to make your server more powerful, and allowing you to install additional Patchwork plug-ins with ease.
Please follow the simple steps below to install Patchwork Dashboard:
- Clone this repository (Patchwork Dashboard) in your server:
git clone
git@github.com:patchwork-hub/patchwork_dashboard.git
- Create .env file by copying the .env.sample file:
$ cp .env.sample .env
- Modify following environment variables:
RAILS_ENV=production
- Connect with your mastodon server's redis
REDIS_HOST=localhost
REDIS_PORT=6379
- PostgreSQL - Connect with your mastodon instance's database
DB_HOST=your_db_host
DB_NAME=your_mastodon_instance_db
DB_USER=your_db_username
DB_PASS=your_db_password
DB_PORT=5432
- Run the docker commands below to build the docker image and run the containers:
$ docker-compose build
$ docker-compose up -d
- Get inside the docker container to feed necessary data to database:
$ docker exec -it patchwork-dashboard bash
- Once your are inside the docker container, run below command to feed the data:
$ RAILS_ENV=production bundle exec rake db:seed
-
The container is open to port 3001 and you can access the application with ServerIP:3001.
-
To login to the dashboard, run the following script in Rails console:
username = 'MasterAdmin'
email = 'masteradminexample@example.com'
password = 'password'
# Create or update admin account
admin = Account.where(username: username).first_or_initialize(username: username)
admin.save(validate: false)
# Create or update admin user with MasterAdmin role
user = User.where(email: email).first_or_initialize(
email: email,
password: password,
password_confirmation: password,
confirmed_at: Time.now.utc,
role: UserRole.find_by(name: 'MasterAdmin'),
account: admin,
agreement: true,
approved: true
)
user.save! Once set up, your Patchwork Dashboard can then be configured through the frontend application.
Next, expand your server's capabilities by installing plug-ins.
Choose from this list:
Filter timelines with defined hashtags & keywords, and manage your server's connection to Threads & Bluesky.
- Add this line to your Mastodon application's Gemfile:
gem "content_filters", git: "https://github.com/patchwork-hub/content_filters"- Execute to install the gem:
$ bundle install- After installing the gem, restart your application to load it in your application.
Give users on your server advanced posting options, including custom character limits and text formatting.
- Add this line to your Mastodon application's Gemfile:
gem "posts", git: "https://github.com/patchwork-hub/posts"- Install The gem
bundle install- After installing the gem, restart your application to load it in your application.