README.md 2.19 KB
Newer Older
1
# Mastodon / mastofe repository
Morgan Bazalgette's avatar
Morgan Bazalgette committed
2
[![pipeline status](https://git.pleroma.social/tyge/mastofe/badges/master/pipeline.svg)](https://git.pleroma.social/tyge/mastofe/commits/master)
3

Morgan Bazalgette's avatar
Morgan Bazalgette committed
4 5 6
This is a fork of the Mastodon repository. It was mostly created to develop the
few changes needed to make the Mastodon Frontend, which is bundled in Pleroma
and can be accessed by going on `/web`.
7 8 9

# Development

Morgan Bazalgette's avatar
Morgan Bazalgette committed
10 11 12
I've made a few modifications to the build scripts to avoid having to install
a single ruby gem - or ruby itself, for that matter. All you will need is
nodejs, yarn, nginx and the pleroma backend.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

## Install yarn

Yarn will be needed to set up the mastodon frontend for development. Check out
https://yarnpkg.com/lang/en/docs/install/ . For Debian, it's like this:

```sh
# import yarn pub key and repo
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn
```

## Mastodon Frontend Setup

```sh
# Install dependencies
yarn install -D
npm run dev
# check that http://localhost:3035/packs/common.css works in your browser once
# webpack is done compiling. if css shows up, then it should have worked!
```

## nginx setup

I'll assume that you have already fired up pleroma using the installation guide.
To work on the frontend while still having the backend up, use this nginx
config.

```
server {
    listen 80;
Morgan Bazalgette's avatar
Morgan Bazalgette committed
46
    server_name 127.0.0.6;
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

    location /packs {
        add_header 'Access-Control-Allow-Origin' '*';
        proxy_http_version 1.1;
        proxy_set_header Host $http_host;

        proxy_pass http://localhost:3035;
    }

    location / {
        add_header 'Access-Control-Allow-Origin' '*';
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_pass http://localhost:4000;
    }
}
```

Morgan Bazalgette's avatar
Morgan Bazalgette committed
68 69 70 71
I recommend you leave the server name on a loopback address so that your browser
won't complain about using HTTP. In any case, once you have everything set up,
going to `/web` should show you the frontend and should work with hot reloading.
Have fun!