logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

README.md (2243B)


  1. # Mastodon / mastofe repository
  2. [![pipeline status](https://git.pleroma.social/tyge/mastofe/badges/master/pipeline.svg)](https://git.pleroma.social/tyge/mastofe/commits/master)
  3. This is a fork of the Mastodon repository. It was mostly created to develop the
  4. few changes needed to make the Mastodon Frontend, which is bundled in Pleroma
  5. and can be accessed by going on `/web`.
  6. # Development
  7. I've made a few modifications to the build scripts to avoid having to install
  8. a single ruby gem - or ruby itself, for that matter. All you will need is
  9. nodejs, yarn, nginx and the pleroma backend.
  10. ## Install yarn
  11. Yarn will be needed to set up the mastodon frontend for development. Check out
  12. https://yarnpkg.com/lang/en/docs/install/ . For Debian, it's like this:
  13. ```sh
  14. # import yarn pub key and repo
  15. curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  16. echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  17. sudo apt-get update
  18. sudo apt-get install yarn
  19. ```
  20. ## Mastodon Frontend Setup
  21. ```sh
  22. # Install dependencies
  23. yarn install -D
  24. npm run dev
  25. # check that http://localhost:3035/packs/common.css works in your browser once
  26. # webpack is done compiling. if css shows up, then it should have worked!
  27. ```
  28. ## nginx setup
  29. I'll assume that you have already fired up pleroma using the installation guide.
  30. To work on the frontend while still having the backend up, use this nginx
  31. config.
  32. ```
  33. server {
  34. listen 80;
  35. server_name 127.0.0.6;
  36. location /packs {
  37. add_header 'Access-Control-Allow-Origin' '*';
  38. proxy_http_version 1.1;
  39. proxy_set_header Host $http_host;
  40. proxy_pass http://localhost:3035;
  41. }
  42. location / {
  43. add_header 'Access-Control-Allow-Origin' '*';
  44. proxy_http_version 1.1;
  45. proxy_set_header Upgrade $http_upgrade;
  46. proxy_set_header Connection "upgrade";
  47. proxy_set_header Host $http_host;
  48. proxy_pass http://localhost:4000;
  49. }
  50. }
  51. ```
  52. I recommend you leave the server name on a loopback address so that your browser
  53. won't complain about using HTTP. In any case, once you have everything set up,
  54. going to `/web` should show you the frontend and should work with hot reloading.
  55. Have fun!