Installation guide - patchwork-hub/patchwork_dashboard GitHub Wiki
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.
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.
You can install Patchwork from source-code or using a Docker image.
To install from source-code, please see the instructions on below.
To install Patchwork using a Docker image, please use the guides here.
Dashboard installation guide
Installing Patchwork Dashboard from source-code
1.1 Project setup
Pre-requisites
- Up & running a Mastodon instance
- Ruby v3.3.0
-
Download Patchwork Dashboard repository:
Download the latest release of Patchwork Dashboard Basic from here.
-
Create .env file by copying the .env.sample file:
cp .env.sample .env
-
Read the comments mentioned in the ENV file thoroughly and configure the environment accordingly.
-
Install the gems:
bundle install
- Run database migrations:
bundle exec rails db:migrate
- Import required data and create a master admin account:
bundle exec rails db:seed
- Start your server(change the port number according to your need):
bundle exec rails s -p 3002
1.2 Activate Patchwork Dashboard
To fully activate your Patchwork Dashboard, add an API key by following below steps:
-
Generate an API key
- Go to Patchwork Hub, register a new account and verify it.
- Once you have verified it, generate an API key on the landing page of the Patchwork Hub.
-
Add the generated API key in your Patchwork Dashboard
- Login to your Patchwork Dashboard with the master admin account.
- On the left-side menu, click the "API key".
- In the API key page, add the Key and Secret values generated from the Patchwork Hub.
- After entering the credential, the Patchwork Dashboard is fully activated.
1.3 Plug-ins installation
In order to enable The Newsmast Foundation's apps to work, you need to install the following plug-ins in your Mastodon instance as required to deliver the associated features in the app. This is an essential step to deliver these features to your users. The version of the app you install needs to be matched to these Gems, to ensure that the app works as expected.
This setup assumes that you have installed Mastodon from source.
-
Accounts
A Ruby on Rails plugin that adds custom account management, push notifications, and authentication overrides to Mastodon instance. -
Content filters
A Ruby on Rails plugin that filters Mastodon timelines by defined keywords and hashtags. -
Conversations
A Ruby on Rails plugin that extends Mastodon conversations with custom API endpoints and mobile app functionality. -
Posts
A Ruby on Rails plugin that enhances Mastodon’s posting features with customizable character limits, draft management, quote posts, and automatic ALT text generation.
- Connect to your Mastodon instance's server, access the installation files and locate the Gemfile. Add the ruby gems below to the Gemfile:
gem "accounts", git: "https://github.com/patchwork-hub/accounts/"
gem "content_filters", git: "https://github.com/patchwork-hub/content_filters"
gem "conversations", git: "https://github.com/patchwork-hub/conversations"
gem "posts", git: "https://github.com/patchwork-hub/posts"
- Run the bundle command to install the gems:
$ bundle install
- Run migration command:
$ bundle exec rails db:migrate
- Run the gem setup command for the necessary setup:
bundle exec rake content_filters:install
- Add below environment keys to your Mastodon instance:
AUTO_FOLLOW_ENABLED=false
ALT_TEXT_ENABLED=false
BOOST_POST_ENABLED=false
- After that, restart your application to load the gems.