Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize appearance (logo, favicon, PWA manifest name and icons) #2752

Open
kimsible opened this issue May 13, 2020 · 7 comments
Open

Customize appearance (logo, favicon, PWA manifest name and icons) #2752

kimsible opened this issue May 13, 2020 · 7 comments
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨

Comments

@kimsible
Copy link
Contributor

I'm thinking about a plugin to customize appearance with the new helper plugin getRouter.
This plugin would add in /admin/config/edit-custom, advanced config tab the ability to :

  • upload a png or svg logo
  • customize the main color with a color picker

This plugin would also :

  • process and use the favicon and the PWAs manifest icons with the uploaded logo.
  • update PWAs manifest name and description according to the instance settings

For the last feature, I think a hook would be required to trigguer any change of the name and description instance.

@Chocobozzz Chocobozzz changed the title [Plugin/hook] to customize appearance (logo, favicon, PWA manifest name and icons) Customize appearance (logo, favicon, PWA manifest name and icons) May 18, 2020
@Chocobozzz Chocobozzz added Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨ labels May 18, 2020
@kimsible
Copy link
Contributor Author

kimsible commented Jun 25, 2020

  1. Ability to override client assets (logo, favicon, PWAs icons) Add ability to override client assets : logo - favicon - PWA icons - PWA manifest name and description #2897.

According to the discussion on this PR, I propose these next steps :

  1. Add to the admin panel the ability to upload PNG favicon and SVG logo (without any treatment, only format / extension checking)

  2. Add a script tool to generate PWA icons from SVG logo. must be a plugin because since sharp has been replaced by Jimp we can't convert SVG to PNG

  3. Add plugin hook when uploading SVG logo and PNG favicon

  4. Add Jimp processImage to plugin server helpers

  5. Add a plugin hook in the dymamic manifest :

    manifest.name = CONFIG.INSTANCE.NAME

  6. Improve the router plugin : restrict writing files to an isolated directory maybe a flag like trusted plugin are planned ?

  7. Add action to update contentHash of manifest / logo / favicon to plugin API

  8. Create a plugin or update this one https://github.com/kimsible/peertube-plugin-webapp-manifest for the PWA manifest edition and icons generation.

@Chocobozzz @rigelk all these steps seem reachable to you ?

Some steps contain improvements for the plugin API, it's well in the roadmap ?

@Chocobozzz
Copy link
Owner

all these steps seem reachable to you ?

Yes I think

Some steps contain improvements for the plugin API, it's well in the roadmap ?

No, it's not planned in the roadmap but we can try to implement them if we have some time.

@kontrollanten
Copy link
Contributor

Great idea! But do we need a web UI to customize the manifest? In most cases it's just something that you configure once, therefore I'd suggest to handle this during the client build time. It should be easy to solve with webpack, I think webpack-pwa-manifest-plugin solves our needs? That should be possible to use together with angular-builders.

@rigelk
Copy link
Collaborator

rigelk commented Dec 8, 2020

@kontrollanten most servers are not (re)building their code.

@kontrollanten
Copy link
Contributor

No, but most servers build their code ;) As I mentioned I think this is a one time configuration that is done during installation.

@kontrollanten kontrollanten mentioned this issue Dec 9, 2020
2 tasks
@kimsible
Copy link
Contributor Author

kimsible commented Dec 10, 2020

@kontrollanten I think this is a good idea to explore but we don't have to force any admin to build anything since PeerTube releases and host builds and official docker images. We need to think for both case because not every PeerTube admins have the ability to build their own client bundles.

In most cases it's just something that you configure once

Some instances may want to update their logo for special events, in this case we can't re-build clients bundles :/

@kimsible
Copy link
Contributor Author

kimsible commented Dec 10, 2020

@Chocobozzz, @rigelk, @kontrollanten I don't say it's a priority but maybe we'll need to create a new input type for plugins; an input to upload images strictly in client-overrides directory to avoid security issues. This could be a good compromise to not engage more core development :

  • Add Jimp processImage to plugin server helpers

  • Add a plugin hook in the dymamic manifest

  • Add action to update contentHash of manifest / logo / favicon to plugin API

  • Add a plugin input type to upload images into client-overrides/assets/images....

What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨
Projects
None yet
Development

No branches or pull requests

4 participants