logo

pleroma

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

frontends-management.md (5534B)


  1. # Managing installed frontends
  2. Pleroma lets you install multiple frontends including multiple versions of same frontend. Right now it's only possible to switch which frontend is the default, but in the future it would be possible for user to select which frontend they prefer to use.
  3. As of 2.6.0 there are two ways of managing frontends - through PleromaFE's Admin Dashboard (preferred, easier method) or through AdminFE (clunky but also works on versions older than 2.6.0).
  4. !!! note
  5. Managing frontends through UI requires [in-database configuration](../configuration/howto_database_config.md) to be enabled (default on newer instances but might be off on older ones).
  6. ## How it works
  7. When installing frontends, it creates a folder in [static directory](../configuration/static_dir.md) that follows this pattern: `/frontends/${front-end name}/${front-end version}/`, puts contents of the built frontend in there. Then when accessing the server backend checks what front-end name and version are set to be default and serves index.html and assets from appropriate path.
  8. !!! warning
  9. If you've been putting your frontend build directly into static dir as an antiquated way of serving custom frontend, this system will not work and will still serve the custom index.html you put in there. You can still serve custom frontend builds if you put your build into `/frontends/$name/$version` instead and set the "default frontend" fields appropriately.
  10. Currently, there is no backup system, i.e. when installing `master` version it _will_ overwrite installed `master` version, for now if you want to keep previous version you should back it up manually, i.e. running `cp -r ./frontends/pleroma-fe/master ./frontends/pleroma-fe/master_old` in your static dir.
  11. ## Managing front-ends through Admin Dashboard
  12. Open up Admin Dashboard (gauge icon in top bar, same as where link to AdminFE was),__
  13. ![location of Admin Dashboard icon](../assets/admin_dash_location.png)
  14. switch to "Front-ends" tab.
  15. ![screenshot of Front-ends tab](../assets/frontends_tab.png)
  16. This page is designed to be self-explanatory and easy to use, while avoiding issues and pitfalls of AdminFE, but it's also early in development, everything is subject to change.
  17. !!! warning
  18. This goes without saying, but if you set default frontend to anything except >2.6.0 version of PleromaFE you'll lose the access to Admin Dashboard and will have to use AdminFE to get it back. See below on how to use AdminFE.
  19. ### Limitations
  20. Currently the list of available for install frontends is essentially hard-coded in backend's configuration, each providing only one version, with exception for PleromaFE which overrides 'pleroma-fe' to also include `develop` version. There is no way to manually install build with a URL (coming soon) nor add more available frontends to the repository (it's broken).
  21. There is also no way to tell if there is an update available or not, for now you should watch for [announcements](https://pleroma.social/announcements/) of new PleromaFE stable releases to see if there is new stable version. For `develop` version it's up to you whether you want to follow the development process or just reinstall it periodically hoping for new stuff.
  22. ## Using AdminFE to manage frontends
  23. Access AdminFE either directly by going to `/pleroma/admin` of your instance or by opening Admin Dashboard and clicking the link at the bottom of the window
  24. ![link to open old AdminFE](../assets/old_adminfe_link.png)
  25. Go to Settings -> Frontend.
  26. ### Installing front-ends
  27. At the very top of the page there's a list of available frontends and button to install custom front-end
  28. !!! tip
  29. Remember to click "Submit" in bottom right corner to save your changes!
  30. !!! bug
  31. **Available Frontends** section lets you _install_ frontends but **NOT** update/reinstall them. It's only useful for installing a frontend once.
  32. Due to aforementioned bug, preferred way of installing frontends in AdminFE is by clicking the "Install another frontend"
  33. ![screenshot of admin-fe with instructions on how to install a frontend](../assets/way_to_install_frontends.png)
  34. and filling in the fields. Unfortunately AdminFE does not provide the raw data necessary for you to fill those fields, so your best bet is to see what backend returns in browser's devtools or refer to the [source code](https://git.pleroma.social/pleroma/pleroma/-/blob/develop/config/config.exs?ref_type=heads#L742-791). For the most part, only **Name**, **Ref** (i.e. version) and **Build URL** fields are required, although some frontends might also require **Build Directory** to work.
  35. For pleroma-fe you can use either `master` or `develop` refs, or potentially any ref in GitLab that has artifacts for `build` job, but that's outside scope of this document.
  36. ### Selecting default frontend
  37. Scroll page waaaaay down, search for "Frontends" section, subtitled "Installed frontends management", change the name and reference of the "Primary" frontend.
  38. ![screenshot of admin-fe with instructions on how to install a frontend](../assets/primary_frontend_section.png)
  39. !!! danger
  40. If you change "Admin" frontend name/reference you risk losing access to AdminFE as well.
  41. !!! warning
  42. Don't put anything into the "Available" section as it will break the list of available frontends completely, including the "add another frontend" button. If you accidentally put something in there, click the trashbin icon next to "Available" to reset it and restore the frontends list.